example: Add an option to show a non-closable dock widget

Passing -n to the example will make the dock widget #0 non-closable
This commit is contained in:
Sergio Martins
2020-02-17 21:20:43 +00:00
parent 10621f3b4a
commit b43081851f
3 changed files with 19 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ class MyMainWindow : public KDDockWidgets::MainWindow
Q_OBJECT
public:
explicit MyMainWindow(const QString &uniqueName, KDDockWidgets::MainWindowOptions options,
bool dockWidget0IsNonClosable,
const QString &affinityName = {}, // Usually not needed. Just here to show the feature.
QWidget *parent = nullptr);
@@ -34,4 +35,5 @@ private:
void createDockWidgets();
KDDockWidgets::DockWidgetBase* newDockWidget();
QMenu *m_toggleMenu = nullptr;
const bool m_dockWidget0IsNonClosable;
};