From 1f5c0de80a6567260eb61805bf7b7e1f6ae0e113 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 5 Feb 2019 22:16:30 +0100 Subject: [PATCH] Added line-break to test names --- source/PrintableModel/PrintableModel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/PrintableModel/PrintableModel.cpp b/source/PrintableModel/PrintableModel.cpp index 97b3fd8..baabe85 100644 --- a/source/PrintableModel/PrintableModel.cpp +++ b/source/PrintableModel/PrintableModel.cpp @@ -1,5 +1,7 @@ #include "PrintableModel.h" +#include + PrintableModel::PrintableModel(QObject *parent) : CheckableTestModel(parent) { @@ -134,7 +136,10 @@ void PrintableModel::printTests(QPainter &painter) const double y = 0; 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; for (const auto &item : test.items())