Qt铆接部件、浮动窗口、中心部件
作者:互联网
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDockWidget>
#include <QTextEdit>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
//铆接部件(浮动窗口)
QDockWidget *dockWidget = new QDockWidget("dock widget", this);
//设置允许停靠区域
dockWidget->setAllowedAreas(Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea);
addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
//设置中心部件
QTextEdit *textEdit = new QTextEdit(this);
setCentralWidget(textEdit);
}
标签:Qt,部件,ui,铆接,dockWidget,new,include,MainWindow 来源: https://www.cnblogs.com/zhangxuechao/p/16545527.html