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
deviceprofile_p.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// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of Qt Designer. This header
11// file may change from version to version without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef DEVICEPROFILE_H
17#define DEVICEPROFILE_H
18
20
21#include <QtCore/qcompare.h>
22#include <QtCore/qstring.h>
23#include <QtCore/qshareddata.h>
24
26
27class QDesignerFormEditorInterface;
28class QWidget;
29class QStyle;
30
31namespace qdesigner_internal {
32
34
35/* DeviceProfile for embedded design. They influence
36 * default properties (for example, fonts), dpi and
37 * style of the form. This class represents a device
38 * profile. */
39
41public:
43
47
48 void clear();
49
50 // Device name
51 QString name() const;
52 void setName(const QString &);
53
54 // System settings active
55 bool isEmpty() const;
56
57 // Default font family of the embedded system
58 QString fontFamily() const;
59 void setFontFamily(const QString &);
60
61 // Default font size of the embedded system
62 int fontPointSize() const;
63 void setFontPointSize(int p);
64
65 // Display resolution of the embedded system
66 int dpiX() const;
67 void setDpiX(int d);
68 int dpiY() const;
69 void setDpiY(int d);
70
71 // Style
72 QString style() const;
73 void setStyle(const QString &);
74
75 // Initialize from desktop system
76 void fromSystem();
77
78 static void systemResolution(int *dpiX, int *dpiY);
79 static void widgetResolution(const QWidget *w, int *dpiX, int *dpiY);
80
81 // Apply to form/preview (using font inheritance)
82 enum ApplyMode {
83 /* Pre-Apply to parent widget of form being edited: Apply font
84 * and make use of property inheritance to be able to modify the
85 * font property freely. */
87 /* Post-Apply to preview widget: Change only inherited font
88 * sub properties. */
90 };
92
93 static void applyDPI(int dpiX, int dpiY, QWidget *widget);
94
95 QString toString() const;
96
97 QString toXml() const;
98 bool fromXml(const QString &xml, QString *errorMessage);
99
100private:
102 const DeviceProfile &rhs) noexcept;
104
106};
107
108} // namespace qdesigner_internal
109
110QT_END_NAMESPACE
111
112#endif // DEVICEPROFILE_H
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:47
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:48
QActionGroup * helpActions() const
QActionGroup * fileActions() const
QActionGroup * settingsActions() const
QAction * minimizeAction() const
QActionGroup * styleActions() const
QMap< QString, QString > pendingBackups() const
QActionGroup * editActions() const
QActionGroup * uiMode() const
QString uiExtension() const
QActionGroup * formActions() const
bool openForm(QWidget *parent)
QDesignerFormEditorInterface * core() const
QActionGroup * toolActions() const
QAction * previewFormAction() const
QActionGroup * windowActions() const
QAction * closeFormAction() const
void setWindowListSeparatorVisible(bool visible)
bool saveForm(QDesignerFormWindowInterface *fw)
QAction * editWidgets() const
QAction * openFormAction() const
QAction * viewCodeAction() const
QDesignerWorkbench * workbench() const
static const char * defaultToolbarPropertyName
void setBringAllToFrontVisible(bool visible)
QActionGroup * recentFilesActions() const
QStringList recentFilesList() const
void setToolWindowFont(const ToolWindowFontSettings &fontSettings)
void setShowNewFormOnStartup(bool showIt)
void setToolBarsState(UIMode mode, const QByteArray &mainWindowState)
void setMainWindowState(UIMode mode, const QByteArray &mainWindowState)
void setUiMode(UIMode mode)
void setBackup(const QMap< QString, QString > &map)
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)
ToolWindowFontSettings toolWindowFont() const
void saveGeometryFor(const QWidget *w)
bool showNewFormOnStartup() const
QDesignerActions * actionManager() const
friend class QWidget
Definition qpainter.h:432
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.
void addAction(QAction *action, const QString &category)
Adds the given action to the given category in the manager's list of actions.
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)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
#define qDesigner
Definition qdesigner.h:20
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