Disabling user resizing for QDockWidget in QMainWindow
-
-
I'm not sure this is what you mean but you can control the max/min size of your dock inside the resize event of the main window.
For example, if you want to keep the dock always 1/3 of the main window you can do something like this:
@
void MainWindow::resizeEvent(QResizeEvent * evt) {
QMainWindow::resizeEvent(evt);
ui->dockWidget->setMaximumWidth(evt->size().width() / 3);
ui->dockWidget->setMinimumWidth(evt->size().width() / 3);
}
@ -
There is no QDockWidgetArea. You can restrict size of the dock area content. If the content has fixed size (eg. by setting min and max to same value like I shown) the handle to resize won't appear. QMainWindow handles this for you.