LibEngsas
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Private Attributes | List of all members
EWidget Class Reference

EWidget is a base class for common widgets. More...

#include <ewidget.h>

+ Inheritance diagram for EWidget:

Public Slots

virtual EngSaS::AvailableActions enableActions ()
 Will be called by EMainWindow::setCentralWidget() to enable and disable standard actions.
virtual QString fileFilters (EngSaS::FileFilter reason)
virtual bool load (QFile *file, QString &error)
virtual bool save (QFile *file, QString &error)
virtual bool fileNew (QString &error)
virtual bool print (QString &error)
virtual bool undo (QString &error)
virtual bool redo (QString &error)
virtual bool cut (QString &error)
virtual bool copy (QString &error)
virtual bool paste (QString &error)
virtual bool reload (QString &error)
virtual void reloadSettings ()
 Used to reload settings the settings.

Signals

void error (const QString &message)
void warning (const QString &message)
void information (const QString &message)
void reloadEnableActions ()
 Request reloading of enabled actions in EMainWindow.
void addMenu (QMenu *newMenu, const QString &parent, QString before=QString())
void addAction (QAction *newAction, const QString &parent, QString before=QString())
void addToolBar (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
void addNewDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area)
 To add managed dock widgets, use addManagedDockWidget() instead.
void setCentralWidget (QWidget *centralWidget)
void showSettings ()
void showHelp (const QString &page)
void showStatusWidget (QWidget *widget)
void reloadSettingsRequest ()
 Indicates, that a reload of the settings is needed.
void doReloadSettings ()
 Emitted to bring the reload request back to the farest child.

Public Member Functions

 EWidget (QWidget *parent=0, Qt::WindowFlags flags=0)
virtual ~EWidget ()
void setWindowTitle (const QString &title)
void connectByPass (QObject *object)
 Connects all standard signals.

Protected Slots

virtual void errorByPass (const QString &message)
virtual void warningByPass (const QString &message)
virtual void informationByPass (const QString &message)
virtual void reloadEnableActionsByPass ()
virtual void addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString())
virtual void addActionByPass (QAction *newAction, const QString &parent, QString before=QString())
virtual void addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea)
virtual void addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area)
virtual void setCentralWidgetByPass (QWidget *centralWidget)
virtual void showSettingsByPass ()
virtual void showHelpByPass (const QString &page)
virtual void showStatusWidgetByPass (QWidget *widget)
virtual void reloadSettingsRequestByPass ()

Protected Member Functions

void addManagedDockWidget (QDockWidget *widget, const Qt::DockWidgetArea &area, QString actionLabel=QString(), QString actionParent=QString())
 Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

Private Attributes

QList< QPointer< QDockWidget > > dockWidgets
QList< QPointer< QAction > > dockActions

Detailed Description

EWidget is a base class for common widgets.

It can handle all standard functionality which may be used. If you want to cut of the by passing of signals, just reimplment the virtual byPass() slot of the signal.

See Also
EObject
EDialog

Constructor & Destructor Documentation

EWidget::EWidget ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)
inline
EWidget::~EWidget ( )
virtual

Call close here, to get the close() function called in every possible case.

Member Function Documentation

void EWidget::addAction ( QAction *  newAction,
const QString &  parent,
QString  before = QString() 
)
signal
See Also
EObject::addAction()
addMenu()
addToolBar()
addActionByPass()

+ Here is the caller graph for this function:

virtual void EWidget::addActionByPass ( QAction *  newAction,
const QString &  parent,
QString  before = QString() 
)
inlineprotectedvirtualslot
See Also
addAction() passes the emitted signals from it's child forward
void EWidget::addManagedDockWidget ( QDockWidget *  widget,
const Qt::DockWidgetArea &  area,
QString  actionLabel = QString(),
QString  actionParent = QString() 
)
protected

Adds an dock widget via addNewDockWidget() and adds widget to the list of managed dock widgets.

