Commit Graph

204 Commits

Author SHA1 Message Date
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
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
hjk
596a54f645 RemoteLinux: Move EmbeddeLinuxQtVersion to QtSupport
The class uses only one ID from RL at compile time, and after the
move RL does not hard-depend on QtSupport anymore.

Change-Id: I9f8aa6782e45fe998d83ddcc5323c396964bf1fe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-16 06:10:43 +00:00
hjk
fcffb5f2fc Utils/all: Create an OutputFormatterFactory
Essentially following the scheme used for the various project
configurations. This makes it possible to construct OutputFormatters
by Id only, potentially reducing hard plugin dependencies and
opening the road to have several output formatters per
RunConfiguration/Outputpane/...

Change-Id: I4b5fb6fb6be8b0d9a0859f178bb0effc3398b09e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-13 13:07:06 +00:00
hjk
7ebe005206 ProjectExplorer: Replace RunConfiguration::executable
... by a RunConfiguration::commandLine().

That's what is typically consumed, and removes the need for some
custom runnable() implementations.

Change-Id: I7700b12cdd0965802a0add977b432314734a5a72
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-12 12:30:23 +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
Christian Kandeler
a9d2e14dca ProjectExplorer: Add executable() accessor to RunConfiguration
Amends f6c276daf0, which was a quick fix for 4.9.

Change-Id: I94281af6a9a0d0bfe197ce836488f708d5bd677d
Reviewed-by: hjk <hjk@qt.io>
2019-05-24 09:12:42 +00:00
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
Christian Stenger
ff500cbec7 QmlProjectManager: Fix using history completer
Avoid a soft assert and allow using the history completer when
specifying the QmlScene or qmlviewer.

Change-Id: Ibf1ff7f07b9280d211902f6510505fff2bc63abf
Reviewed-by: hjk <hjk@qt.io>
2019-05-06 07:41:28 +00:00
Thomas Hartmann
f8202239d6 QmlProject: Implement basic support for QmlFileSelector
This patch adds support for QmlFileSelector for
QmlProject and Qt Quick Designer.

Task-number: QDS-590
Change-Id: I0cc043d3ec9578008ec879b36fe834b70fb8c5ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-04-25 13:55:29 +00:00
hjk
d34eb692fe QmlProject: Do not crash on project creation
Task-number: QTCREATORBUG-22244
Change-Id: I38c6527269ba553c0e4734c437f5a6918da729a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Aleksei German <aleksei.german@qt.io>
2019-04-05 15:10:44 +00:00
hjk
1bc10248c0 ProjectExplorer: Introduce a SimpleRunWorkerFactory template
... and use in as replacement for RunConfiguration::addRunWorkerFactory.

It is still convenient to have a simple way to set up run worker
factories for the typical "just run for this configuration" case,
but it's even better if it follows the nowadays predominant pattern
of keeping factories in the plugin's pimpl.

Also, it turned out there were two copies of
QmlProjectRunconfigurationFactory code, one is enough.

Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-19 15:56:17 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00
hjk
6faaea8d0c ProjectExplorer: Split EnvironmentAspect
... at least logically a bit more into hunks responsible for
one of the possible choices of base environments.

This makes it possible to move code that modifies individual
cases closer to the only place that uses it.

Change-Id: I1c87bb869e04e44b92ff097b0bf25274f93808be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-11 12:40:51 +00:00
hjk
ac1b0facc0 ProjectExplorer: De-virtualize EnvironmentAspect::baseEnvironment
Will help to streamline *EnvironmentAspect constructor signature,
which in turn will help to have a generic cloning mechanism to
clone aspect data, which in turn will help to finally execute on
the idea that RunControls should be re-runnable in their original
setup and also resilient to changes in the setup while they are
running.

Change-Id: Ibdaca487c1f7ce043e675fd014fe923a70273639
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-07 16:06:46 +00:00
hjk
014789d994 QmlProjectManager: Fix QmlProjectRunConfiguration::updateEnabledState
Amends 8536504caa.

Change-Id: I20d26dd326dc50609f25de1f04f99a5f1ec186a6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-04 13:12:02 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Alessandro Portale
adea8467f4 Fix warning: "Don't call QHash::operator[]() on temporary"
[-Wclazy-detaching-temporary]

Change-Id: Ide503c9260af285fa1dbedb63f7819c8ad616db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-17 10:04:11 +00:00
Alessandro Portale
0bff017616 QmlProjectManager: Modernize
modernize-*

Change-Id: Ic47c32c3fbf96d36f0d64e331eccc8c8e8aef6d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-30 16:51:15 +00:00
Robert Loehning
8e54095d07 QmlProject: Capitalize consistently
Change-Id: I61c5db4008adf0dead0421a2d223a9d4d2586966
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-22 09:08:06 +00:00
hjk
f18176d6c0 ProjectExplorer: Remove Run{Control,Configuration}::abi
Unused now, and arguably not a valid concept anymore.
A run control may consist of different runworkers,
'operating' on different systems.

