Added line-break to test names

This commit is contained in:
Michael Mandl 2019-02-05 22:16:30 +01:00
parent 57fe4256e2
commit 1f5c0de80a

View file

@ -1,5 +1,7 @@
#include "PrintableModel.h" #include "PrintableModel.h"
#include <regex>
PrintableModel::PrintableModel(QObject *parent) PrintableModel::PrintableModel(QObject *parent)
: CheckableTestModel(parent) : CheckableTestModel(parent)
{ {
@ -134,7 +136,10 @@ void PrintableModel::printTests(QPainter &painter) const
double y = 0; double y = 0;
for (const auto &test : m_tests) for (const auto &test : m_tests)
{ {
drawTextSquare(painter, {0, y, headerWidth, 2 * rowHeight}, test.name()); QString testName = QString::fromStdString(
std::regex_replace(test.name().toStdString(), std::regex("\\s"), "\n"));
drawTextSquare(painter, {0, y, headerWidth, 2 * rowHeight}, testName);
x = headerWidth; x = headerWidth;
for (const auto &item : test.items()) for (const auto &item : test.items())