mainwindow.cpp

来自「一大堆的qt程序,在qte2.3.7下全部可以很好地运行」· C++ 代码 · 共 21 行

CPP
21
字号
#include "mainwindow.h"MainWindow::MainWindow(QWidget *parent,const char *name):            QWidget(parent,name){     QFont f("Helvetica",14,QFont::Bold);     setFont(f);     AddButton = new QPushButton("Add",this);     AddButton->setGeometry(50,15,90,40);     SubButton = new QPushButton("Sub",this);     SubButton->setGeometry(50,70,90,40);     counter = new Counter(this);     counter->setGeometry(50,125,90,40);        QObject::connect(AddButton,SIGNAL(clicked()),              counter,SLOT(IncCounter()));     QObject::connect(SubButton,SIGNAL(clicked()),              counter,SLOT(DecCounter()));}

⌨️ 快捷键说明

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