aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/navigator/navigatortreeview.h
blob: 122f93eddd3eb230d4358e93121ecb7fc02d2e00 (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
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <QTreeView>

namespace QmlDesigner {

class PreviewToolTip;

class NavigatorTreeView : public QTreeView
{
    Q_OBJECT

public:
    NavigatorTreeView(QWidget *parent = nullptr);
    static void drawSelectionBackground(QPainter *painter, const QStyleOption &option);
    bool viewportEvent(QEvent *event) override;

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void startDrag(Qt::DropActions supportedActions) override;

private:
    PreviewToolTip *m_previewToolTip = nullptr;
    qint32 m_previewToolTipNodeId = -1;
    bool m_dragAllowed = true;
};
}