user1870619
user1870619

Reputation: 177

Dockable window -- not maximise

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

Upvotes: 1

Views: 3295

Answers (1)

trompa
trompa

Reputation: 2007

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:

Upvotes: 2

Related Questions