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// 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 PREVIEWMANAGER_H
17#define PREVIEWMANAGER_H
18
20
21#include <QtCore/qcompare.h>
22#include <QtCore/qobject.h>
23#include <QtCore/qstring.h>
24#include <QtCore/qshareddata.h>
25
27
28class QDesignerFormWindowInterface;
29class QWidget;
30class QPixmap;
31class QAction;
32class QActionGroup;
33class QMenu;
34class QWidget;
35class QDesignerSettingsInterface;
36
37namespace qdesigner_internal {
38
39// ----------- PreviewConfiguration
40
42
44public:
46 explicit PreviewConfiguration(const QString &style,
48 const QString &deviceSkin = QString());
49
53
54 QString style() const;
55 void setStyle(const QString &);
56
57 // Style sheet to prepend (to simulate the effect od QApplication::setSyleSheet()).
60
61 QString deviceSkin() const;
62 void setDeviceSkin(const QString &);
63
64 void clear();
67
68private:
71 const PreviewConfiguration &rhs) noexcept;
74 const PreviewConfiguration &rhs) noexcept;
76
78};
79
80// ----------- Preview window manager.
81// Maintains a list of preview widgets with their associated form windows and configuration.
82
84
86{
88public:
89
91 // Modal preview. Do not use on Macs as dialogs would have no close button
93 // Non modal previewing of one form in different configurations (closes if form window changes)
95 // Non modal previewing of several forms in different configurations
97
100
101 // Show preview. Raise existing preview window if there is one with a matching
102 // configuration, else create a new preview.
104 // Convenience that creates a preview using a configuration taken from the settings.
107
108 int previewCount() const;
109
110 // Create a pixmap for printing.
112 // Convenience that creates a pixmap using a configuration taken from the settings.
115
117
118public slots:
119 void closeAllPreviews();
120
121signals:
124
125private slots:
126 void slotZoomChanged(int);
127
128private:
129
130 virtual Qt::WindowFlags previewWindowFlags(const QWidget *widget) const;
132
136 int deviceProfileIndex /* = -1 */,
138 /*Disabled by default, <0 */
139 int initialZoom = -1);
140
142
144
147};
148}
149
150QT_END_NAMESPACE
151
152#endif // PREVIEWMANAGER_H
friend class QWidget
Definition qpainter.h:432
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.
void morphLayout(QWidget *container, int newType)
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)
static bool hasManagedLayoutItems(const QDesignerFormEditorInterface *core, QWidget *w)
#define QDESIGNER_SHARED_EXPORT