📄 5_1.cpp
字号:
#include <qapplication.h>#include <qpushbutton.h>#include <qfont.h>#include <qscrollview.h>class MyMainWindow:public QScrollView{ public: MyMainWindow(); private: QPushButton *b1;};MyMainWindow::MyMainWindow(){ setGeometry(100,100,200,100); b1 = new QPushButton("This button is not too\n big for the window!",this); b1->setGeometry(10,10,180,80); b1->setFont(QFont("Times",18,QFont::Bold)); //we must call the QScrollView::addChild function for each of its child widgets. addChild(b1);}main(int argc,char **argv){ QApplication a(argc,argv); MyMainWindow w; a.setMainWidget(&w); w.show(); a.exec();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -