Commit Graph

167 Commits

Author SHA1 Message Date
David Schulz
01dc62b019 Editor: Fix loading color schemes
When the user switched to another builtin color scheme the full paths
check do not match anymore if the user starts a Qt Creator with a
different install dir.

Change-Id: I4692c85a23a7d524497786db4dd8e1a00bb7a9fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-10 06:53:22 +00:00
hjk
0eacd0190d All: Remove some unneeded #includes
Change-Id: If9a8fb5e0b32424e3b37ecf3adefc060f86b3630
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:50:38 +00:00
hjk
342e066886 Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 13:25:31 +00:00
David Schulz
c58bf7f5b8 Editor: avoid accessing the widget from the FontSettingsPage
Change-Id: I51dbf4d1c7384f460b84da9602c10667addabebb
Reviewed-by: hjk <hjk@qt.io>
2023-07-06 11:49:00 +00:00
Alessandro Portale
9c31267e58 Remove ineffective resize() calls
This removes apparently unnecessary resize() calls on QWidgets based
forms which get anyways added to layouts and resized. Most of these size
values looked "accidental", i.e. neither divisible by 2 nor by 5, in
most cases a remnant from the ui inlining.

Change-Id: I95da3b93f2915ef955b5235e5c2ecc94b51f813a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-10 11:14:10 +00:00
David Schulz
06b0d105dc Editor: simplify font to display options page connection
Operating on saved settings is less error prone and easier to maintain.

Change-Id: I92e3a6b52296cddc302ba2e4410edfd243b8ad32
Reviewed-by: hjk <hjk@qt.io>
2023-05-08 11:20:24 +00:00
hjk
17b20e0622 TextEditor: Tr::tr
Change-Id: I28aa68e25c53c3a4d1c370074d7b3318944dc45a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-18 07:02:12 +00:00
hjk
e7c536011f Prefix Tr::tr contexts with ::
To make outliers better visible in Linguist

Change-Id: Ic35ea2a858b7e3576d9a416fb494fddb616eaaa1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-13 12:00:17 +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
Jarek Kobus
4fc5483c74 FontSettings: Remove unneeded QOverload
Change-Id: Ie6a7fe10a0f8975277c007d50ace8ab233167d32
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-12 08:39:35 +00:00
Jarek Kobus
bf0d716b51 Remove unused includes of QGridLayout
Change-Id: Ia0823fe1dbadb7c68efc431c3bf0f1ba621a9484
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:29:15 +00:00
Jarek Kobus
3caf82f746 Remove unused includes of Q[H/V]BoxLayout
Change-Id: Ia90b30b634281414268e00722771470f1e7b69c0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:29:06 +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
Jarek Kobus
bc4c1faf73 Fix logical XOR
The '^' is the bitwise XOR, we should use logical XOR in
these contexts. The operator!=() should serve for it.

More info and reasoning:
https://stackoverflow.com/questions/24542

Change-Id: I1bd70bdcab25455f409594f0f14c209d1de11d18
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-07 07:42:22 +00:00
hjk
686bcb3ef5 TextEditor: Proliferate FilePath use to FontSettings and ColorScheme
Change-Id: I3fd2e57b9b922d7bf6269b608da48f4a2e13dfb2
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-23 06:22:22 +00:00
Florian Koch
69fad91660 Re-introduction of the feature to adjust the line spacing
This already has been implemented in change
dc64f3207b, but was reverted with
change f220cb0e23) because this does not
work with text wrapping rendering, due to internal limitations of Qt.
Since this is a highly requested feature (e.g. QTCREATORBUG-13727), but
an internal change within Qt is not in sight, the approach taken here
is to offer the text wrapping feature in the settings only when the
line spacing is set to 100%. Additionally, a change has been made to
the layout of the display settings page to reflect this.

Fixes: QTCREATORBUG-13727
Change-Id: Ib233cf90a5f336bc591fa1bf860e162fa774dfe3
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-09-12 16:40:15 +00:00
David Schulz
77b5613cd9 Editor: do not hardcode default colors for function search result
Using white and black as the defaults results in unpleasant colors in a
dark color scheme. Instead rely on the fallback to the colors of C_TEXT
that are used in the SearchResultColor constructor.

