-1

I am using QDockWidget in my GUI and I need to create a slot for the floating button of a QDockWidget so that when I click the floating button of a QDockWidget it maximize it.

Which signal is emitted when I click floating button on an QDockWidget ? I want to trigger a slot where I will make window floating & then maximize it, using this code.

ui->dockWidget_2->setFloating(1);
ui->dockWidget_2->showMaximized();

Please suggest which signal is emitted when i click float button on a QDockWidget ?

Eric
  • 75
  • 2
  • 14
Katoch
  • 2,709
  • 9
  • 51
  • 84

1 Answers1

1

http://qt-project.org/doc/qt-4.8/qdockwidget.html#topLevelChanged

void QDockWidget::topLevelChanged ( bool topLevel ) [signal]
This signal is emitted when the floating property changes. The topLevel parameter is true if the dock widget is now floating; otherwise it is false.

So you can connect it to a slot that maximizes the widget if topLevel is true

trompa
  • 1,967
  • 1
  • 18
  • 26
  • // no need to connect --> if we define --> name of slot as --->on_(object_name)_(signal_name) //http://www.qtforum.org/article/20685/connectslotsbyname.html // Resizing window //http://qt-project.org/forums/viewthread/7815 – Katoch May 07 '13 at 10:53
  • Thats still a connect, just qt takes care of it. And ive had problems with it and nested widgets with same nsmes – trompa May 07 '13 at 11:20