File indexing completed on 2024-12-01 04:35:28
0001 /* 0002 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company, info@kdab.com 0003 Authors: David Faure <david.faure@kdab.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include <QSignalSpy> 0011 #include <QString> 0012 0013 namespace TestModelHelpers 0014 { 0015 inline QString rowSpyToText(const QSignalSpy &spy) 0016 { 0017 if (!spy.isValid()) { 0018 return QStringLiteral("THE SIGNALSPY IS INVALID!"); 0019 } 0020 QString str; 0021 for (int i = 0; i < spy.count(); ++i) { 0022 str += spy.at(i).at(1).toString() + QLatin1Char(',') + spy.at(i).at(2).toString(); 0023 if (i + 1 < spy.count()) { 0024 str += QLatin1Char(';'); 0025 } 0026 } 0027 return str; 0028 } 0029 }