2019独角兽企业重金招聘Python工程师标准>>>
1、创建菜单栏
//使用QMene和QMenuBar类再主窗口创建菜单栏。使用QMenu控件的成员函数addAction()添加QAction类的菜单栏
QAction *newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
QAction *openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
openAct->setStatusTip(tr("Open an existing file"));
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(newAct);
fileMenu->addAction(openAct);
// connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
// connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
2、创建工具栏
3、创建锚街控件
4、设置中心组件
5、添加状态栏
---