Commit Graph

263 Commits

Author SHA1 Message Date
Jarek Kobus
b49c40181a GuiUtils: Apply wheel blocker to more widgets
Attach it to configuration and aspect widgets.

Change-Id: Ifd649f6dbf8bbb1ce1cf7251ac46b7cfac9798e3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-05 10:17:35 +00:00
Jarek Kobus
f53db77230 GuiUtils: Rename attachWheelBlocker into setWheelScrollingWithoutFocusBlocked
This name corresponds better to e.g. SH_ComboBox_AllowWheelScrolling,
SH_TabBar_AllowWheelScrolling or wheelScrollLines.

Change-Id: I244774584e293ca45cc4be4d4526f925c2da9598
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-01-04 14:15:32 +00:00
Marcus Tillmanns
7b1213d9f8 Utils: Fix initial display string for StringAspect
Change-Id: Ib76a5ef4e0792509dc3062c2be244e0f4be049d3
Reviewed-by: hjk <hjk@qt.io>
2023-12-14 10:13:57 +00:00
Jarek Kobus
d1d573ad16 Aspects: Make lambda non-mutable
Amends 16f7652717

Change-Id: Id01ce3f7f0b5c9911097fa3ef2836015a009ed2b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-12-12 11:51:24 +00:00
Jarek Kobus
24397509d4 Libs: Cleanup lambdas
Change-Id: I715a124dd73f23c735dde27d3205ac7613ae04c6
Reviewed-by: hjk <hjk@qt.io>
2023-12-12 11:28:30 +00:00
Eike Ziller
2e280e1c50 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/clangcodemodel/clangdfollowsymbol.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I45b7fee1a1d784c44f2139fb1ede69190d23d6fd
2023-12-06 16:50:15 +01:00
Marcus Tillmanns
d2c03f771b Utils: Add ToggleAspect
Change-Id: I2de41811c0c039cd52d48aab98e0c65706d21a74
Reviewed-by: hjk <hjk@qt.io>
2023-12-05 09:31:30 +00:00
Marcus Tillmanns
1079204a3e Utils: Fix updating BoolAspect::action() checked state
Task-number: QTCREATORBUG-29949
Change-Id: I1c12bd59855ecf13f06fdb16bf8e0937768527b1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-27 14:06:11 +00:00
Alessandro Portale
f96feadad0 Fix missing overrides and redundant virtual
Change-Id: Id2a247b6032602c2295d928067c2462d3f9b5221
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-14 14:27:45 +00:00
Eike Ziller
363d2d161c Merge remote-tracking branch 'origin/12.0'
Change-Id: I35cb28b759fb200c45a1496299584132336fcd1c
2023-11-08 10:07:29 +01:00
Marcus Tillmanns
772546453a Utils: Warn if enabler is set before readSettings
Change-Id: If3dd3fc5adbcd73a87f8e57482c7497c3cd11da2
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:35:26 +00:00
Marcus Tillmanns
845676f814 Utils: Fix incorrect checks
There is no reason to force m_buffer = m_internal afaik.

Change-Id: I6cab375c9d416d4fbe167c4cfb884e7cc6025381
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:19:51 +00:00
Tasuku Suzuki
f1085b324e ProjectExplorer: Avoid accidental changes on spinbox via mouse scroll
- Introduced an Utils::attachWheelBlocker() to disable mouse wheel events on the "Parallel Jobs" field.
- This prevents unintentional modifications when users inadvertently scroll over the input.

Change-Id: Iccb93305fbcf399cae683412078782b5ea9f4ad6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-10-17 01:55:14 +00:00
Marcus Tillmanns
4aef48de5e Utils: Add AspectList::createAndAddItem
Adds a function to add a "default" constructed new item to the list.

Change-Id: I3d826b6f3e3705ae431efa5d778219f431509ea8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-11 10:29:14 +00:00
hjk
c90a6df6ef Revert "Utils: Fix BoolAspect::action"
This reverts commit 4c5e3aa6ba.

Not needed anymore. The action likely ends up in a menu or such
where it is effectively 'autoapply'.

Change-Id: Ib02cba871028fa1422e10622d263218089226c56
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-10-10 08:46:04 +00:00
Marcus Tillmanns
85889e6a09 Utils: Fix connection
Change-Id: I1c17525be7326f836359ddcb911ae048f733a56e
Reviewed-by: hjk <hjk@qt.io>
2023-10-06 08:33:57 +00:00
Marcus Tillmanns
6cd2e6de0c Utils: Fix StringAspect TextEditDisplay
Remove the unnecessary re-setting of the text edit
content due to the undo => edit => undo => edit
connection.

