QCAD
Open Source 2D CAD
RMainWindowQt Class Reference

Base class for a Qt based MDI main application window. More...

#include <RMainWindowQt.h>

Inheritance diagram for RMainWindowQt:
RMainWindow RProgressHandler RMessageHandler

Public Slots

void currentTabChanged (int index)
 Part of the workaround for QMdiArea bug with events filtering through all stacked windows: More...
 
void quit ()
 
void subWindowActivated (QMdiSubWindow *sw)
 

Signals

void closeRequested ()
 
void commandPrompt (const QString &text)
 Emitted when the command prompt is requested to change. More...
 
void contextMenu (int entityId, const RVector &pos)
 Emitted when a context menu is requested on top of the given entity. More...
 
void dragEnter (QDragEnterEvent *event)
 
void drop (QDropEvent *event)
 
void enterPressed ()
 
void escape ()
 
void leftMouseTip (const QString &message)
 Emitted when the left mouse button tip is requested to change. More...
 
void progress (int value)
 
void progressCanceled ()
 
void progressEnd ()
 
void progressText (const QString &label)
 
void resumedTab (RMdiChildQt *mdiChild)
 
void rightMouseTip (const QString &message)
 Emitted when the right mouse button tip is requested to change. More...
 
void toolBarContextMenu (QMenu *menu)
 
void userCommand (const QString &message, bool escape)
 
void userInfo (const QString &message, bool escape)
 
void userMessage (const QString &message, bool escape)
 
void userWarning (const QString &message, bool messageBox, bool escape)
 

Public Member Functions

virtual void cancelProgress ()
 
void clearKeyLog ()
 
virtual QMenu * createPopupMenu ()
 
virtual void disable ()
 
virtual void enable ()
 
virtual void escapeEvent ()
 
virtual QWidget * getChildWidget (const QString &name)
 
QList< QDockWidget * > getDockWidgets ()
 
virtual RDocumentgetDocument ()
 
virtual RDocumentInterfacegetDocumentInterface ()
 
virtual int getHeight ()
 
QString getKeyLog () const
 
RMdiAreagetMdiArea ()
 
RMdiChildQtgetMdiChild ()
 
virtual int getPositionX ()
 
virtual int getPositionY ()
 
QTabBar * getTabBar ()
 
QList< QToolBar * > getToolBars ()
 
virtual int getWidth ()
 
virtual void handleUserCommand (const QString &message, bool escape=true)
 
virtual void handleUserInfo (const QString &message, bool escape=true)
 
virtual void handleUserMessage (const QString &message, bool escape=true)
 
virtual void handleUserWarning (const QString &message, bool messageBox=false, bool escape=true)
 
virtual void move (int x, int y)
 Moves the application window to the given x / y position. More...
 
virtual void postCloseEvent ()
 
virtual void postPropertyEvent (RPropertyTypeId propertyTypeId, const QVariant &value, RS::EntityType entityTypeFilter=RS::EntityAll)
 
virtual void postSelectionChangedEvent ()
 
virtual void postTransactionEvent (RTransaction &t, bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityAll)
 
virtual bool readSettings ()
 Restores the application window settings (size, position, ...). More...
 
virtual void resize (int width, int height)
 Resizes the application window to the given width and height. More...
 
 RMainWindowQt (QWidget *parent=0, bool hasMdiArea=true)
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
virtual void setCommandPrompt (const QString &text="")
 
virtual void setGraphicsViewCursor (const QCursor &cursor)
 Sets the cursor of all graphics views in all MDI children. More...
 
virtual void setLeftMouseTip (const QString &text="")
 
virtual void setProgress (int value)
 
virtual void setProgressEnd ()
 
virtual void setProgressText (const QString &text="")
 
virtual void setRightMouseTip (const QString &text="")
 
virtual void showContextMenu (RObject::Id entityId, const RVector &pos)
 