Since the removed RunConfiguration::abi() implementation uses
only public Target ABI, user code could revive that locally
in case it was needed again.

Change-Id: I658c6e88b4a1aec18bf4de91fc86230552bc0710
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-10-16 08:13:38 +00:00
hjk
1c9410e353 ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra'
to them anymore.

Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 08:32:51 +00:00
hjk
d421bc2fe3 ProjectExplorer: Split IRunConfigurationAspect
... into items that can be used generically in project configurations
(ProjectConfigurationAspect) and items that have a choice between
global and project settings (GlobalOrProjectAspect)

Change-Id: I94831237bdbb18c339eb76eba131bf7f928933d6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-18 06:13:21 +00:00
hjk
32ba65c7f8 ProjectExplorer: Remove IRunConfigurationAspect::runConfiguration
... and adapt constructors to not take the now-unneeded
RunConfiguration pointer.

Change-Id: I53ff338f51334ff7b0c22d4bed92bfcfc8225ea7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 12:09:39 +00:00
hjk
f66770cde1 ProjectExplorer: Pass macro expander to ArgumentsAspect::arguments
To remove the last user of IRCAspect::runConfiguration.

Change-Id: I1390166730112008a4050877f96bb29f274e7ef1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-13 07:32:22 +00:00
hjk
679576b511 QmlProject: Pass project to MainQmlFileAspect ctor
This avoids four uses of IRunConfigurationAspect::runConfiguration()
which is meant to be removed soon.

Change-Id: I7a8f0a09b0a90042b0855b18e5be875bd343268c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-12 07:06:21 +00:00
hjk
0d687b7292 QmlProjectManager: Pass target to QmlProjectEnvironmentAspect ctor
This avoids one use of IRunConfigurationAspect::runConfiguration()
which is meant to be removed soon.

Change-Id: Ib394a71b6bb7a6c028fc533656454b94895f6451
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-11 07:45:17 +00:00
hjk
907767b89b QmlProject: Use IRunConfiguration's changed() signal
... instead of directly accessing the owning runconfig.

The removes two uses of IRCAspect::runConfiguration()
which is meant to be removed soon.

Change-Id: Ia713864f2544e3c6741482b2663ee54fd2ee80e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-11 07:12:41 +00:00
hjk
097de6c5d0 QmlProjectManager: Aspect-ify runconfiguration
Split the remaining manually managed data into a standard ArgumentsAspect
and a new MainQmlFileAspect.

Change-Id: I8a8fe3f4a08d602a7b6e9c9463d3d7de257b6e6c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-10 10:18:27 +00:00
Ulf Hermann
2d93a20bb6 QmlProject: Allow different QML viewers per project
Change-Id: I7ca136fe1cf51b8335a15b1b2b7ea838e4859f78
Reviewed-by: hjk <hjk@qt.io>
2018-09-05 07:55:33 +00:00
hjk
4192d7d62f ProjectExplorer: Compactify runconfiguration aspect creation
Change-Id: I12394d3df8deb7666be6ac3f112082f915454e82
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-09-04 12:45:21 +00:00
hjk
0fbb2839f9 Remove ApplicationLauncher::Mode
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-05 15:08:29 +00:00
hjk
397de4ff30 Tie SimpleTargetRunner desktop usages to individual RunConfigurations
This avoids the "catch all" that leads to conflicts with more specific
setups like the AppManagerRunConfig, and consequently lets us remove
the priorities in the RunWorkerFactories.

Change-Id: I382f00ca7f759eef995ac6fe749bb371ab027020
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-31 10:17:23 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
366be94ad9 Pass id to RunConfiguration constructor
It's what the base class requires, and opens the possibility to
have several factories creating the same type of run configuration.

Also move ios, winrt and android factories closer to their products,
it's the predominant pattern nowadays.

Change-Id: Iad48152f02a248d22cb18dd435a2fc34d73c7077
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-25 15:06:11 +00:00
hjk
83c6a4916c ProjectExplorer: Streamline OutputFormatter creation a bit
Note that the concept of a single monolithic OutputFormatter per
RunConfiguration (and why RunConfiguration, not RunControl to start
with?) is unchanged and suboptimal as one cannot easily combine
existing use cases, e.g. Python_and_Qt.

Change-Id: Ibeb8191020387324f22ed313230293597f96e36a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 11:55:31 +00:00
hjk
11336fb604 QmlProject: Move RunConfigurationFactory close to RunConfiguration
No need to have a dozen lines of code in a separate translation
unit and more in line with what others do nowadays.

Change-Id: I765535d1484805bc3005fe23bfd4992a96a80e9c
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 08:49:09 +00:00
hjk
3bce4b9af2 QmlProject: Use new helper function to create run configuration widgets
Change-Id: I471fe60d25bb3d8ca3ebf2d2abe8e725bc7daa56
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-03-27 12:33:51 +00:00
Thomas Hartmann
0474216e2f QmlProject: Fix import paths for code model
This fixes a regression introduced by
30638df441.

