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
qsimpleresource_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 QSIMPLERESOURCE_H
16#define QSIMPLERESOURCE_H
17
20
21#include <QtCore/qlist.h>
22#include <QtCore/qstringlist.h>
23
25
26class DomCustomWidgets;
27class DomCustomWidget;
28class DomSlots;
29
30class QDesignerFormEditorInterface;
31
32namespace qdesigner_internal {
33
34class WidgetDataBaseItem;
35
37{
38public:
41
44
46 { return m_core; }
47
48 // Query extensions for additional data
55 // Return the script returned by the CustomWidget codeTemplate API
59
60 // Implementation for FormBuilder::createDomCustomWidgets() that adds
61 // the custom widgets to the widget database
64
65protected:
67
68private:
72
73 static bool m_warningsEnabled;
75};
76
77// Contents of clipboard for formbuilder copy and paste operations
78// (Actions and widgets)
90
91// Base class for a form builder used in the editor that
92// provides copy and paste.(move into base interface)
94{
95public:
97
98 virtual bool copy(QIODevice *dev, const FormBuilderClipboard &selection) = 0;
100
101 // A widget parent needs to be specified, otherwise, the widget factory cannot locate the form window via parent
102 // and thus is not able to construct special widgets (QLayoutWidget).
105};
106
107} // namespace qdesigner_internal
108
109QT_END_NAMESPACE
110
111#endif
The QDesignerWidgetDataBaseItemInterface class provides an interface that is used to access individua...
friend class QWidget
Definition qpainter.h:421
void setProperty(const QString &name, const QVariant &value) override
Sets the property with the given name for the currently selected widget to the specified value.
QWidget * current() const override
Returns the currently selected widget in the form window.
int position() const override
Returns the cursor position.
void setPosition(int pos, MoveMode mode) override
Sets the position of the cursor to the given position using the mode to specify how it is moved there...
void resetWidgetProperty(QWidget *widget, const QString &name) override
Resets the property with the given name for the specified widget to its default value.
int selectedWidgetCount() const override
Returns the number of selected widgets in the form window.
QWidget * selectedWidget(int index) const override
Returns the widget with the given index in the list of selected widgets.
QWidget * widget(int index) const override
Returns the widget with the given index in the list of widgets in the form window.
bool hasSelection() const override
Returns true if the form window contains a selection; otherwise returns false.
bool movePosition(MoveOperation op, MoveMode mode) override
Performs the given operation on the cursor using the specified mode, and returns true if it completed...
int widgetCount() const override
Returns the number of widgets in the form window.
QDesignerFormWindowInterface * formWindow() const override
Returns the form window interface associated with this cursor interface.
void setWidgetProperty(QWidget *widget, const QString &name, const QVariant &value) override
Sets the property with the given name for the given widget to the specified value.
QDesignerFormWindowToolInterface * currentTool() const
QDesignerFormWindowToolInterface * tool(int index) const
void setCurrentTool(QDesignerFormWindowToolInterface *tool)
int indexOf(QDesignerFormWindowToolInterface *tool) const
void raiseList(const QWidgetList &l)
WidgetSelection * addWidget(FormWindow *fw, QWidget *w)
static FormWindow * findFormWindow(QWidget *w)
void layoutFunction(QString *margin, QString *spacing) override
Fills in the current margin and spacing for the form's layout in the margin and spacing variables spe...
QWidgetList widgets(QWidget *widget) const
void simplifySelection(QWidgetList *sel) const override
Simplifies the selection of widgets specified by widgets.
void removeResourceFile(const QString &path) override
Removes the resource file at the specified path from the list of those used by the form.
QDesignerFormEditorInterface * core() const override
Returns a pointer to \QD's current QDesignerFormEditorInterface object.
void setPixmapFunction(const QString &pixmapFunction) override
Sets the function used to load pixmaps into the form window to the given pixmapFunction.
void editWidgets() override
Switches the form window into editing mode.
QMenu * initializePopupMenu(QWidget *managedWidget) override
void insertWidget(QWidget *w, QRect rect, QWidget *target, bool already_in_form=false)
HandleOperation handleOperation() const
Definition formwindow.h:185
bool setContents(const QString &) override
Sets the contents of the form using data read from the specified contents string and returns whether ...
void setLayoutDefault(int margin, int spacing) override
Sets the default margin and spacing for the form's layout.
QWidget * createWidget(DomUI *ui, QRect rect, QWidget *target)
QString pixmapFunction() const override
Returns the name of the function used to load pixmaps into the form window.
void setMainContainer(QWidget *mainContainer) override
Sets the main container widget on the form to the specified mainContainer.
void beginCommand(const QString &description) override
Begins execution of a command with the given description.
void setHandleOperation(HandleOperation o)
Definition formwindow.h:186
void highlightWidget(QWidget *w, const QPoint &pos, HighlightMode mode=Highlight) override
void resizeEvent(QResizeEvent *e) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void layoutDefault(int *margin, int *spacing) override
Fills in the default margin and spacing for the form's default layout in the margin and spacing varia...
const QWidgetList & widgets() const
Definition formwindow.h:126
void createLayout(int type, QWidget *container=nullptr)
bool eventFilter(QObject *watched, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QWidget * mainContainer() const override
Returns the main container widget for the form window.
QWidget * designerWidget(QWidget *w) const
bool isDirty() const override
Returns true if the form window is "dirty" (modified but not saved); otherwise returns false.
QDir absoluteDir() const override
Returns the absolute location of the directory containing the form shown in the form window.
void unmanageWidget(QWidget *w) override
Instructs the form window not to manage the specified widget.
QUndoStack * commandHistory() const override
Returns an object that can be used to obtain the commands used so far in the construction of the form...
QEditorFormBuilder * createFormBuilder() override
QStringList resourceFiles() const override
Returns a list of paths to resource files that are currently being used by the form window.
void setLayoutFunction(const QString &margin, const QString &spacing) override
Sets the margin and spacing for the form's layout.
QWidget * currentWidget() const
void endCommand() override
Ends execution of the current command.
QStringList includeHints() const override
Returns a list of the header files that will be included in the form window's associated UI file.
bool handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event)
QString contents() const override
Returns details of the contents of the form currently being displayed in the window.
bool blockSelectionChanged(bool blocked) override
QString exportMacro() const override
Returns the export macro associated with the form currently being displayed in the window.
void clearSelection(bool changePropertyDisplay=true) override
Clears the current selection in the form window.
void addResourceFile(const QString &path) override
Adds the resource file at the given path to those used by the form.
void manageWidget(QWidget *w) override
Instructs the form window to manage the specified widget.
void ensureUniqueObjectName(QObject *object) override
Ensures that the specified object has a unique name amongst the other objects on the form.
QWidgetList selectedWidgets() const
FormWindow(FormEditor *core, QWidget *parent=nullptr, Qt::WindowFlags flags={})
int toolCount() const override
Returns the number of tools available.
void raiseChildSelections(QWidget *w)
QWidget * widgetAt(int index) const
Definition formwindow.h:128
bool setContents(QIODevice *dev, QString *errorMessage=nullptr) override
Sets the form's contents using data obtained from the given device and returns whether loading succee...
void setExportMacro(const QString &exportMacro) override
Sets the form window's export macro to exportMacro.
void registerTool(QDesignerFormWindowToolInterface *tool) override
Registers the given tool with the form window.
void setComment(const QString &comment) override
Sets the information about the form to the comment specified.
bool isMainContainer(const QWidget *w) const
QWidget * formContainer() const override
Returns the form the widget containing the main container widget.
int currentTool() const override
Returns the index of the current tool in use.
virtual QWidget * containerAt(const QPoint &pos)
void setAuthor(const QString &author) override
Sets the details for the author or creator of the form to the author specified.
void setIncludeHints(const QStringList &includeHints) override
Sets the header files that will be included in the form window's associated UI file to the specified ...
void selectWidget(QWidget *w, bool select=true) override
If select is true, the given widget is selected; otherwise the widget is deselected.
void setDirty(bool dirty) override
If dirty is true, the form window is marked as dirty, meaning that it is modified but not saved.
bool unify(QObject *w, QString &s, bool changeIt)
virtual QMenu * createPopupMenu(QWidget *w)
bool dropWidgets(const QList< QDesignerDnDItemInterface * > &item_list, QWidget *target, const QPoint &global_mouse_pos) override
QWidget * widgetAt(const QPoint &pos) override
void emitSelectionChanged() override
Emits the selectionChanged() signal.
QDesignerFormWindowCursorInterface * cursor() const override
Returns the cursor interface used by the form window.
QWidget * findContainer(QWidget *w, bool excludeLayout) const override
bool isWidgetSelected(QWidget *w) const
void updateChildSelections(QWidget *w)
QString author() const override
Returns details of the author or creator of the form currently being displayed in the window.
void setFileName(const QString &fileName) override
Sets the file name for the form to the given fileName.
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.
QDesignerFormWindowToolInterface * tool(int index) const override
Returns an interface to the tool with the given index.
bool dropDockWidget(QDesignerDnDItemInterface *item, QPoint global_mouse_pos)
void morphLayout(QWidget *container, int newType)
QString comment() const override
Returns comments about the form currently being displayed in the window.
void resizeWidget(QWidget *widget, QRect geometry)
void setCurrentTool(int index) override
Sets the current tool to be the one with the given index.
QString fileName() const override
Returns the file name of the UI file that describes the form currently being shown.
DomActionGroup * createDom(QActionGroup *actionGroup) override
QWidget * load(QIODevice *dev, QWidget *parentWidget) override
Loads an XML representation of a widget from the given device, and constructs a new widget with the s...
bool addItem(DomLayoutItem *ui_item, QLayoutItem *item, QLayout *layout) override
void addMenuAction(QAction *action) override
DomLayoutItem * createDom(QLayoutItem *item, DomLayout *ui_layout, DomWidget *ui_parentWidget) override
DomActionRef * createActionRefDom(QAction *action) override
DomLayout * createDom(QLayout *layout, DomLayout *ui_layout, DomWidget *ui_parentWidget) override
void applyProperties(QObject *o, const QList< DomProperty * > &properties) override
void createCustomWidgets(DomCustomWidgets *) override
QLayout * create(DomLayout *ui_layout, QLayout *layout, QWidget *parentWidget) override
void applyTabStops(QWidget *widget, DomTabStops *tabStops) override
DomWidget * saveWidget(QToolBar *toolBar, DomWidget *ui_parentWidget)
DomCustomWidgets * saveCustomWidgets() override
DomWidget * saveWidget(QDesignerDockWidget *dockWidget, DomWidget *ui_parentWidget)
DomUI * copy(const FormBuilderClipboard &selection) override
QAction * create(DomAction *ui_action, QObject *parent) override
QActionGroup * create(DomActionGroup *ui_action_group, QObject *parent) override
DomWidget * saveWidget(QWizardPage *wizardPage, DomWidget *ui_parentWidget)
void saveDom(DomUI *ui, QWidget *widget) override
void createResources(DomResources *) override
void save(QIODevice *dev, QWidget *widget) override
Saves an XML representation of the given widget to the specified device in the standard UI file forma...
QLayoutItem * create(DomLayoutItem *ui_layoutItem, QLayout *layout, QWidget *parentWidget) override
QWidget * create(DomUI *ui, QWidget *parentWidget) override
QWidget * loadUi(DomUI *ui, QWidget *parentWidget)
void loadExtraInfo(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) override
DomWidget * createDom(QWidget *widget, DomWidget *ui_parentWidget, bool recursive=true) override
DomWidget * saveWidget(QTabWidget *widget, DomWidget *ui_parentWidget)
DomWidget * saveWidget(QToolBox *widget, DomWidget *ui_parentWidget)
FormBuilderClipboard paste(DomUI *ui, QWidget *widgetParent, QObject *actionParent=nullptr) override
DomWidget * saveWidget(QWidget *widget, QDesignerContainerExtension *container, DomWidget *ui_parentWidget)
bool addItem(DomWidget *ui_widget, QWidget *widget, QWidget *parentWidget) override
void layoutInfo(DomLayout *layout, QObject *parent, int *margin, int *spacing) override
FormBuilderClipboard paste(QIODevice *dev, QWidget *widgetParent, QObject *actionParent=nullptr) override
QList< DomProperty * > computeProperties(QObject *obj) override
DomWidget * saveWidget(QStackedWidget *widget, DomWidget *ui_parentWidget)
QWidget * create(DomWidget *ui_widget, QWidget *parentWidget) override
DomAction * createDom(QAction *action) override
bool copy(QIODevice *dev, const FormBuilderClipboard &selection) override
bool handlePaintEvent(QWidget *widget, QWidget *managedWidget, QPaintEvent *e)
bool handleKeyPressEvent(QWidget *widget, QWidget *managedWidget, QKeyEvent *e)
bool handleDragLeaveEvent(QWidget *widget, QWidget *managedWidget, QDragLeaveEvent *e)
QDesignerFormWindowInterface * formWindow() const override
bool handleMouseReleaseEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e)
bool handleContextMenu(QWidget *widget, QWidget *managedWidget, QContextMenuEvent *e)
bool handleKeyReleaseEvent(QWidget *widget, QWidget *managedWidget, QKeyEvent *e)
bool handleDropEvent(QWidget *widget, QWidget *managedWidget, QDropEvent *e)
bool handleMouseButtonDblClickEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e)
QDesignerFormEditorInterface * core() const override
bool handleMousePressEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e)
bool handleEvent(QWidget *widget, QWidget *managedWidget, QEvent *event) override
bool handleDragEnterMoveEvent(QWidget *widget, QWidget *managedWidget, QDragMoveEvent *e, bool isEnter)
bool handleMouseMoveEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e)
QDesignerFormEditorInterface * core() const
WidgetHandle(FormWindow *parent, Type t, WidgetSelection *s)
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *e) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
QDesignerFormEditorInterface * core() const
static WidgetState widgetState(const QDesignerFormEditorInterface *core, QWidget *w)
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
#define QT_FORMEDITOR_EXPORT
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static unsigned mouseFlags(Qt::KeyboardModifiers mod)
static void insertNames(const QDesignerMetaDataBaseInterface *metaDataBase, Iterator it, const Iterator &end, QObject *excludedObject, QSet< QString > &nameSet)
static void clearObjectInspectorSelection(const QDesignerFormEditorInterface *core)
static bool canDragWidgetInLayout(const QDesignerFormEditorInterface *core, QWidget *w)
static bool isDescendant(const QWidget *parent, const QWidget *child)
static QSet< QString > languageKeywords()
static QWidget * findSelectedParent(QDesignerFormWindowInterface *fw, const QWidget *w, bool selected)
#define QDESIGNER_SHARED_EXPORT