|
QtCanpool 3.3.0
|
The window skeleton of a ribbon application. 更多...
#include <qxapp/qxappshell.h>

Public 成员函数 | |
| QxAppShell (QWidget *parent=0) | |
| ~QxAppShell () override | |
| QxNavigationBar * | navigationBar () const |
| The navigation rail; owned by the shell. | |
| QxDock::DockWindow * | dockWindow () const |
| The dock area; owned by the shell. | |
| void | addPage (const QString &id, const QIcon &icon, const QString &title, QWidget *page) |
| Adds a page at the end of the workspace and an entry with the same icon and title to the rail. | |
| void | insertPage (int index, const QString &id, const QIcon &icon, const QString &title, QWidget *page) |
| Inserts a page at the given index of the workspace and of the rail. | |
| void | removePage (const QString &id) |
| Removes the page with id and its rail entry. | |
| int | pageCount () const |
| int | indexOfPage (const QString &id) const |
| Index of the page with id, or -1 when there is no such page. | |
| QString | pageId (int index) const |
| Id of the page at the given index, or an empty string. | |
| QWidget * | page (const QString &id) const |
| The page widget with id, or null. | |
| int | currentPageIndex () const |
| QString | currentPageId () const |
| QWidget * | currentPage () const |
| QxDock::DockWidget * | addDock (Qx::DockWidgetArea area, const QString &id, const QString &title, QWidget *widget) |
| Creates a dock widget named id, titles it title, fills it with widget and drops it in area. | |
| QxDock::DockWidget * | dock (const QString &id) const |
| The dock widget created with addDock() under id, or null. | |
| void | setStatusMessage (const QString &message) |
| Text of the permanent message line at the left of the status bar. | |
| QString | statusMessage () const |
| void | setBusy (bool busy) |
| Shows or hides the busy indicator in the status bar. | |
| bool | isBusy () const |
| void | setProgressRange (int minimum, int maximum) |
| Range the progress runs in, 0 to 100 by default. | |
| int | progressMinimum () const |
| int | progressMaximum () const |
| void | setProgress (int value) |
| Shows how far the work has got, which also shows the indicator - setting a progress means wanting it seen. | |
| int | progress () const |
| void | clearProgress () |
| Hides the indicator and puts the progress back at the minimum. | |
| bool | isProgressVisible () const |
| Whether the indicator is up, in either of its two modes. | |
| QxToastManager * | toastManager () const |
| The stack of toasts that shows up over the shell, created on first use and owned by the shell. | |
| QxToast * | showToast (const QString &text, QxToast::Level level=QxToast::Information, int timeoutMs=QxToast::DefaultTimeout) |
| Puts a toast over the shell and returns it, so that a caller who needs to can hold on to it or dismiss it early. | |
| QxWorkspaceManager * | workspaceManager () const |
| The named layouts of this shell, created on first use and owned by it. | |
| QStringList | workspaceNames () const |
| Names of the stored workspaces, in the order they were saved. | |
| bool | saveWorkspace (const QString &name) |
| Stores the current arrangement under name - see QxWorkspaceManager::saveWorkspace(). | |
| bool | applyWorkspace (const QString &name) |
| Brings back the arrangement stored under name - see QxWorkspaceManager::applyWorkspace(). | |
| QxCore::QxSettings * | settings () const |
| The settings object backing persistence; created on first use from the application name and owned by the shell. | |
| void | setSettings (QxCore ::QxSettings *settings) |
| Replaces the settings object; ownership is transferred to the shell. | |
| void | saveLayout () |
| Stores the geometry, the dock layout and the current page. | |
| void | restoreLayout () |
| Restores whatever saveLayout() stored. | |
| bool | autoSaveLayout () const |
| Whether closeEvent() calls saveLayout(); true by default. | |
| void | setAutoSaveLayout (bool on) |
| void | setCurrentPage (int index) |
| Brings the page at the given index to the front. | |
| void | setCurrentPage (const QString &id) |
| Brings the page with id to the front. | |
| void | currentPageChanged (int index, const QString &id) |
| Emitted when the page on screen changes, which also covers the case where another page was inserted or removed and the index of the visible page shifted. | |
Public 成员函数 继承自 QxApp::RibbonAppWindow | |
| RibbonAppWindow (QWidget *parent=0, Qt::WindowFlags flags=Qt::WindowFlags()) | |
| ~RibbonAppWindow () override | |
| void | updateWindowFlags (Qt::WindowFlags flags) override |
Protected 成员函数 | |
| void | closeEvent (QCloseEvent *event) override |
Protected 成员函数 继承自 QxApp::RibbonAppWindow | |
| virtual bool | event (QEvent *e) override |
The window skeleton of a ribbon application.
It is a RibbonAppWindow - so it already carries the ribbon, the window agent and a state bar - with the three parts every application otherwise rebuilds by hand:
On top of that it plugs the shell into the rest of the framework: the status bar gets a message line and a busy indicator, and saveLayout()/restoreLayout() keep the geometry, the dock layout and the selected page in a QxSettings object.
Typical use:
Pages are pages of a QStackedWidget, not dock widgets: they are the fixed workspace in the middle, while the docks around them can be moved, floated and closed as usual.
在文件 qxappshell.h 第 68 行定义.
|
explicit |
在文件 qxappshell.cpp 第 220 行定义.
|
override |
在文件 qxappshell.cpp 第 229 行定义.
| QxDock::DockWidget * QxApp::QxAppShell::addDock | ( | Qx::DockWidgetArea | area, |
| const QString & | id, | ||
| const QString & | title, | ||
| QWidget * | widget | ||
| ) |
Creates a dock widget named id, titles it title, fills it with widget and drops it in area.
The id is stored as the object name, which is what dock() and the persisted layout use.
Returns null when id is empty or already in use.
在文件 qxappshell.cpp 第 376 行定义.
| void QxApp::QxAppShell::addPage | ( | const QString & | id, |
| const QIcon & | icon, | ||
| const QString & | title, | ||
| QWidget * | page | ||
| ) |
Adds a page at the end of the workspace and an entry with the same icon and title to the rail.
The id addresses the page in the configuration file, so it has to be stable and unique; the shell takes ownership of page while it is installed.
The first page added becomes the current one.
在文件 qxappshell.cpp 第 246 行定义.
| bool QxApp::QxAppShell::applyWorkspace | ( | const QString & | name | ) |
Brings back the arrangement stored under name - see QxWorkspaceManager::applyWorkspace().
Returns false when there is no such workspace.
在文件 qxappshell.cpp 第 530 行定义.
| bool QxApp::QxAppShell::autoSaveLayout | ( | ) | const |
Whether closeEvent() calls saveLayout(); true by default.
在文件 qxappshell.cpp 第 593 行定义.
| void QxApp::QxAppShell::clearProgress | ( | ) |
Hides the indicator and puts the progress back at the minimum.
在文件 qxappshell.cpp 第 486 行定义.
|
overrideprotected |
在文件 qxappshell.cpp 第 627 行定义.
| QWidget * QxApp::QxAppShell::currentPage | ( | ) | const |
在文件 qxappshell.cpp 第 370 行定义.
| void QxApp::QxAppShell::currentPageChanged | ( | int | index, |
| const QString & | id | ||
| ) |
Emitted when the page on screen changes, which also covers the case where another page was inserted or removed and the index of the visible page shifted.
id is the stable name of the page, empty when there is none.
| QString QxApp::QxAppShell::currentPageId | ( | ) | const |
在文件 qxappshell.cpp 第 364 行定义.
| int QxApp::QxAppShell::currentPageIndex | ( | ) | const |
在文件 qxappshell.cpp 第 358 行定义.
| QxDock::DockWidget * QxApp::QxAppShell::dock | ( | const QString & | id | ) | const |
The dock widget created with addDock() under id, or null.
在文件 qxappshell.cpp 第 398 行定义.
| QxDock::DockWindow * QxApp::QxAppShell::dockWindow | ( | ) | const |
The dock area; owned by the shell.
在文件 qxappshell.cpp 第 240 行定义.
| int QxApp::QxAppShell::indexOfPage | ( | const QString & | id | ) | const |
Index of the page with id, or -1 when there is no such page.
在文件 qxappshell.cpp 第 336 行定义.
| void QxApp::QxAppShell::insertPage | ( | int | index, |
| const QString & | id, | ||
| const QIcon & | icon, | ||
| const QString & | title, | ||
| QWidget * | page | ||
| ) |
Inserts a page at the given index of the workspace and of the rail.
在文件 qxappshell.cpp 第 252 行定义.
| bool QxApp::QxAppShell::isBusy | ( | ) | const |
在文件 qxappshell.cpp 第 432 行定义.
| bool QxApp::QxAppShell::isProgressVisible | ( | ) | const |
Whether the indicator is up, in either of its two modes.
The question is about the indicator, not about the window: a hidden window leaves the answer where the last call put it.
在文件 qxappshell.cpp 第 494 行定义.
| QxNavigationBar * QxApp::QxAppShell::navigationBar | ( | ) | const |
The navigation rail; owned by the shell.
在文件 qxappshell.cpp 第 234 行定义.
| QWidget * QxApp::QxAppShell::page | ( | const QString & | id | ) | const |
The page widget with id, or null.
在文件 qxappshell.cpp 第 348 行定义.
| int QxApp::QxAppShell::pageCount | ( | ) | const |
在文件 qxappshell.cpp 第 330 行定义.
| QString QxApp::QxAppShell::pageId | ( | int | index | ) | const |
Id of the page at the given index, or an empty string.
在文件 qxappshell.cpp 第 342 行定义.
| int QxApp::QxAppShell::progress | ( | ) | const |
在文件 qxappshell.cpp 第 480 行定义.
| int QxApp::QxAppShell::progressMaximum | ( | ) | const |
在文件 qxappshell.cpp 第 459 行定义.
| int QxApp::QxAppShell::progressMinimum | ( | ) | const |
在文件 qxappshell.cpp 第 453 行定义.
| void QxApp::QxAppShell::removePage | ( | const QString & | id | ) |
Removes the page with id and its rail entry.
The page widget is only taken out of the shell - it stays alive and the caller owns it again.
在文件 qxappshell.cpp 第 296 行定义.
| void QxApp::QxAppShell::restoreLayout | ( | ) |
Restores whatever saveLayout() stored.
Missing or stale values are skipped, so calling it on a fresh installation is harmless.
在文件 qxappshell.cpp 第 568 行定义.
| void QxApp::QxAppShell::saveLayout | ( | ) |
Stores the geometry, the dock layout and the current page.
在文件 qxappshell.cpp 第 555 行定义.
| bool QxApp::QxAppShell::saveWorkspace | ( | const QString & | name | ) |
Stores the current arrangement under name - see QxWorkspaceManager::saveWorkspace().
Returns false for an empty name.
在文件 qxappshell.cpp 第 524 行定义.
| void QxApp::QxAppShell::setAutoSaveLayout | ( | bool | on | ) |
在文件 qxappshell.cpp 第 599 行定义.
| void QxApp::QxAppShell::setBusy | ( | bool | busy | ) |
Shows or hides the busy indicator in the status bar.
It is a bar without a percentage: the shell only reports "working", the caller knows how far the work is.
The indicator is one widget with two modes, and the last call wins: setting a progress takes it over, and going busy takes it back.
在文件 qxappshell.cpp 第 416 行定义.
| void QxApp::QxAppShell::setCurrentPage | ( | const QString & | id | ) |
| void QxApp::QxAppShell::setCurrentPage | ( | int | index | ) |
| void QxApp::QxAppShell::setProgress | ( | int | value | ) |
Shows how far the work has got, which also shows the indicator - setting a progress means wanting it seen.
value is clamped to the range.
在文件 qxappshell.cpp 第 465 行定义.
| void QxApp::QxAppShell::setProgressRange | ( | int | minimum, |
| int | maximum | ||
| ) |
Range the progress runs in, 0 to 100 by default.
The range is remembered and applied the next time a progress is shown, so changing it while the busy indicator is up does not turn that indicator into a bar at zero.
在文件 qxappshell.cpp 第 438 行定义.
| void QxApp::QxAppShell::setSettings | ( | QxCore ::QxSettings * | settings | ) |
Replaces the settings object; ownership is transferred to the shell.
Unlike the theme manager this does not apply anything: a layout can only be restored once the pages and docks it refers to exist, so call restoreLayout() yourself, after the shell has been built.
在文件 qxappshell.cpp 第 542 行定义.
| void QxApp::QxAppShell::setStatusMessage | ( | const QString & | message | ) |
Text of the permanent message line at the left of the status bar.
在文件 qxappshell.cpp 第 404 行定义.
| QxCore::QxSettings * QxApp::QxAppShell::settings | ( | ) | const |
The settings object backing persistence; created on first use from the application name and owned by the shell.
在文件 qxappshell.cpp 第 536 行定义.
| QxToast * QxApp::QxAppShell::showToast | ( | const QString & | text, |
| QxToast::Level | level = QxToast::Information, |
||
| int | timeoutMs = QxToast::DefaultTimeout |
||
| ) |
Puts a toast over the shell and returns it, so that a caller who needs to can hold on to it or dismiss it early.
在文件 qxappshell.cpp 第 506 行定义.
| QString QxApp::QxAppShell::statusMessage | ( | ) | const |
在文件 qxappshell.cpp 第 410 行定义.
| QxToastManager * QxApp::QxAppShell::toastManager | ( | ) | const |
The stack of toasts that shows up over the shell, created on first use and owned by the shell.
A shell is a plain window, so it never asks for the object itself before someone has something to say; once it exists, every showToast() lands in it - see QxToastManager for the stacking, the timeout and the placement.
在文件 qxappshell.cpp 第 500 行定义.
| QxWorkspaceManager * QxApp::QxAppShell::workspaceManager | ( | ) | const |
The named layouts of this shell, created on first use and owned by it.
A shell persists one layout - the one saveLayout() writes - and that is enough for "start where I left off". The manager adds the cases that need a name: keeping two arrangements apart and asking for one back. See QxWorkspaceManager for what a workspace holds and, more to the point, what it does not.
在文件 qxappshell.cpp 第 512 行定义.
| QStringList QxApp::QxAppShell::workspaceNames | ( | ) | const |
Names of the stored workspaces, in the order they were saved.
在文件 qxappshell.cpp 第 518 行定义.