summaryrefslogtreecommitdiff
path: root/src/plugins/modeleditor/dragtool.h
blob: c9982cbebe3176dc6c50b3e1cc65fa76b548bac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2016 Jochen Becher
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QWidget>
#include <QIcon>

namespace ModelEditor {
namespace Internal {

class DragTool :
        public QWidget
{
    Q_OBJECT
    class DragToolPrivate;

public:
    DragTool(const QIcon &icon, const QString &title, const QString &newElementName,
             const QString &newElementId, const QString &stereotype, QWidget *parent = nullptr);
    ~DragTool();

    QSize sizeHint() const override;

protected:
    void paintEvent(QPaintEvent *event) override;
    void enterEvent(QEnterEvent *event) override;
    void leaveEvent(QEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;

private:
    DragToolPrivate *d;
};

} // namespace Internal
} // namespace ModelEditor