Commit Graph

966 Commits

Author SHA1 Message Date
Tim Jenssen
165ccb828d qmlpreview: fix calling right localeIsoCode method
Also add some QTC_CHECK to get at least some warning
in case the functions are renamed in future.

Change-Id: Ie4e78855152e9946950603c95fa881755e850c62
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-10-14 12:15:41 +00:00
hjk
2cabd2ceb5 Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
  instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
  avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
  .startNewRow().addItems({...}
- rename startNewRow() to finishRow()

Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 10:32:26 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
hjk
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
David Schulz
339db00f85 Core: replace QString with Utils::FilePath to get documents
Change-Id: I01777c227398be8bd3bf877c5429b84a75aa361b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-04 10:14:14 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
Thomas Hartmann
02c9f0384c QmlProject: Fix crash
Change-Id: I6b83b6c05b1c94f62c868329ea118d638d9928b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-08-20 12:12:46 +00:00
hjk
51e7bce109 ProjectExplorer: Rename Base*Aspect to *Aspect
In most cases they are used directly, so there's not much Base* in that.

Added the old name as alias as porting help for a while.

Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 07:35:43 +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
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
b45b771581 qmlproject: add convenience method to QmlMultiLanguageAspect
Change-Id: I88799aa1c5caa5c967b7c680ef9ddcbdd4b01bf5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-21 15:37:41 +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
d628a7c6cd qmlproject: remove unnecessary separator
results in two separators which looks wrong

Change-Id: Ie715e1b504303a9ab819ede08b1e69095c5d870d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-20 16:56:21 +00:00
Tim Jenssen
f323a80d57 qmlproject: no need to use raw pointer here
Change-Id: Idbd97a7ab4a78d3e56b3f444b7b48111d7823dd6
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-20 16:56:13 +00:00
Tim Jenssen
2fc89375c6 qmlproject: act on disabling multiLanguageAspect
Change-Id: I2f13090f8708a5cb46bf21fb0e855d8ca9d906e7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-20 16:56:04 +00:00
Marco Bubke
5b63599473 QmlDesigner: Bump up database version to 2
Change-Id: I4b4c4c46c3bd17d2b4f4f80b8fb97f5716261f77
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-17 12:24:33 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +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
Christian Stenger
788926d624 QmlProjectManager: Replace QRegExp by QRegularExpression
While at it modernize a bit.

Task-number: QTCREATORBUG-24098
Change-Id: I5787466333e40e6e9bd3d9c77dc6267fffb970f8
Reviewed-by: hjk <hjk@qt.io>
2020-06-19 12:28:48 +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
hjk
beee392dd8 ProjectExplorer: Consolidate RunConfigurationFactory::ids
It was already only one id string with two names. Since it is not
an id for the factory but the id of the created run configuration,
settle of  runConfigurationId() as accessor.

The factory and id fields in RunConfigurationCreationInfo were
redundant. factory always implies (runconfiguration)id (but not
necessarily the other way round, in theory different factories
are possible for the same runconfiguration type for different
devices). So drop the id field here.

In one case now factory pointers instead of ids are compared, but
this is neutral there as this happens in a context of a fixed Target,
device and project are fixed there, so id and factory are equally
unique.

Change-Id: I859aa91486a2dd4abfc7369540a3322d6ec6260d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-15 12:13:38 +00:00
Vikas Pachdha
07cbc49d33 Allow blocking auto files refresh
While importing assets, qml files are generated under the import
path and this triggers files update every time a file is added.
This results into high CPU usage.

Task-number: QDS-1675
Change-Id: Ia0775ef78bbffedfaf2c140365ee31718e7ee3a4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-03-03 12:50:17 +00:00
Alessandro Portale
33904afa73 QmlProjectManager: Fix setting of QmlProjectItem.qtForMCUs
Change-Id: I0f98d21b7d343685f6e696526486ef17dc7b632e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-02-28 16:03:21 +00:00
Thomas Hartmann
c74a3042d4 QmlProject: Add qtForMCU flag
Change-Id: Ia473fd257414f5edddc0ffcce8c913897d75f351
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-21 14:02:23 +00:00
hjk
f4769d7931 QmlProjectManager: De-export QmlProjectRunConfiguration
Change-Id: I728c4f40f9cc4b559e18fcef10289eddcd5e87bf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-02-11 12:39:15 +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
Igor Sidorov
a9e40ad14c Add final specifies to classes
Warning -Wfinal-dtor-non-final-class in clang trunk

Change-Id: I2bf17064bf8898eab10b82b69583a283157766d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-05 09:33:55 +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
Christian Stenger
a0330b6899 QmlProjectManager: Fix compile with namespaced Qt
Amends 50a350f0a3.

Change-Id: I65dd23cf98c4822a0e7dc6a75413415648cff2e2
Reviewed-by: hjk <hjk@qt.io>
2020-01-08 16:55:49 +00:00
Christian Kandeler
c893fdffb6 QmlProjectManager: Fix qbs build
Change-Id: Id458a2abac161b4cfdfff599167487f772841baf
Reviewed-by: hjk <hjk@qt.io>
2020-01-08 13:37:45 +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
Eike Ziller
267946d100 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/boot2qt/qdbrunconfiguration.cpp
	src/plugins/boot2qt/qdbrunconfiguration.h
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
	src/plugins/qnx/qnxrunconfiguration.cpp
	src/plugins/remotelinux/remotelinuxrunconfiguration.h

Change-Id: I17c8e1bf300bb75d7317ccf7749dd3cc07709c21
2019-12-16 16:19:44 +01:00
Tim Jenssen
f265257d55 QmlProject: use qobject_cast instead of static_cast
Change-Id: I0a75c18eec64404b8689ad27ad35a8d65d69711f
Reviewed-by: hjk <hjk@qt.io>
2019-12-16 09:08:03 +00:00
Orgad Shaneh
49f6b0146a Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportrunconfiguration.cpp
	src/plugins/python/pythonproject.cpp
	src/plugins/qmakeprojectmanager/qmakestep.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
2019-12-07 18:39:54 +02:00
Thomas Hartmann
88103453f2 QmlDesigner: Add option forceFreeType to qmlproject
This option enforces the usage of FreeType even on Windows
for the form editor and live preview.
This can be useful when developing for Linux devices.

The option can be eanbled by adding
'forceFreeType: true'
to the .qmlproject file.

Task-number: QDS-1143
Change-Id: I7e749e95584e23202536596ee4f7cdaa09d3a371
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-12-06 10:05:46 +00:00
hjk
d79c76eb11 ProjectExplorer: Make enabled state updating part of runconfig updates
RunConfiguration::update() is becoming a central place acting on
requests to act on interesting changes, triggering notifications
to "the outside" from there is natural.

Change-Id: I159cb548c159a607e2628a178362987fb37b59e3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-04 09:43:51 +00:00
hjk
738bbf1a87 ProjectExplorer: Introduce per-buildsystem setRootProjectNode
Currently diverting to the original Project::setRootProjectNode.
Idea is to focus on the BuildSystem <-> generated tree relation.

Change-Id: I8b20173e364713f0919cf4f8b76a2f79ef8770bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-21 07:40:22 +00:00
hjk
76a85d9af4 QmlProject: Clean up RunConfiguration
Change-Id: I635b86c53ca72e82a52cf0002b9269ee15e1958e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-21 07:38:56 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Christian Kandeler
efa9832912 LayoutBuilder: Allow for more compact code at calling sites
Change-Id: I12bb6dbfc138e03138b9a74d36e864d8ea36092f
Reviewed-by: hjk <hjk@qt.io>
2019-11-07 11:53:37 +00:00
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
hjk
66c7d75dbd Qbs, Qmake, Python, Generic: Introduce BuildSystem derived classes
... and move context menu action handling there.

This is a temporary measure to be able to move that functionality
alongside the actual BuildSystem to the BuildConfiguration.

There is a lot to be cleaned up left, to keep the patch small.

Change-Id: If4b0820a13b376fc97b70785052924972ce22705
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-25 07:55:10 +00:00
hjk
6eaf239777 ProjectExplorer: Prepare more flexibility to aspect layouting
This hides the explicit use of a QFormLayout from the aspect
interface in a new LayoutBuilder class. That currently works
only on a QFormLayout in the back, but opens the possibility
to use e.g. a QGridLayout as use on the Kits and some option
pages.

The aspects now only announce sub-widgets they like to add,
actuall positioning is does by a new LayoutBuilder class,
also cramming several widgets in an hbox in the right column
of the QFormLayout is done there.

Change-Id: I2b788192c465f2ab82261849d34e514697c5a491
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-18 12:24:39 +00:00
Cristian Adam
f88ad0e9d0 CMake Build: Allow building with Qt5 and Qt6
Emulate Qt5's functions/targets with Qt6 equivalents.

Change-Id: I6bfc5c8a649f0ddc5f1117bc5b2d0f41cb72c821
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-09-24 16:05:23 +00:00
Tobias Hunger
81c71fb261 QmlProjectManager: A bit of polish
Use QVector over QList, add some qAsConst, use ranged based for,
use algorithmns, do not repeatedly search an unsorted QStringList.

Change-Id: I1a97338f0cb0d26d2cc1c4b2802bbb1540b932bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-08-28 07:44:48 +00:00
Tobias Hunger
550c51c75e QmlProject: Ignore generated files
Do not bother to look at generated files. Currently this makes no
big difference, considering that there usually are no generated files
in QmlProjects. That might change in the future with asset
conditioning though.

Change-Id: Ia773f09343efe5ebb006c69e4f41d724bba42d86
Reviewed-by: hjk <hjk@qt.io>
2019-08-22 10:34:48 +00:00
hjk
583cf69391 QtSupport: Move qmlsceneCommand down to BaseQtVersion
This had already accessors to all kind of commands, having also
qmlsceneCommand there makes it more consistent and lets us un-export
DesktopQtVersion.

Change-Id: I3ba5a840125b2b1197abb1564b7906571230f2c4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-20 10:37:40 +00:00
Tobias Hunger
d272a64eab Project: Remove Project::document() method
The document is used to do file watching, which may or may not be
ideal. So make sure we do not leak the information how we watch
files into the API and its users.

The method is not used sensibly anywhere in creator, so it seems
safe to remove it entirely.

Change-Id: Ieed755bd5c852875378e4e96665dc906499975b0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-19 14:27:06 +00:00
Tobias Hunger
5a61197b94 QmlProject: Simplify code based on Project::projectFileIsDirty signal
Change-Id: I7dfce020d1091044568f5131e5026e0b819b86b9
Reviewed-by: hjk <hjk@qt.io>
2019-08-16 12:45:47 +00:00