16#ifndef QGSDOCKABLEWIDGETHELPER_H
17#define QGSDOCKABLEWIDGETHELPER_H
33class GUI_EXPORT QgsNonRejectableDialog :
public QDialog
37 explicit QgsNonRejectableDialog( QWidget *parent =
nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
38 void reject()
override;
51class GUI_EXPORT QgsDockableWidgetHelper :
public QObject
61 QgsDockableWidgetHelper(
bool isDocked,
const QString &windowTitle, QWidget *widget, QMainWindow *ownerWindow, Qt::DockWidgetArea defaultDockArea = Qt::NoDockWidgetArea,
const QStringList &tabifyWith = QStringList(),
bool raiseTab =
false,
const QString &windowGeometrySettingsKey = QString(),
bool usePersistentWidget =
false );
62 ~QgsDockableWidgetHelper();
65 void writeXml( QDomElement &viewDom );
66 void readXml(
const QDomElement &viewDom );
69 void setWidget( QWidget *widget );
71 QWidget *widget() {
return mWidget; }
79 void setWindowTitle(
const QString &title );
81 QString windowTitle()
const {
return mWindowTitle; }
84 void setDockObjectName(
const QString &name );
86 QString dockObjectName()
const;
92 bool isUserVisible()
const;
98 QToolButton *createDockUndockToolButton();
103 QAction *createDockUndockAction(
const QString &title, QWidget *parent );
105 bool eventFilter( QObject *watched, QEvent *event )
override;
107 static std::function<void( Qt::DockWidgetArea, QDockWidget *,
const QStringList &,
bool )> sAddTabifiedDockWidgetFunction;
108 static std::function<QString()> sAppStylesheetFunction;
110 static QMainWindow *sOwnerWindow;
115 void dockModeToggled(
bool docked );
117 void visibilityChanged(
bool isVisible );
120 void toggleDockMode(
bool docked );
122 void setUserVisible(
bool visible );
125 void setupDockWidget(
const QStringList &tabSiblings = QStringList() );
127 bool mIsDocked =
true;
128 QWidget *mWidget =
nullptr;
130 QPointer<QDialog> mDialog;
131 QRect mDialogGeometry;
133 QPointer<QgsDockWidget> mDock;
135 bool mIsDockFloating =
true;
136 Qt::DockWidgetArea mDockArea = Qt::RightDockWidgetArea;
138 QString mWindowTitle;
140 QMainWindow *mOwnerWindow =
nullptr;
142 QStringList mTabifyWith;
143 bool mRaiseTab =
false;
145 QString mWindowGeometrySettingsKey;
150 bool mUsePersistentWidget =
false;