문제

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 ?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top