Commit Graph

227 Commits

Author SHA1 Message Date
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
Eike Ziller
64247bf571 Merge remote-tracking branch 'origin/8.0'
Reverts/comments out parts of 45f93a817a,
which needs to be resolved in a follow-up commit.

 Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
	src/plugins/python/pythoneditor.cpp
	src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
	src/plugins/scxmleditor/common/colorsettings.cpp

Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
2022-08-19 12:48:27 +02:00
David Schulz
9fe3aa6612 Python: Fix detecting python ls for reopened files
Change-Id: Icc601fa43c7b1432d0bf12fae2f65e0c914262ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-08 11:30:03 +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
072489829d Utils: Make port.h slimmer
Fix the fallout. Also make comparisons hidden friends.

Change-Id: Ib16a294391f5732f94f9f411a48220b497691de2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-27 12:07:59 +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
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +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
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
d842862944 Utils: More porting.h related changes
Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-14 12:04:25 +00:00
Eike Ziller
f950a5d86c Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/libs/utils/terminalprocess.cpp
	tests/auto/qml/qmldesigner/coretests/CMakeLists.txt

Change-Id: Ifc5b37dadd46af752f0771a2685da1ac9a6260bd
2022-07-07 13:47:12 +02:00
David Schulz
b47b6cddc7 Python: Prepend pyside6-project path to PATH env variable
Otherwise pyside6-project cannot find uic or rcc or might use those
tools from another pyside installation.

Change-Id: I34eff2fc2627b07a18a705e5d658bd7cf8ce9350
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-07-07 09:10:01 +00:00
Jarek Kobus
96c5a8a789 PipSupport: Connect to watcher before setting a future
In order to avoid runtime warning:
"QFutureWatcher::connect: connecting after calling
setFuture() is likely to produce race".

Change-Id: I921396628e5615e7c2d87045d2e787388dbddcc6
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-07-05 11:47:17 +00:00
Eike Ziller
6c98721efc Merge remote-tracking branch 'origin/8.0'
Change-Id: I552d201d09d62d21655176467088c6e48b8a2fe2
2022-06-29 15:29:49 +02: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
f95a1eca34 Merge remote-tracking branch 'origin/8.0'
Change-Id: Icef5e28557701243e686d35cf885412eb341e75a
2022-06-28 11:35:16 +02:00
hjk
9e363c6421 Add plugintr.h files to all plugins
Except FakeVim, which had it before.

