23#ifndef ABSTRACTDOCKWIDGET_H
24#define ABSTRACTDOCKWIDGET_H
27#include "../common/sharedStructures.h"
28#include "shortcutAction.h"
30#include <qmainwindow.h>
31#include <qdockwidget.h>
59 Q_PROPERTY(
bool visible READ isVisible WRITE setVisible DESIGNABLE
false)
60 Q_PROPERTY(
bool enabled READ isEnabled WRITE setEnabled)
62 Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry)
63 Q_PROPERTY(QRect frameGeometry READ frameGeometry)
64 Q_PROPERTY(QRect normalGeometry READ normalGeometry)
65 Q_PROPERTY(
int x READ x)
66 Q_PROPERTY(
int y READ y)
67 Q_PROPERTY(QPoint pos READ pos WRITE move DESIGNABLE
false STORED
false)
68 Q_PROPERTY(QSize frameSize READ frameSize)
69 Q_PROPERTY(QSize size READ size WRITE resize DESIGNABLE
false STORED
false)
70 Q_PROPERTY(
int width READ width)
71 Q_PROPERTY(
int height READ height)
72 Q_PROPERTY(QRect rect READ rect)
73 Q_PROPERTY(QRect childrenRect READ childrenRect)
74 Q_PROPERTY(QRegion childrenRegion READ childrenRegion)
75 Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle)
118 Toolbar() : section(0), key(
""), tb(NULL) {}
119 Qt::ToolBarArea area;
136 void setParent ( QWidget * parent ) {
m_overallParent = parent; QDockWidget::setParent(parent); }
138 QWidget *getActiveInstance()
148 #define QWIDGETPROPGETTER(gettername) if(m_docked && m_dockAvailable) { return QDockWidget::gettername(); } else { return m_pWindow->gettername(); }
150 #define QWIDGETPROPSETTER(settername,...) \
153 QDockWidget::settername(__VA_ARGS__); \
157 if (m_floatingStyle == floatingWindow) \
159 m_pWindow->settername(__VA_ARGS__); \
160 QDockWidget::settername(__VA_ARGS__); \
164 QDockWidget::settername(__VA_ARGS__); \
168 #define QWIDGETPROPSETTERSPECIAL(settername,...) \
171 QDockWidget::settername(__VA_ARGS__); \
175 if (m_floatingStyle == floatingWindow) \
177 m_pWindow->settername(__VA_ARGS__); \
181 QDockWidget::settername(__VA_ARGS__); \
185 QRect frameGeometry()
const;
186 const QRect &geometry()
const;
187 QRect normalGeometry()
const;
192 QSize frameSize()
const;
197 QRect childrenRect()
const;
198 QRegion childrenRegion()
const;
200 void move(
int x,
int y);
201 void move(
const QPoint &);
202 void resize(
int w,
int h);
203 void resize(
const QSize &);
204 void setGeometry(
int x,
int y,
int w,
int h);
205 void setGeometry(
const QRect &);
206 void setMinimumSize(
const QSize &size);
208 QString windowTitle();
209 void setWindowTitle(
const QString &title);
210 bool isEnabled()
const;
211 bool isVisible()
const;
213 void saveState(
const QString &iniName)
const;
214 void restoreState(
const QString &iniName);
218 virtual QSize sizeHint()
const;
219 virtual QSize minimumSizeHint()
const;
223 friend class ShortcutAction;
233 if (event->type() == QEvent::Close)
236 if(testAttribute(Qt::WA_DeleteOnClose) && event->isAccepted() )
245 return QObject::eventFilter(obj,event);
253 virtual void createActions() = 0;
254 virtual void createMenus() = 0;
255 virtual void createToolBars() = 0;
256 virtual void createStatusBar() = 0;
257 virtual void updateActions() {}
258 virtual void updatePythonActions() = 0;
260 Qt::WindowFlags modifyFlags(
const Qt::WindowFlags &flags,
const Qt::WindowFlags &setFlags,
const Qt::WindowFlags &unsetFlags);
262 virtual void windowStateChanged(
bool ) {}
266 inline QMainWindow* getCanvas() {
return m_pWindow; }
275 inline QMenuBar* getMenuBar()
const {
return (m_pWindow == NULL) ? NULL : m_pWindow->menuBar(); }
277 RetVal addToolBar(QToolBar *tb,
const QString &key, Qt::ToolBarArea area = Qt::TopToolBarArea,
int section = 1);
278 RetVal removeToolBar(
const QString &key);
280 QAction *m_actStayOnTop;
281 QAction *m_actStayOnTopOfApp;
285 void contextMenuEvent(QContextMenuEvent *e)
288 qDebug() <<
"context menu of abstractDockWidget clicked. [placeholder for (un)docking feature.] pos: " << e->pos();
291 QMainWindow *m_pWindow;
301 QList<Toolbar> m_toolbars;
307 QToolBar* m_dockToolbar;
309 QAction* m_actUndock;
316 QRect m_lastUndockedSize;
317 QByteArray m_pendingGeometryState;
320 void setEnabled(
bool);
321 virtual void setVisible(
bool visible);
328 void setDockSize(
int newWidth,
int newHeight);
336 void mnuStayOnTop(
bool checked);
337 void mnuStayOnTopOfApp(
bool checked);
339 void returnToOldMinMaxSizes();
Class for managing status values (like errors or warning)
Definition retVal.h:54
Definition apiFunctionsGraph.cpp:40