aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel/clangdiagnostictooltipwidget.h
blob: 6f8ef7855f0942079ae95eee3bdf0afe0cc7aa44 (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
// 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 <QtGlobal>

#include <functional>

QT_BEGIN_NAMESPACE
class QLayout;
class QWidget;
QT_END_NAMESPACE

namespace ClangCodeModel {
namespace Internal {
class ClangDiagnostic;

class ClangDiagnosticWidget {
public:
    enum Destination { ToolTip, InfoBar };

    static QString createText(const QList<ClangDiagnostic> &diagnostics,
                              const Destination &destination);


    static QWidget *createWidget(const QList<ClangDiagnostic> &diagnostics,
                                 const Destination &destination,
                                 const std::function<bool()> &canApplyFixIt,
                                 const QString &source);
};

} // namespace Internal
} // namespace ClangCodeModel