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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of Qt Designer. This header
10// file may change from version to version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef DEVICEPROFILE_H
16#define DEVICEPROFILE_H
17
19
20#include <QtCore/qcompare.h>
21#include <QtCore/qstring.h>
22#include <QtCore/qshareddata.h>
23
25
26class QDesignerFormEditorInterface;
27class QWidget;
28class QStyle;
29
30namespace qdesigner_internal {
31
33
34/* DeviceProfile for embedded design. They influence
35 * default properties (for example, fonts), dpi and
36 * style of the form. This class represents a device
37 * profile. */
38
40public:
42
46
47 void clear();
48
49 // Device name
50 QString name() const;
51 void setName(const QString &);
52
53 // System settings active
54 bool isEmpty() const;
55
56 // Default font family of the embedded system
57 QString fontFamily() const;
58 void setFontFamily(const QString &);
59
60 // Default font size of the embedded system
61 int fontPointSize() const;
62 void setFontPointSize(int p);
63
64 // Display resolution of the embedded system
65 int dpiX() const;
66 void setDpiX(int d);
67 int dpiY() const;
68 void setDpiY(int d);
69
70 // Style
71 QString style() const;
72 void setStyle(const QString &);
73
74 // Initialize from desktop system
75 void fromSystem();
76
77 static void systemResolution(int *dpiX, int *dpiY);
78 static void widgetResolution(const QWidget *w, int *dpiX, int *dpiY);
79
80 // Apply to form/preview (using font inheritance)
81 enum ApplyMode {
82 /* Pre-Apply to parent widget of form being edited: Apply font
83 * and make use of property inheritance to be able to modify the
84 * font property freely. */
86 /* Post-Apply to preview widget: Change only inherited font
87 * sub properties. */
89 };
91
92 static void applyDPI(int dpiX, int dpiY, QWidget *widget);
93
94 QString toString() const;
95
96 QString toXml() const;
97 bool fromXml(const QString &xml, QString *errorMessage);
98
99private:
101 const DeviceProfile &rhs) noexcept;
103
105};
106
107} // namespace qdesigner_internal
108
109QT_END_NAMESPACE
110
111#endif // DEVICEPROFILE_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
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
QDesignerActions * actionManager() const
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
@ 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