Custom import paths have to be absolute for the code model.

Change-Id: I232229fa58c3900fe684ca4529b2ed08bf93e8be
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-02-26 13:31:23 +00:00
Ulf Hermann
30638df441 QmlProject: Resolve import paths relative to target directory
On desktop the target directory is the same as the source directory. On
remote devices, it can be different. We need to resolve when we know
where to deploy.

Change-Id: I3f2bc088476ae73dac5231cb24f277c055f7d044
Task-number: QTCREATORBUG-19888
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-23 13:04:29 +00:00
Ulf Hermann
e44504371c QmlProjectManager: Prepare for running on remote devices
We add a "targetDirectory" property to the file format and fill in the
deployment data.

(cherry picked from commit fba61c5b55)
Change-Id: If207cd5c77175c54cffdb5df92ea85c425cd3191
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-29 09:04:45 +00:00
Ulf Hermann
8964de84d3 Remove qmlsceneCommand() and qmlViewerCommand() from BaseQtVersion
qmlviewer is QtQuick1 and not supported anymore.

The qmlscene command is in general not a property of the Qt version but
of the target device, as we generally assume Qt binaries to be
preinstalled on the target and qmlscene is executed on the target.

DesktopQtVersion retains a method to retrieve the qmlscene path as there
target == host and having the method available enables us to warn if the
binary is missing.

Also, QmlProjectManager needs to pick the qmlscene command from the Qt
version if it's a desktop Qt.

Change-Id: I2ee0f993e60b96d672080db2db0a6abe5ca933e3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-08 09:13:56 +00:00
hjk
915d5cf259 QmlProject: Inline QmlProjectRunConfiguration::qtVersion into caller
Change-Id: I0af467d60ac4eaf55d825dbe0df83108c0f5db36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-01-03 07:33:42 +00:00
hjk
53a151074a ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.

- Collapse the two lines of constructors similar to what
  890c1906e6 did for RunConfigurations
  * Deploy* was purely mechanical
  * Build* ctors are split in connects() in the ctor body
    to create "empty shell for clone" etc
    and build step additions in initialize() functions which
    are only used in the create() case.
  -- Allows to collapse the shared 'ctor()' functions, too.

- Move FooBuildConfigurationFactory::create() implementations
  to FooBuildConfiguration() constructor. That was a strange
  and unneeded ping-pong between factories and objects, and
  furthermore allows one level less of indirection (and for a
  later, left out here, some reduction of the
  FooBuildConfiguration interfaces that were only used to
  accommodate the *Factory::create() functions.

- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
  but there wasn't one in the base classses. Have one there.

- Most canHandle() functions were checking simple restrictions on
  e.g. project or target types, specify those by setters in the
  constructors instead and check them in the base canHandle()

- clone() is generally replaced by a creation of a "shell object"
  and a fromMap(source->toMap()), implemented in the base, there
  are two cases left for Android and Qbs that needed(?) some extra
  polish

- generally use canHandle() in base implementation, instead
  of doing that in all Derived::canFoo()

- as a result, canCreate/create/canClone/clone reimplementations
  are not needed anymore, keep the base implementation for
  now (could be inlined into their only users later), but
  de-virtualize them.

- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
  'dsym' build step they could create.

- Split the 'mangled' id into the ProjectConfiguration subtype
  specific constant identifier, and a QString extraId() bit.
  Only maintain the mangled id in saved settings.

- Make ProjectConfiguration::m_id a constant member, adapt
  all constructors of derived classe.

Not done in this patch:

- Finish possible cosmetic changes on top

- Add a way to specify restrictions to supported Qt versions
  (used in Android/Ios), as the base implementation does not
  depend on the qtsupport plugin

- Combine the QList<X> availableFoo() + createFoo(X) function
  pairs to somthing like a direct
   QList<struct { X; std::function<X()>; }> fooCreators()
  to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
  pingpong

- Remove the *Factories from the global object pool

- Do something about priority(). Falling back to plain
  qmake in android+qmake setup is not helpful.

Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-08 11:17:55 +00:00
Tobias Hunger
18f38ff18e Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-08 09:09:59 +00:00
Ulf Hermann
8c504dc61e QmlProjectManager: Drop support for QtQuick1
Change-Id: Id60c9768d8fad03f588207af07bba676dbfc76fc
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-11-30 15:57:53 +00:00
Orgad Shaneh
d9cb19b229 Merge remote-tracking branch 'origin/4.5'
Change-Id: I60fca091b2eac67259580acba5ae934c16d74a83
2017-11-11 19:54:32 +02:00
hjk
5ca90a4a5e ProjectExplorer: Fix copying of RunConfigurationAspects
Moving aspect data closer to real Value semantics fixes
the regression introduced by 890c1906e.

Task-number: QTCREATORBUG-19186
Task-number: QTCREATORBUG-19192
Change-Id: Ieaeef3995ae06a817f266c1e2514f9e5793bd4e8
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-11-10 15:09:59 +00:00