virtual void writeSettings ()
 Stores the application window settings (size, position, ...). More...
 
virtual ~RMainWindowQt ()
 
- Public Member Functions inherited from RMainWindow
void addBlockListener (RBlockListener *l)
 Adds a listener for block change / add / remove events. More...
 
void addCoordinateListener (RCoordinateListener *l)
 Adds a listener for coordinate events. More...
 
void addEntityExportListener (REntityExportListener *l)
 
void addExportListener (RExportListener *l)
 Adds a listener for export events. More...
 
void addFocusListener (RFocusListener *l)
 Adds a listener for focus changes. More...
 
void addImportListener (RImportListener *l)
 Adds a listener for import events. More...
 
void addInterTransactionListener (RInterTransactionListener *l)
 Adds a listener for transaction in progress events. More...
 
void addKeyListener (RKeyListener *l)
 Adds a listener for key changes. More...
 
void addLayerListener (RLayerListener *l)
 Adds a listener for layer change / add / remove events. More...
 
void addNewDocumentListener (RNewDocumentListener *l)
 Adds a listener for transaction in progress events. More...
 
void addPaletteListener (RPaletteListener *l)
 Adds a listener for palette change events. More...
 
void addPenListener (RPenListener *l)
 Adds a listener for pen change events. More...
 
void addPreferencesListener (RPreferencesListener *l)
 Adds a listener for preferences changes. More...
 
void addPropertyListener (RPropertyListener *l)
 Adds a listener for property events. More...
 
void addSelectionListener (RSelectionListener *l)
 Adds a listener for selection events. More...
 
void addSnapListener (RSnapListener *l)
 Adds a listener for snap mode changes. More...
 
void addTransactionListener (RTransactionListener *l)
 Adds a listener for transaction events. More...
 
void addUcsListener (RUcsListener *l)
 Adds a listener for UCS change / add / remove events. More...
 
void addViewFocusListener (RViewFocusListener *l)
 Adds a listener for view focus changes. More...
 
void addViewListener (RViewListener *l)
 Adds a listener for view change / add / remove events. More...
 
QVariant eval (const QString &ext, const QString &script)
 
void notifyBlockListeners (RDocumentInterface *documentInterface)
 Notifies all block listeners that at least one block object has changed. More...
 
void notifyBlockListenersCurrentBlock (RDocumentInterface *documentInterface)
 
void notifyCoordinateListeners (RDocumentInterface *documentInterface)
 Notifies all coordinate listeners that the coordinate has changed to position. More...
 
void notifyEntityExportListeners (RExporter *exporter, REntity *entity)
 
void notifyExportListenersEnd (RExporter *exporter)
 Notifies all Export listeners about end of export event. More...
 
void notifyExportListenersPost (RDocumentInterface *documentInterface)
 Notifies all Export listeners about post export event. More...
 
void notifyExportListenersPre (RDocumentInterface *documentInterface)
 Notifies all Export listeners about pre export event. More...
 
void notifyFocusListeners (RDocumentInterface *documentInterface)
 Notifies all focus listeners. More...
 
void notifyImportListenersPost (RDocumentInterface *documentInterface)
 Notifies all import listeners about post import event. More...
 
void notifyImportListenersPre (RDocumentInterface *documentInterface)
 Notifies all import listeners about pre import event. More...
 
void notifyInterTransactionListeners (RDocument *document, RTransaction *transaction=NULL)
 Notifies all transaction in progress listeners. More...
 
void notifyKeyListeners (QKeyEvent *event)
 Notifies all key listeners. More...
 
void notifyLayerListeners (RDocumentInterface *documentInterface, QList< RLayer::Id > &layerIds)
 Notifies all layer listeners that at least one layer object has changed. More...
 
void notifyLayerListenersCurrentLayer (RDocumentInterface *documentInterface, RLayer::Id previousLayerId)
 
void notifyListeners (bool withNull=false)
 