Change-Id: I110aadbae9f07f59fefac07c7ef8fa2af2f3b596
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-09-06 08:13:29 +00:00
Eike Ziller
a2f21d40f5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp
	src/plugins/texteditor/fontsettingspage.cpp

Change-Id: I5a6accd2065e0d8320045b57ade7b54a9a09aae0
2022-08-31 11:03:13 +02:00
David Schulz
e3408a8a0a Editor: fix importing color schemes
Change-Id: I286de6030462e692a673a61f3630ad3ca7f95a2d
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-08-30 06:59:35 +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
Marcus Tillmanns
451d02c88d FilePath: Remove ::toDir() and deprecation hints
Change-Id: Ib561c019e3fd44cd85504ad4286eb3759ce19516
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 08:46:06 +00:00
hjk
4397282fe6 TextEditor: inline fontsettingspage.ui
Change-Id: I6bcfa9135ad66146850b0500c6d35889ab5c5df7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-25 15:11:12 +00:00
Ihor Ivlev
6f7e7980d2 Display parent functions in the Find Usages menu
To display the parent function, first we find it in displayResults and
store the information to SearchResultItem, then
SearchResultTreeItemDelegate gets the information and renders it.

Similar approach is applied to ClangdClient, in addSearchResultsForFile.

This change also adds default style for containing function highlight in
the search.
Default foreground and background colors are same as usual text colors.

Task-number: QTCREATORBUG-27550
Change-Id: Id1251afa192f8d1232524742b7c211770bcb83fb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-25 15:05:25 +00:00
Artem Sokolovskii
66f132dd9b TextEditor: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Ie9594bf661dbeecf22589c1580648252f0bfb7fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-19 07:33:27 +00:00
Artem Sokolovskii
c941f7d0f5 Font settings: Add import and export functions
Fixed: QTCREATORBUG-6833

Change-Id: I23eec56aeb53ed10dd7f04c071318f5cc335b14e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-13 13:11:36 +00:00
David Schulz
18b98a85eb Editor: only remove one scheme at a time
Since the delete button has already the accept role the delete was
triggered twice. First time by the role and second time from the connect
of the button clicked signal to QDialog::accept.

Change-Id: I9bd6104d36f286ec8bd0b25ee4ab6e7c8306d51a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-02 05:28:38 +00:00
David Schulz
8bef120f14 Editor: fix duplicating color schemes
Core::ICore::userResourcePath seems to have returned a string
with a trailing slash before it returned a Utils::FilePath.
This allowed us to just concatenate the resource path with the pattern.
Use FilePath::pathAppended to make sure the styles end up in the correct
directory.

Fixes: QTCREATORBUG-25944
Fixes: QTCREATORBUG-25910
Change-Id: I6ac735e3746e4328b5bbae4e55d91ef642277886
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-02 05:28:30 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
Alessandro Portale
626728609b TextEditor: Define default foreground colors for C_SEARCH_RESULT_ALT1|2
Since the background colors were defined, also the foreground colors
need to be defined to make sure that both light and dark schemes which
do not define C_SEARCH_RESULT_ALT1|2 have a legible contrast.

Change-Id: Ic954852bdc66d3534f664658b914af1a30795a7d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-18 07:41:25 +00:00
Alessandro Portale
bf852d8fed TextEditor: Better default background colors for C_SEARCH_RESULT_ALT1|2
C_SEARCH_RESULT_ALT1: Give it a bluish tint.

C_SEARCH_RESULT_ALT2: Black on red is quite sneaky on many people's
eyes. This changes the red background to a brighter and less saturated
red.

Change-Id: Id1000119583bf05d47206d877a791ccc42323753
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-17 12:54:26 +00:00
David Schulz
f220cb0e23 Revert "Editor: Make line spacing adjustable"
This does not work with text wrapping since there are multiple
QTextLines inside a block but we can not adjust the line hight inside a
block. This needs to be addressed inside Qt.

This reverts commit dc64f3207b.

Change-Id: If6c28056da9891eeeb75f5939a42f08360013a80
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-20 04:35:42 +00:00
David Schulz
dc64f3207b Editor: Make line spacing adjustable
Fixes: QTCREATORBUG-13727
Change-Id: I3dbc3277795b339bced81dc6c5a048c828183cb6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-01 12:11:09 +00:00
Christian Kandeler
4376bc1e39 Core: Allow different highlight colors in search result window
... and make use of that in CppTool's "Find Usages" by assigning
different colors to read and write accesses.

