Commit Graph

88 Commits

Author SHA1 Message Date
Eike Ziller
241efa353d Move Qt Widgets Application wizard to JSON
Adding support for CMake as well as QMake

Task-number: QTCREATORBUG-17308
Change-Id: I615b58921918ec87f935e0f11d3dd23ec20f0ac1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-03-27 09:44:17 +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
fb4d8b5a01 ProjectExplorer: Make kit aspects self-register
Also, construct the KitManager implicitly when the first
KitAspect is created. Ramp-down is still explicit and
somewhat odd.

Change-Id: If1506e1d0789ecabbaad2d8008851d0b42c5218b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-18 14:14:28 +00:00
Christian Kandeler
9686c85a46 Qmake: Improve the build dir location warning
The infamous "build dir is not at the same level at source dir" warning
for qmake projects has gone through a number of iterations in Qt
Creator, having been added, removed and re-added, always to the
criticism of some users. Our new approach is as follows:
    - The warning appears at the widgets where the build directory is
set, both in the target setup page and the build config widget.
    - The warning also appears in the issues pane, but only if the build
failed.
    - The user can disable the warning altogether in a newly introduced
qmake settings page.
    - This option is disabled by default on Unix, because to my
knowledge all failure reports have been for Windows hosts.
This should finally please everybody.

Fixes: QTCREATORBUG-16945
Change-Id: I638be1f15e8c260a5d72047d6850a3a0f685cf03
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-03-06 08:34:36 +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
cd5066d86b QmakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-13 09:25:21 +00:00
Tobias Hunger
05fb67fee7 ProjectExplorer: Use unique_ptr to store KitInformation
Change-Id: I406b6bed005fb7455e6ee41d81a2f314584a051a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-11 08:29:19 +00:00
Eike Ziller
a2fe4087ff Rename files for QmakeMakeStep
Change-Id: Iff0f3f08fff7a5e25ed309891e54d3c02dbb8713
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-18 08:48:15 +00:00
Eike Ziller
2e8d1d00ae Use make step base for qmake projects
There are two differences that get introduced by this change:
- The configuration widget checks that there is a build configuration,
  but not if this build configuration is a QmakeBuildConfiguration. This
  should not matter, since Qmake is still the only supported project
  type for the qmake specific make step
- It removes the automaticallyAddedArguments(). As far as I can see this
  never had any effect anyhow, though. They were never actually added to
  the arguments.

Change-Id: I73be227a32117e462def38bdd040dbd7cbcc113f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-17 14:19:46 +00:00
Mitch Curtis
a40ea3f1d6 Remove duplicated "Qt Unit Test" wizard
There are currently two types of wizards for creating auto tests:

- Qt Unit Test
- Auto Test Project

Both produce almost identical code in the case of a Qt GUI-based test,
and the descriptions are very similar. This is really confusing.

The Auto Test Project wizard has support for Qt Test, Google Test and
Qt Quick Test. In addition, the documentation only mentions Auto Test
Projects when it discusses the creation of auto tests:

http://doc.qt.io/qtcreator/creator-autotest.html#creating-tests

So let's just use that and make everything simpler.

Change-Id: Ia16c88c462744baa8df3f9e8082cbcad6ad9eb15
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-09 11:33:35 +00:00
hjk
d7348e0ccf QmakeProjectManager: Pimpl and remove uses of global object pool
Change-Id: I801a3b6b880e1113d12ece0cf70a882b9696811f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-21 11:29:58 +00:00
hjk
c136e81422 QmakeProject: Use base project node in two more cases
Change-Id: If7648d0ef549ac7f2fdd6c2d13a82b06d0328232
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-01-03 07:39:34 +00:00
hjk
b2a16190e8 Use project id uniformly as project context
The possibly intented flexibility e.g. to have different project types
share the same idea of a common context was never used, in all cases
we had a 1:1 relation ship between project ids and ids that were used
as context. This led to oversights like the one fixed in 60fb35a2.

This patch here uses the project id unconditionally as context and
drops all context ids. If we'll ever have the situation where the
original flexibility was needed, Project::projectContext() could be
made virtual and overridden were needed.

Also, the context was never modified for any given project, so the
updating machinery is not needed.

Change-Id: I3f7fac0ed5e4704e126558987c48577f26082dfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 12:35:14 +00:00
Tobias Hunger
7c35a38100 Session: Move all functionality related to Nodes into ProjectTree
Do no longer expose Nodes from the SessionManager's API. These are now
exclusively handled by the ProjectTree.

Change-Id: I585c2ac919462073870363436e767640775d9045
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-12 13:44:09 +00:00
Andre Hartmann
6221746466 Qmake: Fix Build File (context) menu for non-source files
Enable Build File for source or header files only and
de-duplicate the corresponding code.

