Commit Graph

53 Commits

Author SHA1 Message Date
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
ea79027e20 Merge remote-tracking branch 'origin/9.0'
Change-Id: Idd9c2b1bf787040b7b415b7cda29035227ca1011
2022-11-21 08:57:14 +01:00
hjk
5688c84fcf Python: Initialize settings in the pimpl
Change-Id: I172136851c3002bf785d9b8f378c0cccc408e0e2
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-18 14:51:17 +00:00
hjk
dc620e987d Python: Avoid flashing a separate widget when opening settings
Change-Id: Id0518c222ffa91bc8791cfa71edb9b715ce65cde
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-11-18 08:39:12 +00:00
David Schulz
89e90f31f1 Python: Do not remove unreachable interpreter on startup
A device might be not reachable at Qt Creator startup so do not filter
out remote python interpreters after loading the settings.

Change-Id: I3ac4f2baaca882e699f2210f6f5a92523891b0ca
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-18 06:49:17 +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
David Schulz
c7d3f48508 Python: remove settings object from objects pool
Change-Id: I4f21688f887c1ad99facb3ffe3a85b5918dd7daf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-06 12:33:48 +00:00
David Schulz
a634833720 Docker: detect python in docker images
Change-Id: I841cdb7ce1cb8f34565a5e6993c5c825937e3eab
Reviewed-by: hjk <hjk@qt.io>
2022-09-06 08:47:01 +00:00
David Schulz
407082bcb2 Python: restructure settings
Change-Id: I32b3bed5581e06e981863b561b9b2f2bb125b82e
Reviewed-by: hjk <hjk@qt.io>
2022-09-06 08:46:56 +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
David Schulz
497b20ade7 Python: use consistent pyls naming in settings
Change-Id: I8a36e4089812802c3629ac52ce52499dde53eba8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-05 10:57:54 +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
hjk
7950a038b4 Merge remote-tracking branch 'origin/8.0'
Change-Id: I1dc664137eeecb7dd69f29af7a08164683d51077
2022-08-03 17:51:42 +02:00
David Schulz
0a2510edcb Python: skip root on venv detection
Virtual environments on the root level are uncommon and can cause issues
on some linux distros.

Fixes: QTCREATORBUG-27976
Change-Id: I266f1b321c1c2d2b4b416acf3f34ce8c1d686219
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-03 10:55:30 +00:00
hjk
b97c495d2b Utils: Make the second parameter to LayoutBuilder::attach() an enum
More explicit and more potential options (e.g. "treat grid as form")
than a bool.

Change-Id: I89413efe30410160c38b0e524ba64288dde2332e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:52:16 +00:00
hjk
14257a24f9 Utils: Introduce Layouting::{br,st}
... as "standard" ways to define line breaks and simple stretch.

There have already been too many patterns to do it.

Break() and Stretch() still work for the patches in flight, but
they are planned to be removed.

Change-Id: I9b70dcdc11244a904a496b0c55938dfb0b265fc8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-25 09:52:15 +00:00
hjk
26dd8aef2a Python: Convert to Tr::tr
Change-Id: I0241053b0d51dbb1a60c43351cbff543fd52573d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-21 08:25:04 +00:00
Leena Miettinen
b1f7172077 Python Language Client: Fix typo in translatable text
Change-Id: I11a0161b76661fd876b47dc5aa23ce2449258ae0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-29 08:24:54 +00:00
Leena Miettinen
14965f5792 UI text: Fix grammar errors and capitalization issues
Change-Id: Iefb1075cc0b14eb8c0e99b6c96c31a91c2b079f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-28 13:54:10 +00:00
Eike Ziller
92c74abbf1 Fix lupdate issues
Change-Id: I7256c8aff5eb77b264b76ba24e79c26ab2924e84
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-27 07:05:22 +00:00
David Schulz
6c8605ced2 Python: automatically disable outdated pyls settings
Change-Id: I301c6df3fdd9cf634a1abff20c6f24b9bc5fc23b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 11:23:52 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
David Schulz
4c20a880e6 Python: remove python specific language client settings
Change-Id: Ic993d525f29c1925f7e64dfc6f5e053234fb4904
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:47:23 +00:00
David Schulz
ed22ef7854 Python: globalize Python language server settings
Change-Id: I84fcee6462064f0c788492fcfa12a77379af2bd7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:40:43 +00:00
hjk
28cfdf388a Promote previously python-specific InterpreterAspect
... and drop PythonRunConfiguration, which is a plain RunConfiguration now.