Fixes: QTCREATORBUG-12734
Change-Id: I067db2c8d693bb2c5be44249931ee4f0269f7e52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-09-18 09:33:07 +00:00
David Schulz
e978f59654 Editor: set default text foreground color explicit
Amends 9182d4eda7.

Fixes: QTCREATORBUG-24352
Change-Id: I16171874cf2f2e9fde95b404f7510a502a39f26e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-20 04:37:21 +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
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Eike Ziller
9e0009803c Fix lupdate issues
Change-Id: I26f08ae82354c178f6d26f9138796328b50bfba8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-03-18 10:45:15 +00:00
David Schulz
3c4acafdb6 Editor: Fix crash on exit
Make sure no FontSettingsPageWidget is created when changing the font
zoom level in the editor. Otherwise it will crash in the font combo box
when closing Qt Creator.

Since we can't use the save and emit mechanism from the widget anymore
move it to TextEditorSettings

Change-Id: I1eb87bbae3cf2b802fb15981e7fc2203106d5565
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-03-02 11:24:57 +00:00
hjk
f8ee2d3c40 TextEditor: Move FontSettingsPage more towards new scheme
Mainly re-using the existing pimpl as new widget implementation, and
using the primary storage out of the page (into texteditorsettings).

This one is structutally bit different as there is that second path
(Ctrl+Wheel) to modify font zoom.

Change-Id: I7b85c781c7c53a733b234754beb5bb54664be3fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-30 10:14:16 +00:00
hjk
3e67c2ce92 TextEditor: Make FontSettingsPage more like the other ones
Change-Id: I00d758bcdafd39b14498bdf182332ece53215d64
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-27 07:02:18 +00:00
David Schulz
487df597f3 Editor: Fix Font & Color settings loading
broken after 07b04c2056

Change-Id: I6ec9676aec6dbfee023a5e4710b69cdd709780ef
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 08:55:28 +00:00
hjk
07b04c2056 TextEditor: Dissolve TextEditorOptionsPage intermediate hierarchy level
It's effectively setting only three properties nowadays, not enough
to justify a case of reuse-by-inheritance anymore.

Change-Id: I947fbc51e76c8d908da662dd58dce91614c28e08
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-16 12:09:26 +00:00
David Schulz
5e4b10060f Editor: Allow any point size as font size
...by making the size combobox editable. This way the user can still
access the proposed list of point sizes in the combo box.

Change-Id: Ia73ccde9277d8960bc2de550f74355b0561d4c8e
Fixes: QTCREATORBUG-22536
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-14 08:51:44 +00:00
Eike Ziller
90c6bc578f Revert "Use QComboBox::currentTextChanged instead of currentIndexChanged"
This reverts commit 25f9d9c434.

The deprecation was reverted in qtbase 298f750cdba2bd15e735a47ba8d3b9c093367ba3.

Change-Id: I8a05f038be4b7fc89e05830435e08c3212e4f116
Reviewed-by: hjk <hjk@qt.io>
2019-07-22 12:44:28 +00:00
Alessandro Portale
25f9d9c434 Use QComboBox::currentTextChanged instead of currentIndexChanged
QComboBox::currentIndexChanged is depcrecated as of Qt 5.13 and
QComboBox::currentTextChanged is available since Qt 4.1

Change-Id: I97b8eb37765cbb7556cfbde87ea90f91f63bfa63
Reviewed-by: hjk <hjk@qt.io>
2019-07-04 08:18:30 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Eike Ziller
0619de8681 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/tools/clangpchmanagerbackend/source/taskscheduler.h

Change-Id: I518adaf647df412887c2a372416634359f09ad2a
2019-03-05 10:22:45 +01:00
David Schulz
51e24f5ad4 TextEditor: Hide controls in scheme editor for builtin schemes
Show a label instead with a link that copies the current color scheme.

Fixes: QTCREATORBUG-21874
Change-Id: I74083bac8d7124341b4b63d8e172172235c5e184
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-04 10:16:19 +00:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00