Before, the menus were incorrectly enabled for e.g. .pro
and .ui files also: While the menu was already hidden for
these  non-source files in updateContextActions(), the
following  call to updateBuildFileAction() did enable it
again.

Task-number: QTCREATORBUG-19098
Change-Id: I87f40e64ab044b33be9c465d1c5dfa36c3cf1260
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-10-17 10:25:30 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)

Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.

Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-01 11:24:53 +00:00
Tobias Hunger
09b127f9f1 Project: Move signalling of parsing state into Project
Get rid of duplicated code to do such signaling in derived Project types.

Change-Id: I26914a1d751d72ee65c15a7943e0e7f34978f042
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:21 +00:00
Tobias Hunger
4dc3ef8034 Qmake: Only offer Add Library wizard for qmake projects
Task-number: QTCREATORBUG-18415
Change-Id: Icd8535a6d7d599457c23f92958fa969661076ade
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-20 09:20:50 +00:00
Orgad Shaneh
d3e4ef5868 QMakePM: Fix crash when running qmake before the project is parsed
Disable the build actions properly.

Change-Id: Id4e2906b1891fcb3387e23cb0e0a8c1f119d2426
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-05-29 10:38:16 +00:00
hjk
2ee7967750 ProjectExplorer: Fix enabling state of main project nodes
Since the rootProjectNode() containing the parsed files is now nested
under a new project node the main node needs to delegate enable/disable
decisions.

Task-number: QTCREATORBUG-17922
Change-Id: Ie7bb6d6802072a2127b32c0fe51fb25fc1c9c6cc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-28 07:10:54 +00:00
Orgad Shaneh
423cca3521 Qmake: Fix "Build File" for initial opened file
If a session contains an open file, when Qt Creator loads this session on
startup, Build File is invisible, and doesn't work.

Change-Id: Icbc918a4b74f6293d100c04bae0a070d99ce7196
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-15 10:28:06 +00:00
hjk
c1bfc5d8ec ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 10:41:33 +00:00
David Schulz
f31d9b0b18 ProjectExplorer: Fix global 'Build Subproject' action
Change-Id: I004e87bcf3abab1d5160178a93f5e1bac50f6e86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 13:27:46 +00:00
Tobias Hunger
563b5033f8 Qmake: Fix build/run qmake from context menu again
This got broken when refactoring the project nodes.

Change-Id: Iae4614f4a367cefeba3f70faaf19bc2f8994fb0f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-28 14:24:42 +00:00
Eike Ziller
d64e17ad55 Move mimetype definitions to plugin specs
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
  registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
  handle a mime type if it was enabled

Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 13:54:59 +00:00
hjk
0264053d9b qmake: Avoid passing some context menu data by side channels
... and the need temporarily storing them by creating them when needed.

Change-Id: I930dd34bc7682f3d4fb40bd8da132f52ba32414b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-24 17:02:57 +00:00
hjk
6d723dfa6f ProjectExplorer: Remove arguments from node change signals
This discourages storing the pointers needlessly. The items
are still easy accessible by the static ProjectTree::currentNode()

Change-Id: I3c0cd019e9fdc382afacbc9d9de3b97d5f58ae1e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-24 13:17:46 +00:00
Eike Ziller
55400d5bec Merge remote-tracking branch 'origin/4.2'
Change-Id: I8896af66cf8af7436cf3946ddb013742260d50a9
2017-02-01 14:07:43 +01:00
Tobias Hunger
01c06c4e84 QMake: Disable "Build File" action when opening Qt Creator
Change-Id: I99e7c7eb04a02a49881e1b465b1d1098511bc8eb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 15:28:37 +00:00
Tobias Hunger
895d2eaa2d QMakeProjectManager: Keep more actions visible in the menu
They are disabled if not applicable.

Change-Id: I4ef150c39272c6e8842678b418581ff399068d47
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 15:28:25 +00:00
David Schulz
990cec3371 QmakePM: Fix build sub dir project action
Re-enable the sub dir actions from the 'Build'-menu when a none project
node is selected in the project tree.

Change-Id: I316079336850409f6cd7479310e3b3438060baf8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-14 14:33:18 +00:00
Orgad Shaneh
374c0774e1 QmakePM: Fix Build from context menu on subproject node
Change-Id: I80a840c1003e7ff198b8ce1cba7dec86823fedf0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-22 09:11:24 +00:00
Tobias Hunger
ad003363b7 ProjectExplorer: Rename Node::projectNode to Node::parentProjectNode
Change-Id: I47fa794a0bd8456ae23271934a957d9667d2d7bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-10 15:24:14 +00:00
Tobias Hunger
ce3e586198 ProjectExplorer: Shorten space needed to store a FileType
Use class enum to shorten the FileType to quint16. This frees up a couple
of bytes per FileNode and we can have many of those.

