39 explicit DragDropWidget(
const QString &
id =
"", QWidget *parent =
nullptr);
42 void setButtonIcon(
const QIcon &icon,
const QSize &size = QSize(36, 36));
44 void setScreenShotedView(QWidget *view);
48 virtual void onIgnoreAction();
49 void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
50 void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
51 void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
54 void startDrag(
const QPoint &pos);
55 void gobackDrag(
const QPixmap &pixmap,
const QPoint &pos);
58 QString m_mimeDataFormat;
66 bool m_isClicked =
false;
67 QPointer<QWidget> m_view =
nullptr;
112 void reloadWidgets();
113 void removePlaceHolder();
114 virtual void addWidget(
const QString &key,
int index);
115 void removeWidget(
int index);
118 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
121 void updateMinimumValue();
122 void initExpandButton();
126 QHBoxLayout *m_mainHLayout;
127 QVector<QPair<QString, QWidget*>> m_viewsInMenu;
129 QPointer<QWidget> m_placeHolder =
nullptr;
132 int m_minimumWidth = 0;
159 void updateCustomWidget(
bool isEditMode =
true);
160 void updateScreenShotedViews();
161 void addWidget(
const QString &key,
int index) Q_DECL_OVERRIDE;
162 bool isFixedTool(
const int index);
163 bool dropped()
const;
164 void setDropped(
bool isDropped);
165 void doStartScreenShot();
166 void replaceOldView(
const QString &toolId);
169 void addingToolView(
const QString &key,
const int pos);
170 void removedToolView(
const QString &key,
const int pos);
171 void movedToolView(
const QString &key,
const int pos);
172 void resetToolView();
173 void startScreenShot();
176 void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
177 void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
178 void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
179 void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
180 bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
181 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
184 bool containsTool(
const QString &toolId);
185 void handleTitlebarZoneWidgetMoveEvent(QDropEvent *event);
186 void handleSelectionZoneWidgetMoveEvent(QDropEvent *event);
187 void handleDefaultWidgetDropEvent(QDropEvent *event);
188 void handleTitlebarZoneWidgetDropEvent(QDropEvent *event);
189 void handleSelectionZoneWidgetDropEvent(QDropEvent *event);
190 void positionPlaceHolder(
const QPoint &pos,
const QPoint &hotSpot,
const QSize &size);
193 bool m_isDropped =
true;