Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Classes

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. More...
 
virtual ~QtxMainWindow ()
 Destructor. More...
 
bool isOpaqueResize () const
 
void setOpaqueResize (bool)
 
bool isDockableMenuBar () const
 Check if the menu bar is dockable. More...
 
void setDockableMenuBar (const bool)
 Set menu bar dockable/undockable. More...
 
bool isDockableStatusBar () const
 Check if the status bar is dockable. More...
 
void setDockableStatusBar (const bool)
 Set status bar dockable/undockable. More...
 
QString storeGeometry () const
 Dump main window geometry to the string. More...
 
void retrieveGeometry (const QString &)
 Restore main window geometry from the string. More...
 
bool isFullScreenAllowed () const
 FullScreenAllowed flag allowed dump in the main window geometry Qt::WindowFullScreen parameter. More...
 
void setFullScreenAllowed (const bool)
 Set FullScreenAllowed flag. The default value is true. More...
 
bool isMinimizeAllowed () const
 MinimizeAllowed flag allowed dump in the main window geometry Qt::WindowMinimized parameter. More...
 
void setMinimizeAllowed (const bool)
 Set MinimizeAllowed flag. The default value is true. More...
 

Protected Member Functions

virtual bool event (QEvent *)
 

Private Slots

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

Private Member Functions

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

Private Attributes

QToolBarmyMenuBar
 dockable menu bar More...
 
QToolBarmyStatusBar
 dockable status bar More...
 
bool myFullScreenAllowed
 
bool myMinimizeAllowed
 
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::event ( QEvent e)
protectedvirtual
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
bool QtxMainWindow::isDockableMenuBar ( ) const
Returns
true if dockable menu bar exists

References myMenuBar.

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

References myStatusBar.

bool QtxMainWindow::isFullScreenAllowed ( ) const
Returns
FullScreenAllowed flag.

References myFullScreenAllowed.

bool QtxMainWindow::isMinimizeAllowed ( ) const
Returns
MinimizeAllowed flag.

References myMinimizeAllowed.

bool QtxMainWindow::isOpaqueResize ( ) const

References myOpaque.

void QtxMainWindow::onDestroyed ( QObject obj)
privateslot

Clears internal pointer to prevent crashes.

Parameters
objsignal sender (object being destroyed)

References myMenuBar, and myStatusBar.

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

References geometryValue(), isFullScreenAllowed(), and isMinimizeAllowed().

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

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

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

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

void QtxMainWindow::setFullScreenAllowed ( const bool  f)
Parameters
fvalue of the FullScreenAllowed flag.

References myFullScreenAllowed.

void QtxMainWindow::setMinimizeAllowed ( const bool  f)
Parameters
fvalue of the MinimizeAllowed flag.

References myMinimizeAllowed.

void QtxMainWindow::setOpaqueResize ( bool  on)

References myOpaque.

QString QtxMainWindow::storeGeometry ( ) const
Returns
string represenation of the window geometry

References isFullScreenAllowed(), and isMinimizeAllowed().

Member Data Documentation

bool QtxMainWindow::myFullScreenAllowed
private
QToolBar* QtxMainWindow::myMenuBar
private
bool QtxMainWindow::myMinimizeAllowed
private
QMouseEvent* QtxMainWindow::myMouseMove
private
bool QtxMainWindow::myOpaque
private
Resizer* QtxMainWindow::myResizer
private
QToolBar* QtxMainWindow::myStatusBar
private

The documentation for this class was generated from the following files: