8#include <formwindowbase_p.h>
11#include <QtGui/qundostack.h>
12#include <QtCore/qhash.h>
13#include <QtCore/qlist.h>
14#include <QtCore/qset.h>
15#include <QtCore/qpointer.h>
21class QDesignerDnDItemInterface;
22class QDesignerTaskMenuExtension;
42class SetPropertyCommand;
70 void registerTool(QDesignerFormWindowToolInterface *tool)
override;
73 void setAuthor(
const QString &author)
override;
76 void setComment(
const QString &comment)
override;
97 bool setContents(QIODevice *dev, QString *errorMessage =
nullptr)
override;
146 bool unify(QObject *w, QString &s,
bool changeIt);
167 bool dropDockWidget(QDesignerDnDItemInterface *item, QPoint global_mouse_pos);
169 const QPoint &global_mouse_pos)
override;
178#if QT_CONFIG(clipboard)
183 bool eventFilter(QObject *watched, QEvent *event)
override;
195#if QT_CONFIG(clipboard)
216 void checkSelection();
217 void checkSelectionNow();
218 void slotSelectWidget(QAction *);
219 void slotCleanChanged(
bool);
231 MouseDeferredSelection
233 MouseState m_mouseState;
234 QPointer<QWidget> m_lastClickedWidget;
237 void initializeCoreTools();
239 int getValue(QRect rect,
int key,
bool size)
const;
240 int calcValue(
int val,
bool forward,
bool snap,
int snapOffset)
const;
241 void handleClickSelection(
QWidget *managedWidget,
unsigned mouseFlags);
243 bool frameNeeded(
QWidget *w)
const;
245 enum RectType { Insert, Rubber };
247 void startRectDraw(QPoint global,
QWidget *, RectType t);
248 void continueRectDraw(QPoint global,
QWidget *, RectType t);
253 void checkPreviewGeometry(QRect &r);
255 bool handleContextMenu(
QWidget *widget,
QWidget *managedWidget, QContextMenuEvent *e);
256 bool handleMouseButtonDblClickEvent(
QWidget *widget,
QWidget *managedWidget, QMouseEvent *e);
257 bool handleMousePressEvent(
QWidget *widget,
QWidget *managedWidget, QMouseEvent *e);
258 bool handleMouseMoveEvent(
QWidget *widget,
QWidget *managedWidget, QMouseEvent *e);
259 bool handleMouseReleaseEvent(
QWidget *widget,
QWidget *managedWidget, QMouseEvent *e);
260 bool handleKeyPressEvent(
QWidget *widget,
QWidget *managedWidget, QKeyEvent *e);
261 bool handleKeyReleaseEvent(
QWidget *widget,
QWidget *managedWidget, QKeyEvent *e);
263 bool isCentralWidget(
QWidget *w)
const;
265 bool setCurrentWidget(
QWidget *currentWidget);
266 bool trySelectWidget(
QWidget *w,
bool select);
268 void dragWidgetWithinForm(
QWidget *widget, QRect targetGeometry,
QWidget *targetContainer);
270 void setCursorToAll(
const QCursor &c,
QWidget *start);
272 QPoint mapToForm(
const QWidget *w, QPoint pos)
const;
273 bool canBeBuddy(
QWidget *w)
const;
277 void clearMainContainer();
279 static int widgetDepth(
const QWidget *w);
284 void updateWidgets();
286 void handleArrowKeyEvent(
int key, Qt::KeyboardModifiers modifiers);
288 void layoutSelection(
int type);
289 void layoutContainer(
QWidget *w,
int type);
293 QWidget *containerForPaste()
const;
294 QAction *createSelectAncestorSubMenu(
QWidget *w);
295 void selectSingleWidget(
QWidget *w);
299 QWidget *m_mainContainer =
nullptr;
300 QWidget *m_currentWidget =
nullptr;
302 bool m_blockSelectionChanged =
false;
307 QWidgetList m_widgets;
308 QSet<QWidget*> m_insertedWidgets;
315 QUndoStack m_undoStack;
320 QHash<QWidget *, PaletteAndFill> m_palettesBeforeHighlight;
322 QRubberBand *m_rubberBand =
nullptr;
324 QTimer *m_selectionChangedTimer =
nullptr;
325 QTimer *m_checkSelectionTimer =
nullptr;
326 QTimer *m_geometryChangedTimer =
nullptr;
331 QStringList m_resourceFiles;
335 QString m_pixmapFunction;
336 int m_defaultMargin, m_defaultSpacing;
337 QString m_marginFunction, m_spacingFunction;
338 QString m_exportMacro;
339 QStringList m_includeHints;
341 QPoint m_contextMenuPosition;
QDesignerResource(FormWindow *fw)
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)
@ ToggleSelectionModifier
static bool isDescendant(const QWidget *parent, const QWidget *child)
static QSet< QString > languageKeywords()
static QWidget * findSelectedParent(QDesignerFormWindowInterface *fw, const QWidget *w, bool selected)
QRect apply(QRect rect) const