// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include #include #include #include #include #include #include #include class ModelDemo : public QObject { Q_OBJECT public: explicit ModelDemo(QObject *parent = 0) : QObject(parent) {} Valgrind::XmlProtocol::StackModel* stackModel; public Q_SLOTS: void selectionChanged(const QItemSelection &sel, const QItemSelection &) { if (sel.indexes().isEmpty()) return; const QModelIndex idx = sel.indexes().first(); const Valgrind::XmlProtocol::Error err = idx.data(Valgrind::XmlProtocol::ErrorListModel::ErrorRole).value(); qDebug() << idx.row() << err.what(); stackModel->setError(err); } };