Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qdesigner_toolwindow.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QDESIGNER_TOOLWINDOW_H
5#define QDESIGNER_TOOLWINDOW_H
6
7#include "mainwindow.h"
8
9#include <QtCore/qcompare.h>
10#include <QtCore/qpointer.h>
11#include <QtGui/qfontdatabase.h>
12#include <QtWidgets/qmainwindow.h>
13
15
17{
20 bool m_useFont{false};
21
22 friend bool comparesEqual(const ToolWindowFontSettings &lhs,
23 const ToolWindowFontSettings &rhs) noexcept
24 {
25 return lhs.m_useFont == rhs.m_useFont
26 && lhs.m_writingSystem == rhs.m_writingSystem
27 && lhs.m_font == rhs.m_font;
28 }
30};
31
33
34/* A tool window with an action that activates it. Note that in toplevel mode,
35 * the Widget box is a tool window as well as the applications' main window,
36 * So, we need to inherit from MainWindowBase. */
37
39{
41protected:
43 QWidget *w,
44 const QString &objectName,
45 const QString &title,
48 QWidget *parent = nullptr,
50
51public:
52 // Note: The order influences the dock widget position.
56
58
60 QAction *action() const;
61
62 Qt::DockWidgetArea dockWidgetAreaHint() const { return m_dockAreaHint; }
63 virtual QRect geometryHint(const QRect &availableGeometry) const = 0;
64
65private slots:
66 void showMe(bool);
67
68protected:
69 void showEvent(QShowEvent *e) override;
70 void hideEvent(QHideEvent *e) override;
71 void changeEvent(QEvent *e) override;
72
73private:
74 const Qt::DockWidgetArea m_dockAreaHint;
75 QDesignerWorkbench *m_workbench;
76 QAction *m_action;
77};
78
79QT_END_NAMESPACE
80
81#endif // QDESIGNER_TOOLWINDOW_H
bool activateIdentifier(const QString &identifier, QString *errorMessage)
bool isRunning() const
bool showPage(const QString &path, QString *errorMessage)
static QString qtReferenceManualUrl(int qtVersion=0)
static QString designerManualUrl(int qtVersion=0)
static QString documentUrl(const QString &prefix, int qtVersion=0)
bool activateKeyword(const QString &keyword, QString *errorMessage)
void restoreSettings(const QDesignerSettings &s, const DockWidgetList &dws, const QRect &desktopArea)
DockedMainWindow(QDesignerWorkbench *wb, QMenu *toolBarMenu, const DesignerToolWindowList &toolWindows)
DockWidgetList addToolWindows(const DesignerToolWindowList &toolWindows)
void saveSettings(QDesignerSettings &) const
QMdiSubWindow * createMdiSubWindow(QWidget *fw, Qt::WindowFlags f, const QKeySequence &designerCloseActionShortCut)
QMdiArea * mdiArea() const
void formWindowActivated(QDesignerFormWindow *)
bool event(QEvent *event) override
static QString mainWindowTitle()
CloseEventPolicy closeEventPolicy() const
Definition mainwindow.h:46
void closeEvent(QCloseEvent *e) override
This event handler is called with the given event when Qt receives a window close request for a top-l...
static int settingsVersion()
static QList< QToolBar * > createToolBars(const QDesignerActions *actions, bool singleToolBar)
void setCloseEventPolicy(CloseEventPolicy pol)
Definition mainwindow.h:47
QActionGroup * helpActions() const
QActionGroup * fileActions() const
QActionGroup * settingsActions() const
QAction * minimizeAction() const
QActionGroup * styleActions() const
QActionGroup * editActions() const
QActionGroup * uiMode() const
bool writeOutForm(QDesignerFormWindowInterface *formWindow, const QString &fileName, bool check=true)
QString uiExtension() const
QActionGroup * formActions() const
bool openForm(QWidget *parent)
QDesignerFormEditorInterface * core() const
QActionGroup * toolActions() const
QAction * previewFormAction() const
QActionGroup * windowActions() const
bool readInForm(const QString &fileName)
QAction * closeFormAction() const
void setWindowListSeparatorVisible(bool visible)
bool saveForm(QDesignerFormWindowInterface *fw)
QAction * editWidgets() const
QAction * openFormAction() const
QAction * viewCodeAction() const
QDesignerWorkbench * workbench() const
void helpRequested(const QString &manual, const QString &document)
static const char * defaultToolbarPropertyName
void setBringAllToFrontVisible(bool visible)
QActionGroup * recentFilesActions() const
QDesignerFormWindowInterface * editor() const
void closeEvent(QCloseEvent *ev) override
This event handler is called with the given event when Qt receives a window close request for a top-l...
QDesignerWorkbench * workbench() const
void changeEvent(QEvent *e) override
This event handler can be reimplemented to handle state changes.
void resizeEvent(QResizeEvent *rev) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
QStringList recentFilesList() const
void setToolWindowFont(const ToolWindowFontSettings &fontSettings)
void setShowNewFormOnStartup(bool showIt)
void setUiMode(UIMode mode)
void setBackup(const QMap< QString, QString > &map)
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void restoreGeometry(QWidget *w, QRect fallBack=QRect()) const
QByteArray mainWindowState(UIMode mode) const
QDesignerSettings(QDesignerFormEditorInterface *core)
QMap< QString, QString > backup() const
QByteArray toolBarsState(UIMode mode) const
void setRecentFilesList(const QStringList &list)
void setValue(const QString &key, const QVariant &value)
ToolWindowFontSettings toolWindowFont() const
void saveGeometryFor(const QWidget *w)
bool showNewFormOnStartup() const
static QDesignerToolWindow * createStandardToolWindow(StandardToolWindow which, QDesignerWorkbench *workbench)
Qt::DockWidgetArea dockWidgetAreaHint() const
void hideEvent(QHideEvent *e) override
This event handler can be reimplemented in a subclass to receive widget hide events.
QDesignerWorkbench * workbench() const
void changeEvent(QEvent *e) override
This event handler can be reimplemented to handle state changes.
void showEvent(QShowEvent *e) override
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
QDesignerActions * actionManager() const
QActionGroup * modeActionGroup() const
QDesignerToolWindow * toolWindow(int index) const
bool saveForm(QDesignerFormWindowInterface *fw)
QDesignerFormEditorInterface * core() const
void setSuppressNewFormShow(bool v)
bool suppressNewFormShow() const
QDesignerFormWindow * formWindow(int index) const
void removeFormWindow(QDesignerFormWindow *formWindow)
void updateBackup(QDesignerFormWindowInterface *fwi)
friend class QWidget
Definition qpainter.h:421
The QtToolBarDialog class provides a dialog for customizing toolbars.
void setToolBarManager(QtToolBarManager *toolBarManager)
Connects the toolbar dialog to the given toolBarManager.
The QtToolBarManager class provides toolbar management for main windows.
QByteArray saveState(int version=0) const
Saves the state of the toolbar manager's toolbars.
bool restoreState(const QByteArray &state, int version=0)
Restores the saved state of the toolbar manager's toolbars.
void setMainWindow(QMainWindow *mainWindow)
Sets the main window upon which the toolbar manager operates, to be the given mainWindow.
QByteArray saveState(int version=0) const
bool restoreState(const QByteArray &state, int version=0)
UIMode
@ NeutralMode
@ DockedMode
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define qDesigner
Definition qdesigner.h:12
static void addActionsToToolBar(const ActionList &actions, QToolBar *t)
static void addActionsToToolBarManager(const ActionList &al, const QString &title, QtToolBarManager *tbm)
static QToolBar * createToolBar(const QString &title, const QString &objectName, const ActionList &actions)
bool toolBarTitleLessThan(const QToolBar *t1, const QToolBar *t2)
#define QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_IMPORT
friend bool comparesEqual(const ToolWindowFontSettings &lhs, const ToolWindowFontSettings &rhs) noexcept
QFontDatabase::WritingSystem m_writingSystem