Commit Graph

163 Commits

Author SHA1 Message Date
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
Christian Stenger
7801fda463 ScxmlEditor: Fix missing include
Amends 94d7e2efac.

Change-Id: I8220dbbd0cd30c7a0b2ca851b9486b7915a55a99
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 12:22:46 +00:00
Alessandro Portale
dc3eae230f ScxmlEditor: Convert to using Tr::tr
Change-Id: Ia8ab06d4b8a16bb144d6887624c478fb911f29ea
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 08:17:40 +00:00
Alessandro Portale
94d7e2efac ScxmlEditor: inline .ui files
colorpicker.ui
colorsettings.ui
colorthemedialog.ui
magnifier.ui
navigatorslider.ui
search.ui
shapestoolbox.ui
stateview.ui
statistics.ui
statisticsdialog.ui

Change-Id: Idab9db2102d4d9dbafb60d2025386165c536d894
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-09-01 08:17:29 +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
c6c92ec096 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/libs/qmljs/qmljsmodelmanagerinterface.cpp
	src/plugins/clangcodemodel/clangdclient.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp
	src/plugins/qmldesigner/designercore/include/modelnode.h
	src/plugins/qmldesigner/designercore/model/modelnode.cpp
	src/plugins/qmldesigner/designercore/model/rewriterview.cpp

Change-Id: I93c57879b79f27325321bfc045ca618bd835af93
2022-08-26 08:40:23 +02:00
Christian Stenger
3b73b27862 ScxmlEditor: Fix build with Qt5
Change-Id: I09609ac62604885f7800088619cbe1f4ea510d83
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-08-22 11:17:56 +00:00
Jarek Kobus
5e6ad51e97 ScxmlEditor: Fix a crash when closing scxml editor
Don't iterate on m_overlappedItems inside d'tor, as every
iteration calls removeOverlappingItem() and it modifies
the container being iterated. Do the same for m_outputTransitions
and m_inputTransitions.

Amends 8b444f88eb

Fixes: QTCREATORBUG-28027
Change-Id: I78fe67b5ea584c969e4850a2db3f00d981296865
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-22 08:03:43 +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
Alessandro Portale
52b8b51b32 ScxmlEditor: Prevent crash
Create the connection after populating the combobox prevents an
assertion.

Change-Id: I35be1cf724ed7084123e7070b377b50274132e55
Reviewed-by: hjk <hjk@qt.io>
2022-08-10 07:56:26 +00:00
Jarek Kobus
1192441a31 Scxml Magnifier: Don't install event filter on qApp
After 1ba6faeea0, where
activating the magnifier with Alt key was disabled,
the fix in 158fd92558
isn't needed anymore.

Amends 158fd92558
Amends 1ba6faeea0

Change-Id: Ibeb90fa246d576f8d7fe2cf2a64fa7a9cc6d30f2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-03 11:50:19 +00:00
hjk
4f4d77e797 Core: Avoid #include of fileutils.h in icore.h
filepath.h is sufficient.

Change-Id: Ibd865020f7820a6c6478eca6cf7b8065cf8c8cf3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-22 13:07:43 +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
Jarek Kobus
74046fa1f5 ScxmlEditor: Avoid using sender()
Do some cleanup of unneeded () after lambda capture.
Fit code into 100 char lines.

Change-Id: I2494765f6ba7aa1f13f4eadb7183bc88febd9638
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-20 18:31:06 +00:00
Jarek Kobus
e32ebe2146 Drop Qt5: Various plugins: Get rid of QOverload
Change-Id: I4913044f8897fd3449dbb537e4af6785eb3ad447
Reviewed-by: hjk <hjk@qt.io>
2022-07-20 13:52:38 +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
hjk
802de0eb5e Utils: Collapse most of porting,h
Taking the Qt 6 branches, leaving some dummies until downstream
adapted.

Change-Id: Ib9b86568d73c341c8f740ba497c3cbfab830d8a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-13 09:44:09 +00: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
Artem Sokolovskii
37bf11550e ScXMLEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ifaacfe54553e5400ae334263c2d346eeafe4b66c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-02 07:59:17 +00:00
Christian Stenger
e0efc4faf3 ScxmlEditor: Fix build with Qt5.15
Amends 8b444f88eb.

Change-Id: Ide1da6a6c26f3a72388b2f9642ae25ce3cf62171
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-05-25 11:18:18 +00:00
Artem Sokolovskii
8b444f88eb ScXMLEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ic439470b7c23022fee6acbf0cdaba7760309edb0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-25 08:52:57 +00:00
Jarek Kobus
4ad8fb80c6 Utils: More forward declarations / drop unused headers [H-K]
Round 1 - focus on headers.
For classes with initial in range [H-K].
Try to keep the same separators between different kind of headers.

Change-Id: Iefb032953743be41a847ee011c30527edfa425d8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-25 07:14:04 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Eike Ziller
3749cfc896 InfoBar: Make adding more buttons possible
Change-Id: Ic0c946cf3f87fe46cd06391f38e0bc71374ad340
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-18 09:33:20 +00:00
Jarek Kobus
1ba6faeea0 Disable showing/hiding magnifier by pressing Alt modifier
The Alt modifier doesn't work well with mouse wheel
as it causes the horizontal wheel to be triggered.
Disable the Alt modifier as a shortcut for activating
the Magnifier. When Magnifier is shown by activating
the toolbar action, the magnification works by simple
mouse wheel without any modifier.

Fixes: QTCREATORBUG-25612
Change-Id: Idb7c40dbf92ed135a796c9623cc46b6b1e80e9e6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-18 08:12:07 +00:00
David Schulz
0bfbdf5e7c ScxmlEditor: block non Utf8 codecs
Change-Id: I7d44dc0ddb17ab543e9e578d4480a090cc6835f1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-13 06:52:59 +00:00
Jarek Kobus
686603ae83 Remove unused includes of QThread from cpp files
Change-Id: I61b8e9182bf03fa96d2aabe399a6c93964fc8d03
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 10:37:20 +00:00
hjk
584217a52f Use more FileUtils based file dialogs
Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-19 08:33:22 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
David Schulz
665c090039 Core: filepathify IDocument
Change-Id: I364a80d070c5f90433309c281c4906ee101a1a1a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-19 09:45:22 +00:00
Alessandro Portale
93fbd5be02 Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.

Add a comment in porting.h where we still need such code for sdktool.

Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 19:12:39 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Jarek Kobus
2b2cacfc09 Fix vanishing transitions when zooming to state
The main design issue in this plugin is that
there is no clear separation between model (which
pretent to be ScxmlDocument and his childern of
ScxmlTag type) and its views (GraphicsScene
and its children of BaseItem subclasses).
When the "Zoom to State" action is invoked,
the new view is being created, showing just
a part of the ScxmlDocument model. However,
some validation is done only on the view part,
checking that BaseItems belong to the common
GraphicsScene. In case the transition was defined
from internal state node to somewhere outside,
we don't have for it an BaseItem on the gui side,
as we just show the part of the scene. That's why
the validation vanishes the transition when
viewing a zoom.

In general, all the validations should be moved
from gui to the ScxmlDocument / ScxmlTag part.
This in general would require really big refactoring,
or even rewrite.

This patch moves some checks into a model side and
disables direct modifications of the model when
it's not desired.

Fixes: QTCREATORBUG-21676
Change-Id: Ica0771f637a9802dcc0fb87ad04b0ee77a21cda2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-14 20:48:55 +00:00
Eike Ziller
484d40258a IDocument: Simplify permission changes
Take care of handling file permission changes centrally.

TextDocument had its own, caching implementation of tracking the backing
file's read-only state. Move that into IDocument directly.

IDocument::reload with a permission-only change is not a very
interesting case, but every subclass needed to add handling of it.
Instead, remove TypePermission from the file-change types, and handle it
separately via the now unified checkPermissions() implementation.
IDocument::reloadBehavior already was never called with TypePermission.

Change-Id: I321d47ba6193bc878efa9bb50ba7a739fa492745
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-14 14:55:34 +00:00
Jarek Kobus
a64defa10b Remove unneeded include
Change-Id: If5a21c5dd95cbee594b0aa5cfaee895eda84bc10
Reviewed-by: hjk <hjk@qt.io>
2021-01-13 16:06:34 +00:00
Jarek Kobus
cf010911f7 Don't allocate unneeded temporary containers
Fix clazy warnings: allocating an unneeded temporary container
[clazy-container-anti-pattern]

Change-Id: I4b4c2c634eea650bbdf3c12d982a17f899fc94ec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-14 12:35:47 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Jarek Kobus
48c2afe157 Decorate some classes and methods with final keyword
This way we silence the clang warnings about calling
virtual methods from c'tor or from d'tor:
[clang-analyzer-optin.cplusplus.VirtualCall]

Change-Id: I8d6318b490152133da4833bda2ba28622bce30dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-19 09:45:53 +00:00
Jarek Kobus
6d5e302157 Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed
since they still rely on dynamic introspection
(mainly QQuickItem cases).

Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 13:45:02 +00:00
Eike Ziller
3ee70780b4 Qt6: Sprinkle QLatin1Strings for QStringView comparisons
Task-number: QTCREATORBUG-24098
Change-Id: I2fb79bcfd0537a6704a1ee8db840401d6beca7a0
Reviewed-by: hjk <hjk@qt.io>
2020-10-08 10:38:47 +00:00
Eike Ziller
929e3819a8 Qt6: enterEvent now gets passed a QEnterEvent
Add a Utils::EnterEvent for porting.

Task-number: QTCREATORBUG-24098
Change-Id: I2782fe33e41a813b5562676f6dc87d6d53babdd3
Reviewed-by: hjk <hjk@qt.io>
2020-09-29 10:34:22 +00:00
Eike Ziller
3a602e8338 Replace qrand with QRandomGenerator
Task-number: QTCREATORBUG-24098
Change-Id: I91b610409a413c7d76b3c5dd43cf581a960edf7d
Reviewed-by: hjk <hjk@qt.io>
2020-09-18 14:12:23 +00:00
Eike Ziller
2a05186194 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	CMakeLists.txt

Change-Id: I799060da2cb299bb0c49a3da3530fad18427a23c
2020-08-21 10:08:55 +02:00
David Schulz
158fd92558 SCXML: fix magnifier not hiding
Fixes: QTCREATORBUG-24463
Change-Id: I835550e32467992ea7ad2555c546d810e6e0bbad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-20 06:20:40 +00:00
hjk
52b2ca55c9 Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
QT_USE_FAST_CONCATENATION doesn't do anything nowadays.

Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS
for QStrings and enables more QStringBuilder use for QByteArrays.

Change-Id: Ibd297817c50d86661d47822799f989447249af1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-07 12:45:03 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Christian Stenger
26a9f4a214 SCXMLEditor: Remove unused includes
Change-Id: Ia2d76b0f7749686636589bde9c4bcbd9b52f39d4
Reviewed-by: hjk <hjk@qt.io>
2020-06-19 12:28:34 +00:00
hjk
3ec4afff0e Remove uses QOverload<const QString &>::of(&QComboBox::currentIndexChanged)
Gone in Qt 6.

Task-number: QTCREATORBUG-24098
Change-Id: I7ab2dcb9b7c71a3b0d07f05162ef2752e02dc881
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-19 09:32:55 +00:00