Commit Graph

58 Commits

Author SHA1 Message Date
David Schulz
c5f424d696 Coco: use the diagnostic foreground color as annotation color
Change-Id: I4f0991c8956b0b31a441aa4348aaf8b7d0677dda
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-05-11 07:21:11 +00:00
David Schulz
febe659690 Editor: filter text marks in paintAnnotation
Calculate the correct width for the annotation and decide inside
TextMark whether it can be painted or not. This will also
make sure that all annotation rectangles are correctly saved in
TextEditorWidgetPrivate::updateLineAnnotation.

Change-Id: I7e6c606e615b1673a34000618e106efb14184b10
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-15 05:22:08 +00:00
David Schulz
a8cad01887 Editor: make sure to update marker on annotation change
Ensures an update for the markers editor widget after any of the
information displayed in the annotation has changed

Change-Id: I845e05f5103ee1615cfc3d7760cdfc2bbf510f32
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-15 05:22:01 +00:00
Alessandro Portale
716f0bd032 Avoid compiler warnings about truncation from double to float
They appeared when compiling against Qt 6

Change-Id: I6bb94168f9776a7fa416d51ff4bb3ca32c9f02fc
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 15:25:44 +00:00
David Schulz
f66df921d7 Core: filepathify file renaming
Change-Id: I3d4f39e34e65cde3df7b7c19570e3a54d0625d53
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-17 11:13:51 +00:00
Christian Kandeler
6fbe88b215 TextEditor: Queue call to ICore::showOptionsDialog()
... from text marks.
Direct calls appear to be unsafe, possibly because text marks are
transient.

Fixes: QTCREATORBUG-25623
Change-Id: I929ff6310c9d93b677f66acc8869e7aeceb5564b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-04 07:27:59 +00:00
Christian Kandeler
765f518de3 TextEditor: Support tooltips for buttons in text mark tooltips
In case users don't find the icon self-explanatory.

Task-number: QTCREATORBUG-25150
Change-Id: I481b1ea7f510f065f83badcb91e127ac1c81f5a1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-05 12:43:17 +00:00
Christian Kandeler
a1c5dd93f5 TextEditor: Let TextMark subclasses provide a settings page
Task-number: QTCREATORBUG-25150
Change-Id: Id5bbdcf2db7afacb823140d77ebd5bc141ac7f81
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-01-20 14:17:35 +00:00
hjk
94df9822f9 TextEditor: Add a mechanism to provide dynamic icons and tooltips
... to TextMarks more easily by allowing callbacks in addition to
fixed values.

Change-Id: Ica9e7d54dd1a53a59dc11812857402d0b7594d6c
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-09-24 13:06:55 +00:00
David Schulz
e371eafd4b Editor: Calculate annotation color based on editor color scheme
Amends 9182d4eda7

Fixes: QTCREATORBUG-24644
Change-Id: Id34bfbc4ea3d1102835c7c1cf3afa1580dff01d8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-09-16 07:20:20 +00:00
David Schulz
67db5cb2de Editor: Use optional for text mark color
instead of an additional hasColor member

Change-Id: I658401bb91374b10420e070625cf61049cb3cc64
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-07 19:02:12 +00:00
David Schulz
9afc5305d6 TextEditor: more FileName -> FilePath renaming
Change-Id: Ia61868806db47561e7bf7ae9b3cfb1e62a085a7a
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 07:54:11 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +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
6d43aaf134 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7bdb6a4658c5fca1a7e1dda5adbb5613dabc6d18
2019-02-19 09:08:53 +01:00
Friedemann Kleint
ec6b38dea0 Fix Qt 5.13 deprecation warning about QFontMetrics::width()
Replace by QFontMetrics::horizontalAdvance(), fixing:
warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated:
 Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]

Change-Id: I9991ffefe6e87e872dc35ba291d562e06b28ca64
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-02-15 15:12:02 +00:00
Nikolai Kosjar
da28d40030 TextEditor: Add more space before TextMarks' tooltip actions
Change-Id: I6331d60026da865f29c5ed2455f2399414f99900
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-15 14:15:56 +00:00
David Schulz
b41b5a0714 move text document for file path convenience function
Move it from language client utils to a static function inside
the text document.

Change-Id: I91bc72d0e978c1d843082e12bb8a0fa60a1bbc5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-14 13:19:19 +00:00
Nikolai Kosjar
0df7468e51 Clang: Add tooltip action to copy to clipboard
...as selecting text in the tooltip was difficult and eventually got
disabled due to other problems - see
d58c0a9ac8.

This adds support for actions in TextMarks. They are displayed as
QToolButtons in a dedicated column in the tooltip.

Change-Id: I84ee3c3e4af573a80953786881d1333b00e4200c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-01 08:15:36 +00:00
Orgad Shaneh
8760c5024d TextEditor: Support hyperlinks in TextMark tooltip
Change-Id: I3fa4470fb06469286901025c350d636fcdd9410a
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-08 13:28:02 +00:00
Orgad Shaneh
41dee83bec TextEditor: Modernize
override, auto, nullptr, member initializers.

Change-Id: I04c6ebb683849568973bd7782fb5a3279267141e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 08:48:49 +00:00
Eike Ziller
45f8d221bf Use FileName in TextMark
Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-05-03 06:51:47 +00:00
David Schulz
5fb310828e TextEditor: reduce annotation painting artifacts
Request an update covering the complete annotation
rectangle if it is not part of the event rectangle
and Correctly calculate the position for the gradients.

Task-number: QTCREATORBUG-18855
Change-Id: I68b61459e6fd94949baebba25f965226f9d5e441
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-10-09 12:10:44 +00:00
Eike Ziller
efa5a7b6d7 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qtcreator.pri

Change-Id: If5f4a9821a23ac0df81eb84b3980f9cf7ecd70ba
2017-07-25 11:54:44 +02:00
David Schulz
698e323a73 TextEditor: Make annotation position configurable
Change-Id: Ib59c9770390523e1863ac507ce43512ba679c591
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-07-21 08:25:14 +00:00
Eike Ziller
1feb5c604d Merge remote-tracking branch 'origin/4.4'
Change-Id: I02e54f45d233b89ddaee9c87da9b9af2a56374b8
2017-07-21 10:08:05 +02:00
Orgad Shaneh
c2ecee517e TextEditor: Avoid removing text marks that were not added to hash
TextMarks with empty file names are not added, no reason to remove them.

Change-Id: I8647deaa1136294d2f7c3c63337d967afea675c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-21 05:19:18 +00:00
David Schulz
8c4127ebac TextEditor: Improve readability of text annotation
Change-Id: Iddcf6951b44a73cd3e9d740d9aba725fa4d7d663
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-20 13:15:23 +00:00
Tobias Hunger
7d33f0f061 TextEditor: Initialize some members
Coverity was complaining about these, in some places even rightly so:-)

Change-Id: Ia85cdd2c74f05edba6f0d4534aa9f2ee2a750595
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-07-20 12:45:53 +00:00
David Schulz
862dd4c6bf TextEditor: Simplify annotation rectangle computation
Change-Id: Ie04f545d24696d66645c367b2c25d643c3691908
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-07-18 06:53:30 +00:00
David Schulz
6591a01452 TextEditor: Add line annotations
Displaying short descriptive text of a TextMark at line end.
Currently implemented for ClangTextMark and BookMark.

Change-Id: Idc6b579bda0382ad94b2e236b715696396b10460
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-30 08:27:16 +00:00
David Schulz
1d57a7e566 TextEditor: Fix updating TextMark priority
Change-Id: Ie88b75507faf1f467b4e044f2b06e25aae32bdcf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-27 04:40:20 +00:00
David Schulz
4322990926 Editor: Simplify text marks
Moving defaultToolTip and color from TextMarkRegistry to TextMark.
Allowing every instance of a TextMark object to define these
information.