Fixes: QTCREATORBUG-29688
Change-Id: I7838ed594ae3741df757fa5eb3cdd90506428be3
Reviewed-by: hjk <hjk@qt.io>
2023-10-04 12:34:17 +00:00
Marcus Tillmanns
67e4c280aa Utils: Fix connection
Change-Id: I88090c4200cec2a80d6b871b9b443ad7891573e1
Reviewed-by: hjk <hjk@qt.io>
2023-10-04 08:02:17 +00:00
Marcus Tillmanns
fe24faa12b Fix issues found by coverity
Change-Id: I1eba9b800fed419bea4169ec6d6042c2f99b505d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-28 10:06:28 +00:00
hjk
7a4e66992c Utils: Streamline QtcSettings interface
Change-Id: Icd9592c0fca5df1e52bdafb570665d92deeb70bb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-28 07:00:05 +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
d6fe357d81 Utils: Use a proper class as Key
The Key encapsulates now a QByteArray.

Plan is to use QByteArray::fromRawData on literals, but that's not
active yet due to an unclear ASAN report, see the gerrit discussion.

For now we also paddle back when interfacing QSettings, instead of mimicing
writing a QVariantMap (and fail in some corners), always convert
the Store. This is meant to go away in the future when code paths
are better controled.

Change-Id: Id1206a434d511f8003903d5322c7c9bd5f5fb859
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-27 09:41:44 +00:00
Marcus Tillmanns
61048fa737 Utils: Add AspectList::clear()
Change-Id: Ic3e90bc76d271c1bb3b84e545fae5ba1c7a10468
Reviewed-by: hjk <hjk@qt.io>
2023-09-26 09:02:45 +00:00
Marcus Tillmanns
a43191497d Utils: Fix StringSelectionAspect
Previously the undo state was not updated when the value
was set from the outside before the gui model was setup.

Change-Id: I380916f888edd120f512089bdb94762977c11978
Reviewed-by: hjk <hjk@qt.io>
2023-09-26 07:37:44 +00:00
Marcus Tillmanns
9923992755 Utils: Fix nullptr check in StringAspect
Change-Id: Ibf649c7a00c9cc1ec778590c3c6b64bea9ad552a
Reviewed-by: hjk <hjk@qt.io>
2023-09-25 07:29:30 +00:00
Marcus Tillmanns
dedfc3dbe7 Utils: Fix StringAspect ui connection
QLineEdit::textEdited is only called when the user types.
It is not triggered if the text changes due to undo/redo.
QLineEdit::textChanged is triggered for all changes.

We also have to make sure that we don't call
QLineEdit::setTextKeepingActiveCursor unnecessarily
as that would clear the undo/redo stack of the QLineEdit.

Change-Id: I19562d0804e6a34b11f19e86abd256a807e147d6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 13:01:13 +00:00
Marcus Tillmanns
b32643e996 Utils: Don't store widgets in StringAspect
Change-Id: Ibeabd5c933210fefede7748cdfba416ed33b27bf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-21 12:35:56 +00:00
Marcus Tillmanns
84ba3c58c2 Utils: Replace BaseAspect::pushUndo
Moving the logic into Undoable::set() reduces allocations.

Change-Id: Ib4a10d1e41da8d42d66bfe9ef24a667c5bfd8c0c
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 12:01:46 +00:00
Marcus Tillmanns
811792df58 Utils: Don't store widgets in BoolAspect
Change-Id: I185dbb32ccae6bff4e222f7a9d9cd6ccd6bdbc69
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 09:20:18 +00:00
Marcus Tillmanns
399c2f92d6 Utils: Don't store pointer to aspect label widget
Change-Id: Ieb8a04357fbdbc909fed79e33ef6a1d0cef2d721
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 08:30:48 +00:00
Marcus Tillmanns
f4f75224b7 Revert "Utils: Add StringListAspect editor"
This reverts commit cd8bc98e52.

Reason for revert: Breaks compilation

Change-Id: I27ef9b718adf8cd4b8ac72e77161515ff637bd6e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-09-21 07:35:28 +00:00
Marcus Tillmanns
cd8bc98e52 Utils: Add StringListAspect editor
Change-Id: I0d6713f75967fb56132f89772aa48fa1de2368af
Reviewed-by: hjk <hjk@qt.io>
2023-09-21 07:34:03 +00:00
Marcus Tillmanns
67bd5fc359 Utils: Add StringSelectionAspect
Change-Id: I73b5c964be1222f56fcc01f30d17506f92d1f6b2
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 13:02:07 +00:00
Marcus Tillmanns
b81026488c Docker: Improve error reporting
Change-Id: I1a1ad824b4084ce7203357acf9ec19ccfe91b5cd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 13:00:39 +00:00
Marcus Tillmanns
16f7652717 Utils: Add AspectList::addToLayout
Added a new, clean IconButton that mimiks the ToolButton
with the compact/relaxed background.

Change-Id: I582c6aac404724af5459bab2ca9023aa63171f93
Reviewed-by: hjk <hjk@qt.io>
2023-09-15 06:26:42 +00:00
Marcus Tillmanns
26b436f46f Utils: Fix constness in AspectList functions
Change-Id: I960e02e1a193856de3ed0e090fdf694884a28ac5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-15 06:25:22 +00:00
Marcus Tillmanns
d44afce0f0 Utils: Add AspectList aspect
Change-Id: Id164828f4ba46c973edbcd123c855bb7b70ad8f7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 11:37:10 +00:00
Marcus Tillmanns
7200644f75 Utils: Syntax cleaning
Change-Id: If296e0240840f66c371106508f3f0046bc7a9a71
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-09-13 07:11:52 +00:00
Marcus Tillmanns
67aab38873 Utils: Add undo/redo to BoolAspect
Change-Id: Ie80e81c2ceef232278e2815ffa56bcbaef903eb2
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 13:30:40 +00:00
Marcus Tillmanns
ed0935733e Utils: Add FilePathListAspect
Change-Id: Iec89581e5818139bcc48ed807935c10421b7b664
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 08:51:20 +00:00
Marcus Tillmanns
66c8eda943 Utils: Add Undo facilities for aspects
Change-Id: I2a8acfa23b3a4303414be21af224b08c13561666
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 07:12:45 +00:00
Marcus Tillmanns
8bcec807d9 Utils: Fix AspectContainer::setAutoApply
Removes duplicate m_autoApply from AspectContainerPrivate.
Fixes issue when calling BaseAspect::setAutoApply()
on an AspectContainer.

Change-Id: I5f56d8d3c6d52d32c9365faf3d0e22facb757f03
Reviewed-by: hjk <hjk@qt.io>
2023-09-12 07:11:26 +00:00
Marcus Tillmanns
76a95ff0ee Utils: Switch to QtcSettings
Changes a few remaining QSettings members that popped
up when trying to build with "apt-get" Qt 6.2.4.

Change-Id: I3caa8545cf02d6453b802559c2f65279e1fb63fd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-05 07:02:24 +00:00
Marcus Tillmanns
0490266723 Utils: Add Aspects::volatileToMap
Change-Id: Ic4b77e27570485864cb4a9a412d685c400a9e7d1
Reviewed-by: hjk <hjk@qt.io>
2023-08-24 08:49:06 +00:00
hjk
2bf886ed73 Utils: Use a bit more Key and Store
Also, separate the Key into a separate header to minimiz impact
on #include load.

Change-Id: I4f719cad4d23a71a9c228d0b7f5c2409fd6e24d5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 05:58:05 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
hjk
ec7abcf98c Utils: Make FilePathAspect::setDefaultValue take a QString
This sets the unexpanded value, so going to a "cooked" FilePath can
at least theoretically break. On the user side it saves a
roundtrip in a few cases, but is more ugly when the input is already
a proper FilePath.

Change-Id: I8a7e8f6d46fcc34c96b55e41d656dca933fbef4e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-17 11:58:41 +00:00
hjk
e9c1901bad Core: Use an aspect for the Patch tool path setting
Change-Id: Ifc758fb4ac5d00a7b755ea06f3f6b98d53e7cc46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-16 08:57:09 +00:00
Marcus Tillmanns
013b71b301 Utils: Allow cascaded aspect "setEnabler"
Change-Id: I4e519c0ef27460b42c4e44a755e5e6cbbf49ebdf
Reviewed-by: hjk <hjk@qt.io>
2023-08-15 13:30:06 +00:00