What exactly do you mean by:
Move the widget content out of the dock widget and then make it full screen
I'm unsure how to do this. Maybe you could be more precise or provide a simple example how to move the content of a floated dockwidget out of it and make it full screen (and vice versa).
Nevertheless i found a quick work around using style sheets. Actually it's all right for my purpose but it's not really a solution to the problem:
// Set full screen:
dockflags = dw->windowFlags();
styleSheet = dw->styleSheet();
geometry = dw->geometry();
dw->setWindowFlags( Qt::Window );
dw->setStyleSheet(
QString("QDockWidget{ border: 0px; color: #000099; background-color: black; margin: 0px; padding: 0px }") + QString("QDockWidget::title{ text-align: center; background-color: black; padding: 0px; margin: 0px; }") + QString("QDockWidget::close-button, QDockWidget::float-button { border: 0px solid black; background: black; padding: 0px; }") + QString("QDockWidget::close-button:hover, QDockWidget::float-button:hover { background: gray; }") + QString("QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { padding: 1px -1px -1px 1px; }") );
dw->showFullScreen();
...
// Reset from fullscreen:
dw->setWindowFlags( dockflags );
dw->setStyleSheet( styleSheet );
dw->setGeometry(geometry);
dw->show();
// Set full screen:
dockflags = dw->windowFlags();
styleSheet = dw->styleSheet();
geometry = dw->geometry();
dw->setWindowFlags( Qt::Window );
dw->setStyleSheet(
QString("QDockWidget{ border: 0px; color: #000099; background-color: black; margin: 0px; padding: 0px }") +
QString("QDockWidget::title{ text-align: center; background-color: black; padding: 0px; margin: 0px; }") +
QString("QDockWidget::close-button, QDockWidget::float-button { border: 0px solid black; background: black; padding: 0px; }") +
QString("QDockWidget::close-button:hover, QDockWidget::float-button:hover { background: gray; }") +
QString("QDockWidget::close-button:pressed, QDockWidget::float-button:pressed { padding: 1px -1px -1px 1px; }") );
dw->showFullScreen();
...
// Reset from fullscreen:
dw->setWindowFlags( dockflags );
dw->setStyleSheet( styleSheet );
dw->setGeometry(geometry);
dw->show();
To copy to clipboard, switch view to plain text mode
The title bar of the dock widget is still there but it's simply "hidden"; colored black.
Finally this is not the full screen behaviour i'm happy with, but it kinda works for now. (I'm displaying video and/or 3D models within the window). Furthermore i'm still searching for a better/real solution wich is not a hack like this. Maybe i have to think about not using QDockWidgets at all, due to the lack of identic behaviour at different OSs (especially in that case of the showFullScreen method). Actually i am just a little "satisfied" - so i'm still searching for a more convenient solution. Any more hints are welcome, thnx so far...
Bookmarks