main.cpp

来自「qt类库是非微软类库」· C++ 代码 · 共 18 行

CPP
18
字号
#include <qapplication.h>
#include <qpushbutton.h>
#include <qwidget.h>
int main( int argc, char **argv )
{
QApplication a(argc,argv);
QWidget mainwindow;
mainwindow.setMinimumSize(200,100);
mainwindow.setMaximumSize(200,200);
QPushButton Pb1( "Hello Yzf!",&mainwindow);
QPushButton Pb2( "Hello world!",&mainwindow);
Pb1.setGeometry(20,20,40,40);
Pb2.setGeometry(70,70,90,90);
a.setMainWidget(&mainwindow);
mainwindow.show();
return a.exec();
}

⌨️ 快捷键说明

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