1

I have made a gui which contains dockable windows.

If i click on maximize square on the docable window it comes out but does not occupies the full screen of my gui.

Example if i click syntax window it does not occupy full screen

Which property do i have to change to make docable window to occupy full screen ?

Please see the attached image.enter image description here

user1870619
  • 177
  • 1
  • 6
  • 12

1 Answers1

2

You will need to create your own TitleBarWidget and set it with:

void QDockWidget::setTitleBarWidget ( QWidget * widget )

So you will be able to have as many buttons as you want and maximize it. Following code will help you with it:

QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget());
dockWidget->showMaximized();

Edit: To keep the 2 existing buttons functionality:

The docking will be done with setFloating(bool ). So:

QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget());
dockWidget->setFloating( !dockWidget->isFloating () );

For the close, parent close() method will work.

And, last edit, i promise ;).

You will need to have the title to show it on your titleWidget:

And it is in windowTitle : QString property of parent:

trompa
  • 1,967
  • 1
  • 18
  • 26