diff --git a/src/app/mainapplication.cpp b/src/app/mainapplication.cpp
index cd73bf28927c3f6001fb860b87b910833e98e5e0..64a2bd81acdc88458203383aed124712801d3289 100644
--- a/src/app/mainapplication.cpp
+++ b/src/app/mainapplication.cpp
@@ -425,7 +425,8 @@ MainApplication::initQmlLayer()
                          &screenInfo_,
                          this);
 
-    QUrl url;
+    QUrl url = u"qrc:/MainApplicationWindow.qml"_qs;
+#ifdef QT_DEBUG
     if (parser_.isSet("test")) {
         // List the QML files in the project source tree.
         const auto targetTestComponent = findResource(parser_.value("test"));
@@ -439,9 +440,8 @@ MainApplication::initQmlLayer()
         engine_->rootContext()->setContextProperty("testWidth", testWidth);
         engine_->rootContext()->setContextProperty("testHeight", testHeight);
         url = u"qrc:/ComponentTestWindow.qml"_qs;
-    } else {
-        url = u"qrc:/MainApplicationWindow.qml"_qs;
     }
+#endif
     QObject::connect(
         engine_.get(),
         &QQmlApplicationEngine::objectCreationFailed,