Change-Id: I3a9ae25059690fefa15305a4268269647d6dc1c9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-03 15:55:39 +00:00
Eike Ziller
2cb3beab42 Simplify Qt external editors (Linguist, Designer)
Remove unneeded extra classes, and unneeded parameters.

Change-Id: Ib4ceccd7d92bd8ca5de122e174f2579a2a8a9390
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 08:07:59 +00:00
hjk
1b650190d8 QmakeProjectManager: Add a wizard to import project for editing only
This is Heavily Inspired by the Generic project import wizard.

It basically does what we commonly refer to as "Create a dummy .pro file for
editing stuff in Creator". The result is generally more flexible (project
logic can be added to the .pro) and better supported in Creator (.pro
is first class citizen, the Generic project less so).

The qmake/make build steps are currently generally enabled but are only
expected to work for very simple projects like the typical "one file
example for teaching purposes".

Change-Id: I4976c34d423f256ea9f8f9e569c9783d90f380e3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-05-27 09:27:24 +00:00
Tobias Hunger
26bc22adc5 QMake: Modernize
Change-Id: I05dd2cb4923ad2c72c0c79d24baa2c12677eff06
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-29 14:54:17 +00:00
Tobias Hunger
024f1cf422 Qmake: Do not show "Run qmake" needlessly
Do not show "Run qmake" in the menu right after Qt Creator starts up
with no project loaded.

Change-Id: I371734e902b518b6270ca14887db14c254237ba2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-10 13:30:06 +00:00
Tobias Hunger
cdf6e499c5 Qmake: Modernize code
Change-Id: I4ebedb69ae91843fd096af6f4cf225ec0c76a0b2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-03-10 13:30:02 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
5d7f5a2a32 ProjectNode: Rename path() to filePath()
Change-Id: I78bb73f8c9457fd74c470eacbf54eb9195ac9681
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-03 11:01:50 +00:00
Jarek Kobus
a73ad816a3 QMakeProjectManager: Introduce member initialization.
Change-Id: I69df0c22a215b2df12f63fdc47082e9797fc02ac
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-06-23 21:03:41 +00:00
Jarek Kobus
684267179e Properly delete plugins dependent on failed plugin
Init all class member pointers to NULL.
This fixes possible crash on exit when dependent
plugin was not loaded (e.g. TextEditor was missing).
In this case plugin's constructor gets called,
initialize() method is _not_ called
and destructor gets called -> crash.

Properly delete dependent plugins on
a plugin which failed to initialize properly.

Fix labels of deleted plugins inside an error dialog
after pressing "Error Details" from "Installed Plugins"
dialog.

Change-Id: Iddc029a0f07dcba2501d734d142fb0e69e9383d3
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-06-17 17:00:56 +00:00
Tobias Hunger
25f2f8e1ee IWizardFactory: Create wizards with factoryCreators
Do not use the object pool to hold potential wizards. Register
FactoryCreator functions with IWizardFactory instead and use
those to create the wizards when necessary.

This saves us a couple of cycles during startup since we can now
delay construction of all wizards and it makes us more flexible
wrt. managing the lifecycle of the wizard factories.

Change-Id: I95d6a6dfcdf0fd995e1934a9fefcd96c6a676753
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-05-26 11:47:53 +00:00
Tobias Hunger
78630de9e5 QMakeProjectManager: Denoise code
Use "using Core;" instead of prefixing Core:: all over the place.

Change-Id: I00b50da731bf2b4bf442c587566d11a3ef921834
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-05-19 14:02:17 +00:00
Tobias Hunger
1da94d5fac QMakeProjectManager: Replace consoleappwizard with a Json wizard
Change-Id: If05743ad530ee7d589fde324202ffb9c2750a669
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-05-18 15:39:28 +00:00
Alessandro Portale
8ae18a9ca8 ProjectManager: Qt Quick application templates via json wizard
Using the new .json wizard engine allows us to get rid of much old
custom wizard logic. As additional benefit for the end user of
Qt Creator, the .qml.ui split is now optional.

Change-Id: I4b5ebcc35a585fad6ebc2e994711ca23e3300717
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2015-05-15 13:14:37 +00:00
Daniel Teske
357d01817b QmakeProjectManager: Rework run qmake action
Relied on some broken magic.

Change-Id: I1641f4b135e825ef60d57e99741def018ab9b55a
Task-number: QTCREATORBUG-13700
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-09 10:45:10 +00:00
Friedemann Kleint
54da18eaaa Clean exported headers of the Core plugin.
Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 07:18:14 +00:00
hjk
7f001dab1b Core: Make Context parameter to registerAction optional
... and default to C_GLOBAL. A rather common case.
Similar for ActionContainer::addSeparator().

Change-Id: I7f9ba573af201c0a472132d5a494ad17cc4175b7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-26 10:09:03 +00:00