If actionLabel (and also actionParent) is set, an EAction is created and added to parent actionParent to show and hide the dock widget. This action is also managed and therefore deleted along with the dock widget itself.

The benefit is, that all the dock widgets on this list are deleted automatically, if the widget it self is deleted.

+ Here is the call graph for this function:

void EWidget::addMenu ( QMenu *  newMenu,
const QString &  parent,
QString  before = QString() 
)
signal
virtual void EWidget::addMenuByPass ( QMenu *  newMenu,
const QString &  parent,
QString  before = QString() 
)
inlineprotectedvirtualslot
See Also
addMenu() passes the emitted signals from it's child forward
void EWidget::addNewDockWidget ( QDockWidget *  widget,
const Qt::DockWidgetArea &  area 
)
signal

To add managed dock widgets, use addManagedDockWidget() instead.

See Also
EObject::addNewDockWidget()
setCentralWidget()
addNewDockWidgetByPass()

+ Here is the caller graph for this function:

virtual void EWidget::addNewDockWidgetByPass ( QDockWidget *  widget,
const Qt::DockWidgetArea &  area 
)
inlineprotectedvirtualslot
See Also
addNewDockWidget() passes the emitted signals from it's child forward
void EWidget::addToolBar ( QToolBar *  newToolBar,
Qt::ToolBarArea  area = Qt::TopToolBarArea 
)
signal
virtual void EWidget::addToolBarByPass ( QToolBar *  newToolBar,
Qt::ToolBarArea  area = Qt::TopToolBarArea 
)
inlineprotectedvirtualslot
See Also
addToolBar() passes the emitted signals from it's child forward
void EWidget::connectByPass ( QObject *  object)
inline

Connects all standard signals.

See Also
EObject::connectByPass(QObject*)
EDialog::connectByPass(QObject*)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool EWidget::copy ( QString &  error)
virtualslot

copy selected Use error to describe the error for the user.

+ Here is the caller graph for this function:

bool EWidget::cut ( QString &  error)
virtualslot

cut selected Use error to describe the error for the user.

+ Here is the caller graph for this function:

void EWidget::doReloadSettings ( )
signal

Emitted to bring the reload request back to the farest child.

See Also
reloadSettings()
reloadSettingsRequest()
EDialog::doReloadSettings()
EObject::doReloadSettings()
virtual EngSaS::AvailableActions EWidget::enableActions ( )
inlinevirtualslot

Will be called by EMainWindow::setCentralWidget() to enable and disable standard actions.

See Also
EMainWindow::AvailableAction

+ Here is the caller graph for this function:

void EWidget::error ( const QString &  message)
signal
See Also
EObject::error()
warning()
information()
errorByPass()

+ Here is the caller graph for this function:

virtual void EWidget::errorByPass ( const QString &  message)
inlineprotectedvirtualslot
See Also
error() if a child emits this signal, this class emits error() (it passes the childs signal upwards)
QString EWidget::fileFilters ( EngSaS::FileFilter  reason)
virtualslot

Severall filters can be seperated by ;; like

return tr("Text files (*.txt);;XML files (*.xml)");
Returns
all filters for file prefixes, for reason.
See Also
EngSaS::FileFilter for existing cases
EFileDialog

+ Here is the caller graph for this function:

bool EWidget::fileNew ( QString &  error)
virtualslot

Create new empty document Use error to describe the error for the user.

+ Here is the caller graph for this function:

void EWidget::information ( const QString &  message)
signal
See Also
EObject::information()
error()
warning()
informationByPass()

+ Here is the caller graph for this function:

virtual void EWidget::informationByPass ( const QString &  message)
inlineprotectedvirtualslot
See Also
information() passes the emitted signals from it's child forward
bool EWidget::load ( QFile *  file,
QString &  error 
)
virtualslot

Try load file. You do not need to take care for opening or closing, because the file is already opened for reading and will be closed afterwards. Use error to describe the error for the user.

Returns
true if loading was successful, otherwise return false

