summaryrefslogtreecommitdiff
path: root/src/libs
Commit message (Collapse)AuthorAgeFilesLines
* ScopedTimer: Make it possible to provide optional message stringJarek Kobus2023-05-172-24/+41
| | | | | | | | | | | | | When optional message argument is provided, both macros print the message instead of __FILE__ and __LINE__ info. It helps to ease the identification of the exact place in code when many macros are added - custom message may be more informative that the file and line location. Change-Id: I7a3ccbdaca2858b44dcbd51a8f9330160dab73e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils: add Position::fromCursor with testsDavid Schulz2023-05-172-0/+6
| | | | | | Change-Id: I1cd989eaf7e75bc04f171989f9f9fe932402abef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CheckableMessageBox: Simplify checkbox setupEike Ziller2023-05-171-9/+1
| | | | | | | | If the dialog is shown, the checkbox must be unchecked, because otherwise the dialog would not have been shown. Change-Id: I34e8034975baef710997e0cdb3c7d2f8b0c94cd2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* CheckableMessageBox: Make semantics of bool value clearerEike Ziller2023-05-172-6/+6
| | | | | Change-Id: I06a43ab986e6f028cf07ea5e9700c831a591cbf2 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Fix Qbs buildChristian Stenger2023-05-171-0/+1
| | | | | | | | | Amends f84199f8b70bb03b66a0dbac3ff4dcdb56094d20 and reverts 796cfceb3a27337e2f613624a8c223761fdd44b8. Change-Id: I7eb686c012bd99cddf36aa16219e3f33de2b15b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Unify CheckableMessageBox and make it look more nativeMarcus Tillmanns2023-05-172-465/+334
| | | | | | Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Solutions: Long live Solutions!Jarek Kobus2023-05-1718-46/+139
| | | | | | | | | | | | | | | | | | | | | | Short live Tasking in Solutions! Add src/libs/solutions/README.md with the motivation and hints. Move TaskTree and Barrier from Utils into Tasking object lib, the first solution in Solutions project. Tasking: Some more work is still required for adapting auto and manual tests. Currently they use Async task, which stayed in Utils. For Qt purposed we most probably need to have a clone of Async task inside the Tasking namespace that is more Qt-like (no Utils::FutureSynchronizer, no priority field, global QThreadPool instead of a custom one for Creator). Change-Id: I5d10a2d68170ffa467d8c299be5995b9aa4f8f77 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Allow a BoolAspect to adopt an external buttonhjk2023-05-172-2/+16
| | | | | | | | | | This will be used by the apply machinery and allows more complex setups than the automatically generated internal CheckBox button. Change-Id: I237a9283253f11bcb76e0366a0b6c5a0346fdfd8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Add minimal Flow layout support to layout builderhjk2023-05-162-0/+184
| | | | | | | | | | It will be used in the CppCheck option page. The de-facto copy of utils/flowlayout.{cpp,h} is intentional to keep the layout builder usable stand-alone. Change-Id: Ibda3ece2aeb3cbb1badaf6083b52ebb63b6524ac Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Introduce a FilePathAspecthjk2023-05-162-0/+30
| | | | | | | A shallow wrapper around a StringAspect with a suitable operator(). Change-Id: I0a5e121565d03573faa5c3f4085d72db2b9c3774 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Terminal: Fix exiting of conpty terminalsCristian Adam2023-05-161-1/+3
| | | | | | | QMetaObject would complain about not knowing about the HANDLE type. Change-Id: Iae240bed37c892561eaacdc1d22cf4ae0173df29 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ExtensionSystem: Start reworking initialization order systemhjk2023-05-163-1/+83
| | | | | | | | Allow specifying object creation without immediate creation (but create them nevetheless very soon). Change-Id: I01b91f7cf753ced61705d3f26352548b268be6b5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: add tests for Position::fromPositionInDocumentDavid Schulz2023-05-161-0/+2
| | | | | | | Change-Id: I2b530cf62a4defe0292c51834b1e5093a7d5e55f Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Make CTAD work with std::unexpectedMarco Bubke2023-05-161-14/+1
| | | | | | | | | | | Aliases are not working with CTAD before C++ 20. Instead of aliasing some types we simply importing the namespace tl into the namespace Utils. This enables some not aliased things too. Change-Id: Ic61a50bedbbf7253ecb5bb1f6dc0624dcc704aa0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: add tests for Position::fromFileNameDavid Schulz2023-05-162-1/+10
| | | | | Change-Id: I321b91567e47e08883c7b991cd24d02bb8a9b9c6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Delay close signal in pty processMarcus Tillmanns2023-05-152-6/+2
| | | | | | | | | | | | The close signal of the conpty process needs to be delayed as it otherwise might arrive before the last output of the process. This should be fixed in the future by using overlapped io for the pipes. Change-Id: I49fe4863672a0b14f5766bbe5ee7b1d8894594ca Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* ProjectExplorer: Don't allow remote run in terminalMarcus Tillmanns2023-05-151-2/+0
| | | | | | | | | | Currently the process stub does not support starting / debugging processes on remote devices. To reflect this the "Run In Terminal" aspect is disabled for remote targets. Fixes: QTCREATORBUG-29058 Change-Id: I9b3bcd65d4db468c683f2743a49227bfbecaf3d3 Reviewed-by: hjk <hjk@qt.io>
* Uitls: Make BaseAspect::isDirty() virtualhjk2023-05-151-1/+1
| | | | | | | | | It's sometimes not so easy to trigger the volatileValue() != value() branch, so create a way to be explicit when needed. Change-Id: I322508a33c935077038d730fd09c819419901353 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Use QAbstractButton instead of QCheckBox in BoolAspecthjk2023-05-121-17/+17
| | | | | | | | Opens the path to use e.g. QRadioButton. Change-Id: Idb1591c0a1486181b8aeb51edb93bc4bfecef834 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Utils: Fix some IntegerAspect value display issuehjk2023-05-121-2/+2
| | | | | | | ... when a display scale factor was set. Change-Id: I764db99e444f9cc70871c3dbec101d0b65542c4a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Add an AspectContainer::changed() signalhjk2023-05-122-0/+6
| | | | | | | | | | In contrast to applied() only emitted if anything was dirty before. Ideally, applied() would not be needed, but I am not sure about downstream uses. Change-Id: Ie0c293b8730c503fc4409884a33207ee9ca5f129 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Add operator() as a way to access .value() for some aspectshjk2023-05-121-0/+5
| | | | | | | | This can make the user code look a bit nicer. Change-Id: I98867114810ede2f04342144f600682ff3c261b4 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CMake: Add -fPIC also for OBJECT librariesCristian Adam2023-05-122-2/+1
| | | | | | | | | | add_qtc_library would have set the POSITION_INDEPENDENT_CODE property for STATIC libraries on UNIX based systems. The OBJECT libraries need the same treatment. Change-Id: Ia333a36ea0f35d7db3ed876cdde5b895b47644c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Use FilePath hash in operator==Marcus Tillmanns2023-05-121-0/+3
| | | | | Change-Id: Ibbea420a5a5353da221d285b70272cdf9b09d0d0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Cache FilePath::qHashMarcus Tillmanns2023-05-122-4/+12
| | | | | | | | | | | | Calling toCaseFolded is expensive if the same filepath is hashed often, so we calculate the hash value once and cache the result. One such case was found to happen when parsing tests, as the cpp parser is queried a lot and it uses hash maps / sets with filepaths. Change-Id: Ic3ca7f09e8f108f5a89b3fdb17743ae7c3258001 Reviewed-by: hjk <hjk@qt.io>
* Layouting: Add a plain 'Widget' itemhjk2023-05-122-0/+12
| | | | | Change-Id: Id419b1efd56f51fb282b11c4b241b96eb7d7d0ae Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: fix Text::Range length and remove midDavid Schulz2023-05-122-9/+17
| | | | | | | | | | | | | | | | Those functions are based on the assumption that the passed text starts at the begin position, which was good enough for search results, but if used in other parts of the codebase it might give unwanted results. Calculate the length of the range now as expected and subtract the beginning lines. In order to still got the correct results for the text result texts modify the result range to always start at the first line before calculating the length of the range. Also add tests for the modified functionality Change-Id: I7ccd75b642dda6dd4f738877cbe3543d46c03652 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* TaskTree: Prepare for de-utils-ization - part 4Jarek Kobus2023-05-122-4/+14
| | | | | | | | Add internal implementation for qtcassert.{c,h}. Change-Id: I646b302be2f86e32e91c8c6fafa7b799e48773c2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* TaskTree: Prepare for de-utils-ization - part 3Jarek Kobus2023-05-126-9/+9
| | | | | | | | Rename QTC_* macros into TASKING_*. Change-Id: I809ebf678f20df612a3211c38ebbfe6d4bf6492d Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* TaskTree: Prepare for de-utils-ization - part 2Jarek Kobus2023-05-128-47/+33
| | | | | | | | | Move TaskTree into Tasking namespace. Move Tasking namespace out of Utils namespace. Change-Id: Ib4c1d7f54f1808517e54768dfa27209c33517b61 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* TaskTree: Prepare for de-utils-ization - part 1Jarek Kobus2023-05-121-1/+22
| | | | | | | | Add internal implementation for Guard/GuardLocker. Change-Id: I9bcedee937221c0796143be2f943650a1bb56f38 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* Utils: Remove empty item after optionChristian Stenger2023-05-121-1/+0
| | | | | | | Triggers a soft assert. Change-Id: I9ad863ceb7e1f377e4f9fbae62cca1d0932a76d6 Reviewed-by: hjk <hjk@qt.io>
* Utils: Fix unused parameter warningBjörn Schäpers2023-05-111-0/+2
| | | | | | Change-Id: Ibe4c866b4f3bf39999cfe43bd32287e069e51d2c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: Turn StyleHelper into a namespaceAlessandro Portale2023-05-112-136/+173
| | | | | | | | | | | It was in fact just a bag of static functions. Most importantly, it fixes a previouls introduced build error. Amends 5975657e7747052211310a9bfedaac1fa937fc19 Change-Id: Ia7de8bdcf91e1763f9d3b435316a5df9993717de Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: replace LineColumn with Text::PositionDavid Schulz2023-05-113-41/+0
| | | | | | | Change-Id: Ia69547374efec7412717cbed1eb4162162a89d39 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Utils: Guard SelectionAspect value access against out-of-bounds accesshjk2023-05-111-2/+4
| | | | | Change-Id: I6ca414015cb55f06b7264949487fafc7eb57efd3 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: Add more FilePathChooser config options to StringAspecthjk2023-05-112-0/+30
| | | | | | | Will be used in the Beautifier plugin. Change-Id: I6e70f757a25afcdf1d3e3742357d71503f210b2a Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Utils: fix buildDavid Schulz2023-05-111-0/+1
| | | | | Change-Id: Ibc9050c8b3dd4a1fcba9e87f70b46908dbbd1dce Reviewed-by: hjk <hjk@qt.io>
* Utils: use Text::Position instead of LineColumn in textutilsDavid Schulz2023-05-112-28/+12
| | | | | Change-Id: I606b0b4f8106bdb2f97383d6c81ac065e7e61858 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Utils: move extractFromFileName from LineColumn to Text::PositionDavid Schulz2023-05-117-55/+42
| | | | | | Change-Id: Ibb2465e66c280d4201377921f69741a050d94bc1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-05-111-13/+46
|\ | | | | | | Change-Id: I98e5e1ad43103984b490c65cdeed84b7414303b3
| * Utils: Avoid watching directories of watched filesDavid Schulz2023-05-081-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not watch directories unconditionally, but only if they contain removed files to check whether those files are readded. This should reduce the number of needlesly watched directories to a minimum and fix performance regressions introduced by 61598eca15e14af64c20d314db382973dfccb2d2. Fixes: QTCREATORBUG-28957 Change-Id: I8fe387e7de32b0fb585074330c7f6ca7eae44730 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | Utils: remove OptionalLineColumnDavid Schulz2023-05-113-10/+5
| | | | | | | | | | | | | | LineColumn already has a isValid() that is sufficient for the use case. Change-Id: I7f6e1d64b66a9af05d74ce0ef45717265dc28ed3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Utils: Make column of LineColumn consistently 0-basedDavid Schulz2023-05-112-5/+4
| | | | | | | | | | | | Change-Id: I4ab153d1c55653936efbcdc13ac04463185930e0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Utils: Fix the applying of new base color at run-timeAlessandro Portale2023-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the base color was changed via the color picker that opens with shift-click on the upper left toolbar area, some widgets were not instantly updated with the new color. This change ensures that all (visible) widgets instead of just all top level windows get updated after changing the color. While this method is potentially more expensive, it does not effect the start-up negatively, because on start-up StyleHelper::setBaseColor() gets called before the mainwindow is shown. Fixes: QTCREATORBUG-29135 Change-Id: I227c2f243ffcd9f8210b9d2d1a47ad0494663d50 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Utils: Centralize style-related property names as constantsAlessandro Portale2023-05-104-7/+24
| | | | | | | | | | | | | | | | | | | | This introduces string constants in Utils::StyleHelper. They are used by code all over in Qt Creator to tell ManhattanStyle how to paint certain widgets. Change-Id: Iecca36103f80084cd5fe93fcb6b18b8fbb3a32bb Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Utils: Fix groupChecker functionality for aspectsChristian Stenger2023-05-101-1/+3
| | | | | | | | | | Change-Id: I1a44384cfebe8e23d8778ccb97f5846bfcbf0b9f Reviewed-by: hjk <hjk@qt.io>
* | Utils: Fix hasSuppressedQuestionsMarcus Tillmanns2023-05-101-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | QSettings::childKeys() only returns direct child values, not child groups. Therefore we also need to check QSettings::childGroups() here. We don't need to iterate all the keys. Keys are only created with "true" value. Change-Id: Ie4653dca1dfbad85ab895440a756c8e03aa78118 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Remove ineffective resize() callsAlessandro Portale2023-05-102-2/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
* | LayoutBuilder: Avoid leak warnings in Application::exec()Alessandro Portale2023-05-101-2/+2
| | | | | | | | | | Change-Id: I9c05f3015b120220408076d58d29983d2194d9e1 Reviewed-by: hjk <hjk@qt.io>