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
previewmanager_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 PREVIEWMANAGER_H
16#define PREVIEWMANAGER_H
17
19
20#include <QtCore/qobject.h>
21#include <QtCore/qstring.h>
22#include <QtCore/qshareddata.h>
23
25
26class QDesignerFormWindowInterface;
27class QWidget;
28class QPixmap;
29class QAction;
30class QActionGroup;
31class QMenu;
32class QWidget;
33class QDesignerSettingsInterface;
34
35namespace qdesigner_internal {
36
37// ----------- PreviewConfiguration
38
40
42public:
44 explicit PreviewConfiguration(const QString &style,
46 const QString &deviceSkin = QString());
47
51
52 QString style() const;
53 void setStyle(const QString &);
54
55 // Style sheet to prepend (to simulate the effect od QApplication::setSyleSheet()).
58
59 QString deviceSkin() const;
60 void setDeviceSkin(const QString &);
61
62 void clear();
65
66private:
68};
69
70QDESIGNER_SHARED_EXPORT bool operator<(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2);
71QDESIGNER_SHARED_EXPORT bool operator==(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2);
72QDESIGNER_SHARED_EXPORT bool operator!=(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2);
73
74// ----------- Preview window manager.
75// Maintains a list of preview widgets with their associated form windows and configuration.
76
78
80{
82public:
83
85 // Modal preview. Do not use on Macs as dialogs would have no close button
87 // Non modal previewing of one form in different configurations (closes if form window changes)
89 // Non modal previewing of several forms in different configurations
91
94
95 // Show preview. Raise existing preview window if there is one with a matching
96 // configuration, else create a new preview.
98 // Convenience that creates a preview using a configuration taken from the settings.
101
102 int previewCount() const;
103
104 // Create a pixmap for printing.
106 // Convenience that creates a pixmap using a configuration taken from the settings.
109
111
112public slots:
113 void closeAllPreviews();
114
115signals:
118
119private slots:
120 void slotZoomChanged(int);
121
122private:
123
124 virtual Qt::WindowFlags previewWindowFlags(const QWidget *widget) const;
126
130 int deviceProfileIndex /* = -1 */,
132 /*Disabled by default, <0 */
133 int initialZoom = -1);
134
136
138
141};
142}
143
144QT_END_NAMESPACE
145
146#endif // PREVIEWMANAGER_H
friend class QWidget
Definition qpainter.h:421
void removeFormWindow(QDesignerFormWindowInterface *formWindow) override
int formWindowCount() const override
Returns the number of form windows maintained by \QD's form window manager.
QPixmap createPreviewPixmap() const override
Creates a pixmap representing the preview of the currently active form.
QActionGroup * actionGroup(ActionGroup actionGroup) const override
Returns the action group specified by the enumeration value actionGroup.
bool eventFilter(QObject *o, QEvent *e) override
Filters events if this object has been installed as an event filter for the watched object.
QDesignerFormWindowInterface * formWindow(int index) const override
Returns the form window at the given index.
QDesignerFormWindowInterface * activeFormWindow() const override
Returns the currently active form window in \QD's workspace.
QDesignerFormWindowInterface * createFormWindow(QWidget *parentWidget=nullptr, Qt::WindowFlags flags={}) override
Creates a form window with the given parent and the given window flags.
void dragItems(const QList< QDesignerDnDItemInterface * > &item_list) override
void setActiveFormWindow(QDesignerFormWindowInterface *formWindow) override
QDesignerFormEditorInterface * core() const override
Returns a pointer to \QD's current QDesignerFormEditorInterface object.
QAction * action(Action action) const override
Returns the action specified by the enumeration value action.
void accept() override
Hides the modal dialog and sets the result code to Accepted.
static FormWindow * findFormWindow(QWidget *w)
void createLayout(int type, QWidget *container=nullptr)
QWidget * mainContainer() const override
Returns the main container widget for the form window.
void endCommand() override
Ends execution of the current command.
bool isMainContainer(const QWidget *w) const
int currentTool() const override
Returns the index of the current tool in use.
void emitSelectionChanged() override
Emits the selectionChanged() signal.
bool hasInsertedChildren(QWidget *w) const
bool isManaged(QWidget *w) const override
Returns true if the specified widget is managed by the form window; otherwise returns false.
static Iterator findFirstChildOf(Iterator it, Iterator end, const QWidget *w)
static QString whatsThisFrom(const QString &str)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static QWidget * findLayoutContainer(const FormWindow *fw)
QDESIGNER_SHARED_EXPORT bool operator==(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2)
QDESIGNER_SHARED_EXPORT bool operator!=(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2)
QDESIGNER_SHARED_EXPORT bool operator<(const PreviewConfiguration &pc1, const PreviewConfiguration &pc2)
static bool hasManagedLayoutItems(const QDesignerFormEditorInterface *core, QWidget *w)
#define QDESIGNER_SHARED_EXPORT