⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 my.cpp

📁 qt类库是非微软类库
💻 CPP
字号:
#include <stdlib.h>
#include "my.h"
MyMainWindow::MyMainWindow()
{
	OldValue=0;
    //colordlg->getColor(QColor(0,0,0));
	setGeometry(100,100,300,200);
    b1=new QPushButton("OPEN",this);
	b1->setGeometry(10,10,80,40);
	b1->setFont(QFont("Times",18,QFont::Bold));
	connect(b1,SIGNAL(clicked()),this,SLOT(MyQuit()));

	lcd=new QLCDNumber(2,this);
	lcd->setGeometry(100,10,190,180);

	slider=new QSlider(Vertical,this);
	slider->setGeometry(10,60,80,130);

	connect(slider,SIGNAL(valueChanged(int)),lcd,SLOT(display(int)));

}
MyMainWindow::MyQuit()
{
	mb=new QMessageBox("Process?","Do you want to process?",
 					QMessageBox::Critical,
 					QMessageBox::Ok|QMessageBox::Default,
 					QMessageBox::Cancel|QMessageBox::Escape,
 					0);
	mb->show();
	int i;
	i=mb->exec();
	if(i==QMessageBox::Accepted)
		mb->show();
}

void MyMainWindow::SetValue(int Value)
{
	if(OldValue!=Value)
		{
		OldValue=Value;
        emit YChangedValue(Value);
		}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -