Commit Graph

202 Commits

Author SHA1 Message Date
Christian Kandeler
de072785cd ProjectExplorer: Make sure we always scroll to the new current item
... in the issues pane.
When fixing another issue, we accidentally lost auto-scrolling for cursor
key navigation.
Amends 74b773e68f.

Fixes: QTCREATORBUG-25432
Change-Id: I67f9a9b198276ce38a19862dc66000ced6a9a6fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-07 10:02:36 +00:00
Alessandro Portale
afc2fda8a9 ProjectExplorer: Use qAsConst w/ non-const Qt containers in range-loops
Change-Id: I6422b3e40a6925504a231be2d47b3214d86c6e06
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:21 +00:00
Christian Kandeler
2604a8e485 ProjectExplorer: Use already-open visible editor, if available
... when following links from the issues pane.

Fixes: QTCREATORBUG-13961
Change-Id: I799e34f8fa789ef824b3b4aa2a075c938d6f1271
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-26 09:55:10 +00:00
Christian Kandeler
74b773e68f ProjectExplorer: Improve issues pane behavior
... when the user clicks a link. Apparently, the (unintended?) default
item view behavior is to move the scrollbar so that the top of the
current item becomes visible, which we don't want here.

Fixes: QTCREATORBUG-25101
Change-Id: I4c99ff09ba762b7b375b0bdefd8cebfbda69b0ea
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-18 13:12:30 +00:00
Alessandro Portale
b2a766a79a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-19 08:42:14 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Orgad Shaneh
6cfd240285 OutputWindow: Do not activate links for empty reference
Change-Id: I1d4fc0f25f1882a34058c66c51376982cc70238e
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-18 16:52:03 +00:00
Eike Ziller
83843fbd06 Remove some useless IContext subclasses
They are only created at single places anyhow, so use the setters of
IContext instead

Change-Id: I00a089c9f1ea151c76cb6443e2a24c4a05437bbb
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 08:42:37 +00:00
Eike Ziller
e5bb7d1ffe Remove unnecessary removeContextObject calls
They are removed on deletion now.

Change-Id: I08461ea4938e24ab450df013a0f8f820032381da
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 08:42:00 +00:00
Christian Kandeler
d9dd1f8d52 GCC parser: Create fewer and better issues
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>
2020-05-18 12:34:52 +00:00
hjk
5b87681366 ProjectExplorer: Remove some unused BuildManager signals
Change-Id: Iea832e96b726db9b93c235a57d6285337df7734d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-26 14:45:44 +00:00
Christian Kandeler
aacfd340ca Output panes: Allow to invert the meaning of the filter field
That is, show only the non-matching lines.

Task-number: QTCREATORBUG-19596
Change-Id: Iac06a7c4531688dbf97c7d5c4d0cdb80979b5f95
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-02 13:14:30 +00:00
Christian Kandeler
ca7e6bd1b1 ProjectExplorer: Fix restoring the issues pane warning button state
The wrong button function was called.
This does not fully fix the linked problem for the default session,
because there is the additional issue of TaskView::loadSettings() not
getting called at all.

Task-number: QTCREATORBUG-19388
Change-Id: I64dcec9c6d07c8ac614c9a2ecd783e7eaa1a204c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-26 13:59:58 +00:00
Christian Kandeler
6f8cbb6fd2 Issues pane: Show the right number of issues on the pane button
While we do want to show contextual messages from the compiler, the
number displayed on the button should correspond to the actual number of
issues (i.e. errors or warnings), and should not include the notes
around them.
We used to do this correctly, but broke it in acd0d02e28.

Fixes: QTCREATORBUG-18490
Change-Id: Ib6b36f24b4f6bfe53ed5b977f0f88586c4d95b16
Reviewed-by: hjk <hjk@qt.io>
2019-07-22 08:11:55 +00:00
Christian Kandeler
e34b41934d Output panes: Respect filter options
The UI elements for case sensitivity and regexp behavior had not been
doing anything until now.

Change-Id: Ie210103984fda64d4249c56f9a5b21200132108f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-06-05 12:28:57 +00:00
Christian Kandeler
d6848fc831 ProjectExplorer: Allow text filtering in issues pane
Task-number: QTCREATORBUG-21893
Fixes: QTCREATORBUG-22083
Change-Id: Ida227ce21d90fc2487cf3009e957eedeec507fd0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-06-04 11:01:54 +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
Alessandro Portale
e9cf8a4e3e Remove a couple of "setAutoRaise(true)" for toolbar buttons
Most of the QToolButtons in the toolbars don't set autoRaise, and they
are fine. I assume that those who do set it, just do it for because that
line was copy/pasted so often.

Change-Id: I71341ddbd26a586d34713661ec538b37033685e5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-04-29 10:35:33 +00:00
Christian Kandeler
c960885733 ProjectExplorer: Use QSortFilterProxyModel for TaskFilterModel
We used our own, hand-rolled filter model implementation for performance
reasons, but benchmarking shows no difference.

Change-Id: I076ffeffbd39b468308d48d23d15a69b966dbc23
Reviewed-by: hjk <hjk@qt.io>
2019-04-08 08:01:03 +00:00
Christian Kandeler
d0db212575 Resolve ambiguous results of searches for relative file paths
Qt Creator extracts file names from the output of external processes in
various places, for instance from compilers during the build. It often
happens that such file names are not absolute, so they cannot be
directly opened in an editor when the user clicks on their
representation in some widget. That's why they are processed by the
FileInProjectFinder facility first.
This patch enhances the FileInProjectFinder to be able to return more
than one candidate for a relative file path, and allows the user to
choose between these candidates where possible. This way, we won't open
a random file anymore when a project contains more than one file with
the same name.

Fixes: QTCREATORBUG-13623
Change-Id: Id19c9eace3e6b3dbde89f6528e6d02b55872d747
Reviewed-by: hjk <hjk@qt.io>
2019-03-04 09:52:13 +00:00
Christian Kandeler
f3778d77fe ProjectExplorer: Add fallback finder for file paths in issues pane
The more specific output parsers often fail to resolve relative file
paths, so add a fallback that attempts to find the corresponding file in
the current session.
A follow-up patch should add support for manual ambiguity resolving.

Change-Id: If0aecbab0f3bf1aa779f4a538076c87ae6bf22d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-25 14:52:35 +00: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
Friedemann Kleint
963dc84cc5 Fix some deprecation warnings in basic plugins
Fix warnings apppearing in 5.13, for example:
warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
...
warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations]
warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
...
warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
...
warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations]
warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations]
...
warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations]

Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 09:32:06 +00:00
Tobias Hunger
80c2ce118d ProjectExplorer: Modernize even more
Use unique_ptr for all *Private classes, except for those
in singletons.

Change-Id: Ib56c31ddedc6e9cf321f15de1f1e697a27ad4089
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-24 09:04:54 +00:00
Alessandro Portale
8d19333075 ProjectExplorer: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-transparent-functors

Change-Id: Iebed22caa2e733d292f334e956e3d16b844e14e3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-16 10:01:53 +00:00
Nikolai Kosjar
20d2d76824 Clang: Do not flash issues pane when switching editor
Previously, when swichting to a file with errors, the Issues pane button
would flash.

Stop this for the clang code model issues as it is rather annoying since
the issues pane is updated for the current document.

Change-Id: I403a8b8cd0deef586c53769d0b646855a7fc9278
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-14 09:32:28 +00:00
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Tobias Hunger
144bba95e9 ITaskHandler: Harden against vanishing ITaskHandlers
Harden against vanishing ITaskHandlers and avoid qobject_casts.

Task-number: QTCREATORBUG-19994
Change-Id: I72bccb944cb6fa6ec92a8c0293617931a2eb2732
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-03-08 16:54:15 +00:00
hjk
5405fc98e7 ProjectExplorer: Remove a use of ActionManager::instance()
The used function is static nowadays.

Change-Id: I12ccd3429b1b377f004d56585b48ed286ab0edeb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-01 12:07:53 +00:00
hjk
cc88302309 De-emphasize PluginManager::getObjects<Type>()
... by additionally keeping local (currently non-owning) pools per
"interesting" type.

Current situation:
  - The global object pool does not scale well for looking up
    objects, as iteration plus qobject_cast typically iterates
    over all pooled objects.
  - User code that can use typed results from the object
    pool need to have access to the full type definition anyway,
    i.e.  depend on the plugin of the target class anyway.

The patch here solves the scaling problem is to have local
type-specific pools to which objects register in their
constructors and deregister in their destructors.

This patch here does *not* change the ownership model of the
pooled objects, however, it opens the possibility to change
the ownership model per type (e.g. by not putting things into
the global pool at all anymore and make the local pool 'owning')
and the intent is to handle that in later patchs.

Even without the follow-up patches this here is a performance
improvement for the cases that access the local pools instead
the global one, i.e. "practically all".

Change-Id: Ib11a42df2c4ecf5e1155534730083a520dd1995b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-15 07:08:05 +00:00
Montel Laurent
86ea365a0b Use const'ref in theses methods
Change-Id: Idfa5ffdcf23d1ef80442276690b8082b8279dbfa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 07:58:39 +00:00
Orgad Shaneh
a18f405ba1 Remove unneeded includes of projectexplorerconstants.h
Change-Id: I458c3299c13ffa4b25af52a570d82b4405cb669f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-20 11:07:25 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Alessandro Portale
f0b36b238a ProjectExplorer: Remove duplicated IOutputPane window titles
Change-Id: I9187feaccf137ca56f6db6c58367df84494e377f
Reviewed-by: Marc Reilly <marc.reilly@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-12 08:00:29 +00:00
Alessandro Portale
c2d1bcb210 ProjectExplorer: HighDPI off-by-one fix for issues pane item delegate
Change-Id: Id0177f01b06cdfcfdc500f181abb49b4be0e20c4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-11 16:18:54 +00:00
Orgad Shaneh
6afcf33f7a TextEditor: Remove use of deprecated additionalFormats
Replace with formats

Change-Id: I9a24c0ad138c378aed1c49a15b80b7f64edabe30
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-10 06:12:10 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
hjk
08dc992aef Core: Use QList's initializer list contructor for output panes
More concise code.

Change-Id: I0c83a02de725648294e1b6b49669bdec0c47fafe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-11 07:39:13 +00:00
Orgad Shaneh
0bf7893415 ProjectExplorer: Complete Qt5-style connects
+ De-slot private and internal public slots

Change-Id: I0a62adb529ab81b7368645dbeab6edf7e237dc69
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-03 07:41:56 +00:00
Tobias Hunger
95ac4edfd4 Projectexplorer: Modernize codebase
Change-Id: I4793b58aa77bcd46af99f8b843c0f7439cdc9269
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
2016-04-15 09:40:53 +00:00
Orgad Shaneh
15f8bb07ed ProjectExplorer: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: I619db09a79760186b72e7662490ed1205155c1a7
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-01 15:51:34 +00:00
hjk
677effda78 Remove even more uses of deprecated typedefs
Change-Id: Icb48d484f760eb11ef2d41d8271e43f4f51c2e91
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-22 13:23:53 +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
Alessandro Portale
09d03825fc Core: Better warning/error/info icons on non-toolbars
The warning/error/info with shadow and transparent mark work
well on our toolbars but not anywhere else.

This patch creates a separate set of these icons with better
contrast, filled marks and no shadow.

Change-Id: I96787753dffd80b325336f0adc8e3be054c34618
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-12-08 13:05:54 +00:00
Alessandro Portale
033862f305 Themed Icons: Introduce Utils::Icon
Instead of describing icons via file name or in the themed icons case
via
a string that is a list of mask/color pairs, we have now a class for it.

Icons are now listed in per-plugin *icons.h headers.

RunControl::m_icon was The only place left where an icon property was in
fact a string. This patch changes that member to be a Utils::Icon.

Change-Id: Ibcfa8bb25e6d2e330c567ee7ccc0b97ead603177
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-25 12:30:52 +00:00
Tobias Hunger
26c872f3e6 TaskWindow: Use Qt5 style connects
Change-Id: I675e1d83b789371925d9c71d4e5f0c2327085d7c
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-13 10:12:19 +00:00
Alessandro Portale
b8bdc6f669 Icon refresh: First step towards the new Qt Creator themes
http://blog.qt.io/blog/author/didesous/ announced new designs/themes
for Qt Creator. This patch replaces many of the existing toolbar icons
with recolorizable masks for better theming support.

Change-Id: I557aa485205fe2624f33724226f698c303342b40
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-10-23 16:04:52 +00:00
hjk
1c119185d0 Tasks: Remove other uses of Id::uniqueIdentifier()
Ids can be compared and tested for default-constructedness without.

Change-Id: I410c8a3922faa32fa27a090ea8fba7562a9a0231
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-06-23 12:22:19 +00:00
Tobias Hunger
62ee0736c4 TaskWindow: Save filter settings as part of a session
Change-Id: I530b655404541c9a9afaa1e87f2b39c867c93e37
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-22 10:21:54 +00:00
hjk
674b798350 ProjectExplorer: Replace some uses of QAction::setData
... by connections to lambdas.

Change-Id: I32a276146cf6a4cfc79ae9c133a4cb5f0783c867
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-03-23 15:12:04 +00:00