void notifyNewDocumentListeners (RDocument *document, RTransaction *transaction, bool beforeLoad)
 Notifies all transaction in progress listeners. More...
 
void notifyPaletteListeners ()
 Notifies all palette listeners that the current palette has changed. More...
 
void notifyPenListeners (RDocumentInterface *documentInterface)
 Notifies all pen listeners that the current pen has changed. More...
 
void notifyPreferencesListeners (RDocumentInterface *documentInterface)
 Notifies all preferences listeners. More...
 
void notifyPropertyListeners ()
 Notifies all property listeners that no properties are currently relevant. More...
 
void notifyPropertyListeners (RDocument &document, REntity &entity)
 Notifies all property listeners that the current property is the given entity. More...
 
void notifyPropertyListeners (RDocument *document, bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityUnknown)
 Notifies all property listeners that the current property has changed. More...
 
void notifySelectionListeners (RDocumentInterface *documentInterface)
 Notifies all selection listeners that the current selection has changed. More...
 
void notifySnapListeners (RDocumentInterface *documentInterface)
 Notifies all snap mode listeners. More...
 
void notifyTransactionListeners (RDocument *document, RTransaction *transaction=NULL)
 Notifies all transaction listeners. More...
 
void notifyUcsListeners (RDocumentInterface *documentInterface)
 Notifies all UCS listeners that at least one UCS object has changed. More...
 
void notifyViewFocusListeners (RGraphicsView *view)
 Notifies all view focus listeners. More...
 
void notifyViewListeners (RDocumentInterface *documentInterface)
 Notifies all view listeners that at least one view object has changed. More...
 
void propertyChangeEvent (RPropertyEvent &event)
 
virtual void quit ()=0
 Closes the application window. More...
 
void removeBlockListener (RBlockListener *l)
 
void removeCoordinateListener (RCoordinateListener *l)
 
void removeEntityExportListener (REntityExportListener *l)
 
void removeExportListener (RExportListener *l)
 
void removeFocusListener (RFocusListener *l)
 
void removeImportListener (RImportListener *l)
 
void removeInterTransactionListener (RInterTransactionListener *l)
 
void removeKeyListener (RKeyListener *l)
 
void removeLayerListener (RLayerListener *l)
 
void removeNewDocumentListener (RNewDocumentListener *l)
 
void removePaletteListener (RPaletteListener *l)
 
void removePenListener (RPenListener *l)
 
void removePreferencesListener (RPreferencesListener *l)
 
void removePropertyListener (RPropertyListener *l)
 
void removeSelectionListener (RSelectionListener *l)
 
void removeSnapListener (RSnapListener *l)
 
void removeTransactionListener (RTransactionListener *l)
 
void removeUcsListener (RUcsListener *l)
 
void removeViewFocusListener (RViewFocusListener *l)
 
void removeViewListener (RViewListener *l)
 
 RMainWindow ()
 
void ucsSetEvent (const QString &ucsName)
 Called immediately after the user has activated a new UCS to be used as current UCS. More...
 
virtual ~RMainWindow ()
 
- Public Member Functions inherited from RProgressHandler
 RProgressHandler ()
 
virtual void setProgressEnabled (bool on)
 

Static Public Member Functions

static RMainWindowQtgetMainWindow ()
 
- Static Public Member Functions inherited from RMainWindow
static RDocumentInterfacegetDocumentInterfaceStatic ()
 
static RMainWindowgetMainWindow ()
 
static bool hasMainWindow ()
 
static void installMessageHandler ()
 
static void messageHandler (QtMsgType type, const char *msg)
 

Protected Slots

void initGuiActions ()
 
void notifyListenersSlot (QMdiSubWindow *mdiChild)
 
void suspendAndResume (QMdiSubWindow *mdiChild)
 
void updateGuiActions (QMdiSubWindow *mdiChild=NULL)
 
