qtquick: Add "Close All" option in the example

This commit is contained in:
Sergio Martins
2021-04-05 18:31:56 +01:00
parent e476dce1d4
commit 2706a3d379
2 changed files with 8 additions and 1 deletions

View File

@@ -36,6 +36,13 @@ ApplicationWindow {
}
}
Action {
text: qsTr("Close All")
onTriggered: {
_kddwDockRegistry.clear();
}
}
MenuSeparator { }
Action { text: qsTr("&Quit")
onTriggered: {

View File

@@ -137,7 +137,7 @@ public:
* This is called before restoring a layout.
* @param affinities if specified only closes dock widgets and main windows with the specified affinities
*/
void clear(const QStringList &affinities = {});
Q_INVOKABLE void clear(const QStringList &affinities = {});
/**
* @brief clear Overload that only clears the specified dockWidgets and main windows.