itom
|
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an instance of QMainWindow. The real widget is then placed as central widget of this QMainWindow. QMainWindow has the ability to show a menubar as well as a toolbar, which is used in different versions depending on docked state. Inherit AbstractDockWidget in order to realize content of QMainWindow. More...
#include <abstractDockWidget.h>
Classes | |
struct | Toolbar |
Public Types | |
enum | tFloatingStyle { floatingNone , floatingStandard , floatingWindow } |
The floating style of a widget, derived from AbstractDockWidget. More... | |
enum | tMovingStyle { movingDisabled , movingEnabled } |
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one. More... | |
enum | tTopLevelStyle { topLevelOverall , topLevelParentOnly , topLevelNothing } |
The top level style of a widget, derived from AbstractDockWidget. More... | |
Public Slots | |
void | setEnabled (bool) |
virtual void | setVisible (bool visible) |
virtual void | pythonStateChanged (tPythonTransitions pyTransition) |
slot invoked if python state changed. Sets the specific member variables according to the python transition. | |
void | raiseAndActivate () |
activates this dock widget or window and raises it on top of all opened windows | |
void | mini () |
void | setDockSize (int newWidth, int newHeight) |
void | dockWidget () |
docks this dockWidget. | |
void | undockWidget (bool show_it=true) |
undocks this dockWidget. | |
RetVal | setAdvancedWindowTitle (QString newCompleteTitle=QString(), bool appendToBasicTitle=true) |
changes the title of widget | |
Signals | |
void | dockStateChanged (bool docked) |
emitted if the widget is either docked or undocked from the main window | |
Public Member Functions | |
AbstractDockWidget (bool docked, bool isDockAvailable, tFloatingStyle floatingStyle, tMovingStyle movingStyle, const QString &title=QString(), const QString &objName=QString(), QWidget *parent=0) | |
constructor | |
virtual | ~AbstractDockWidget () |
destructor | |
bool | docked () const |
RetVal | setTopLevel (tTopLevelStyle topLevel, bool showWindow=true) |
void | setParent (QWidget *parent) |
QWidget * | getActiveInstance () |
QRect | frameGeometry () const |
const QRect & | geometry () const |
QRect | normalGeometry () const |
int | x () const |
int | y () const |
QPoint | pos () const |
QSize | frameSize () const |
QSize | size () const |
int | width () const |
int | height () const |
QRect | rect () const |
QRect | childrenRect () const |
QRegion | childrenRegion () const |
void | move (int x, int y) |
void | move (const QPoint &) |
void | resize (int w, int h) |
void | resize (const QSize &) |
void | setGeometry (int x, int y, int w, int h) |
void | setGeometry (const QRect &) |
void | setMinimumSize (const QSize &size) |
QString | windowTitle () |
void | setWindowTitle (const QString &title) |
bool | isEnabled () const |
bool | isVisible () const |
void | saveState (const QString &iniName) const |
void | restoreState (const QString &iniName) |
void | synchronizeTopLevelState () |
synchronizes the top level state of the dock widget with the floating settings of this abstract dock widget | |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
Protected Member Functions | |
bool | eventFilter (QObject *obj, QEvent *event) |
eventFilter for m_pWindow | |
void | init () |
init method, called by constructor | |
virtual void | closeEvent (QCloseEvent *event) |
closeEvent invoked if this AbstractDockWidget should be closed | |
virtual void | createActions ()=0 |
virtual void | createMenus ()=0 |
virtual void | createToolBars ()=0 |
virtual void | createStatusBar ()=0 |
virtual void | updateActions () |
virtual void | updatePythonActions ()=0 |
Qt::WindowFlags | modifyFlags (const Qt::WindowFlags &flags, const Qt::WindowFlags &setFlags, const Qt::WindowFlags &unsetFlags) |
virtual void | windowStateChanged (bool) |
void | setContentWidget (QWidget *widget) |
sets any given QWidget as central widget of QMainWindow and inversely sets this QWidget's parent to the instance of QMainWindget | |
QWidget * | getContentWidget () const |
QMainWindow * | getCanvas () |
bool | pythonBusy () const |
bool | pythonDebugMode () const |
bool | pythonInWaitingMode () const |
QToolBar * | getToolBar (QString key) const |
returns reference to toolbar with given key-value | |
QMenuBar * | getMenuBar () const |
RetVal | addToolBar (QToolBar *tb, const QString &key, Qt::ToolBarArea area=Qt::TopToolBarArea, int section=1) |
RetVal | removeToolBar (const QString &key) |
Protected Attributes | |
QAction * | m_actStayOnTop |
QAction * | m_actStayOnTopOfApp |
Private Slots | |
void | mnuStayOnTop (bool checked) |
void | mnuStayOnTopOfApp (bool checked) |
void | returnToOldMinMaxSizes () |
Private Member Functions | |
void | contextMenuEvent (QContextMenuEvent *e) |
Private Attributes | |
QMainWindow * | m_pWindow |
bool | m_docked |
bool | m_dockAvailable |
tFloatingStyle | m_floatingStyle |
tMovingStyle | m_movingStyle |
QString | m_basicTitle |
QString | m_completeTitle |
QMap< QString, QToolBar * > | m_toolBars |
QList< Toolbar > | m_toolbars |
bool | m_pythonBusy |
bool | m_pythonDebugMode |
bool | m_pythonInWaitingMode |
QToolBar * | m_dockToolbar |
QAction * | m_actDock |
QAction * | m_actUndock |
QWidget * | m_overallParent |
tTopLevelStyle | m_recentTopLevelStyle |
QSize | m_oldMinSize |
QSize | m_oldMaxSize |
QRect | m_lastUndockedSize |
QByteArray | m_pendingGeometryState |
Friends | |
class | ShortcutAction |
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an instance of QMainWindow. The real widget is then placed as central widget of this QMainWindow. QMainWindow has the ability to show a menubar as well as a toolbar, which is used in different versions depending on docked state. Inherit AbstractDockWidget in order to realize content of QMainWindow.
Base class for all widgets that should be docked into the main window of itom. Widgets, deriving from this base class, can have different appearances. Depending on their configuration, they can behave like a dock widget and be docked into the main window or undocked (floated) as independent toolbox or they can be a dock widget if docked or a real window if they are undocked.
The floating style of a widget, derived from AbstractDockWidget.
An AbstractDockWidget can have different window representations, which can also be allowed or disallowed for different widgets:
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one.
Enumerator | |
---|---|
movingDisabled | The dock widget must not be moved from one docking area to another one |
movingEnabled | The dock widget can be moved from one docking area to another one |
The top level style of a widget, derived from AbstractDockWidget.
The top level style is only relevant if the widget is currently undocked and has a window representation. Then the window can behave like a normal window, or it can always stay on top of its parent window or it can stay on top of all itom windows, dialogs...
Enumerator | |
---|---|
topLevelOverall | Window stays on top of everything |
topLevelParentOnly | Window stays on top of its parent window only |
topLevelNothing | Window has no specific top level behaviour (default) |
ito::AbstractDockWidget::AbstractDockWidget | ( | bool | docked, |
bool | isDockAvailable, | ||
tFloatingStyle | floatingStyle, | ||
tMovingStyle | movingStyle, | ||
const QString & | title = QString(), | ||
const QString & | objName = QString(), | ||
QWidget * | parent = 0 ) |
constructor
basic member initializations. Afterwards method init is called.
docked | true if widget should be docked at startup, else false |
isDockAvailable | true if docking functionality is available, else false |
floatingStyle | FloatingStyle of AbstractDockWidget |
movingStyle | MovingStyle of AbstractDockWidget |
title | initial title for docking widget. members m_basicTitle and m_completeTitle are set to title, too. |
parent | parent-widget, default: NULL |
|
virtual |
destructor
returns if docking widget is docked (true) or undocked (false)
|
protectedvirtual |
closeEvent invoked if this AbstractDockWidget should be closed
In this abstract class, the event is always accepted.
event | Event of type QCloseEvent |
Reimplemented in ito::FigureWidget, and ito::ScriptDockWidget.
|
protectedpure virtual |
Implemented in ito::BookmarkDockWidget, ito::CallStackDockWidget, ito::ScriptDockWidget, and ito::WorkspaceDockWidget.
|
protectedpure virtual |
Implemented in ito::BookmarkDockWidget, and ito::ScriptDockWidget.
|
protectedpure virtual |
Implemented in ito::BookmarkDockWidget, and ito::ScriptDockWidget.
|
protectedpure virtual |
Implemented in ito::BookmarkDockWidget, ito::CallStackDockWidget, ito::ScriptDockWidget, and ito::WorkspaceDockWidget.
|
slot |
docks this dockWidget.
Transforms this widget into a docking widget (e.g. from a single window) and docks it into the main window. The menubar is hidden and the size of all icons is decreased to 16x16 px.
|
inlineprotected |
eventFilter for m_pWindow
depending on m_floatingStyle and the docked property, close-events will be caught by the closeEvent-method of this docking-widget or by the closeEvent of m_pWindow, which is not overloaded directly. Therefore this event-filter is installed and in case of a QCloseEvent, the closeEvent-method of this docking widget will be invoked in order to handle the close request. Else, the event will be passed and handled by somebody else.
|
inlineprotected |
returns reference to central widget of docking window
|
protected |
returns reference to toolbar with given key-value
key | String with key value for desired toolbar |
|
protected |
init method, called by constructor
|
inlineprotected |
returns if python is busy (true)
|
inlineprotected |
returns if python is in debug mode (true)
|
inlineprotected |
returns if python is in waiting mode (true)
|
virtualslot |
slot invoked if python state changed. Sets the specific member variables according to the python transition.
pyTransition | pythonTransition (type tPythonTransitions) defining the transition to the destination python state |
|
slot |
activates this dock widget or window and raises it on top of all opened windows
activates this dock widget or window and raises it on top of all opened windows (if possible)
Depending on the docking-state of this widget and its style (docking-widget or single-window), this widget is activated and if undocked raised on top of the window stack.
|
slot |
changes the title of widget
If widget is docked or m_floatingStyle is not equal to floatingWindow, this widget always gets the title m_basicTitle. Otherwise its title is set to m_completeTitle. This member is either set to newCompleteTitle if prependToBasicTitle is equal to false, otherwise newCompleteTitle is prepended to m_basicTitle.
newCompleteTitle | new complete title for this widget (e.g. containing filename and modification sign *) |
prependToBasicTitle | true if member m_completeTitle should consist of newCompleteTitle + m_basicTitle, false if m_completeTitle is equal to newCompleteTitle |
|
protected |
sets any given QWidget as central widget of QMainWindow and inversely sets this QWidget's parent to the instance of QMainWindget
widget | instance of QWidget, which should be the central widget of this dock widget |
void ito::AbstractDockWidget::synchronizeTopLevelState | ( | ) |
synchronizes the top level state of the dock widget with the floating settings of this abstract dock widget
If the floating style is floating window and the dock widget has been set as floated dock widget (e.g. by a restoreState method call) the dock widget is in the top level state, however it does not correspond to the desired undocked, main window style. This is synchronized and corrected by this function.
|
slot |
undocks this dockWidget.
If m_floatingStyle is equal to floatingWindow, then this widget is transformed into a single window with its own toolbar and menubar. All Icons are increased in size in order to have the single-window-look.
|
inlineprotectedvirtual |
Reimplemented in ito::BookmarkDockWidget, and ito::WorkspaceDockWidget.
|
protectedpure virtual |
Implemented in ito::BookmarkDockWidget.
|
private |
basic title for this instance, shown if dock widget is docked
|
private |
complete title for this instance, shown if dock widget is undocked
|
private |
flag indicating whether docking functionality is available (true)
|
private |
flag indicating whether this instance is docked (true) or not (false)
|
private |
floating style of dock widget
|
private |
moving style of dock widget
|
private |
parent given by constructor, which is the parent of both the dock widget and the main window in floating mode
|
private |
if true, python is busy right now
|
private |
if true, python is in debug mode right now
|
private |
if true, python is in debug mode but waiting for next user command (e.g. the debugger waits at a breakpoint)
|
private |
map of different toolbars, which are shown in undocked version with bigger icon sizes comparing to docked version