itom 2.0.0
ito::AbstractDockWidget Class Reference

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...

Inheritance diagram for ito::AbstractDockWidget:
ito::AIManagerWidget ito::BreakPointDockWidget ito::CallStackDockWidget ito::FigureWidget ito::FileSystemDockWidget ito::HelpDockWidget ito::LastCommandDockWidget ito::ScriptDockWidget ito::WorkspaceDockWidget

List of all members.

Classes

class  ShortcutAction
struct  Toolbar

Public Types

enum  tFloatingStyle { floatingNone, floatingStandard, floatingWindow }
enum  tMovingStyle { movingDisabled, movingEnabled }
enum  tTopLevelStyle { topLevelOverall, topLevelParentOnly, topLevelNothing }

Public Slots

void setEnabled (bool)
virtual void setVisible (bool visible)
virtual void dockedToMainWindow (AbstractDockWidget *)
virtual void removedFromMainWindow (AbstractDockWidget *)
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 setDockSize (int newWidth, int newHeight)
void dockWidget ()
 docks this dockWidget.
void undockWidget (bool show_it=true)
 undocks this dockWidget.

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 setAdvancedWindowTitle (QString newCompleteTitle=QString(), bool appendToBasicTitle=true)
 changes the title of widget
RetVal setTopLevel (tTopLevelStyle topLevel)
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 &)
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

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

Properties

bool visible
bool enabled
QRect geometry
QRect frameGeometry
QRect normalGeometry
int x
int y
QPoint pos
QSize frameSize
QSize size
int width
int height
QRect rect
QRect childrenRect
QRegion childrenRegion

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< Toolbarm_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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
dockedtrue if widget should be docked at startup, else false
isDockAvailabletrue if docking functionality is available, else false
floatingStyleFloatingStyle of AbstractDockWidget
See also:
tFloatingStyle
Parameters:
movingStyleMovingStyle of AbstractDockWidget
See also:
tMovingStyle
Parameters:
titleinitial title for docking widget. members m_basicTitle and m_completeTitle are set to title, too.
parentparent-widget, default: NULL
See also:
init

Member Function Documentation

RetVal ito::AbstractDockWidget::addToolBar ( QToolBar *  tb,
const QString &  key,
Qt::ToolBarArea  area = Qt::TopToolBarArea,
int  section = 1 
) [protected]

! ands given toolbar and register it with given key-string in toolbar-map (m_toolBars) ! ! remove toolbar with given key from m_toolBars !

void ito::AbstractDockWidget::closeEvent ( QCloseEvent *  event) [protected, virtual]

closeEvent invoked if this AbstractDockWidget should be closed

In this abstract class, the event is always accepted.

Note:
Please overwrite this method by derived class in order to realize desired behaviour.
Parameters:
eventEvent of type QCloseEvent

Reimplemented in ito::FigureWidget, and ito::ScriptDockWidget.

bool ito::AbstractDockWidget::docked ( ) const [inline]

returns if docking widget is docked (true) or undocked (false)

void ito::AbstractDockWidget::dockWidget ( ) [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.

bool ito::AbstractDockWidget::eventFilter ( QObject *  obj,
QEvent *  event 
) [inline, protected]

eventFilter for m_pWindow

depending on m_floatingStyle and the docked property, close-events will be catched 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.

Reimplemented in ito::FileSystemDockWidget.

QWidget* ito::AbstractDockWidget::getContentWidget ( ) const [inline, protected]

returns reference to central widget of docking window

QToolBar * ito::AbstractDockWidget::getToolBar ( QString  key) const [protected]

returns reference to toolbar with given key-value

Parameters:
keyString with key value for desired toolbar
Returns:
reference to QToolBar or NULL, if key not found
void ito::AbstractDockWidget::init ( void  ) [protected]

init method, called by constructor

See also:
AbstractDockWidget::AbstractDockWidget
bool ito::AbstractDockWidget::pythonBusy ( ) const [inline, protected]

returns if python is busy (true)

bool ito::AbstractDockWidget::pythonDebugMode ( ) const [inline, protected]

returns if python is in debug mode (true)

bool ito::AbstractDockWidget::pythonInWaitingMode ( ) const [inline, protected]

returns if python is in waiting mode (true)

See also:
m_pythonInWaitingMode
void ito::AbstractDockWidget::pythonStateChanged ( tPythonTransitions  pyTransition) [virtual, slot]

slot invoked if python state changed. Sets the specific member variables according to the python transition.

Parameters:
pyTransitionpythonTransition (type tPythonTransitions) defining the transition to the destination python state
void ito::AbstractDockWidget::raiseAndActivate ( ) [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.

Returns:
retOk
RetVal ito::AbstractDockWidget::setAdvancedWindowTitle ( QString  newCompleteTitle = QString(),
bool  prependToBasicTitle = true 
)

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.

Parameters:
newCompleteTitlenew complete title for this widget (e.g. containing filename and modification sign *)
prependToBasicTitletrue if member m_completeTitle should consist of newCompleteTitle + m_basicTitle, false if m_completeTitle is equal to newCompleteTitle
Returns:
retOk
void ito::AbstractDockWidget::setContentWidget ( QWidget *  widget) [protected]

sets any given QWidget as central widget of QMainWindow and inversely sets this QWidget's parent to the instance of QMainWindget

Parameters:
widgetinstance 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.

void ito::AbstractDockWidget::undockWidget ( bool  show_it = true) [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.


Member Data Documentation

basic title for this instance, shown if dock widget is docked

complete title for this instance, shown if dock widget is undocked

flag indicating whether docking functionality is available (true)

flag indicating whether this instance is docked (true) or not (false)

tFloatingStyle ito::AbstractDockWidget::m_floatingStyle [private]

floating style of dock widget

See also:
tFloatingStyle

moving style of dock widget

See also:
tMovingStyle

parent given by constructor, which is the parent of both the dock widget and the main window in floating mode

if true, python is busy right now

if true, python is in debug mode right now

if true, python is in debug mode but waiting for next user command (e.g. the debugger waits at a breakpoint)

QMap<QString,QToolBar*> ito::AbstractDockWidget::m_toolBars [private]

map of different toolbars, which are shown in undocked version with bigger icon sizes comparing to docked version


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends