Commit e335fd4c authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

CppEditor: Support qDebug() for OverrideItem in tests

It is used in some comments but doesn't compile...

Change-Id: I5ba3afbe927c3b625218c0c2fee2c9ee6f53f4aa
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent a8f42831
......@@ -84,6 +84,10 @@ public:
OverrideItem() : line(0) {}
OverrideItem(const QString &text, int line = 0) : text(text), line(line) {}
bool isValid() { return line != 0; }
QByteArray toByteArray() const
{
return "OverrideItem(" + text.toLatin1() + ", " + QByteArray::number(line) + ')';
}
QString text;
int line;
......@@ -101,11 +105,14 @@ QT_BEGIN_NAMESPACE
namespace QTest {
template<> char *toString(const OverrideItem &data)
{
QByteArray ba = "OverrideItem(";
ba += data.text.toLatin1() + ", " + QByteArray::number(data.line);
ba += ")";
return qstrdup(ba.data());
return qstrdup(data.toByteArray().data());
}
}
QDebug &operator<<(QDebug &d, const OverrideItem &data)
{
d << data.toByteArray();
return d;
}
QT_END_NAMESPACE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment