#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);
}