void updateScenes (QMdiSubWindow *mdiChild)
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual bool event (QEvent *e)
 

Protected Attributes

int disableCounter
 
QString keyLog
 
QTime keyTimeOut
 
RMdiAreamdiArea
 
- Protected Attributes inherited from RMainWindow
QList< RBlockListener * > blockListeners
 
QList< RCoordinateListener * > coordinateListeners
 
QList< REntityExportListener * > entityExportListeners
 
QList< RExportListener * > exportListeners
 
QList< RFocusListener * > focusListeners
 
QList< RImportListener * > importListeners
 
QList< RInterTransactionListener * > interTransactionListeners
 
QList< RKeyListener * > keyListeners
 
QList< RLayerListener * > layerListeners
 
QMutex mutex
 
QList< RNewDocumentListener * > newDocumentListeners
 
QList< RPaletteListener * > paletteListeners
 
QList< RPenListener * > penListeners
 
QList< RPreferencesListener * > preferencesListeners
 
QList< RPropertyListener * > propertyListeners
 
QList< RSelectionListener * > selectionListeners
 
QList< RSnapListener * > snapListeners
 
QList< RTransactionListener * > transactionListeners
 
QList< RUcsListener * > ucsListeners
 
QList< RViewFocusListener * > viewFocusListeners
 
QList< RViewListener * > viewListeners
 
- Protected Attributes inherited from RProgressHandler
bool progressEnabled
 

Additional Inherited Members

- Static Protected Attributes inherited from RMainWindow
static RMainWindowmainWindow = NULL
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 

Detailed Description

Base class for a Qt based MDI main application window.

Scriptable:\nThis class is available in script environments.\n

Constructor & Destructor Documentation

◆ RMainWindowQt()

RMainWindowQt::RMainWindowQt ( QWidget *  parent = 0,
bool  hasMdiArea = true 
)

Copyright (c) 2011-2018 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

◆ ~RMainWindowQt()

RMainWindowQt::~RMainWindowQt ( )
virtual

Member Function Documentation

◆ cancelProgress()

void RMainWindowQt::cancelProgress ( )
virtual

◆ clearKeyLog()

void RMainWindowQt::clearKeyLog ( )

◆ closeEvent()

void RMainWindowQt::closeEvent ( QCloseEvent *  e)
protectedvirtual

◆ closeRequested

void RMainWindowQt::closeRequested ( )
signal

◆ commandPrompt

void RMainWindowQt::commandPrompt ( const QString &  text)
signal

Emitted when the command prompt is requested to change.

◆ contextMenu

void RMainWindowQt::contextMenu ( int  entityId,
const RVector pos 
)
signal

Emitted when a context menu is requested on top of the given entity.

◆ createPopupMenu()

QMenu * RMainWindowQt::createPopupMenu ( )
virtual

◆ currentTabChanged

void RMainWindowQt::currentTabChanged ( int  index)
slot

Part of the workaround for QMdiArea bug with events filtering through all stacked windows:

◆ disable()

void RMainWindowQt::disable ( )
virtual

Reimplemented from RMainWindow.

◆ dragEnter

void RMainWindowQt::dragEnter ( QDragEnterEvent *  event)
signal

◆ dragEnterEvent()

void RMainWindowQt::dragEnterEvent ( QDragEnterEvent *  event)
protectedvirtual

◆ drop

void RMainWindowQt::drop ( QDropEvent *  event)
signal

◆ dropEvent()

void RMainWindowQt::dropEvent ( QDropEvent *  event)
protectedvirtual

◆ enable()

void RMainWindowQt::enable ( )
virtual

Reimplemented from RMainWindow.

◆ enterPressed

void RMainWindowQt::enterPressed ( )
signal

◆ escape

void RMainWindowQt::escape ( )
signal

◆ escapeEvent()

void RMainWindowQt::escapeEvent ( )
virtual

Implements RMainWindow.

