Commit Graph

108 Commits

Author SHA1 Message Date
hjk
c7710acadd Utils: Use Key more widely in QtcSettings
And adapt user code.

Change-Id: I6efe4ebe6823de4cc862f304a57e041b02c40eac
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 07:38:02 +00:00
hjk
6c2864bd4b ProjectExplorer: And more Key and Store
Change-Id: Id5787890bdb46bfeef8e3f37923e6dc26cb56c31
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 11:20:25 +00:00
hjk
69d1f24316 ProjectExplorer: Handle more Qt deprecations
Change-Id: I12895e65c14ca2723f6aea02c33b30659c30735a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-06-08 13:47:05 +00:00
hjk
390b4aa895 ProjectExplorer: Replaace some QVariant::type() uses
Deprecated since Qt 6.0 in favor of typeId()

Change-Id: Ib6ab5196ad9ec4cb2d3dbc2d4f1ceca5cfdcdd07
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-06-06 14:36:09 +00:00
Jarek Kobus
16100acdc9 JsonFieldPage: Fix collecting the results from all matchers
Connect to LocatorMatcher::done() signal instead of to
serialOutputDataReady() in order to get all the results
available (not just 1st partial results).

Give locator matcher a parent to avoid possible leak.

Amends 1cc7342ef1

Change-Id: Ie4a73a5b2dd25f22616bd30a13eb7393c96a890f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-21 08:55:05 +00:00
Jarek Kobus
422d422deb LocatorMatcherTask: Get rid of Input/OutputData typedefs
Introduce LocatorFilterEntries instead.

Change-Id: I082e0405441aa4b70a5e8fb796aa5c4fa3879265
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-21 06:45:04 +00:00
Jarek Kobus
99b5d93cfb LocatorMatcher: Introduce MatcherType enum
Use it for registering/getting different kinds of matchers.

Change-Id: I6f944e0332bf8c512892a00b8ba88f9939f34682
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-20 09:18:11 +00:00
Jarek Kobus
1cc7342ef1 JsonFieldPage: Use locator matcher for line edit completion
This may be tested in File | New File... | C/C++ | C++ Class,
Base class line edit should provide class completion.

With locator matcher the task is being executed ~20% faster.

This patch also solves the potential issue with interference
between parallel runs of classes filter in locator and
in LineEditField.

Change-Id: Ice3e719d9cbe72ec4cd11bd4362a94e9c3ce8874
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-19 12:13:54 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
Christian Stenger
36ca97d32b PE: Silence soft assert
Change-Id: Ie07d261cc49a20fd57d885e9be9d63c4b4a8743f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-05 10:11:34 +00:00
Jarek Kobus
d3d2536022 JsonFieldPage: Remove superfluous reportFinished()
Change-Id: I0f55b89a03fe012d6b2ac5a6430193729620edec
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-16 13:51:15 +00:00
Alessandro Portale
64aaf66c3b Proliferate Tr::tr in various places
This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.

Found with regular expression: (?<!(Tr::)|([\w]))tr\(

Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:19 +00:00
hjk
c5f7f5ab0a ProjectExplorer: Tr::tr
Change-Id: I8f1b463c5cc7a53627f7a9ad261998b92f13e56a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-16 12:10:24 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Eike Ziller
cead76f378 JSON wizards: Fix "span" with combo boxes
Combo boxes have "suppressName" set, but if they have span set too, we
still need to use addRow instead of addWidget.

Reorder the if conditions. The previous code didn't make much sense,
because it first checked for suppressName, and then for hasSpan, but
inside hasSpan it checked for (!suppressName) again, which could never
be false.

You can see this in action in the File > Qt > JS File wizard.

Change-Id: I976227f80277642823620e41aba605c8570aed44
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-03 10:30:03 +00:00
hjk
e4c49b720e Utils: Consolidate the isRelative/isAbsolute implementations
Even if we do it wrong in corner cases, we should do it consistently.

Change-Id: I68d5a6e55ede889cb44bedb46d0ea545dae7ba2c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-01 12:51:22 +00:00
Sergey Levin
5779d036c5 Wizard: Fix tooltip translation
Change-Id: I232a7887f41cd8af54567e1be28ad60aa7a23c95
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-03 13:08:59 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
1567d24980 Utils: Replace PathChooser::{fileP,p}athChanged signals
... by a new PathChooser::textChanged signal.

They were both emitted in reaction to the underlying line edit's
textChanged() signal.

Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.

Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.

Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-06 05:01:51 +00:00
hjk
10e8a21630 ProjectExplorer: Let JsonWizard react on PathChooser::textChanged
The other code path to trigger rawPathChanged is not relevant here.
Helps in a follow-up change.

Change-Id: Ifa70a763d8b3c82484b3c4e3c62d91ba2ca8e998
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-05 14:40:27 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
5b3927869c Drop Qt5: ProjectExplorer: Get rid of QOverload
Change-Id: Id8b28efa7b31a92a5e24485803322c586a23802d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-20 13:13:11 +00:00
hjk
e2c8866f2a ProjectExplorer: Replace some uses of PathChoosers::pathChanged
Change-Id: I3b0cc4218d1b0222f49bf98bbff206a38fa0b571
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-01 09:44:07 +00:00
Jarek Kobus
d6ee5cb163 Remove algorithm.h from jsonfieldpage.h
Change-Id: I15dfae3568030c169785c33e7957ecba3e975b65
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-18 08:38:11 +00:00
Artem Sokolovskii
5790905d6e ProjectExplorer: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I9a7b21643393852d2904ed25abb876998c543172
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-09 09:08:33 +00:00
Artem Sokolovskii
b06db48869 Wizard: Improve QtQuick2 extension plugin
- Added options for Kit version
- Added CMake support for Qt6.2
- Added options for creating example project,
which uses the plugin

Task-number: QTCREATORBUG-26982
Change-Id: I808c01bce6e4015a679f2fd69767c13179a25ee5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-21 12:47:11 +00:00
Eike Ziller
51d23ad64f Merge remote-tracking branch 'origin/6.0'
Change-Id: I55d228482ceda144f903fb85eef048d53602ad18
2022-01-24 10:34:10 +01:00
Samuel Ghinet
d023dfca1e Fix creating a project from a Recent preset with custom size
When creating a project from a Recent preset, everything worked well if
the user selected a predefined size. However, when typing a custom width
and custom height, the recent was saved with the selected/active item in
the screen size combobox.

This patch does the following to fix the issue:
* Save the recent info with the screen size written in the text fields
  (since they're updated when the user selects a different size from
  combobox but the user can type in any other value, the text fields
  always reflect the user's choice of width and height)
* When loading a preset for display in the UI, if the preset was saved
  with a custom size that does not exist in the predefined list (i.e. in
  the combobox), whether that is a custom size or a different
  orientation of a predefined size, then append an item into the screen
  size combobox so that this custom size will appear as one of the
  predefined sizes for the preset. This is both for visual reasons (so
  that the combobox would have a valid item active on display) and in
  order to be able to save in the backend model this choice (when the
  user decides to create the project)
* Update the ListField::selectRow function so that it does not attempt
  to select an item that does not exist. The reason is that, when the
  user clicks "Create" to create the project, the QWizard will be reset
  to the first page, and any modification we might have made to the
  model of the screen size combobox will be gone - and thus the
  selection would be invalid, which would normally cause the wizard to
  fail on page->isComplete(). By not allowing it to select an item in
  this case, we rely on the custom width and custom height fields to
  hold the real values.

Task-number: QDS-5691
Change-Id: I9e848c5f4957252eb414da7e7146f9f8e7be760c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-20 08:56:08 +00:00
Alessandro Portale
d7ed48ac6f Add missing "emit"s
Change-Id: I88a7397c7689b1e72cdd0e52077f8097443963c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-11 14:10:42 +00:00
Samuel Ghinet
32799b3a7b Make additional changes in the QtCreator side required for QDS new project dialog
* We need to use the CheckBox field to set the checked state of fields
  (TargetQtVersion, Use as default project location).
* When the validation of the Project Name or Project Location fails, we
  need a way to be notified of what went wrong. We also need a way to
  force the project intro page to execute the validation of those fields
  whenever we need (i.e. when the user types into our QML TextField
  controls)

Also, add a warning on loading wizards: whenever a wizard.json file
cannot be parsed, we should issue a qWarning(), so that we can more
easily notice when something went wrong.

Task-number: QDS-4490
Change-Id: I7cfa61b4e43d731db9d0679e093e723d947b60c0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-30 09:41:04 +00:00
hjk
98fad961a6 ProjectExplorer: Use FilePath in JsonWizard
Also remove m_currentPath and logic around it, as it was unused.

Change-Id: Id32ae2845e3788a3e24bb238005b31e8f174f6b9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-28 07:49:36 +00:00
Samuel Ghinet
b985530144 Make changes in the QtCreator side required for QDS new project dialog
* We need the showing of the Wizard dialog to be optional
* Each wizard has a "detailsPage.qml" file that stores wizard-specific
  UI configuration. We need a way to access that path (QUrl) from QDS.
* ComboboxField is used directly by QDS, and the field object is
  fetched by a call to JsonFieldPage::jsonField() - hence, the
  ComboboxField needs to be dllexported. We need to access fields
  directly from QDS because the QML controls use those fields as backend.
* From QDS we need to select / activate in a combobox field, and to see
  which item is current (activated). We also need to make use of the
  model that the ComboBoxField uses in order to show those same items in
  the qml controls of QDS.
* From QDS we need to set the text in a LineEditField

Task-number: QDS-4490
Change-Id: Ia42d539a5bcbf3dff4593fb027ac18c52da4d046
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-21 13:21:44 +00:00
Samuel Ghinet
8bd1969e7f Enhance logging capabilities for wizard classes
* Added QDebug operator<< for the Field classes so that they could be inspected during runtime (i.e. logged)
* Added optional QDebug operator<< overloads for QVariant (wizarddebug.h) - to better visualize the data parsed from the wizard.json files (QVariant objects), by using a format more in the like of json.

Change-Id: I53a729b24e4f2d9c9acf1ed802ac9dc3bb67f373
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-02 12:11:11 +00:00
David Schulz
6008c5f673 Core: filepathify LocatorFilterEntry
Change-Id: I279af30f6b57e8d1279d96e5cbae4025cf4ef473
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-08 07:46:37 +00:00
Christian Kandeler
d12e3cb72d Wizards: Use a FancyLineEdit::ValidationFunction
... rather than a QValidator.
QLineEdit's behavior of preventing invalid input is not suitable here,
as its concept of intermediate states is too limited.

Change-Id: If34793966e8b06762db86b90bb1dbb1526b74ea7
Fixes: QTCREATORBUG-22080
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-10 08:26:41 +00:00
Christian Kandeler
3a6e4860c4 Wizards: Delay validity check in LineEditField
... until the values have actually been set up.

Fixes: QTCREATORBUG-24971
Change-Id: Ia967fe95545eda1c9044faf8ab1ee885bf3d9e02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-12-03 08:32:03 +00:00
Jarek Kobus
6b588d7227 Remove unused variables
Mark some of them with Q_UNUSED, since it looks like
sometimes the copy is done on purpose, to force detach
or used for some hack with memory management.
In one case make unused variable used again.

Change-Id: I3825cd3399fa63bf6e12173c64509287d4a125e5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-20 13:58:46 +00:00
Christian Kandeler
1f72edcda9 Wizards: Fix crash
... if the project has no classes.
Apparently, one must not call QFutureInterface::reportsResults() with an
empty list, so prevent that.
Also, for simplicity, make sure we have only one possible point of
deletion for the watcher.

Change-Id: I68c3813459533ced86610e88bea81b6a9d170ca5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-12 08:21:12 +00:00
Christian Kandeler
45dd017853 Wizards: Offer auto-completion in "New C++ Class" wizard
That is, offer existing namespaces for the class name line edit and
existing classes for the base class line edit.

Fixes: QTCREATORBUG-10066
Change-Id: I276036864626eff92997e40e4e22ab16c4f4d617
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 10:11:37 +00:00
hjk
611a3bb68a Even more Qt6 porting
Task-number: QTCREATORBUG-24098
Change-Id: Ib6ef0e521483153c9716c9a1870072e836d6b026
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-23 11:24:44 +00:00
Christian Stenger
839e776012 PE: JsonWizard: Improve handling of check boxes
Only handle active user clicks as 'modified' to be able
to react on (un)setting values by expressions that depend
on other fields.
Improves the check box handling on the "Add C++ Class" and
"Add Python Class" wizards as it re-evaluates the check box
state based on an expression as long the user does not
actively checks the respective check box.

Change-Id: I739c02b85196555c0379272005ca3b0095f7c762
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-28 05:03:59 +00:00
Christian Stenger
0aa1a3ad4b Revert "JsonWizard: Fix restoreLastHistoryItem for LineEdit"
This reverts commit e3abd5b348 as it broke
updating evaluating line edits.

Change-Id: Ie729a63d6a2b87df7143aba26726b657cffb8148
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-26 09:23:09 +00:00
hjk
68c539bb9d Utils: Replace FileChooser::path() by filePath().toString()
Keep the old method for now to ease downstream porting.

The change is kept mechanical, there's a lot of cleanup possible now
on the user code side.

Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-09 17:45:06 +00:00
Andre Hartmann
e3abd5b348 JsonWizard: Fix restoreLastHistoryItem for LineEdit
The value was successfully loaded from the history,
but overwritten again.

Let's now check if the line edit already contains
a value (loaded from history) before setting the
default text.

Change-Id: Ic0acad83f76e0aca76309dfd213183a210d334ac
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-08 10:45:03 +00:00
Andre Hartmann
0c1906319d JsonWizard: Fix spelling of "restoreLastHistoryItem"
Change-Id: If442b51bc5dc67ab668eb77afb8f0a0ead7c7c95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-06 16:25:42 +00:00
hjk
84d0e3dda8 Utils: Use FilePath for PathChooser::m_baseDirectory
... and collapse the two accessor versions to one.

Change-Id: I282753a0092601cff073684053ff914016452645
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-19 07:59:13 +00:00
Nikolai Kosjar
6c1b11dd3e ProjectExplorer: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: Iaaac21e96a3e9db6b9819d77fdae623ede373e59
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-01 09:31:32 +00:00
Christian Kandeler
0d81e90bb1 Wizards: Fix ComboBox implementation
The ComboBoxField class used the QComboBox view's selection model as the
source for the current value, which makes no sense, as the item that was
last selected was not necessarily activated by the user.

Fixes: QTCREATORBUG-23149
Change-Id: I8587dd20381e142b91f13a987e54c86b8f6237c8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-10-28 12:14:18 +00:00
Christian Kandeler
4702faba06 Wizards: Add the ability to remember user choices
Wizard authors can now provide a persistence key to values where that
makes sense.
For now, we make use of it for the build system type in all wizards and
the minimum Qt version as well as the virtual keyboard settings in the
QtQuick wizards.

Fixes: QTCREATORBUG-16657
Change-Id: I179930665bd163b1cf198467ab8b43bc72f8ec4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-23 12:48:56 +00:00