+ Here is the caller graph for this function:

bool EWidget::paste ( QString &  error)
virtualslot

paste selected Use error to describe the error for the user.

+ Here is the caller graph for this function:

bool EWidget::print ( QString &  error)
virtualslot

Print content Use error to describe the error for the user.

+ Here is the caller graph for this function:

bool EWidget::redo ( QString &  error)
virtualslot

redo last Use error to describe the error for the user.

+ Here is the caller graph for this function:

bool EWidget::reload ( QString &  error)
virtualslot

reload content Use error to describe the error for the user.

+ Here is the caller graph for this function:

void EWidget::reloadEnableActions ( )
signal

Request reloading of enabled actions in EMainWindow.

virtual void EWidget::reloadEnableActionsByPass ( )
inlineprotectedvirtualslot

Passes the reloadEnableActions() signals from it's childs forward.

virtual void EWidget::reloadSettings ( )
inlinevirtualslot

Used to reload settings the settings.

This function is connected to doReloadSettings() and should be used to actually do the reload of the settings. To indicate, that the settings should be reloaded, emit reloadSettingsRequest(). Use error to describe the error for the user. And don't forget to call the base implementation or emit doReload() yourself.

See Also
doReloadSettings()
reloadSettingsRequest()
EObject::reloadSettings()
EDialog::reloadSettings()
void EWidget::reloadSettingsRequest ( )
signal

Indicates, that a reload of the settings is needed.

Therefore this signal is used to bring the reload message upwards to the main window or whatever.

See Also
reloadSettingsRequestByPass()
doReloadSettings()
reloadSettings()
EDialog::reloadSettingsRequest()
EObject::reloadSettingsRequest()

+ Here is the caller graph for this function:

virtual void EWidget::reloadSettingsRequestByPass ( )
inlineprotectedvirtualslot
See Also
reloadSettingsRequest() passes the emitted signals from it's child forward.
reloadSettings()
reloadSettingsByPass()
doReloadSettings()
bool EWidget::save ( QFile *  file,
QString &  error 
)
virtualslot

Try to save content to file. Take care of the chosen file ending to allow exporting. You do not need to take care for opening or closing, because the file is already opened for writing and will be closed afterwards. Use error to describe the error for the user.

Returns
true if successful, otherwise return false

+ Here is the caller graph for this function:

void EWidget::setCentralWidget ( QWidget *  centralWidget)
signal
virtual void EWidget::setCentralWidgetByPass ( QWidget *  centralWidget)
inlineprotectedvirtualslot
See Also
setCentralWidget() passes the emitted signals from it's child forward
void EWidget::setWindowTitle ( const QString &  title)

overloads QWidget::setWindowTitle() and prepends the application short name. this is according to the Microsoft window guide line and also common behaviour.

void EWidget::showHelp ( const QString &  page)
signal
virtual void EWidget::showHelpByPass ( const QString &  page)
inlineprotectedvirtualslot
See Also
showHelp() passes the emitted signals from it's child forward
void EWidget::showSettings ( )
signal
virtual void EWidget::showSettingsByPass ( )
inlineprotectedvirtualslot
See Also
showSettings() passes the emitted signals from it's child forward
void EWidget::showStatusWidget ( QWidget *  widget)
signal
virtual void EWidget::showStatusWidgetByPass ( QWidget *  widget)
inlineprotectedvirtualslot
See Also
showStatusWidget() passes the emitted signals from it's child forward
bool EWidget::undo ( QString &  error)
virtualslot

undo last Use error to describe the error for the user.

+ Here is the caller graph for this function:

void EWidget::warning ( const QString &  message)
signal
virtual void EWidget::warningByPass ( const QString &  message)
inlineprotectedvirtualslot
See Also
warning() passes the emitted signals from it's child forward

Member Data Documentation

QList<QPointer<QAction> > EWidget::dockActions
private
QList<QPointer<QDockWidget> > EWidget::dockWidgets
private

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