◆ event()

bool RMainWindowQt::event ( QEvent *  e)
protectedvirtual

◆ getChildWidget()

QWidget * RMainWindowQt::getChildWidget ( const QString &  name)
virtual

Implements RMainWindow.

◆ getDockWidgets()

QList<QDockWidget*> RMainWindowQt::getDockWidgets ( )
inline

◆ getDocument()

RDocument * RMainWindowQt::getDocument ( )
virtual
Returns
Pointer to the document that is currently open and has the focus or NULL if no document is open.

Implements RMainWindow.

◆ getDocumentInterface()

RDocumentInterface * RMainWindowQt::getDocumentInterface ( )
virtual
Returns
Pointer to the document interface of the document that is currently open and has the focus or NULL if no document is open.

Implements RMainWindow.

◆ getHeight()

int RMainWindowQt::getHeight ( )
virtual
Returns
Height of the main application window.

Implements RMainWindow.

◆ getKeyLog()

QString RMainWindowQt::getKeyLog ( ) const
inline

◆ getMainWindow()

RMainWindowQt * RMainWindowQt::getMainWindow ( )
static

◆ getMdiArea()

RMdiArea * RMainWindowQt::getMdiArea ( )

◆ getMdiChild()

RMdiChildQt * RMainWindowQt::getMdiChild ( )

◆ getPositionX()

int RMainWindowQt::getPositionX ( )
virtual
Returns
X position of the main application window (distance from left of screen).

Implements RMainWindow.

◆ getPositionY()

int RMainWindowQt::getPositionY ( )
virtual
Returns
Y position of the main application window (distance from top of screen).

Implements RMainWindow.

◆ getTabBar()

QTabBar * RMainWindowQt::getTabBar ( )

◆ getToolBars()

QList<QToolBar*> RMainWindowQt::getToolBars ( )
inline

◆ getWidth()

int RMainWindowQt::getWidth ( )
virtual
Returns
Width of the main application window.

Implements RMainWindow.

◆ handleUserCommand()

void RMainWindowQt::handleUserCommand ( const QString &  message,
bool  escape = true 
)
virtual

Reimplemented from RMainWindow.

◆ handleUserInfo()

void RMainWindowQt::handleUserInfo ( const QString &  message,
bool  escape = true 
)
virtual

Reimplemented from RMainWindow.

◆ handleUserMessage()

void RMainWindowQt::handleUserMessage ( const QString &  message,
bool  escape = true 
)
virtual

Reimplemented from RMainWindow.

◆ handleUserWarning()

void RMainWindowQt::handleUserWarning ( const QString &  message,
bool  messageBox = false,
bool  escape = true 
)
virtual

Reimplemented from RMainWindow.

◆ initGuiActions

void RMainWindowQt::initGuiActions ( )
protectedslot

◆ leftMouseTip

void RMainWindowQt::leftMouseTip ( const QString &  message)
signal

Emitted when the left mouse button tip is requested to change.

◆ move()

void RMainWindowQt::move ( int  x,
int  y 
)
virtual

Moves the application window to the given x / y position.

Implements RMainWindow.

◆ notifyListenersSlot

void RMainWindowQt::notifyListenersSlot ( QMdiSubWindow *  mdiChild)
protectedslot

◆ postCloseEvent()

void RMainWindowQt::postCloseEvent ( )
virtual

Implements RMainWindow.

◆ postPropertyEvent()

