(Re)add a way to select the minimum supported Qt version. If it is >=
6.4, connect to QQmlApplicationEngine::objectCreationFailed instead of
objectCreated, getting rid of the status check.
Moreover, if we have Qt >= 6.4, also use qt_standard_project_setup
instead of manually enabling AUTOMOC. That is available since 6.3, but
no need to clutter the version selection list with too many entries.
If only 6.5 or higher is required, put the QML files under
AUTO_RESOURCE_PREFIX, and use loadFromModule instead of load.
Unconditionally rename main.qml to Main.qml, which is necessary for
loadFromModule to work, and making this conditional on the used Qt
version is more trouble than it is worth.
For qbs, we do not yet put the files under the auto resource prefix, so
do not use loadFromModule there.
Fixes: QTBUG-47996
Change-Id: Ib8ca375c2316b58eecf54009d36fc9f7dac7c1f4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This adds a checkbox labeled "Design Studio style project" to the
Wizard. With that selected, the project is generated via the "General /
Empty" templates of QDS with Qt 6.2 as target Qt version, 1920x1080 form
size, the "Material" QtQuick.Controls style ("Light" Theme) and CMake
project format.
At the same time, the preexisting QtQuick Application wizard in Qt
Creator now also focusses on Qt 6.2 and CMake. TS file generation is
removed for now, can be added later, but then using the i18n setup
feature of QQmlApplicationEngine (instead of a QTranslator in main.cpp).
The wizard now focusses on the QML CMake API. In order to filter the
kits accordingly, the flag "QtSupport.Wizards.FeatureQtQmlCMakeApi" was
added.
Task-number: QTCREATORBUG-28436
Change-Id: I80bc5585f31ec82c64f845701c768f8a07e000da
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Don't just create the ts file, but also make sure it is embedded in the
application (if supported by the build system) and make the application
load it if it matches the current locale.
Task-number: QTCREATORBUG-25079
Change-Id: Ie3a0b1975531b12acb008e8c1312dab97f158751
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
By monitoring the objectCreated() signal of QQmlApplicationEngine we can
also catch errors if the components are instantiated asynchronously.
Task-number: QTBUG-39469
Change-Id: I796eb5561fc8d48ab5aa74d37b0964b118a1ba7e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This reverts commit dcb8681cb7.
The effort to handle asynchronous loading is not required for the
qmllivepreview (for which it had been introduced).
Task-number: QTCREATORBUG-19648
Change-Id: I20cbd318dedb3da43d4993c0c0a1910ffe6d5761
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Avoid setting Qt::AA_EnableHighDpiScaling when running in the simulator.
Simulator detection is done by testing whether environment variable
QTGLESSTREAM_DISPLAY is set.
This amends 8c3bd61594 where all platforms
except Windows were excluded from setting the flag.
Task-number: QTBUG-64815
Change-Id: I8ab7ba9f24217915dc1d01e1f2eb5c37923c5504
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Setting Qt::AA_EnableHighDpiScaling causes a few graphics backends to
malfunction. This patch reduced the setting of the flag to happen only
on Windows (it is automatically set on macOS with retina).
Task-number: QTBUG-64815
Change-Id: I08fa5d1bd2c93e7a39c23487b684bd3f7b358783
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
There are a number of reasons why the root component of a QtQuick
application may be loaded asynchronously. It might, for example, be
derived from a component loaded over the network.
In that case, checking that there is a root object right after calling
load() is misleading. The object is only created later. Therefore, we
need to listen for the objectCreated signal to decide if the root
component was correctly created.
As calling qApp->exit(-1) does nothing while the event loop isn't
running, we always connect the check with Qt::QueuedConnection.
Change-Id: Ie2814894b79bb3e467c5a838c7ec419291fcf591
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
It now really creates an empty project.
Also, adapt the QtQuickPrototype template accordingly.
Change-Id: I0749805211df080c88cad1b9c2d476d56836c18a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
When something goes wrong with deployment or there is a syntax
error in the QML files, the old code would enter the main
loop not showing any windows. Worse, the binary is then locked
on Windows and cannot be overwritten. Add a clause checking
whether there are any root objects and bail out on failure.
Task-number: QTBUG-60764
Change-Id: I3620a09ec4331dc04a5194dfd2ece2ff44bdc429
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>