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/qcompare.h>
21#include <QtCore/qobject.h>
22#include <QtCore/qstring.h>
23#include <QtCore/qshareddata.h>
24
26
27class QDesignerFormWindowInterface;
28class QWidget;
29class QPixmap;
30class QAction;
31class QActionGroup;
32class QMenu;
33class QWidget;
34class QDesignerSettingsInterface;
35
36namespace qdesigner_internal {
37
38// ----------- PreviewConfiguration
39
41
43public:
45 explicit PreviewConfiguration(const QString &style,
47 const QString &deviceSkin = QString());
48
52
53 QString style() const;
54 void setStyle(const QString &);
55
56 // Style sheet to prepend (to simulate the effect od QApplication::setSyleSheet()).
59
60 QString deviceSkin() const;
61 void setDeviceSkin(const QString &);
62
63 void clear();
66
67private:
70 const PreviewConfiguration &rhs) noexcept;
73 const PreviewConfiguration &rhs) noexcept;
75
77};
78
79// ----------- Preview window manager.
80// Maintains a list of preview widgets with their associated form windows and configuration.
81
83
85{
87public:
88
90 // Modal preview. Do not use on Macs as dialogs would have no close button
92 // Non modal previewing of one form in different configurations (closes if form window changes)
94 // Non modal previewing of several forms in different configurations
96
99
100 // Show preview. Raise existing preview window if there is one with a matching
101 // configuration, else create a new preview.
103 // Convenience that creates a preview using a configuration taken from the settings.
106
107 int previewCount() const;
108
109 // Create a pixmap for printing.
111 // Convenience that creates a pixmap using a configuration taken from the settings.
114
116
117public slots:
118 void closeAllPreviews();
119
120signals:
123
124private slots:
125 void slotZoomChanged(int);
126
127private:
128
129 virtual Qt::WindowFlags previewWindowFlags(const QWidget *widget) const;
131
135 int deviceProfileIndex /* = -1 */,
137 /*Disabled by default, <0 */
138 int initialZoom = -1);
139
141
143
146};
147}
148
149QT_END_NAMESPACE
150
151#endif // PREVIEWMANAGER_H
friend class QWidget
Definition qpainter.h:431
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)
Auxiliary methods to store/retrieve settings.
static QWidget * findLayoutContainer(const FormWindow *fw)
static bool hasManagedLayoutItems(const QDesignerFormEditorInterface *core, QWidget *w)
#define QDESIGNER_SHARED_EXPORT