Version: 6.3.1
Data Structures | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes

QtxMainWindow Class Reference

Enhanced main window which supports dockable menubar and status bar plus geometry saving/restoring.

#include <QtxMainWindow.h>

Inheritance diagram for QtxMainWindow:
Inheritance graph

Data Structures

class  Filter
 Internal object used to filter child removal events for specified widget from parent widget. More...
class  Resizer
 Internal object used to resize dock widgets. More...

Public Member Functions

 QtxMainWindow (QWidget *=0, Qt::WindowFlags=0)
 Constructor.
virtual ~QtxMainWindow ()
 Destructor.
bool isOpaqueResize () const
void setOpaqueResize (bool)
bool isDockableMenuBar () const
 Check if the menu bar is dockable.
void setDockableMenuBar (const bool)
 Set menu bar dockable/undockable.
bool isDockableStatusBar () const
 Check if the status bar is dockable.
void setDockableStatusBar (const bool)
 Set status bar dockable/undockable.
QString storeGeometry () const
 Dump main window geometry to the string.
void retrieveGeometry (const QString &)
 Restore main window geometry from the string.

Protected Member Functions

virtual bool event (QEvent *)

Private Slots

void onDestroyed (QObject *)
 Called when child object (menu bar, status bar) is destroyed.

Private Member Functions

int geometryValue (const QString &, int &, bool &) const
 Retrieve numerical value from the string.

Private Attributes

QToolBarmyMenuBar
 dockable menu bar
QToolBarmyStatusBar
 dockable status bar
bool myOpaque
ResizermyResizer
QMouseEvent * myMouseMove

Constructor & Destructor Documentation

QtxMainWindow::QtxMainWindow ( QWidget parent = 0,
Qt::WindowFlags  f = 0 
)
Parameters:
parentparent widget
fwidget flags (Qt.WindowFlags)
QtxMainWindow::~QtxMainWindow ( ) [virtual]

Member Function Documentation

bool QtxMainWindow::isOpaqueResize ( ) const

References myOpaque.

void QtxMainWindow::setOpaqueResize ( bool  on)

References myOpaque.

bool QtxMainWindow::isDockableMenuBar ( ) const
Returns:
true if dockable menu bar exists

References myMenuBar.

void QtxMainWindow::setDockableMenuBar ( const bool  on)
Parameters:
onif true, make menu bar dockable, otherwise make menu bar undockable

References isDockableMenuBar(), myMenuBar, and onDestroyed().

bool QtxMainWindow::isDockableStatusBar ( ) const
Returns:
true if dockable status bar exists

References myStatusBar.

void QtxMainWindow::setDockableStatusBar ( const bool  on)
Parameters:
onif true, make status bar dockable, otherwise make status bar undockable

References isDockableStatusBar(), myStatusBar, and onDestroyed().

QString QtxMainWindow::storeGeometry ( ) const
Returns:
string represenation of the window geometry
void QtxMainWindow::retrieveGeometry ( const QString &  str)
Parameters:
strstring represenation of the window geometry

References geometryValue().

bool QtxMainWindow::event ( QEvent e) [protected, virtual]
void QtxMainWindow::onDestroyed ( QObject obj) [private, slot]

Clears internal pointer to prevent crashes.

Parameters:
objsignal sender (object being destroyed)

References myMenuBar, and myStatusBar.

int QtxMainWindow::geometryValue ( const QString &  str,
int &  num,
bool &  percent 
) const [private]

Numerical value in the string have the structure [+|-]*[%], that is one or more digits which can start from "+" or "-" and can end with "%" symbol.

Parameters:
strstring being converted
numreturning value (> 0)
percentif string ends with "%" this parameter is equal to true after returning from the function
Returns:
-1 if value < 0, 1 if value > 0 and 0 in case of error

Field Documentation

bool QtxMainWindow.myOpaque [private]
QMouseEvent* QtxMainWindow.myMouseMove [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS