Commit Graph

113 Commits

Author SHA1 Message Date
hjk
8066ce8a6f Remove a the necessity of a few weak vtables
For background, see QTBUG-45582.

Change-Id: I6c4758ce62149437c26971056b465d5dbd2b13b0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-22 11:41:36 +00:00
Eike Ziller
9ab0510eaf Aspects: Update of combo box when changing TriState value
Call SelectionAspect::setValue instead of skipping it and calling
BaseAspect::setValue directly. That takes care of updating the combo box
state.

Amends c8829ff5b3

Change-Id: I55e90459c2b54da09883f746b61b19d46acfdf92
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-06-08 07:52:22 +00:00
Jarek Kobus
4b9545fe7f Utils: Drop unused headers [A-H]
Round 2 - focus on sources.
For classes with initial in range [A-H].
Try to keep the same separators between different kind of headers.

Change-Id: I838a8324ddd5b4d8d5a51b8f30605f783c663813
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 07:47:09 +00:00
hjk
8dacb123e0 Utils: Pass MacroExpander to ArgumentsAspect constructor
In the past we wanted to keep the aspect constructor simple but
it turned out that exceptions were needed and accumulating, so those
are likely here to stay.

By passing also the MacroExpander to the ArgumentsAspect constructor
allows other single-purpose warts like the ProjectConfiguration::doPostInit()
machinery can be removed.

Change-Id: I148b0ca1ab0740270eecd0d3134620de65a86d4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-20 07:06:10 +00:00
Jarek Kobus
0a8dbaf153 Utils lib: Remove unneeded includes from cpp files
It's a result of a team work consisting of yellow triangle and me.

Change-Id: I8b4812766da70e0785ae71bf0cb71357379e2514
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-19 12:37:20 +00:00
Jarek Kobus
92d7e4601d QtcProcess: Forward declare Environment in QtcProcess header
Change-Id: If85a8a07b144c94cb6e45f66dcb06573ef07c777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-05-09 07:42:40 +00:00
David Schulz
7000ab04fb Utils: add default file path to string aspect
Change-Id: Ia3df289b0b2dc59f6e7098332c21a335dce207f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-05 13:35:43 +00:00
Eike Ziller
0d586e96ec Merge remote-tracking branch 'origin/7.0'
Change-Id: Ica0f410a8248722cef95a9cbf3929a2d29bf91c0
2022-04-27 11:19:31 +02:00
Cristian Adam
8c050eaad9 CMake: Set the build directory change after Browse
As an user I expect when I select Browse for the build directory
that after the directory has been chosen it will be taken into
consideration.

Amends 1d600101ee

Fixes: QTCREATORBUG-27407
Change-Id: I331b6095c176f57ca8e4c73c0b378a11ce3d6dbc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-04-26 13:24:48 +00:00
hjk
5da8695dca ProjectExplorer: Pass envAspect directly to WorkingDirectory constructor
This trades a now necessary order of setup for the now removed
"acquaintSiblings" facility.

Change-Id: I85058578b792e210f24573e2ab4e3a40a8813a11
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-22 11:53:59 +00:00
hjk
a26f0ba808 Debugger: Avoid one use of RunControl::runConfiguration()
Change-Id: Iaf9fb0cee4544121a4df433c3726d98ae0175ff2
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-14 09:25:46 +00:00
hjk
530b9ae85a ProjectExplorer: Copy more RunConfiguration data to RunControl
The aspects are now responsible for defining what data needs
to be copied and also to provide a suitable interface (kind
of source-compatible to direct use) for access.

The important change here is that RunControl::aspect(...) doesn't
need to access RunControl::runConfiguration() in fully aspectified
RunConfigurations anymore. In not-fully aspectified the runConfig
access is moved to the user code to make the problem visible there.
Long term, aspectification should be finished.

As an additional benefit, the resolving of macros etc can
now be done at the correct time.

Change-Id: I690d9f8f696ce9b4efd42082ba3f81b514efcb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-12 08:43:09 +00:00
Cristian Adam
68cb80f276 CMakePM: Add options link to the CMake offline/online documentation
This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 13:12:15 +00:00
Cristian Adam
a0836a29c7 CMakePM: Refactor "Initial Parameters" as a tab bar item
Now we have "Initial Configuration" and "Current Configuration"
as tab bar buttons.

This way the UI can be shared between the two configuration states.

Task-number: QTCREATORBUG-26869
Change-Id: I8206032a2a5ac076629865057816edb99706f2ff
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-17 15:23:19 +00:00
Sergey Levin
44ff85cb1b Change QLabel from StringAspect to ElidingLabel
ElidingLabel with elided mode set other than Qt::ElideNone will not show
in case QFormLayout has QFormLayout::ExpandingFieldsGrow field growth
policy

Change-Id: I26db57fbeb2c921e054cf7dc18229ebddcb04530
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-12-08 12:53:19 +00:00
hjk
898210f0a1 Debugger: Fix passing tooltips from to toolbuttons
Visible in the O and <> buttons of the Callgrind toolbar.

Change-Id: I1016f853335bfc243f7e934e7a0cd430922c8af6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-11-17 08:54:42 +00:00
Christian Stenger
a8d5929be3 Utils: Do not update pathchooser value from displayed string
The displayed string may differ from its "real" resulting path
depending on having a base directory or not.

Fixes: QTCREATORBUG-26408
Change-Id: Ic569671899329249559a2bfb3ecd30190f166dba
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-02 08:09:15 +00:00
hjk
9def0165ac Replace a few PathChooser::setPath by setFilePath
Change-Id: I4120aa2fe9584334e7c19ca15a647027e496008e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-04 06:03:58 +00:00
hjk
81acd0c62a Utils: Remove uses of deprecated PathChooser::path()
There's filePath() nowadays.

Change-Id: Ief06bd07a69a287d6a5ca3c41eb7069dba869d52
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-28 06:39:02 +00:00
Alessandro Portale
fcf9537dc5 Various FilePath::fromString -> fromUserInput changes
Change-Id: Ic9c5e2f5c0375468651557f504b101572b72ac06
Reviewed-by: hjk <hjk@qt.io>
2021-09-23 16:28:54 +00:00
hjk
6418eb2dda Utils: Use EnvironmentChange instead of Environment in several places
For path choosers this makes it easier to change the actual base retrospectively
based on the device for the file path entered by the user.

In other cases "end user code" only knows that something needs to
be added to PATH to get a proper environment. This here lets this
code to specify the change alone without bothering about the base
environment this might be applied to.

Change-Id: I726aaa2fd2feb0bee7158f601aac660b0ac6327b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-11 13:33:52 +00:00
Christian Kandeler
b6dd53d4ed ProjectExplorer: Prevent build directory on non-existing drive
A drive that is not actually there is apparently different enough from a
"normal" non-writable location to seriously throw off some build tools,
so spend some effort in preventing this.

Fixes: QTCREATORBUG-25633
Change-Id: I5a15b0b2a3a882a08f50866c23e4d45c93fd78c9
Reviewed-by: hjk <hjk@qt.io>
2021-07-26 08:42:00 +00:00
Eike Ziller
1d600101ee CMake: Apply build directory change on editingFinished
Otherwise every time a character is typed, a dialog pops up, and that
dialog is closed without triggering a cmake run, the value is reset.

Add that behavior optionally to StringAspect.

Change-Id: I6831d1622f08acae6df43d4ceb2bf7367c96a747
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 12:05:45 +00:00
Cristian Adam
26e856254c CMakePM: Allow copy / editing of build directory
This reverts 69b0a2cafc

The build directory is preset and by having the ability to edit, you can
easily do a new build by appending a number.

When you have a new build directory a dialog will warn you that you'll
start from scratch. This is enough of a hinderniss to the user to start
typing and get lots of build directories. No need to have it read only.

