aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/outputformatter.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | 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>
* Utils: Remove Utils::optionalEike Ziller2022-09-011-6/+12
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | 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>
* Utils: More forward declarations / drop unused headers [L-O]Jarek Kobus2022-05-251-1/+2
| | | | | | | | | | | | | | | Round 1 - focus on headers. For classes with initial in range [L-O]. Try to keep the same separators between different kind of headers. Drop changes to NameValueDictionary for now, as apparently environmentfwd.h is broken currently. It looks we can't forward declare the argument T inside QList<T> - the type must be complete. Change-Id: If26e88357a2ffbb91a79c4d003046443d98d5673 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Add output parser for AddressSanitizer messagesChristian Kandeler2022-04-131-0/+1
| | | | | | Change-Id: I9107a4f23998ed95f374c7d61c9ee1e6e6e2d437 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* QtSupport: Use red color for failing test casesChristian Kandeler2021-12-021-2/+4
| | | | | | | | We want them to stick out in the output pane. Change-Id: I2276c93301500fa67a3e23a61cde021b1993a247 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* ProjectExplorer: Generalize issues -> output pane linkingChristian Kandeler2021-11-251-1/+1
| | | | | | | | This feature was specific to the compile output pane, but we want to have it in other panes too. Change-Id: I110b27af7d0aa23acbc5623d1c0405816250df19 Reviewed-by: hjk <hjk@qt.io>
* Compile: add ability to parse standard output in buildPetar Perisin2021-08-071-0/+1
| | | | | | | | | | | When working with make wrapper scripts, sometimes they forward everything to stdout. When this happens failures are not parsed, and the are not "clickable" in QtC. This patch adds an option to enable parsing of standard output. Change-Id: I44b283dbdf6286f90c546898d496bff41de0d5ed Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Utils: Make Link a classChristian Stenger2021-05-311-1/+1
| | | | | | Change-Id: Ia2f1c9589f65064eca2416b093b3fecf568058d2 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Fix build on WindowsChristian Stenger2021-05-311-1/+1
| | | | | | | Amends b9c7ca0096ddabffc093f6b662e4957d6388612e. Change-Id: I1fb2f8a8857c716b4ce9842f102e86d2ddfd51d5 Reviewed-by: hjk <hjk@qt.io>
* Utils: Use Utils::Link instead of TaskView::Locationhjk2021-05-281-2/+3
| | | | | | | Same layout, effectively the same purpose Change-Id: I742d85ed06c07009ebb9696734f00894275859a3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Fix output formatter "new searchDir found" signallingAlessandro Portale2021-02-171-1/+1
| | | | | Change-Id: Id9bc5cb0641dbac902b7d5af8ee3d00e0308478e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Mark some convenience methods as const/staticBernhard Beschow2021-02-061-1/+1
| | | | | Change-Id: Icb7a7394270e495717de5edd66bc19a0c2d97a3c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Aggregation/Utils/ExtensionSystem: Make member functions const/staticAlessandro Portale2020-11-271-8/+8
| | | | | | | | | | | | | | | | | | readability-make-member-function-const finds lots of member functions that could be made const. This change just picks getter functions that really should be const. readability-convert-member-functions-to-static finds non-static member functions which do not access this. This change turns most of them into static ones, but leaves some non static to keep the class API consistent. readability-static-accessed-through-instance fixes the places where the originally non-static, now static functions were called through instance. Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* OutputFormatter: Fix visual glitchqds/v4.3.2qds/v1.6.0-rc1qds/1.6.0-rc1Christian Kandeler2020-09-071-2/+3
| | | | | | | | | | | When inserting a line into an output window, we have to delay appending the line feed character. Otherwise strange visual effects appear under certain circumstances. I have no idea why. Fixes: QTCREATORBUG-24411 Change-Id: If8842ae4d9db36d514996b1f34dcca0432fafbfc Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* VCS: Pass links to the correct VCSOrgad Shaneh2020-06-211-0/+1
| | | | | | | | | | | | | | Current implementation requires each VCS to connect to the referenceClicked signal. Only Git does it, but this is conceptually wrong. If other VCSs would connect to the same signal, all of them will act upon clicking a link, which can result in multiple editors, most of them are likely to be invalid anyway. By default executes vcsDescribe. Can be extended or modified by subclasses. Change-Id: Ib953009efd77446a4b2963f0aa8a2f3f3d26509f Reviewed-by: Artur Shepilko <artur.shepilko@nomadbyte.com> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Utils: Replace some QRegExp to QRegularExpressionChristian Stenger2020-06-191-1/+0
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: I7d12992506bbe33306c0ab750f73c7db1626abc3 Reviewed-by: hjk <hjk@qt.io>
* Utils: Remove unused functionChristian Stenger2020-06-171-2/+0
| | | | | Change-Id: I0b8fae0e7257a3281573f774862af4c1284a2941 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* GCC parser: Create fewer and better issuesChristian Kandeler2020-05-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following compiler warning: In file included from qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ ardupilotmega/ardupilotmega.h:946, from qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ ardupilotmega/mavlink.h:32, from qgroundcontrol/src/comm/QGCMAVLink.h:24, from qgroundcontrol/src/comm/LinkInterface.h:21, from qgroundcontrol/src/comm/LinkManager.h:21, from qgroundcontrol/src/QGCApplication.h:27, from qgroundcontrol/src/QtLocationPlugin/ QGCMapUrlEngine.cpp:19: qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ardupilotmega/./ mavlink_msg_vision_position_delta.h: In function ‘uint16_t mavlink_msg_vision_position_delta_encode(uint8_t, uint8_t, mavlink_message_t*, const mavlink_vision_position_delta_t*)’: qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ardupilotmega/./ mavlink_msg_vision_position_delta.h:138:178: warning: taking address of packed member of ‘__mavlink_vision_position_delta_t’ may result in an unaligned pointer value [-Waddress-of-packed-member] 138 | return mavlink_msg_vision_position_delta_pack(system_id, component_id, msg, vision_position_delta->time_usec, vision_position_delta->time_delta_usec, vision_position_delta- >angle_delta, vision_position_delta->position_delta, vision_position_delta->confidence); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ Before this patch, this output resulted in nine entries in the issues pane, which defeats the purpose: The user is supposed to get a quick overview of the build problems, but instead we basically just copied over the contents of the compile window, which is of little help and also slows things down by overloading the task model. We now try harder to identify output lines that belong to the same issue and create just one task for them. File paths are now linkified in the detailed issue view, so that users can still navigate quickly to all involved files. Task-number: QTCREATORBUG-22914 Change-Id: I1aed2ffac7d363c02073ef318cb863754379cf6d Reviewed-by: hjk <hjk@qt.io>
* Merge output formatters and output parsersChristian Kandeler2020-04-231-11/+82
| | | | | | | | | | | | | | | | | | | | | | | Now only one piece of code needs to be written to both linkify output in an output pane and create tasks for it in the issues pane. The calling sites are also simplified. For instance, until now, build steps had to feed their output parsers manually and then push the created tasks up the signal stack in parallel with the actual output, which the build manager relied upon for cross-linking the output pane content. Afterwards, the output would get forwarded to the formatter (and parsed for ANSI escape codes a second time). In contrast, a build step now just forwards the process output, and task parsing as well as output formatting is done centrally further up the stack. Concrete user-visible improvements so far: - File paths in compiler/linker messages are clickable links now. - QtTest applications now create clickable links also when run as part of a build step, not just in the app output pane. Task-number: QTCREATORBUG-22665 Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* OutputFormatter: Take ownership of the line parsersChristian Kandeler2020-04-151-1/+1
| | | | | | | | For symmetry with IOutputParser. Task-number: QTCREATORBUG-22665 Change-Id: I92e93b32e87ff4f3fa163a2d2fe13768e56bfa24 Reviewed-by: hjk <hjk@qt.io>
* Utils: Split up OutputFormatter classChristian Kandeler2020-04-141-30/+46
| | | | | | | | | | | | | | | An OutputFormatter takes some string and prints it into a text edit. In addition, it can ask any number of registered OutputLineParsers whether they think any special formatting should be applied to the current line. This mechanism is now properly modeled by our class design, rather than being hidden in a monolithic class where everything had the same type, no matter what its purpose was. Prospective contributors can now simply be pointed to the OutputLineParser class and will see at one glance what they have to do. Change-Id: I9844499f062c94fb038ce73fd6f26576910148c2 Reviewed-by: hjk <hjk@qt.io>
* Utils: Dissolve the AggregatingOutputFormatter classChristian Kandeler2020-04-141-19/+2
| | | | | | | | | Inheritance is not the right design here (anymore), so we merge the derived class into the base for now. We will later re-split in a more sensible manner. Change-Id: I326e9f02287b3070f47147c771f3fa908d51b7fb Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: Do all formatting centrallyChristian Kandeler2020-04-141-10/+27
| | | | | | | | | | | | | | | Instead of working directly on the text edit, the specialized OutputFormatter classes now simply ask the base class to do it for them. In practice, the request currently always is "turn this part of the text into a link", but the interface can be extended to other types of formatting, should that ever be required. This is a win/win situation: Derived classes no longer have to fiddle with QTextCursor & friends (nor do they have to call any base class functions), while the base class can make strong assumptions about what the derived class does to the text edit (i.e.: nothing). Change-Id: Icc4bc52d4001b0359247563e39a206fa274833d7 Reviewed-by: hjk <hjk@qt.io>
* Remove the limitation that output formatters have to be exclusiveChristian Kandeler2020-03-201-7/+32
| | | | | | | | | | | | Introduce an aggregating output formatter that forwards its input to a sub-formatter that feels responsible for it, or otherwise lets the base class handle it. Our output panes now use such an aggregating formatter. In particular, this means that in the future, we won't have to stuff all run control output formatting into the Qt output formatter anymore. Change-Id: I5498f200a61db10ccff3ec8974c6825da7f7072d Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: Do the newline handling centrallyChristian Kandeler2020-03-191-2/+10
| | | | | | | | | | | All output formatters are line-based, and they all did their own line splitting and, if they didn't entirely ignore it, handling of partial lines. Instead, we now do all the book-keeping in the base class, and the subclasses always work with complete lines. Change-Id: I0b0df7951d0e4f6601f4d912230071784c87b3d3 Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: Make more functions privateChristian Kandeler2020-03-181-2/+3
| | | | | Change-Id: Ifde7ce2e685f8ad87e636a9825a5a4c649a6e23f Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: De-virtualize the clear() functionChristian Kandeler2020-03-181-1/+1
| | | | | | | ... and make it also clear the text edit. Change-Id: Ifd073167b8afc27f3adafca1bdaf95316be7fdaa Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: Remove unneeded function and include statementChristian Kandeler2020-03-181-2/+0
| | | | | Change-Id: I7372a340660e0e927c3e8e83dd438d5fa32304eb Reviewed-by: hjk <hjk@qt.io>
* OutputFormatter: Simplify newline handlingChristian Kandeler2020-03-181-2/+0
| | | | | | | | | There does not seem to be a reason to remove trailing newlines and re- insert them on the next call. Presumably, this is related to historical auto-newline magic. Change-Id: If4dc8acf022d3895b41b887af25d63cca36bf8a4 Reviewed-by: hjk <hjk@qt.io>
* Move some code from OutputWindow to OutputFormatterChristian Kandeler2020-03-171-3/+7
| | | | | | | | That's where it belongs: The logic there is applicable to all output formatters, not just those used via an output window. Change-Id: Idf4ca8d22631ca96feb97553f28724c0275e0bf8 Reviewed-by: hjk <hjk@qt.io>
* Utils: Remove unused signal from OutputFormatterChristian Kandeler2020-03-131-5/+0
| | | | | Change-Id: I337a78f9edf8b63869b117e031c648e52e3203a0 Reviewed-by: hjk <hjk@qt.io>
* QtOutputFormatter: Use cursor object from base classChristian Kandeler2020-03-131-1/+2
| | | | | | | | There does not seem to be a reason for the duplication. Change-Id: I7c9b016c76a9aa93ccd93af0aea931fa5b148300 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: hjk <hjk@qt.io>
* Remove duplicated codeMiklós Márton2020-02-051-0/+1
| | | | | | | | | | | Merge QtOutputFormatter::linkFormat and PythonOutputFormatter::linkFormat to OutputFormatter::linkFormat because these two functions were identical. Fixes: QTCREATORBUG-23562 Change-Id: I1337b2fd66fc7d7b6742eb5e9c1a2caf1dc6b5bd Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Add output filtering for Application Output paneAlessandro Ambrosano2019-04-081-0/+3
| | | | | | | | Task-number: QTCREATORBUG-16356 Change-Id: Ibf6cca1915ef56c50c01cd3c23e7798453506a05 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* VCS: Unbold messages and errors in output paneOrgad Shaneh2018-11-241-0/+1
| | | | | Change-Id: Id154d75c07cf95b9ceaad3ee26fcac08e66b3200 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* OutputFormatter: SimplifyOrgad Shaneh2018-11-191-1/+1
| | | | | | | | Instead of storing a state for \r, select the text right away, so the next insertText will overwrite it. Change-Id: I40d39220106a6c08c12ee0b92b5b3d745277abb6 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* OutputFormatter: Make appendMessage(QTextCharFormat) privateOrgad Shaneh2018-11-191-1/+1
| | | | | | | | Clients should only use the OutputFormat overload. Change-Id: Ifa7989c460a2f46d9497280c5d373a5a7e4786ff Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Utils: Remove superfluous qualificationsOrgad Shaneh2018-07-191-1/+1
| | | | | Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Use override consistentlyTobias Hunger2018-05-131-1/+1
| | | | | | | clang-tidy fixes from modernize-use-override check. Change-Id: I89d27f359b6ee507153cb3712f61f81471ff0858 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Add the needed infrastucture to enable application output filtersBogDan Vatra2017-02-281-0/+2
| | | | | | | | Currently will be used only by Android, but in the future can be extended everywhere Change-Id: I37314248f2d6dba2401e853b2a6ea4a36859f502 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Wholesale conversion to #pragma oncehjk2016-03-301-4/+1
| | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* ZOOOOM for CompileOutputWindow and AppOutWindowDaniel Teske2015-08-311-2/+0
| | | | | | | | | | | | | | | Implement zooming for the compile output and app output panes. Those windows can be zoomed by toolbar buttons or ctrl+mousewheel. The zoom factor is synced between app output panes, but not between compile and app output. The scroll wheel zoom can be disabled in the settings. While at it, fix that the AppOutputPane did not update its font on changes to the fontsettings. Task-number: QTCREATORBUG-12476 Change-Id: I8a1639ab3d39c24a5fc21ed82f558f3d10efc02d Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* QtSupport: Use a fixed cursor in QtOutputFormatterOrgad Shaneh2015-02-261-1/+1
| | | | | Change-Id: I5fb762cd767c31673f4dba6044db9f135e71102b Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Utils: Pimpl OutputFormatterOrgad Shaneh2015-02-251-7/+3
| | | | | Change-Id: I42682a9793e895fb99b154cf9fac37fb189fd9c8 Reviewed-by: hjk <hjk@theqtcompany.com>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-161-6/+6
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | QtOutputFormatter: Support ANSI colorsAndre Hartmann2015-01-131-0/+2
|/ | | | | | | Task-number: QTCREATORBUG-13764 Change-Id: Iac020bbea0eae8bd2b09f836a61da199acec1575 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Implement theming for QtCreatorThorben Kroeger2014-10-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a 'Theme' tab to the environment settings and a '-theme' command line option. A theme is a combination of colors, gradients, flags and style information. There are two themes: - 'default': preserves the current default look - 'dark': uses a more flat for many widgets, dark color theme for everything This does not use a stylesheet (too limited), but rather sets the palette via C++ and modifies drawing behavior. Overall, the look is more flat (removed some gradients and bevels). Tested on Ubuntu 14.04 using Qt 5.4 and running on a KDE Desktop (Oxygen base style). For a screenshot, see https://gist.github.com/thorbenk/5ab06bea726de0aa7473 Changes: - Introduce class Theme, defining the interface how to access theme specific settings. The class reads a .creatortheme file (INI file, via QSettings) - Define named colors in the [Palette] section (see dark.creatortheme for example usage) - Use either named colors of AARRGGBB (hex) in the [Colors] section - A file ending with .creatortheme may be supplied to the '-theme' command line option - A global Theme instance can be accessed via creatorTheme() - Query colors, gradients, icons and flags from the theme were possible (TODO: use this in more places...) - There are very many color roles. It seems better to me to describe the role clearly, and then to consolidate later in the actual theme by assigning the same color. For example, one can set the text color of the output pane button individualy. - Many elements are also drawn differently. For the dark theme, I wanted to have a flatter look. - Introduce Theme::WidgetStyle enum, for now {Original, Flat}. - The theme specifies which kind of widget style it wants. - The drawing code queries the theme's style flag and switches between the original, gradient based look and the new, flat look. - Create some custom icons which look better on dark background (wip, currently folder/file icons) - Let ManhattanStyle draw some elements for non-panelwidgets, too (open/close arrows in QTreeView, custom folder/file icons) - For the welcomescreen, pass the WelcomeTheme class. WelcomeTheme exposes theme colors as Q_PROPERTY accessible from .qml - Themes can be modified via the 'Themes' tab in the environment settings. TODO: * Unify image handling * Avoid style name references * Fix gradients Change-Id: I92c2050ab0fb327649ea1eff4adec973d2073944 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>