Change-Id: Iec1794372cf902b34d343402074e3999e7f9faf7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-22 08:42:40 +00:00
David Schulz
daac41338e TextEditor: Simplify TextMarkRegistry
The registry is an implementation detail and doesn't need to be exported
so move it to the textmark.cpp file.

Change-Id: Ic103b122cb20063fa4bc220bdc90cecff27054aa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-30 05:01:16 +00:00
Ulf Hermann
883492c135 TextEditor: Set widthFactor from TextMark ctor
The text marks are added to the document from their ctor. The document
then uses the widthFactor to calculate the space needed for them. If the
widthFactor is only set afterwards, the calculated space is wrong.

Change-Id: Ic7d24f99cc78d1bf084b2b1cfdf6b955496072f3
Task-number: QTCREATORBUG-17833
Reviewed-by: hjk <hjk@qt.io>
2017-03-16 16:19:22 +00:00
David Schulz
50a6c47830 Use icons and default tool tips in text mark popup
Change-Id: I4487d642e066479e8e344ed77e539de92fbca651
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-09-06 09:12:36 +00:00
Eike Ziller
c56aa52b80 Merge remote-tracking branch 'origin/4.1'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qmakeprojectmanager/makestep.cpp
	src/shared/qbs

Change-Id: If1787ed23afa786ed2cef57f53c1db642559cbe0
2016-08-31 14:40:38 +02:00
David Schulz
149f084b11 Editor: Use correct pointer in guard
Task-number: QTCREATORBUG-16253
Change-Id: Ie046af69c37784c1a42cc693971b42baaef2f6ff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-25 12:30:44 +00:00
David Schulz
af91d73a1c TextEditor: Remove unnecessary hash lookup
Change-Id: I50b80ad43c7a4dc56207497e948993946d977101
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-22 07:06:26 +00:00
David Schulz
8b21f687c0 Add default tool tips to text marks
The default tool tip should describe the general purpose
of the mark which is displayed in the UI when no tool tip
is explicitly set for the text mark.

Change-Id: I27aff26cf0f3458d454428e805a9b323191dc393
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-08-22 05:40:50 +00:00
hjk
728b914727 CppEditor: Use full tooltip in ClangTextMark
Change-Id: I39cc64acbdbcd5e5156e1514acaf9674a91e81a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-25 13:25:16 +00:00
hjk
6edfb66908 TextEditor: Enable tooltips for textmarks
Adjust bookmark code, add tooltips for clang diagnostics.

Change-Id: I489d499f5431fcb29f27611d4350298acb30baac
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-19 10:45:23 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Orgad Shaneh
9d3b2f0998 TextEditor: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I380120e3419d2a3c0e272f51cc3e0d5f6aaa5e9b
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-12-18 11:54:12 +00:00
Marco Bubke
610ff191af TextEditor: Move constructor has now noexcept
Otherwise the copy constructor will be used too and we get an error
because it is private.

Change-Id: Ibfe70939ebe34fa9a524b9844a20d962eb09bd97
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-09-01 11:38:16 +00:00
Marco Bubke
b278dc87ca Clang: Add diagnostics
Diagnostics are now moved to the clang backend process. Fixits are
supported too.

Change-Id: I20faacf466bbf78dec479220c3d7b336a47bc453
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-08-31 14:59:16 +00:00
David Schulz
3ceec86577 Editor: Add Check for TextMark color definition.
Change-Id: I805402a5ec9595bd31b6d72c5934198c77a1f402
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-06-03 06:48:06 +00:00
Orgad Shaneh
6d67f9429e Theme: Remove InvalidColor
It's not defined anyway. Use ProjectExplorer_TaskWarn_TextMarkColor as
default text mark color.

Change-Id: I1c7f76f0a6dc83338798cdd7450e1468e8ce39a7
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-05-25 08:56:47 +00:00
David Schulz
ab2a0d74de TextEditor: Sort text marks in categories.
Also adding a color for each category.

Change-Id: I3627d13913951a95804b5a816f087a822c01bd86
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-05-21 08:23:16 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
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
2015-02-12 17:29:21 +01:00