Fixes: QTCREATORBUG-24451
Change-Id: Id1bc77d0fbcb071608f5ac83ddd6b8af943fdac5
Reviewed-by: hjk <hjk@qt.io>
2021-06-10 13:42:29 +00:00
Christian Stenger
4d63206d95 Utils: Add helper methods for SelectionAspect
Change-Id: Idda6ac0846549f37e934d3e856c453ed314c7880
Reviewed-by: hjk <hjk@qt.io>
2021-04-19 06:20:03 +00:00
hjk
38b4536090 Utils: Introduce a BaseAspect::setEnabler(BoolAspect *)
A convenience method to tie the enabled state of an aspect to some
other bool aspect, to be used e.g. when settings item availability
depends on some check box.

Makes it harder to miss one of the three necessary steps.

Change-Id: I8c120bb6846aea2a503614f7c73fa57a149cab41
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-13 09:59:58 +00:00
hjk
ef108d7a06 Docker: Add DockerDevice and a simple run config
The "Docker Container" runconfig executes 'docker run <image>' without
further attributes, and "works" with docker's hello-world example image.

Change-Id: Ib9417d238ac0757db16be1fc21af40c81db02f05
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-13 08:54:17 +00:00
hjk
454e8a31e2 Analyzer: Base ISettingsAspect on Utils::AspectContainer
Change-Id: Ib4c19d0cb167911dc50d989771dd53f3569db087
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-12 13:15:13 +00:00
hjk
7471c3a378 Utils: Provide a method to set total cell span for aspects
Only row span used currently in some base aspects, can be
extended once needed.

Used in the Perf config widget to correct recent change.

Change-Id: I37fae178cbfb8d493e0232e53e877d0e317ec9f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-09 07:08:22 +00:00
hjk
fa2129f76b Utils: Add a SelectionAspect way to pass values to QComboBox::itemData
Change-Id: I428fbb5deb66163e7c0a7561eb44c315db1ed823
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-08 07:51:24 +00:00
hjk
ba06114afa Utils: Improve handling of BoolAspects used for checked QGroupBoxes
Make the group box a registered subwidget of the BoolAspect, so it
properly triggers the necessary behavior in BaseAspect::isDirty.

Change-Id: I9f6291d87ef7ce4067e0d235de8b5be24de79a93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-06 11:28:08 +00:00
hjk
6b82af5990 Utils: Make AspectContainer a QObject
... and add a 'void applied()' signal.

I actually wanted to avoid that, but it seems to be a recurring
pattern of usage to do something on top of plain apply for all
children, like triggering IVersionControl::configurationChanged
in the VCS plugins.

Change-Id: Ib64c3147c6ba30b178237e51a3a377a291c550f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-01 16:03:50 +00:00
Christian Stenger
f48586b8d8 Utils: Clear button storage after their deletion
Change-Id: I26650c645de67f5b1577f7c3a665f28397a64eec
Reviewed-by: hjk <hjk@qt.io>
2021-04-01 09:27:30 +00:00
hjk
cfae2812e7 Utils: Fix enable update for explicitly disabled StringAspects
The generic update that is triggered on all major interactions
did not take a explicitly set disabled flag into account.

Change-Id: I026bc0817ce534e92cfdd631beebcb80ddf7e6dd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-01 09:26:48 +00:00
hjk
968d083631 Utils: Introduce a SelectionAspect::volatileChanged
Analog to BoolAspect::volatileChanged for cases when the availability
of some other aspect, line edit, ... is governed by a specific state
of a combobox.

Change-Id: I5c7903dde21ab997e799568b20a01308a25c4397
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-01 09:01:00 +00:00
hjk
cbc26f5dce AutoTest: Aspectify CatchTest settingspage
Change-Id: I281891fecdcd97e4ec450a795d51981cfb47ef69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-31 12:10:45 +00:00
hjk
1d04466628 Autotest: Use LayoutBuilder for QtTestSettingsPage
Change-Id: I6f454bedbe0f1d2b9a1a14c146e35bcf41752533
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-31 11:56:36 +00:00
hjk
4cc6fef901 Utils: Merge BaseAspects and AspectContainer
They were quite similar, largest difference was the ownership of
subaspects, which is now handled by a bool property.

Change-Id: Ib3f2f20b9a84ef40ea8a9eb59da9c89c9a281750
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-03-31 11:56:04 +00:00
hjk
09f632d4c7 Utils: Delete aspect subwidgets one by one
Items deleted in finish() trigger via the connect in registerAspect their
own removal from m_subWidgets, invalidating container iterators used
by deleteAll().

The re-ordering to back-to front does not make a difference, I'd
still to destroy things in reverse construction order.

Change-Id: Ibb17da7cdc67013d744b159aa33fd1d119080e3b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-29 12:38:25 +00:00
hjk
6a6e7c90df Utils: Add a StringAspect::valueChanged signal
Similar to what BoolAspect already has. Will help with the NimSettings
page.

Change-Id: Id373cd21769c129fb8329d9102ccfd97675e8d24
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-29 05:28:25 +00:00
hjk
7651601f19 Utils: Introduce a standard way to have a Reset button for StringAspects
Resets line edit contents to defaultValue(), disabled if current
contents is the default.

Usable later for BuildPropertySettings

Change-Id: I1fcbcfb8664eb7f66de62a6606d8d7556026f468
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-26 07:06:09 +00:00
hjk
bfe398072d Utils: Allow nested groups for settings keys
Will be helpful for the Autotest settings

Change-Id: I83a1cc27021124a14d8e8023164f20ede6c4d80e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-25 13:40:32 +00:00
hjk
641bccacf1 Utils: Actually delete subwidgets on finish()
In the context of option pages, finish() means that the dialog is
dismissed somehow. Keeping the widgets around for subsequent re-use
is ok in principle, on the other hand it's a matter of hygiene and
give a defined clean slate next time addToLayout() is used.

This has not much practical impact yet as most option pages do not
forward finish() to their aspects right now.

Change-Id: Ifd591e3fa0d07c7943e86eb5474429efae2887f9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-25 10:42:16 +00:00
hjk
b7b41f7cc3 Utils: Fix SelectionAspect with radio button display
Register subwidgets to make non-autoapply work.
Also delete the parent-less button group on destruction.

Change-Id: If6fb306a812c8aa950535dd138a2020145d80c34
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-25 10:36:11 +00:00
hjk
bc97b10488 Utils: Only set SelectionAspect value automatically if requested
This is in line with what the other aspects do. Without this,
non-auto-apply aspects behave as auto-apply, even if marked with
setAutoApply(false).

Change-Id: I39192f63bb3b6e47ee181527938c19ee5044a5ec
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-25 09:04:13 +00:00
David Schulz
c3ab90e30f Utils: directly use default value if settingsKey is not defined
This saves one value > variant > value transformation.

Change-Id: I16e5c464017fdcc0b9a07b895bbe90423022ac83
Reviewed-by: hjk <hjk@qt.io>
2021-03-25 08:15:29 +00:00
David Schulz
321652be19 Utils: prevent crashes in SelectionAspects
Change-Id: I21315f1cbbc43948f00f00dbef777fa82c9606f5
Reviewed-by: hjk <hjk@qt.io>
2021-03-24 14:04:18 +00:00
hjk
77dc087250 Utils: Allow aspects to modify values for loading and saving
In some cases it is useful when the persistent value is not the
internally used actual value, e.g.  Having the displayed string
of a SelectionAspect instead of a numerical index makes
the settings more readable for a human.

Change-Id: I11ecb8e75ab041ace2358cc45972ce9ee965b24d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-24 13:28:55 +00:00
David Schulz
eeedf4cd8c Utils: simplify loading/saving grouped settings
Change-Id: I8e06fb301eab193137f3e77d841698b9f4881deb
Reviewed-by: hjk <hjk@qt.io>
2021-03-24 12:24:27 +00:00
hjk
a694487711 Utils/VcsBase: Move ability to specify group settings keys to base
Merge it with the read/writeSettings implementation that was already
there.

Change-Id: I25dfbdf6fd1cf122b17f89eae82cb2598d8470c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-24 10:14:25 +00:00