Commit Graph

19 Commits

Author SHA1 Message Date
Jarek Kobus
6b588d7227 Remove unused variables
Mark some of them with Q_UNUSED, since it looks like
sometimes the copy is done on purpose, to force detach
or used for some hack with memory management.
In one case make unused variable used again.

Change-Id: I3825cd3399fa63bf6e12173c64509287d4a125e5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-20 13:58:46 +00:00
Tim Jenssen
9dda8af0b0 qmlprieview: fix that init language is the chosen one
* removes language feature from preview service
* it is handled by an extra DebugTranslationService until now
* Qt versions without that extra service can not preview
  languages anymore
* Introduce the use of QmlPreviewRunnerSetting. It makes it
  easier to add more properties in the future
* Language needs an extra handling because it needs
  the loadUrl to find existing languages. So we save
  the language to a m_scheduledInitLanguage and emit
  this after the loadFile call happend.

Change-Id: I7f4aec97f7b61d6b290f225282169da594eb9160
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-10-07 14:55:17 +00:00
Tim Jenssen
1f702edfd3 qmlpreview: add debugtranslation ui
action in the menu will only be shown if a QtStudio Qt is found
qtversion.xml
   <value type="QString" key="overrideFeatures">QtStudio</value>

 - still have some issues with multiple file test runs
   so disable it for now
 - elideWarning is not tested

Change-Id: I68c9f774a980b84cd4eea1595775fd01afa6f3cf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-23 09:42:46 +00:00
Tim Jenssen
ce926844d0 qmlpreview: fix init locale issue
The init language was never found, because the
findValidI18nDirectoryAsUrl() uses the m_lastLoadedUrl
to find the translation file path.

Change-Id: I6e9b62f3d846795d68ddef5e3a4caf3e3d953c7c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-21 15:38:04 +00:00
Tim Jenssen
69b0a42ac1 qmlpreview: remove unnecessary include
Change-Id: Ia2ffd868bcb1cb1b09aafa1f63132308bf829062
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-20 16:58:20 +00:00
Tim Jenssen
cb13e84656 qmlpreview: remove redundant set QT_MULTILANGUAGE_DATABASE
already done in the environment modifier method at
qmlprojectrunconfiguration.cpp

Change-Id: Ibd1e2ffb94bec23e709d9155b032bb358b7f4a0c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-20 16:56:31 +00:00
Tim Jenssen
52316578f8 qml: introduce QmlMultiLanguageAspect
This aspect is only available if the special multilanguage
plugin is available.
Translation changes in that plugin changes this aspect,
which results in environment variables which activate the use
of a multilanguage created sqlite to provide the translations.

Change-Id: I38250b69165eb7ec3e4f82dc34b3cc4ba0a33f8f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-18 13:02:37 +00:00
Tim Jenssen
5b00401850 Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: If4869664ad4cbb5ec56e7c306f47d0bf0f1f075c
2020-05-27 19:02:07 +02:00
Tim Jenssen
f0bcc1e96a qmlpreview: add QT_MULTILANGUAGE_DATABASE feature
Change-Id: If6d1d95eb994eea5fe801a3aa5e7343f7764b2a0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:13:04 +02:00
Ulf Hermann
20c387f636 QmlPreview: Don't use MainFileAspect if it doesn't exist
We only need to choose the main file if we're dealing with a qmlproject.

Fixes: QTCREATORBUG-24056
Change-Id: I5b5dfa29a46fa07de7ee570fa033d978e72dfdb5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-05-22 09:28:29 +00:00
Tim Jenssen
fb171ebc5b QmlDesigner: use current file to start preview
- Maybe we need a check if it is a qml file.

Task-number: QDS-1299
Change-Id: I2b54514f311fb78d3508e588783c0d04c7a7bc0b
Reviewed-by: hjk <hjk@qt.io>
2020-01-13 15:48:47 +00:00
Eike Ziller
8df0653bf8 Merge remote-tracking branch 'origin/4.10'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/projectexplorer/gcctoolchain.cpp
	src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp

Change-Id: Iffdf48e782a734107ea170ebb3812e997cea0e7b
2019-09-12 09:08:04 +02:00
Orgad Shaneh
2aca0c1b28 Fix MSVC warnings
* Missing `this` captures
* Implicit size_t -> int conversion
* Unused argument
* Suppress warnings in clang headers

Change-Id: I7083ce6ab22ee22ecc1258539e77c790acc78df1
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 15:20:34 +00:00
hjk
4028a41d2e ProjectExplorer: Use std::function for SimpleTargetRunner::start()
This spares us the typical r = runnable(); modify(r); setRunnable(r)
roundtrip and the m_runnable storage that might or might not
be the same as runControl->runnable. Similar for m_device.

Change-Id: I8300260dd8dd7cd395e40bcd3d2ae45089085008
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-04 11:08:34 +00:00
hjk
d3cf7cd553 QmlPreview: Fix endless recursion
Amends 3844f59806.

Change-Id: I953f7e8af7ada9eac4cafd1e3bba8bbcac99cf08
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-03 11:38:14 +00:00
hjk
fbc043c96d QmlPreview: Simplify QmlPreviewRunner
Change-Id: Icdbc65ec39dd63d59f5bc96b21649a9d488be920
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-18 12:47:27 +00:00
hjk
60f18b6170 Limit scope of uses of RunControl::runConfiguration()
Change-Id: Iccd9c0ce869060367db606b3c338bf21b2299548
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-03-18 09:43:46 +00:00
hjk
9ef0b97716 Avoid some visible uses of RunControl::runConfiguration()
For a long time, probably from the very beginning, a RunControl
was meant to hold (a copy of) data needed for its operation, that was
valid at the time of its construction, to be resilient in cases
where RunConfiguration setting were changed while the RunControl
was running, or to properly re-run with the original settings.

Unfortunately, the task was repetitive, as RunConfiguration
classes had no generic access to properties / "aspects"
and there was was the runConfiguration() accessor (probably
for mostly unrelated reasons in the output pane handling) which
made the idea of just casting that to the original runConfiguration
and access the data directly there appealing, with all the
expected consequences.

This patch here partially addresses the issue by copying some
more of the related data at RunControl construction time and
adjust the using code, avoiding most uses of the runConfiguration()
accessor in a mostly mechanical matter.

Complete removal appears possible, but will be less mechanical
in "difficult" plugins like ios, so this is left for later.

The new accessors in RunControl are very much ad-hoc, leaving
room for improvement, e.g. by consolidating the access to the
run config settings aspects with the other runconfig aspects
or similar. For now the goal is to remove the runConfiguration()
accessor, and to as much as possible fixed data after RunControl
setup is finished.

Next step would be to officially allow construction of RunControls
without a specific RunConfiguration by setting the necessary
data independently, removing the need for the various workarounds
that are currently used for the purpose of faking (parts of) the
effect of the non-existing RunConfiguration or refusing to operate
at all, even if it would be possible.

Change-Id: If8e5596da8422c70e90f97270389adbe6d0b46f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 12:27:35 +00:00
Ulf Hermann
c7f22213ee Import QML preview plugin into Qt Creator
... and relicense it as GPL or Commercial.

Fixes: QTCREATORBUG-21838
Change-Id: I28d58ee963e1c63aa4a8bbe4525faade7201c353
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-17 11:12:47 +00:00