LibEngsas
|
Base class for mainwindows. It provides several useful functions by default. More...
#include <emainwindow.h>
Signals | |
void | doReloadSettings () |
Public Member Functions | |
EMainWindow (QWidget *parent=0, Qt::WindowFlags flags=0) | |
virtual | ~EMainWindow () |
void | setWindowTitle (const QString &title) |
Protected Slots | |
virtual void | fileNew () |
virtual void | fileOpen () |
virtual void | fileOpen (QString absoluteFilePath) |
virtual void | fileSave () |
virtual void | fileSaveAs () |
virtual void | fileDoSave (QString file) |
Function called by fileSave() and fileSaveAs() to actually do save data. | |
virtual void | filePrint () |
virtual void | fileExit () |
virtual void | editCut () |
virtual void | editCopy () |
virtual void | editPaste () |
virtual void | editUndo () |
virtual void | editRedo () |
virtual void | editSetupWizard () |
Implement this function to call showSetupWizard() properly. | |
virtual void | editSettings () |
Connect to the Settings action in Edit menu. | |
virtual void | viewReload () |
void | helpHelp () |
Calls helpHelp(QString) with empty string to open standard help. | |
virtual void | helpHelp (QString file) |
Starts the helpcenter and tries to load the given file . | |
virtual void | helpDependencies () |
Calls showDependencies() with a NULL-Pointer. | |
virtual void | helpAbout () |
Calls showAbout() with empty values, should therefore be implemented at your subclass. | |
virtual void | reloadSettings () |
Reload your settings here. | |
void | enableActions (EngSaS::AvailableActions enabledActions) |
void | connectESlots (QObject *object) |
void | errorByPass (const QString &message) |
void | warningByPass (const QString &message) |
void | informationByPass (const QString &message) |
void | reloadEnableActionsByPass () |
Forwards the reloading of enabled actions signal. | |
void | addMenuByPass (QMenu *newMenu, const QString &parent, QString before=QString()) |
void | addActionByPass (QAction *newAction, const QString &parent, QString before=QString()) |
void | addToolBarByPass (QToolBar *newToolBar, Qt::ToolBarArea area=Qt::TopToolBarArea) |
void | addNewDockWidgetByPass (QDockWidget *widget, const Qt::DockWidgetArea &area) |
void | setCentralWidgetByPass (QWidget *centralWidget) |
void | showSettingsByPass () |
void | showHelpByPass (const QString &page) |
void | showStatusWidgetByPass (QWidget *widget) |
void | reloadSettingsRequestByPass () |
void | clearRecentlyUsed () |
Clears the list of recently used files. |
Protected Member Functions | |
void | showSetupWizard (EngSaS::SetupWizardObjects objects, bool msgOnNotNeeded=false, QIcon logo=QIcon(), QString applicationName=QString()) |
Uses ESetupWizard to guide the user through the setup process. | |
void | showSettings (ESettingsModel *model) |
Uses ESettingsDialog to present the settings given in the model . | |
void | showDependencies (EDependencyModel *model) |
Show the standard EDepenenciesDialog. | |
void | showAbout (QPixmap logo, QString name, QString version, QUrl url, EAboutModel *model) |
Shows the standard EAboutDialog as about dialog. | |
void | setupHelpCenter (EHelpCenterSetup setup) |
Call this function in your subclass to setup the EHelpCenter. | |
void | closeEvent (QCloseEvent *event) |
void | restoreWindowState () |
void | error (const QString &message) |
void | warning (const QString &message) |
void | information (const QString &message) |
void | reloadEnableActions () |
Indicates, that a reload of the enabled actions is needed. | |
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) |
void | setCentralWidget (QWidget *centralWidget) |
void | showSettings () |
void | showHelp (const QString &page) |
void | showStatusWidget (QWidget *widget) |
EWidget * | getCentralWidget () |
void | controleMenuStati () |
void | controleMenuStati (QMenu *menu) |
void | addToRecentlyUsed (QString absoluteFilePath) |
Protected Attributes | |
QMenuBar * | menubar |
QStatusBar * | statusbar |
QMenu * | fileMenu |
QMenu * | fileRecentlyUsedMenu |
QMenu * | editMenu |
QMenu * | viewMenu |
QMenu * | otherMenu |
QMenu * | helpMenu |
EAction * | fileNewAction |
EAction * | fileOpenAction |
EAction * | fileSaveAction |
EAction * | fileSaveAsAction |
EAction * | filePrintAction |
EAction * | fileExitAction |
EAction * | editUndoAction |
EAction * | editRedoAction |
EAction * | editCutAction |
EAction * | editCopyAction |
EAction * | editPasteAction |
EAction * | editSetupWizardAction |
EAction * | editSettingsAction |
EAction * | viewReloadAction |
EAction * | helpHelpAction |
EAction * | helpDependenciesAction |
EAction * | helpAboutAction |
EHelpCenter * | helpCenter |
EHelpCenterSetup | helpCenterSetup |
QList< QAction * > | recentlyUsedActions |
QAction * | recentylUsedSeperator |
QSignalMapper * | recentlyUsedMapper |
Private Member Functions | |
QAction * | findBefore (QObject *parent, QString name) |
void | setupUi () |
Setups the UI Elements like menus, statusbar, ...) | |
void | loadRecentlyUsed () |
Adds the needed actions to fileRecentlyUsedMenu. |
Base class for mainwindows. It provides several useful functions by default.
Especially the handling of EWidget's is quite well. It also set's the QApplication::organizationName() to EngSaS and allows better standard conform window title handling. It also provides file opening (fileOpen()), file save (fileSave() and fileSaveAs())and recently used files functionalities.
You may subclass some of the protected slots, but if you use EWidget's, this shouldn't be needed, because all specials must be done in your EWidget's.
Implement auto hide of QMenu, if childs are removed (e.g. via deleting the child somewhere else)
Save and restore size
EMainWindow::EMainWindow | ( | QWidget * | parent = 0 , |
Qt::WindowFlags | flags = 0 |
||
) |
|
virtual |
|
protected |
If no parent
is given or the given parent can not be found, the action is added to the menu "Other", which is enabled if needed. With help of before
, the action, which should be the one before newAction
can be specified.
parent
menu becomes the parent. Therfore you are responsible to delete the menu again, if your widget is deleted
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls addAction()
|
protected |
If parent
can not be found, it is added to toplevel menu "Other". This menu is enabled if needed With help of before
, the action, which should be the one before newAction
can be specified (QMenu::menuAction()).
parent
menu becomes the parent. Therfore you are responsible to delete the menu again, if your widget is deleted
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls addMenu()
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls addNewDockWidget()
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls addToolBar()
|
protected |
|
protectedslot |
Clears the list of recently used files.
|
protected |
Stores the geomtry and state.
|
protectedslot |
|
protected |
|
protected |
|
signal |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
inlineprotectedvirtualslot |
Connect to the Settings action in Edit menu.
Subclass this function, to create a ESettingsModel and call showSettings(ESettingsModel*) afterwards, to present the content to the user with help of the standard ESettingsDialog.
|
inlineprotectedvirtualslot |
Implement this function to call showSetupWizard() properly.
This slot is connected to the setup wizard action in edit menu. Normally you setup a list of ESetupWizardObjects in this function and call showSetupWizard() with this list and true as second argument, to inform the user, if the wizard is not needed.
|
protectedvirtualslot |
|
protectedslot |
used to disable or enable default actions
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls error().
|
protectedvirtualslot |
Function called by fileSave() and fileSaveAs() to actually do save data.
This function just calls the EWidget::save() function from the current central widget, if it is an EWidget.
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
protectedvirtualslot |
|
private |
name
and is child of parent
|
protected |
tries to cast the central widget and returns a pointer the resulting object
|
protectedvirtualslot |
Calls showAbout() with empty values, should therefore be implemented at your subclass.
Implement this function in your subclass to call showAbout() with proper values.
|
inlineprotectedvirtualslot |
Calls showDependencies() with a NULL-Pointer.
Implement this function to call showDependencies() with your configured EDependencyModel.
|
protectedslot |
Calls helpHelp(QString) with empty string to open standard help.
|
protectedvirtualslot |
Starts the helpcenter and tries to load the given file
.
This function is also called by the slot showHelp(QString).
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls information()
|
private |
Adds the needed actions to fileRecentlyUsedMenu.
|
protected |
Indicates, that a reload of the enabled actions is needed.
|
inlineprotectedslot |
|
inlineprotectedvirtualslot |
Reload your settings here.
Please emit doReloadSettings() or call this base implementation to broadcast the reload event to all childs.
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots.
|
protected |
Calls restoreGeometry() and restoreState(), therefore it should be called after all widgets are loaded. It uses objectName() to identify itself, so the objectname should be setted also before calling this function.
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls setCentralWidget()
|
protected |
Call this function in your subclass to setup the EHelpCenter.
|
private |
Setups the UI Elements like menus, statusbar, ...)
void EMainWindow::setWindowTitle | ( | const QString & | title | ) |
|
protected |
Shows the standard EAboutDialog as about dialog.
It adds the EABoutPersons from ELibrary also.
url
should be relative to engsas.de. EAboutDialog::setApplicationUrl() made it absolute with the localized engsas url.
|
protected |
Show the standard EDepenenciesDialog.
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls showHelp()
|
protected |
Uses ESettingsDialog to present the settings given in the model
.
It adds the settings widget from ELibrary also.
|
inlineprotected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls showSettings()
|
protected |
Uses ESetupWizard to guide the user through the setup process.
It shows the ESetupWizard containing objects
, if needed. If not and msgOnNotNeeded
is set to true, it popsup a message box with the information, that everything is correctly configured. With logo
and applicationName
, you can setup the logo and application name used inside the wizard. If nothing is set, the default of ESetupWizard is used (QApplication::windowIcon() and QApplication::applicationName()). To call this function with proper arguments, implement editSetupWizard().
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots.
|
protectedvirtualslot |
|
protected |
|
inlineprotectedslot |
these functions are wrappers to provide convenient API to EWidget and EObject. For example EObject::connectByPass() can be called with help of these slots. Calls warning().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |