Commit Graph

108 Commits

Author SHA1 Message Date
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
Christian Stenger
d49365e29e QmlPreview: Fix test
Change-Id: Ida6c406fb17e79ffa8d46d61984584681025db7a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-02 14:59:11 +00:00
Eike Ziller
423ea729f8 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportoptions.cpp

Change-Id: I3fd0d0a6a3ff30bb990da3dc0f78e69f9e1247ef
2020-09-23 10:11:44 +02:00
Lukasz Ornatek
0831c07cb3 Make Translation Tests ignore imported files
Change-Id: I4abd222bd15da79a1fe14d01b8a4a1f25d935b3b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-09-17 14:50:08 +00:00
hjk
e62044aa29 Use Qt::SkipEmptyParts unconditionally
Squashes a warning in qmldebugtranslationwidget and is safe to use
with Qt 5.14.

Change-Id: I1912e7379a570a17fbf057b87390a63d524ced49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-14 06:41:46 +00:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Marco Bubke
dc870f538d Prepare merge of qds-1.59 to 4.13
It is not compiling but we are closing this branch anyway.

Change-Id: If96318175d92ae492871d668d5c937c473fd05d5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-13 06:24:10 +00:00
Marco Bubke
208ebd6043 QmlPreview: Fix crash at shutdown
Seem like it get a nullptr project at shutdown.

Change-Id: I76d9f4b2b90b0641d645cb413f9ebfe678bb1c9f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 12:55:26 +00:00
Tim Jenssen
49bce1d9e6 qmlpreview: fix compile
Change-Id: I7c9b82637217e45c6d239413df07cc9d62440603
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-23 17:05:29 +00:00
Tim Jenssen
955f124ffd fix build on older compilers
Change-Id: Id5ccad524c7609eb789d7fa805ace0719a807e65
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-23 11:43:43 +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
bde420f7b7 qmlproject: rename lastUsedLanguage -> currentLocale
removed the connection from plugin to
QmlMultiLanguageAspect::setCurrentLocale
but calling it directly in QmlPreviewPlugin::setLocale

Does not matter which method is called it will change the right
thing only once because it is checking if it already have the
set locale.

Change-Id: I6cb4b115788adc103481dcda45e3214a0cd73401
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-23 09:14:31 +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
b1fc2cdbb4 qmlpreview: fix translation for qml files in subdirectories
Found path was ignored - so the location was wrong
Keeping the kind of ugly in findValidI18nDirectoryAsUrl(const QString &locale)
for now - to not change too much in that area.

Change-Id: I491df1f928868a8d9afbbb7d25c8102bbe9b51a7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-21 15:37:52 +00:00
Tim Jenssen
3659f5b41d qmlpreview: stop previews if the language backend is changed
Change-Id: Iadf0712ea429f3bdb8c4109dfb558466fa2743f2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-21 15:37:31 +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
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02: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
Orgad Shaneh
91103ad66d QmlPreview: Fix MSVC warning
C4065: switch statement contains 'default' but no 'case' labels

This amends commit 6079a317b9

Change-Id: I90dc72702d8b8d4c1dbcb08f78f67c8ddf9f6717
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-09 11:37:44 +00:00
Tim Jenssen
cb9e0c99be qmlpreview: fix cmake builds
Change-Id: I0062d017a207b8641e97c39427e2440c9fac07ed
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-08 08:41:49 +00:00
Tim Jenssen
d5b2a90bc0 qmldesigner: use Core::ICore::dialogParent() instead of mainWindow
According to a change in master from Eike this keeps window stack
order.

Change-Id: If9cb615cfa2fa3cf71f86f10711897418e3cf93b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 14:41:45 +00:00
Henning Gruendl
b851b71128 Fix compilation under linux
Change-Id: I3070876f0549a9fb7c3a52c5bc99638bad2d2894
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-06-03 09:09:38 +00:00
Tim Jenssen
6079a317b9 QmlDesigner: add qmldebugtranslationclient
Change-Id: I4b863a454831f469823e03355d87861eed9be046
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-28 13:18:59 +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
Eike Ziller
35c5c09c38 Remove unused QTC_PLUGIN_REVISION macros
These were used when the plugins were in separate repositories

Change-Id: Iba06bb1e197e96271f6157b70ffb382b016147f1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-04-09 11:26:51 +00:00
hjk
a44bfdd779 Provide an empty default IPlugin::extensionsInitialized()
And remove all empy re-implementations.

Change-Id: I19f0b4e55c042c96693ecb89766f97f0a97b54ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-07 10:21:34 +00:00
Christian Kandeler
d28b66aee3 QmlPreview: Fix memory leak
Change-Id: Ibdd6634308f1f0c15026a4d52c17c0efe92c64e9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Federico Guerinoni <guerinoni@micro-systems.it>
2020-01-23 11:27:39 +00:00
Cristian Adam
08202b9110 CMake Build: rename target qmljs to QmlJS
This is in sync with what qmake and qbs project have.

Change-Id: Id82bbd933a8331c3e2032e5068323c183b2a1814
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-16 17:32:24 +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
Tim Jenssen
50a350f0a3 QmlProject: move/rename MainQmlFileAspect to QmlMainFileAspect
Will be used later in LocalQmlPreviewSupport so add also
export and dependencies in the build system files.

Change-Id: Ie5d26e7b89342c3ae3ff682a73194f240b71c21a
Reviewed-by: hjk <hjk@qt.io>
2020-01-08 09:55:29 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
Eike Ziller
34e8f58c47 Fix lupdate issues
Change-Id: Ib0cbb96a1a4857db5724f9d1e316b97bf2827dbd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-04 14:06:09 +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
ae11f30b20 ProjectExplorer: Proliferate FilePath
DeployableFile and fallout.

Change-Id: I9a9c56e4a4ebf8f68df70d65da2e699efedfe907
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 05:42:13 +00:00
hjk
3844f59806 ProjectExplorer: Standardize RunWorker creation logic
This unifies the remaining paths of RunWorker creation to always
use RunWorkerFactories in the plugin pimpls.

There were, and are, still effectively three basic kinds of workers:
 - "toplevel" tools corresponding to the run modes, that are often all
    that's used for local runs and directly started via the fat buttons
    or e.g. entries in the analyze menu, with factories already previously
    located in the plugin pimpls
 -  core "tool helpers", providing tool specific functionality typically
    used in conjunction with a remote device specific run mechanism,
    set up via RunControl::registerWorkerCreator
 -  target/device specific runhelper like port gatherers contructed e.g.
    via *Device::workerCreator(Core::Id id)

Worse, these categories are partially overlapping, so it was not
clear how a "clean" setup would look like, instead some ad-hoc cobbling
"to make it work" happened.

In some cases, the runMode id was used throughout the whole ensemble
of run workers for a given run, and which worker exactly was created
depended on which of the mechanism above was used in which order.

With the new central setup, the top-level runmodes remain, but the
second kind gets new ids, so the implicit dependencies on order
of setup mechanism are avoided.

This also helps in the cases where there was previously unclarity of where
and how to set up worker factories: It's always and only the plugin
pimpl now.

Change-Id: Icd9a08e2d53e19abe8b21fe546f469fae353a69f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-27 07:54:45 +00:00
hjk
847108d4f4 QmlPreview: Pimpl plugin
This is closer in structure and timing to what others do.

Properties are left in the plugin itself in case someone uses them.

Change-Id: Ic43aea1da7e3bc56e9678144f37f5ad40ce1b20f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-15 08:19:27 +00:00
hjk
f9c221eb54 ProjectExplorer: Re-work setup runworker factories
This combines two of the previous three paths to create run workers,
and refers to RunConfigurations by id, not by type where possible
to decrease coupling between the classes.

Only allow "type of run configuration" and "type of device"
as the only possible kind of restriction and require a uniform
RunWorker constructor signature.

Adapt user code to fit that pattern.

Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-08-09 12:34:42 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Eike Ziller
e0b0a08e50 ExtensionSystem: Move away from QList
Qt 6 API will move away from it.
Use QVector for API and some std container for internal things.

Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 14:21:00 +00:00
Eike Ziller
6fb9bf453f CMake build: Add ability to disable building of individual plugins
Adds a cache entry "BUILD_PLUGIN_${NAME}", defaulting to ON which
can be set to OFF to disable building of a plugin.

Adds a extend_qtc_plugin function that should be used to add
properties to a plugin after add_qtc_plugin, instead of the
standard CMake functions target_... . The new function results
in a no-op if the plugin was disabled.

Change-Id: I57f6799620aea0aaa8b56acead4815ccced95911
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-23 11:13:21 +00:00
Cristian Adam
d855b84c5d Qt Creator CMake port
Based on Tobias Hunger's work from a few months ago.

The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.

Auto tests are run with "ctest". At the moment the pass rate is 87%.

Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 13:33:28 +00:00
hjk
a5148b5363 ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNode
For consistency, it's straight forwards access, similar to
currentProject, not much to search and find.

Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 17:10:39 +00:00