16#ifndef QGSDOCKABLEWIDGETHELPER_H
17#define QGSDOCKABLEWIDGETHELPER_H
33class GUI_EXPORT QgsNonRejectableDialog :
public QDialog
38 explicit QgsNonRejectableDialog( QWidget *parent =
nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
39 void reject()
override;
52class GUI_EXPORT QgsDockableWidgetHelper :
public QObject
63 QgsDockableWidgetHelper(
bool isDocked,
const QString &windowTitle, QWidget *widget, QMainWindow *ownerWindow,
64 Qt::DockWidgetArea defaultDockArea = Qt::NoDockWidgetArea,
65 const QStringList &tabifyWith = QStringList(),
bool raiseTab =
false,
66 const QString &windowGeometrySettingsKey = QString(),
bool usePersistentWidget =
false );
67 ~QgsDockableWidgetHelper();
70 void writeXml( QDomElement &viewDom );
71 void readXml(
const QDomElement &viewDom );
74 void setWidget( QWidget *widget );
76 QWidget *widget() {
return mWidget; }
84 void setWindowTitle(
const QString &title );
86 QString windowTitle()
const {
return mWindowTitle; }
89 void setDockObjectName(
const QString &name );
91 QString dockObjectName()
const;
97 bool isUserVisible()
const;
103 QToolButton *createDockUndockToolButton();
108 QAction *createDockUndockAction(
const QString &title, QWidget *parent );
110 bool eventFilter( QObject *watched, QEvent *event )
override;
112 static std::function< void( Qt::DockWidgetArea, QDockWidget *,
const QStringList &,
bool ) > sAddTabifiedDockWidgetFunction;
113 static std::function< QString( ) > sAppStylesheetFunction;
115 static QMainWindow *sOwnerWindow;
120 void dockModeToggled(
bool docked );
122 void visibilityChanged(
bool isVisible );
125 void toggleDockMode(
bool docked );
127 void setUserVisible(
bool visible );
130 void setupDockWidget(
const QStringList &tabSiblings = QStringList() );
132 bool mIsDocked =
true;
133 QWidget *mWidget =
nullptr;
135 QPointer< QDialog > mDialog;
136 QRect mDialogGeometry;
138 QPointer< QgsDockWidget > mDock;
140 bool mIsDockFloating =
true;
141 Qt::DockWidgetArea mDockArea = Qt::RightDockWidgetArea;
143 QString mWindowTitle;
145 QMainWindow *mOwnerWindow =
nullptr;
147 QStringList mTabifyWith;
148 bool mRaiseTab =
false;
150 QString mWindowGeometrySettingsKey;
155 bool mUsePersistentWidget =
false;