VisualizationDragWidget.h
34 lines
| 1.1 KiB
| text/x-c
|
CLexer
r846 | #ifndef SCIQLOP_VISUALIZATIONDRAGWIDGET_H | |||
#define SCIQLOP_VISUALIZATIONDRAGWIDGET_H | ||||
r838 | ||||
#include <Common/spimpl.h> | ||||
r844 | #include <QMimeData> | |||
#include <QWidget> | ||||
r838 | ||||
r844 | class VisualizationDragWidget : public QWidget { | |||
r838 | Q_OBJECT | |||
public: | ||||
r844 | VisualizationDragWidget(QWidget *parent = nullptr); | |||
r838 | ||||
r1047 | virtual QMimeData *mimeData(const QPoint &position) const = 0; | |||
r838 | virtual bool isDragAllowed() const = 0; | |||
r1047 | virtual void highlightForMerge(bool highlighted) { Q_UNUSED(highlighted); } | |||
/// Custom pixmap to display during a drag operation. | ||||
/// If the provided pixmap is null, a pixmap of the entire widget is used. | ||||
virtual QPixmap customDragPixmap(const QPoint &dragPosition); | ||||
r838 | ||||
protected: | ||||
virtual void mousePressEvent(QMouseEvent *event) override; | ||||
virtual void mouseMoveEvent(QMouseEvent *event) override; | ||||
private: | ||||
class VisualizationDragWidgetPrivate; | ||||
spimpl::unique_impl_ptr<VisualizationDragWidgetPrivate> impl; | ||||
signals: | ||||
r844 | void dragDetected(VisualizationDragWidget *dragWidget, const QPoint &dragPosition); | |||
r838 | }; | |||
r846 | #endif // SCIQLOP_VISUALIZATIONDRAGWIDGET_H | |||