summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/analyzer/detailederrorview.h
blob: 6b260b3c6fe95d09cf043e0f1d9d17f459d74fe2 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 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 <debugger/debugger_global.h>

#include <QTreeView>
#include <QStyledItemDelegate>

namespace Debugger {

class DiagnosticLocation;

class DEBUGGER_EXPORT DetailedErrorView : public QTreeView
{
public:
    DetailedErrorView(QWidget *parent = nullptr);
    ~DetailedErrorView() override;

    virtual void goNext();
    virtual void goBack();

    void selectIndex(const QModelIndex &index);

    enum ItemRole {
        LocationRole = Qt::UserRole,
        FullTextRole
    };

    enum Column {
        DiagnosticColumn,
        LocationColumn,
    };

    static QVariant locationData(int role, const DiagnosticLocation &location);

private:
    void contextMenuEvent(QContextMenuEvent *e) override;
    void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;

    int currentRow() const;
    void setCurrentRow(int row);
    int rowCount() const;

    QList<QAction *> commonActions() const;
    virtual QList<QAction *> customActions() const;

    QAction * const m_copyAction;
};

} // namespace Debugger