void RMainWindowQt::postPropertyEvent ( RPropertyTypeId  propertyTypeId,
const QVariant &  value,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
virtual

Implements RMainWindow.

◆ postSelectionChangedEvent()

void RMainWindowQt::postSelectionChangedEvent ( )
virtual

Implements RMainWindow.

◆ postTransactionEvent()

void RMainWindowQt::postTransactionEvent ( RTransaction t,
bool  onlyChanges = false,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
virtual

Implements RMainWindow.

◆ progress

void RMainWindowQt::progress ( int  value)
signal

◆ progressCanceled

void RMainWindowQt::progressCanceled ( )
signal

◆ progressEnd

void RMainWindowQt::progressEnd ( )
signal

◆ progressText

void RMainWindowQt::progressText ( const QString &  label)
signal

◆ quit

void RMainWindowQt::quit ( )
slot

◆ readSettings()

bool RMainWindowQt::readSettings ( )
virtual

Restores the application window settings (size, position, ...).

Reimplemented from RMainWindow.

◆ resize()

void RMainWindowQt::resize ( int  width,
int  height 
)
virtual

Resizes the application window to the given width and height.

Implements RMainWindow.

◆ resumedTab

void RMainWindowQt::resumedTab ( RMdiChildQt mdiChild)
signal

◆ rightMouseTip

void RMainWindowQt::rightMouseTip ( const QString &  message)
signal

Emitted when the right mouse button tip is requested to change.

◆ setCommandPrompt()

void RMainWindowQt::setCommandPrompt ( const QString &  text = "")
virtual

Implements RMainWindow.

◆ setGraphicsViewCursor()

void RMainWindowQt::setGraphicsViewCursor ( const QCursor &  cursor)
virtual

Sets the cursor of all graphics views in all MDI children.

Necessary as workaround for Qt cursor bug (cursor inconsistent with multiple widgets on top of each other in MDI area).

Implements RMainWindow.

◆ setLeftMouseTip()

void RMainWindowQt::setLeftMouseTip ( const QString &  text = "")
virtual

Implements RMainWindow.

◆ setProgress()

void RMainWindowQt::setProgress ( int  value)
virtual

Implements RProgressHandler.

◆ setProgressEnd()

void RMainWindowQt::setProgressEnd ( )
virtual

Implements RProgressHandler.

◆ setProgressText()

void RMainWindowQt::setProgressText ( const QString &  text = "")
virtual

Implements RProgressHandler.

◆ setRightMouseTip()

void RMainWindowQt::setRightMouseTip ( const QString &  text = "")
virtual

Implements RMainWindow.

◆ showContextMenu()

void RMainWindowQt::showContextMenu ( RObject::Id  entityId,
const RVector pos 
)
virtual

◆ subWindowActivated

void RMainWindowQt::subWindowActivated ( QMdiSubWindow *  sw)
slot

◆ suspendAndResume

void RMainWindowQt::suspendAndResume ( QMdiSubWindow *  mdiChild)
protectedslot

◆ toolBarContextMenu

void RMainWindowQt::toolBarContextMenu ( QMenu *  menu)
signal

◆ updateGuiActions

void RMainWindowQt::updateGuiActions ( QMdiSubWindow *  mdiChild = NULL)
protectedslot

◆ updateScenes

void RMainWindowQt::updateScenes ( QMdiSubWindow *  mdiChild)
protectedslot

◆ userCommand

void RMainWindowQt::userCommand ( const QString &  message,
bool  escape 
)
signal

◆ userInfo

void RMainWindowQt::userInfo ( const QString &  message,
bool  escape 
)
signal

◆ userMessage

void RMainWindowQt::userMessage ( const QString &  message,
bool  escape 
)
signal

◆ userWarning

void RMainWindowQt::userWarning ( const QString &  message,
bool  messageBox,
bool  escape 
)
signal

◆ writeSettings()

void RMainWindowQt::writeSettings ( )
virtual

Stores the application window settings (size, position, ...).

Reimplemented from RMainWindow.

Member Data Documentation

◆ disableCounter

int RMainWindowQt::disableCounter
protected

◆ keyLog

QString RMainWindowQt::keyLog
protected

◆ keyTimeOut

QTime RMainWindowQt::keyTimeOut
protected

◆ mdiArea

RMdiArea* RMainWindowQt::mdiArea
protected

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