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
qdesigner_dnditem_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 QDESIGNER_DNDITEM_H
16#define QDESIGNER_DNDITEM_H
17
19#include <QtDesigner/abstractdnditem.h>
20
21#include <QtCore/qpoint.h>
22#include <QtCore/qlist.h>
23#include <QtCore/qmimedata.h>
24
26
27class QDrag;
28class QImage;
29class QDropEvent;
30
31namespace qdesigner_internal {
32
62
63// Mime data for use with designer drag and drop operations.
64
67
68public:
70
72
73 const QDesignerDnDItems &items() const { return m_items; }
74
75 // Execute a drag and drop operation.
77
78 QPoint hotSpot() const { return m_hotSpot; }
79
80 // Move the decoration. Required for drops over form windows as the position
81 // is derived from the decoration position.
82 void moveDecoration(const QPoint &globalPos) const;
83
84 // For a move operation, create the undo command sequence to remove
85 // the widgets from the source form.
87
88 // Accept an event with the proper action.
89 void acceptEvent(QDropEvent *e) const;
90
91 // Helper to accept an event with the desired action.
93
94private:
97
98 static void setImageTransparency(QImage &image, int alpha);
99
103};
104
105} // namespace qdesigner_internal
106
107QT_END_NAMESPACE
108
109#endif // QDESIGNER_DNDITEM_H
friend class QWidget
Definition qpainter.h:421
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.
#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