fix: CMake include path and QString literals
qt-migration-copilot-demo/pipeline/pr-main There was a failure building this commit

- Add target_include_directories for test target to find MainWindow.h
- Replace u""_s literals with QStringLiteral() for compiler compatibility
- Fixes Jenkins build errors

Entire-Checkpoint: 0e6491fe1b1c
This commit is contained in:
torsten committed 2026-10-22 18:15:25 +02:00
1 parent 7aadf4212e
commit d79dcac3b3
2 files changed
+11 -7

No files matched your search

@@ -66,6 +66,10 @@ add_executable(Qt6MigratedBenchmarkTest
MainWindow.cpp
)
target_include_directories(Qt6MigratedBenchmarkTest PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(Qt6MigratedBenchmarkTest PRIVATE
Qt6::Core
Qt6::Gui
@@ -13,10 +13,10 @@ MainWindow::MainWindow(QWidget* parent)
{
ui->setupUi(this);
setWindowTitle(u"Qt6 Legacy Migration Benchmark"_s);
setWindowTitle(QStringLiteral("Qt6 Legacy Migration Benchmark"));
ui->label->setText(u"Bitte Text wie Test123 eingeben."_s);
ui->iconLabel->setPixmap(QPixmap(u":/icons/app.png"_s).scaled(48, 48));
ui->label->setText(QStringLiteral("Bitte Text wie Test123 eingeben."));
ui->iconLabel->setPixmap(QPixmap(QStringLiteral(":/icons/app.png")).scaled(48, 48));
connect(ui->validateButton, &QPushButton::clicked, this, &MainWindow::onValidateClicked);
connect(ui->screenButton, &QPushButton::clicked, this, &MainWindow::onScreenInfoClicked);
@@ -37,10 +37,10 @@ QString MainWindow::getScreenInfo() const
const QScreen* screen = QApplication::primaryScreen();
if (!screen)
{
return u"Screen: unavailable"_s;
return QStringLiteral("Screen: unavailable");
}
const QRect geometry = screen->geometry();
return u"Screen: %1x%2"_s.arg(geometry.width()).arg(geometry.height());
return QStringLiteral("Screen: %1x%2").arg(geometry.width()).arg(geometry.height());
}
void MainWindow::onValidateClicked()
@@ -49,11 +49,11 @@ void MainWindow::onValidateClicked()
if (validateInput(text))
{
ui->resultLabel->setText(u"Match"_s);
ui->resultLabel->setText(QStringLiteral("Match"));
}
else
{
ui->resultLabel->setText(u"No match"_s);
ui->resultLabel->setText(QStringLiteral("No match"));
}
}