1

When I drag the edge to a certain extent, the central QDockWidget is hidden. I recorded the screen when i operated this Qt Demo wrote by me. The recording screen video link is as follow:

recording screen


development environment: QT5 & Qt Creator 4.6.1 & Win10


There is two .ui files, one is the mainwindow.ui ,another is the secondmainwindow.ui.

mainwindow.cpp constructor function:

    ui->setupUi(this);
    ui->mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    ui->mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

    QMdiSubWindow *subWindow = ui->mdiArea->addSubWindow(new SecondMainwindow());
    // hide title
    subWindow->setWindowFlags(Qt::FramelessWindowHint);

    subWindow->showMaximized();
    // 
    setCentralWidget(ui->mdiArea);
    // 
    setDockNestingEnabled(true);

secondmainwindow.cpp constructor function:

    ui->setupUi(this);
    // 
    QWidget* p = takeCentralWidget();
    if(p) {
        delete p;
        p = nullptr;
    }

the all QDockWidget are generated by the Qt Designer software, And all parameters are default with QDockWidget. so, Are there some details I didn't notice? Thanks.

Ethan
  • 11
  • 1

0 Answers0