for i in [a-eg-z]*/*.json ; do
    upper=${i##*/}
    upper=${upper/.json/}
    lower=${i%/*}
    trfile=$lower/${lower}tr.h

    cat << EOT > $lower/${lower}tr.h
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

namespace $upper {

struct Tr
{
    Q_DECLARE_TR_FUNCTIONS($upper)
};

} // namespace $upper
EOT

    git add $trfile

    perl -pi -e "s/(${lower}_global.h)/\1\n    ${lower}tr.h/"  $lower/CMakeLists.txt

    perl -pi -e "s/(\"${lower}_global.h\",)/\1 \"${lower}tr.h\",/"  $lower/$lower.qbs

done

Change-Id: I15ebbaaa9443c57b391b9e143f592d8a0c9208a9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-27 13:34:57 +00:00
David Schulz
1956fa0365 Python: prevent setting local env to remote pyls
Change-Id: Id0eea5420c897687e6931bf640e3a37ba2638b8f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-27 11:23:54 +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
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
David Schulz
e3cfbc0a7b Python: improve initializing python run configuration
Sets main.py as the default script. If we cannot find a main.py we
create a runconfig for every py file in the project.

Change-Id: I93f4c9a5c9e2825a592eee3707439e69a8aea566
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 11:24:18 +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
e4d692a689 Python: only add python files as targets
Change-Id: I21f0ca6035aed6306d6cbe55a6c6df0838e49f45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-24 09:53:52 +00:00
Jarek Kobus
a613caa234 PipInstallTask: Connect to done() signal instead of finished()
Change-Id: I7a712791a440668c7efb8282d7f035a120c7d719
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-06-21 08:14:16 +00:00
David Schulz
591fc12ffa Python: remove static cast of client interface in client constructor
Change-Id: I475a2b79438b8392085f1d9bf2cdb8b7369efa68
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:11:31 +00:00
David Schulz
e74999cced Python: check for pyside tools after installation
Change-Id: Icf9ae0ec08a78efc51216daa3304e76f8e812d5f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:11:07 +00:00
David Schulz
ca47064020 Python: Fix scripts path to global/venv pyside installations
... when checking for pyside tools.

Change-Id: I1aaac9dd9da76f08ada031cc88761dba36c4e3b6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 13:10:56 +00:00
David Schulz
3b8b247f88 Python: ignore windows store redirectors
Change-Id: Ife5c13549d73156550a7ce4b5436f1e5a19503fa
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-20 06:16:08 +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
hjk
152b14207c Replace QtcProcess::stopProcess() by stop() plus waitForFinished
... or nothing, if the process object is destroyed immediately.

Change-Id: I6a1e1928bc49fc20a1c0e0ee9b8f4f723276bbca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-16 08:26:10 +00:00
David Schulz
a750961f4d Python: make sure working dir is on python device
Task-number: QTCREATORBUG-27536
Change-Id: If9c8f88f2a871ec71b200020689a4ae9df1e8a6a
Reviewed-by: hjk <hjk@qt.io>
2022-06-15 12:11:36 +00:00
David Schulz
2b428d5de0 Python: prefer python from path when detecting python for document
Change-Id: I794a741fa7257833f0b4efbc25dfae43b8748427
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-15 05:44:46 +00:00
David Schulz
02bfd03c22 Python: simplify detect python for document path
Change-Id: I49b943e8b89db32c11b12ee66c0ad3add9a695af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-15 05:44:42 +00:00
David Schulz
99acc9a153 Python: Fix python detection for non project files
Do not return an empty file path if we cannot find a python venv for a
file path, but also consider the configured interpreters.

Change-Id: I5a7f06e394fb925f9a00143fc5f0797e8754534b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-10 12:47:29 +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
David Schulz
2029fe8c99 LanguageClient: fix todo
Change-Id: Ia6b3b5fe6e595c32a8b8a13b869f3178afb37ed8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-07 06:29:42 +00:00
David Schulz
ff8495b0a2 Python: fix pyside tool detection
pip might return an incomplete list of files on Windows for
installations. So we need to manually check the Scripts
folder for the tools we are looking for.

Change-Id: I40778607fd2f2015059744f17a539ca381b85560
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-03 07:35:13 +00:00
David Schulz
b9034e8426 Python: support python 3 mime type in language client
Change-Id: I9319442aecc61e854aaeb0778b959086a70d431b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-02 13:29:17 +00:00
David Schulz
b9627ddba7 Python: add pyside uic extra compiler
To be able to autocomplete code from .ui forms we need to feed the
python language server the compiled form. The uic extra compiler
generates a temporary ui_name.py file for uncompiled or unsaved ui
files. These files are inside a folder that gets appended to the python
path environment variable for the python language server.

Change-Id: I9f48d2012162f33986639315189c41e0a7e0dad2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-06-02 09:09:22 +00:00
David Schulz
3ad82a66f9 Python: move pyside detection to runconfig
Change-Id: I781c4d005ced0c884081616696eae7f738f38c6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-31 05:59:45 +00:00
hjk
2837f4d777 ProjectExplorer: Pass macroexpander (again) to WorkingDirectoryAspect
Broke with 8dacb123e0.

Probably calls for a more centralized approach again. Later.

Change-Id: Ibf52487d68d7938d4b5dfb38f1f0a5b0e1a97bc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-30 14:45:47 +00:00