Commit Graph

26 Commits

Author SHA1 Message Date
hjk
8cf500c5bc Utils: Make Layouting a top level namespace
The whole machinery is now almost only layoutbuilder.{h,cpp},
mostly independent of the rest of Utils. Idea is to finish the
separation to make it stand-alone usable also outside creator.

Change-Id: I958aa667d17ae26b21209f22412309c5307a579c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-25 13:31:25 +00:00
Artem Sokolovskii
028686b419 ClangFormat: Grey out Clang-Format Style config when not overridden
Add feature to grey out the Clang-Format Style configuration widget
after unchecking the 'Override' checkbox.

Change-Id: I94bbb1f4436f3caeaed55d49582211257e480d0d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-06 11:20:29 +00:00
Jarek Kobus
d96c7a2d0d CppCodeStyleSettingsPage: Reuse Layouting::TabWidget
Change-Id: I82ad373f1acebc6d62da3d58619b9a6cc11d7638
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-16 12:57:05 +00:00
Alessandro Portale
f7bcd4f574 CppEditor: Convert to Tr::tr
Change-Id: Ic4025e06e17c45eb6dc2162fb7f21f5b8aebe84d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-12 06:46:45 +00:00
Eike Ziller
0dfa542bee Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppcodestylesettingspage.h

Change-Id: I1aa4e2f9efc6d9cf9f284aef1abf148be9b93a60
2023-01-10 15:44:55 +01: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
Artem Sokolovskii
ce1a547b6c CodeStyle: Fix preview update
Fixes: QTCREATORBUG-28621
Change-Id: I66a66d9c16933ebd8197f9e286e72dce7a621933
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-05 09:12:15 +00:00
Eike Ziller
af60fb8241 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppelementevaluator.cpp
	src/plugins/vcsbase/vcsbaseclient.cpp

Change-Id: I31e03b063240416280f5ca88c31f432911d5c67e
2022-12-12 11:07:15 +01:00
Artem Sokolovskii
69abc39aea CodeStyle: Fix save settings without applying
Change-Id: Iebe4c4fb6f3279592e7933981aba69087db558f9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-09 11:17:00 +00:00
Eike Ziller
b4fed03c27 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppeditorplugin.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: I41747ff9490e4ab20340d4d4acb4655100aaa3d2
2022-12-07 10:47:47 +01:00
Artem Sokolovskii
f93404d405 CodeStyle: Fix loading settings at the start in codestylesettingspage
Fixes: QTCREATORBUG-28450
Change-Id: I578c6cd102e4753d3af562986dad62e10e54d06d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-06 12:44:45 +00:00
hjk
9d80e23256 CppEditor: Proliferate FilePath use
This includes one functional change: It drops some cleaning
of the path used to create the CppDocument, which is now
assumed to be done on the caller side.

Change-Id: I5e2a182028e4d5b56282ad85f4a5c665f081754f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-24 15:54:33 +00:00
hjk
fa1adf4d40 CPlusPlus: Proliferate FilePath use
The starts with CppDocument::filePath(), plus a bit of the fallout

This is one patch of potentially many. It is hard to draw the
line where to stop this kind of chunk, this here converts a few
additional functions for which including it in the patch looked
like less churn than without.

Converting is mostly fromString/toString, with a few exceptions
for "already seem" like caches, that use cheaper "path()" to
avoid likely performance regressions (on Windows FilePath
comparison is currently case-insenstive, and more expensive).

There should be no difference for local operation with this patch.

Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-11-22 15:30:00 +00:00
Jarek Kobus
47b5613c53 CppCodeStyleSettingsPage: Use Layouting
Change-Id: Ied8991d32d5799af944c94a65ff3e85f3f454b26
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-18 08:14:00 +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
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
Alexander Drozdov
4a79623959 Fix crash on Preferences dialog close
Mitigation for regression introduced by
74ac09346f.

On finish() method call m_widget maybe nullptr, so call for any him
methods is dangerous without checking for nullptr.

Change-Id: Ia7ab5572946fef9bcc62c63709e5ffc69cd2ebae
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2022-08-17 22:28:41 +00:00
Artem Sokolovskii
74ac09346f CodeStyle: Remove edit pop-up
Removed the Edit pop-up on the CodeStyle page.
Now editing is available immediately after opening
CodeStyle tab.
I left a preview on the project CodeStyle page and
added a link to global settings.

ToDo:
In project CodeStyle page replace preview with CodeStyleEditor.
I'm not 100% sure that it is needed. If you have some thoughts
please write a comment.

Change-Id: I31032a97b9668b4f6b06fc6c5c704700fb44ee4f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-16 11:49:19 +00:00
Artem Sokolovskii
e572bdd90c ClangFormat: Move global settings in main page
The settings: indenting instead formatting, format while
typing, format edited on file save are moved to Code Style
page.

Change-Id: I28787b44602ce288961c778fe704ad2a1a05913f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-05 09:41:14 +00:00
hjk
2361353289 CPlusPlus: Remove Rreprocessor::run overload for QStrings
The preprocessor operates on QByteArray, making it less
convenient to use strings helps preventing accidental
conversion roundtrips.

Change-Id: Ifb2068a8fed137c52b05f2979b99cbce3462151e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-01 12:18:06 +00:00
Artem Sokolovskii
7e69b64b74 CppEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: I9915cf2c07bdcc570efc20601752d60f2ec82f34
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-06 13:35:43 +00:00
Artem Sokolovskii
9afe4f958a ClangFormat: Remove unneeded warning
- Remove warning when .clang-format file is absent
- Remove warning when a page is nullptr in addTab function

Change-Id: I4232bc77eaac56c78707fc37aaf75b00b8af9006
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-04-26 09:10:05 +00:00
Artem Sokolovskii
059d20ed22 ClangFormat: Fix unsaving properties for global settings
- Fixed behavior "Formatting mode" combobox settings isn't
saved after pressing "Ok" button when no one project is
open. Now it works as expected, settings save after press
"Ok" button.
- Added additional applying interface for ICodeStylePreferenceFactory
which allows pass-through apply call from dialog to the editor.

Note: it doesn't work with read-only code style profiles

Change-Id: If4f0c85e3105550db4ffd9860e94b678f0d9b386
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-03-30 16:32:08 +00:00
Artem Sokolovskii
a997161dd6 ClangFormat: Synchronize ClangFormat settings with CppEditor codestyle
Added synchronization between ClangFormat codestyle settings and
CppEditors codestyle settings. All changes which will be done in
ClangFormat settings tab settings tabs will be automatically
retranslated to CppEditor codestyle settings tabs and vice versa.

Change-Id: I408d726c12552856e3c1b72d3ba09b77fff83321
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-24 21:35:31 +00:00
Artem Sokolovskii
9cb0bd94f0 ClangFormat: Move ClangFormat settings page
- Move ClangFormat settings page to TabWidget in the dialog
that opens when a user press "Edit" button in the CodeStyle tab

Change-Id: Ibd285344f07a6b2b20e275f2134976c50f91a019
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-08 13:09:12 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00