2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
2011-03-04 12:15:18 +01:00
|
|
|
** Author: Frank Osterfeld, KDAB (frank.osterfeld@kdab.com)
|
2016-01-15 14:57:40 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-03-04 12:15:18 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-02-24 14:42:52 +01:00
|
|
|
#include <debugger/analyzer/detailederrorview.h>
|
2015-06-25 10:00:49 +02:00
|
|
|
#include <utils/treemodel.h>
|
|
|
|
|
|
2016-03-08 15:03:31 +01:00
|
|
|
#include <functional>
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
namespace Valgrind {
|
|
|
|
|
namespace XmlProtocol {
|
|
|
|
|
|
|
|
|
|
class Error;
|
|
|
|
|
class Frame;
|
|
|
|
|
|
2016-06-24 09:36:42 +02:00
|
|
|
class ErrorListModel : public Utils::TreeModel<>
|
2011-03-04 12:15:18 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-08-05 18:03:37 +02:00
|
|
|
|
2011-03-04 12:15:18 +01:00
|
|
|
public:
|
|
|
|
|
enum Role {
|
2016-03-02 13:57:37 +01:00
|
|
|
ErrorRole = Debugger::DetailedErrorView::FullTextRole + 1,
|
2011-03-04 12:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
2018-12-10 08:11:18 +01:00
|
|
|
explicit ErrorListModel(QObject *parent = nullptr);
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2018-12-10 08:11:18 +01:00
|
|
|
using RelevantFrameFinder = std::function<Frame (const Error &)>;
|
2016-03-08 15:03:31 +01:00
|
|
|
RelevantFrameFinder relevantFrameFinder() const;
|
|
|
|
|
void setRelevantFrameFinder(const RelevantFrameFinder &relevantFrameFinder);
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
void addError(const Valgrind::XmlProtocol::Error &error);
|
|
|
|
|
|
|
|
|
|
private:
|
2016-03-08 15:03:31 +01:00
|
|
|
friend class ErrorItem;
|
|
|
|
|
friend class StackItem;
|
|
|
|
|
QVariant errorData(const QModelIndex &index, int role) const;
|
|
|
|
|
Frame findRelevantFrame(const Error &error) const;
|
|
|
|
|
QString errorLocation(const Error &error) const;
|
|
|
|
|
|
|
|
|
|
RelevantFrameFinder m_relevantFrameFinder;
|
2011-03-04 12:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
2011-05-18 17:05:49 +02:00
|
|
|
} // namespace XmlProtocol
|
|
|
|
|
} // namespace Valgrind
|