Commit Graph

16 Commits

Author SHA1 Message Date
Christian Kandeler
1bd3c7d9e5 Wizards: Stop chasing The Current Thing in string construction
Guard against random deprecations by using a robust solution that works
across all Qt versions.

Fixes: QTCREATORBUG-30325
Change-Id: I00428d2454fcd6abffd3a25631946ea5d27cc4ae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-02-16 13:45:41 +00:00
Fabian Kosmale
fa2ea6fd97 QtQuickApplication template: Support more modern API
(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>
2023-01-31 06:38:19 +00:00
Alessandro Portale
4e0b4fcc92 QtQuick Application wizard: Add "QDS style project" option
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>
2023-01-05 13:09:59 +00:00
Artem Sokolovskii
77fed0b0fd QtWizard: Create new project templates for Qt 6.2
Task-number: QTCREATORBUG-26170
Change-Id: Ifbe1055bbed24937929bc846e1f036a1306557b4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-09-13 08:53:49 +00:00
Christian Kandeler
f19baeb9a5 Wizards: Extend translation support
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>
2021-01-25 14:21:33 +00:00
Christian Kandeler
013f2a9d73 Wizards: Prevent deprecation warning in generated QtQuick application
Fixes: QTCREATORBUG-25002
Change-Id: Ic118e98a48913acc2abc841b985685059ef3741a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-27 12:31:16 +00:00
Ulf Hermann
cc9e5c3816 Wizards: Handle errors more elegantly in Qt Quick application template
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>
2019-01-18 09:46:27 +00:00
Alessandro Portale
3f757998b5 Revert "Wizards: Accept asynchronous root components for qqapplication"
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>
2018-02-06 09:50:02 +00:00
Eike Ziller
469edcdde3 Merge remote-tracking branch 'origin/4.5'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: Ic1ab71d0d40fa6c90e337c8ee9d9558e8f103eaa
2017-12-12 10:53:51 +01:00
Alessandro Portale
a53df3892a Qt Quick Application wizards: No AA_EnableHighDpiScaling on Simulator
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>
2017-12-11 10:16:25 +00:00
Eike Ziller
e2baa116ca Merge remote-tracking branch 'origin/4.5'
Change-Id: I86852d289c22210a0439e8e297819dc7276a96de
2017-11-29 09:56:22 +01:00
Alessandro Portale
8c3bd61594 Qt Quick Application wizards: Qt::AA_EnableHighDpiScaling only on WIN
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>
2017-11-28 13:36:29 +00:00
Ulf Hermann
dcb8681cb7 Wizards: Accept asynchronous root components for qtquickapplication
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>
2017-10-06 10:37:55 +00:00
Alessandro Portale
dbf9bd444b Wizards: Refresh the basic Qt Quick Application wizard
It now really creates an empty project.
Also, adapt the QtQuickPrototype template accordingly.

Change-Id: I0749805211df080c88cad1b9c2d476d56836c18a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-08-02 17:00:52 +00:00
Friedemann Kleint
cf807253e4 QML application wizards: Add code to bail out on load errors
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>
2017-05-16 14:04:03 +00:00
Jake Petroules
b0229acd54 Clean up projects wizards and support for Qbs+CMake+qmake to all
Task-number: QTCREATORBUG-17308
Change-Id: I5d320a52f2cc5c0adbaf513985e4be0d75219a7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-10 18:19:57 +00:00