QtCanpool 3.3.0
载入中...
搜索中...
未找到
qxappshell.h
浏览该文件的文档.
1
5#ifndef QXAPPSHELL_H
6#define QXAPPSHELL_H
7
8#include "qxapp_global.h"
10#include "qxtoast.h"
11#include "ribbonappwindow.h"
12
13#include "qxcore/qxsettings.h"
15
16#include <QtCore/QString>
17#include <QtGui/QIcon>
18
19QT_BEGIN_NAMESPACE
20class QCloseEvent;
21class QLabel;
22class QProgressBar;
23class QStackedWidget;
24QT_END_NAMESPACE
25
30
32
33class QxAppShellPrivate;
34class QxNavigationBar;
35class QxToastManager;
36class QxWorkspaceManager;
37
70{
71 Q_OBJECT
72public:
73 explicit QxAppShell(QWidget *parent = Q_NULLPTR);
74 ~QxAppShell() override;
75
77 QxNavigationBar *navigationBar() const;
79 QX_DOCK_PREPEND_NAMESPACE(DockWindow) * dockWindow() const;
80
81 // Pages -----------------------------------------------------------------
90 void addPage(const QString &id, const QIcon &icon, const QString &title, QWidget *page);
92 void insertPage(int index, const QString &id, const QIcon &icon, const QString &title, QWidget *page);
97 void removePage(const QString &id);
98
99 int pageCount() const;
101 int indexOfPage(const QString &id) const;
103 QString pageId(int index) const;
105 QWidget *page(const QString &id) const;
106
107 int currentPageIndex() const;
108 QString currentPageId() const;
109 QWidget *currentPage() const;
110
111 // Docks -----------------------------------------------------------------
119 QX_DOCK_PREPEND_NAMESPACE(DockWidget) *
120 addDock(Qx::DockWidgetArea area, const QString &id, const QString &title, QWidget *widget);
122 QX_DOCK_PREPEND_NAMESPACE(DockWidget) * dock(const QString &id) const;
123
124 // Plugin context --------------------------------------------------------
133 QxPlugin::QxPluginContext *pluginContext() const;
134
135 // Status bar ------------------------------------------------------------
137 void setStatusMessage(const QString &message);
138 QString statusMessage() const;
147 void setBusy(bool busy);
148 bool isBusy() const;
149
155 void setProgressRange(int minimum, int maximum);
156 int progressMinimum() const;
157 int progressMaximum() const;
169 void setProgress(int value);
170 int progress() const;
172 void clearProgress();
178 bool isProgressVisible() const;
179
180 // Notifications ---------------------------------------------------------
189 QxToastManager *toastManager() const;
198 QxToast *showToast(const QString &text, QxToast::Level level = QxToast::Information,
199 int timeoutMs = QxToast::DefaultTimeout);
200
201 // Workspaces ------------------------------------------------------------
211 QxWorkspaceManager *workspaceManager() const;
213 QStringList workspaceNames() const;
218 bool saveWorkspace(const QString &name);
230 bool applyWorkspace(const QString &name);
231
232 // Persistence -----------------------------------------------------------
237 QX_CORE_PREPEND_NAMESPACE(QxSettings) * settings() const;
245 void setSettings(QX_CORE_PREPEND_NAMESPACE(QxSettings) * settings);
246
248 void saveLayout();
253 void restoreLayout();
254
256 bool autoSaveLayout() const;
257 void setAutoSaveLayout(bool on);
258
259public Q_SLOTS:
261 void setCurrentPage(int index);
263 void setCurrentPage(const QString &id);
264
265Q_SIGNALS:
271 void currentPageChanged(int index, const QString &id);
272protected:
273 void closeEvent(QCloseEvent *event) override;
274private:
275 Q_DISABLE_COPY(QxAppShell)
277};
278
280
281#endif // QXAPPSHELL_H
The window skeleton of a ribbon application.
Definition qxappshell.h:70
void currentPageChanged(int index, const QString &id)
Emitted when the page on screen changes, which also covers the case where another page was inserted o...
A vertical rail of exclusive, checkable entries.
The stack of toasts of one window.
One short message, shown over the window it belongs to and gone a few seconds later.
Definition qxtoast.h:54
Level
What the message is about; it selects the icon and the accent colour.
Definition qxtoast.h:58
The named layouts of one shell.
Thin wrapper around QSettings that keeps call sites free of the usual boilerplate: typed accessors wi...
Definition qxsettings.h:32
The DockWidget class provides a widget that can be docked inside a DockWindow or floated as a top-lev...
Definition dockwidget.h:31
The central dock window that maintains the complete docking system.
Definition dockwindow.h:36
The thin surface a plugin programs against.
DockWidgetArea
#define QX_APP_END_NAMESPACE
#define QX_APP_EXPORT
#define QX_DECLARE_PRIVATE(Class)
#define Q_NULLPTR
Copyleft (C) 2025 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
#define QX_APP_BEGIN_NAMESPACE
#define QX_CORE_PREPEND_NAMESPACE(name)
#define QX_DOCK_END_NAMESPACE
#define QX_DOCK_BEGIN_NAMESPACE
#define QX_DOCK_PREPEND_NAMESPACE(name)
const char * name
Definition qxtheme.cpp:25
QColor text