Change-Id: I540cb738180fc1424f730d6d1998886915ce527b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-27 08:54:22 +00:00
David Schulz
98a2600150 Python: add clean up button to python settings
Change-Id: I633a8b20f4b02a989f2fd71448b611bbb0d0a3a4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-31 10:43:48 +00:00
David Schulz
d0c8cc20f5 Python: automatically purge outdated autodetected interpreters
Save whether an interpreter was automatically detected. Use this
information on startup and check whether the path still exists to remove
the interpreters that are gone.

Fixes: QTCREATORBUG-27253
Change-Id: I094e573122f2800f643a2708b924a7a9d7e25ae1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-31 10:43:42 +00:00
David Schulz
d8589e0222 Python: show error icon on non existent interpreter in settings
Change-Id: I8539d1aaaf2b332e0f97e0288b6b4e93f4851dfe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-31 10:43:36 +00:00
David Schulz
7cb3a726d4 Python: add PySide installation check on document open
Checks if the document imports PySide and whether the selected python
interpreter can find a PySide installation. If not show a global info
bar that can install PySide via pip like the python lsp server.

Task-number: PYSIDE-1742
Change-Id: I02c0d5f6eb268f3d8826d4fb9d9ec3c7c48b8638
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-28 12:15:15 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
David Schulz
cfdf613679 Python: prefer python3 from path as default interpreter
Change-Id: Ic53fc19f59da29d55c8f59385afc74a2524d6e49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-12-10 08:44:15 +00:00
hjk
704b0af8db Replace some PathChooser::setFile with setFilePath
Change-Id: I9a135e27d97b6706ea199b60a0b0b28838c77dcc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-13 09:47:56 +00:00
hjk
906348ed50 Python: Simplify InterpreterDetailsWidget::toInterpreter()
The fromUserInput is already done as part of m_executable->filePath().

Change-Id: Ia623acd5a1be7763655cf9ad2fe5af32510b5060
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-19 04:29:00 +00:00
hjk
bd4a501f15 Replace some uses of HostOsInfo::withExecutableSuffix with FilePath
Change-Id: Id72e9fd04dd4995ff2775ee919f747018cbcc339
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 11:48:48 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
1dba079cbd Python: Use LayoutBuilder in settings widgets
The removed margin around the subform at the bottom is intentional.

Change-Id: Ia598a6189111346b0f23f7aa4801ad0db1725fb9
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-26 07:09:26 +00:00
Christian Stenger
d60fa5c762 Python: Improve auto detection
Do not list app installer redirectors as python
executables. Windows may put empty redirector files
with the same name in a path that is prepended to
PATH for the respective user.

Change-Id: I9418784ef099df72ef8d0426e55198b30fbeed6a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:33:49 +00:00
hjk
efc39f971e Qt6: Workaround for ListModel iterators
Change-Id: I622b42b8aea4f06b62e8739f7e8abb234ed7d3b4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-30 07:04:03 +00:00
hjk
b2f06b7695 Python: Use new ListModel convenience functions for interpreter model
Change-Id: I98cbfd255fe35a9a9dd23f6c09c472c505ed271e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-20 07:31:44 +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
hjk
d43b793dd8 Core: Introduce a IOptionsPage::setCategoryIconPath
Less noise on the user side.

Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-16 09:53:45 +00:00
Eike Ziller
34e8f58c47 Fix lupdate issues
Change-Id: Ib0cbb96a1a4857db5724f9d1e316b97bf2827dbd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-04 14:06:09 +00:00
David Schulz
3df6a29d4f Python: remove reference to out of scope variable
Change-Id: Idd4dbab5ee01fda331452fefd27de71625afa5af
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-11-04 08:03:17 +00:00
Christian Stenger
b2ede6ff51 Python: Check for changes before applying
Storing the python settings seems to be rather costly
and may take some time.
Perform an early return if nothing has changed.

Change-Id: I509e83f503d2af31a7464df893e0e4e69e99a277
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-30 13:21:29 +00:00
David Schulz
6664d78ded Python: detect virtual environments for documents and projects
After opening a document or project the directory hierarchy is looked up
for a Scripts/(activate && python.exe) on windows or bin/(activate &&
python) on unix. This is the usual structure of python virtual
environments. If such a folder is found add the python from that folder
to the list of configured interpreters in the settings, set it as the
current interpreter for the project and try to open the corresponding
language server.

Change-Id: I038c309ea2988f9370194330d250d1515beac0a0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-30 08:46:12 +00:00
David Schulz
95bd328c31 Python: export Interpreter generator
Change-Id: I591bd6c14706e1699f028a9a3a6dfd9b89eec66a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 12:50:46 +00:00