标签:qtextedit ted 文件 class 新建 menu statusbar pen man
//菜单栏
QMenuBar *bar = menuBar();
this->setMenuBar(bar);
QMenu *fileObj = bar->addMenu("文件");
QMenu *fileEdit = bar->addMenu("编辑");
QAction *newAct = fileObj->addAction("新建");
fileObj->addSeparator();
QAction *openAct = fileObj->addAction("打开");
//工具栏
QToolBar *toolB = new QToolBar(this);
addToolBar(Qt::LeftToolBarArea,toolB);
toolB->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
toolB->addAction(newAct);
toolB->addSeparator();
toolB->addAction(openAct);
//状态栏
QStatusBar *statusB = statusBar();
setStatusBar(statusB);
QLabel *lab = new QLabel(this);
lab->setText("xiaozhoa");
statusB->addWidget(lab);
QLabel *labL = new QLabel("左侧提示",this);
statusB->addPermanentWidget(labL);
//铆接部件
QDockWidget *dock = new QDockWidget(this);
addDockWidget(Qt::BottomDockWidgetArea,dock);
//设置停靠范围
dock->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::RightDockWidgetArea);
//addDockWidget(Qt::RightDockWidgetArea,dock);
//核心部件
QTextEdit *edit = new QTextEdit(this);
setCentralWidget(edit);
标签:qtextedit ted 文件 class 新建 menu statusbar pen man
原文地址:https://www.cnblogs.com/lodger47/p/14724878.html