Version: 9.12.0
QtxMainWindow Class Reference

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

#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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ QtxMainWindow()

QtxMainWindow::QtxMainWindow ( QWidget parent = 0,
Qt::WindowFlags  f = 0 
)

Constructor.

Parameters
parentparent widget
fwidget flags (Qt::WindowFlags)

◆ ~QtxMainWindow()

QtxMainWindow::~QtxMainWindow ( )
virtual

Destructor.

References setDockableMenuBar(), and setDockableStatusBar().

Member Function Documentation

◆ event()

bool QtxMainWindow::event ( QEvent e)
protectedvirtual

◆ geometryValue()

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

Retrieve numerical value from the string.

Numerical value in the string have the structure [+|-]\d*[%], 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

◆ isDockableMenuBar()

bool QtxMainWindow::isDockableMenuBar ( ) const

Check if the menu bar is dockable.

Returns
true if dockable menu bar exists

References myMenuBar.

◆ isDockableStatusBar()

bool QtxMainWindow::isDockableStatusBar ( ) const

Check if the status bar is dockable.

Returns
true if dockable status bar exists

References myStatusBar.

◆ isFullScreenAllowed()

bool QtxMainWindow::isFullScreenAllowed ( ) const

FullScreenAllowed flag allowed dump in the main window geometry Qt::WindowFullScreen parameter.

Returns
FullScreenAllowed flag.

References myFullScreenAllowed.

◆ isMinimizeAllowed()

bool QtxMainWindow::isMinimizeAllowed ( ) const

MinimizeAllowed flag allowed dump in the main window geometry Qt::WindowMinimized parameter.

Returns
MinimizeAllowed flag.

References myMinimizeAllowed.

◆ isOpaqueResize()

bool QtxMainWindow::isOpaqueResize ( ) const

References myOpaque.

◆ onDestroyed

void QtxMainWindow::onDestroyed ( QObject obj)
privateslot

Called when child object (menu bar, status bar) is destroyed.

Clears internal pointer to prevent crashes.

Parameters
objsignal sender (object being destroyed)

References myMenuBar, and myStatusBar.

◆ retrieveGeometry()

void QtxMainWindow::retrieveGeometry ( const QString &  str)

Restore main window geometry from the string.

Parameters
strstring represenation of the window geometry

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

◆ setDockableMenuBar()

void QtxMainWindow::setDockableMenuBar ( const bool  on)

Set menu bar dockable/undockable.

Parameters
onif true, make menu bar dockable, otherwise make menu bar undockable

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

◆ setDockableStatusBar()

void QtxMainWindow::setDockableStatusBar ( const bool  on)

Set status bar dockable/undockable.

Parameters
onif true, make status bar dockable, otherwise make status bar undockable

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

◆ setFullScreenAllowed()

void QtxMainWindow::setFullScreenAllowed ( const bool  f)

Set FullScreenAllowed flag. The default value is true.

Parameters
fvalue of the FullScreenAllowed flag.

References myFullScreenAllowed.

◆ setMinimizeAllowed()

void QtxMainWindow::setMinimizeAllowed ( const bool  f)

Set MinimizeAllowed flag. The default value is true.

Parameters
fvalue of the MinimizeAllowed flag.

References myMinimizeAllowed.

◆ setOpaqueResize()

void QtxMainWindow::setOpaqueResize ( bool  on)

References myOpaque.

◆ storeGeometry()

QString QtxMainWindow::storeGeometry ( ) const

Dump main window geometry to the string.

Returns
string represenation of the window geometry

References isFullScreenAllowed(), and isMinimizeAllowed().

Member Data Documentation

◆ myFullScreenAllowed

bool QtxMainWindow::myFullScreenAllowed
private

◆ myMenuBar

QToolBar* QtxMainWindow::myMenuBar
private

dockable menu bar

◆ myMinimizeAllowed

bool QtxMainWindow::myMinimizeAllowed
private

◆ myMouseMove

QMouseEvent* QtxMainWindow::myMouseMove
private

◆ myOpaque

bool QtxMainWindow::myOpaque
private

◆ myResizer

Resizer* QtxMainWindow::myResizer
private

◆ myStatusBar

QToolBar* QtxMainWindow::myStatusBar
private

dockable status bar


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