Commit Graph

58212 Commits

Author SHA1 Message Date
Alessandro Portale
1c6db4ca8b Acknowledge KSyntaxHighlighting in README.md
https://doc-snapshots.qt.io/qtcreator-master/creator-
acknowledgements.html

Acknowledges KSyntaxHighlighting already. README.md should do so,
as-well.

Change-Id: I099fd9a8d9b479c3ba3278412e59160d6918ca2f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-12 06:01:25 +00:00
David Schulz
643a814ba1 Utils: Add a JsonTreeItem
JsonTreeItem is used to visualize json values in tree views. It
will automatically generate new child items if the value contains an
object or array.

Change-Id: I316ea9f626050c21c05cbfc0628d0a5e20ad5a49
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-12 05:51:42 +00:00
Marco Bubke
ffa043fb99 Clang: Improve performance by reducing parsing
We generate one big file per project part so the preprocessor is skipping
the recurring includes.

This generated many errors about missing macros but we don't care
much about them during dependency collection step so we just
silence these errors with ignoring diagnostics consumer.

Change-Id: I5581d623b5d5f9995496252735577ea6b54790d9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-11 15:23:26 +00:00
Ivan Donchevskii
7fe65851d9 Clang: Extend ClangTool and CommandLineBuilder
We now support source file and not only header files and the file path is
now automatically added to the end. This removes quite some clutter.

Change-Id: I74eabd262e6c7e5f4d523e3a3cd194bd3efe1ef3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-11 15:22:58 +00:00
Nikolai Kosjar
d6a6d356bb ClangTools: Add errors as errors to issues pane
Fixes: QTCREATORBUG-19047
Change-Id: I4aca248d1ccb625fef77632bf35b554d7441e5cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 15:05:11 +00:00
Nikolai Kosjar
933f5a0df5 ClangTools: Refer to items consistently
Sometimes we used "issue" (treeview header, or filter line edit) and
sometimes "diagnostic" (go to next/pervious diagnostic actions).

Stick to "diagnostic" as it's more generic and avoid conflicts/confusion
with the "Issues pane".

Task-number: QTCREATORBUG-19047
Change-Id: I26b814b117a8fd475c080f0ef79c9fabc1446406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 15:05:00 +00:00
Nikolai Kosjar
cc81284db6 ClangTools: Clear entries from issues pane when starting
Change-Id: I3e192c539236b80bf99431fa9d0b0232213a5372
Fixes: QTCREATORBUG-19049
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 15:04:48 +00:00
Nikolai Kosjar
483b286061 ClangTools: Move unexported ClangToolsBasicSettings to Internal
Change-Id: I1a727374dbdcac955a92d9091faaac08918d7918
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-11 15:04:36 +00:00
Christian Stenger
0a28cf70fe Squish: Fix generic highlighter test
This is now using KSyntaxHighlighter, adapt accordingly.

Change-Id: Ie5dac469d326c5165f5f8513bc3adc5f6be5e48b
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-02-11 14:19:58 +00:00
Christian Stenger
6ae786bcc8 TextEditor: Fix build for Qt5.9
Do not use functions that are not supported with
the minimum supported Qt for building QC.
Partially reverts 963dc84cc5.

Change-Id: Ife03143a7cf5a8f428754040e7004efe42d70a8a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 13:39:21 +00:00
Christian Kandeler
749bc50e1b QmakeProjectManager: Prevent adding files to the project a second time
We check the child nodes of the current project and only add the new
file if it doesn't occur there already.

Fixes: QTCREATORBUG-19546
Change-Id: Ic784a117515eb7e433ebf1d08db1708da6cf5440
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-02-11 13:18:48 +00:00
David Schulz
82466375b9 TextEditor: Show info when multiple highlight definitions are available
Show an editor info bar when multiple highlight definitions can be found
for a single file or mime type. Add a combo box to the info that allows
the user to choose between them.

Change-Id: I07278d065e19d4e04fba24a6d789c8b6c9f55d60
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 12:45:04 +00:00
Ulf Hermann
0a974cb59f PerfProfiler: Drop [kernel] from expanded row labels
We don't treat the kernel symbols as special anymore and the extra row
messes up the other labels.

Change-Id: I562b683322172a9b166a89b7c7087b4e69a1646c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-11 12:13:29 +00:00
Ulf Hermann
8789c5ab71 QmlProfiler, PerfProfiler: Properly style panel widgets
We need to set the "panelwidget" property for the foreground color to be
set. Now that we do this correctly we don't need to hack around in the
palette anymore in QmlProfiler.

Change-Id: Icdc737e1c74d16ec76a12dbbdf6f8f64062bd19c
Fixes: QTCREATORBUG-21961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-11 12:13:22 +00:00
Nikolai Kosjar
f6dcc90a6f ClangCodeModel: Modernize
Change-Id: Ie001a2d8ed9c82ac5fedf8e59bd56d7bbdddf919
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-11 11:12:16 +00:00
Ivan Donchevskii
1740fcc008 ClangFormat: Take line context into account when formatting
In some cases indenting/formatting after special characters can
break the code. Let's try to avoid such corner cases.

Change-Id: I8918bc460af31d696e49f60e0ea85f34e9ff5664
Fixes: QTCREATORBUG-21474
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-11 11:08:09 +00:00
Ivan Donchevskii
f8dd6b35ec ClangFormat: Do not create extra operations to undo on save
If formatting is applied on save do not create a new replacement
for each replacement action.
Instead join the last edit block to make it possible to undo the
formatting in one go.

Change-Id: Ie0cb66eb5e76998e5045c1183f5f796e5a718659
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-02-11 11:07:47 +00:00
Friedemann Kleint
e20a0ed580 buildsteplist.cpp: Fix compile error for Qt < 5.13
QList::swapItemsAt() was added in Qt 5.13 (without \since).

Amends 963dc84cc5.

Change-Id: I40e4a5eda3540ae4a3212ea44413ed8a6cf17ce4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 10:22:57 +00:00
Friedemann Kleint
e7ab1182a0 clangdiagnostictooltipwidget.cpp: Fix compilation
Add missing include.

Amends 963dc84cc5.

Change-Id: Ida93a63dbc8ad3155834901ac2cdf7186bc7deb2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-02-11 09:45:28 +00:00
Eike Ziller
1a37a2b6aa Merge remote-tracking branch 'origin/4.8' into 4.9
Change-Id: I8c11be2a6cb4301be4ef639ba25ee9735960db71
2019-02-11 10:37:12 +01: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
Andre Hartmann
77392c7dea ProWriter: constify local vars
Change-Id: I4742edd3f449020c9f9be30401a9ae92f2bb81b3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-11 09:29:15 +00:00
Andre Hartmann
e50cab50b9 ProjectExplorer: Remove ellipsis from Duplicate File
This action does not open a dialog, it only duplicates
the current file and adds it to the project.

Change-Id: I9a7ba23b7168622656659ccb28a8a41b0dc7ddac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-11 09:28:59 +00:00
Andre Hartmann
b71a6eec20 ExternalToolConfig: Fix choosing executable
Somehow the function to select the executable broke
and changed to "Choose Directory".

Fixes: QTCREATORBUG-21937
Change-Id: Ifc596df276a3e26bb063d5b856fca29f9db227df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 08:39:11 +00:00
Eike Ziller
8309606a52 Help: Lookup in index if ID is not found
And if multiple topics are found in the index, show the topic chooser
dialog that we already have for the help index.

Fixes: QTCREATORBUG-12704
Task-number: QTCREATORBUG-15959
Change-Id: I7afa6f44bbecc12f602aaaa4a11209ec72399689
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-11 08:24:40 +00:00
Vikas Pachdha
7388326bca Fix crash while quitting debugging
Task-number: QTCREATORBUG-21684
Change-Id: I2a51d0666f2a591daeec34fc88ee12aa50265ff3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-10 21:39:08 +00:00
Andre Hartmann
52ff4f6f8e ExternalToolConfig: Cleanup and modernize
* Remove QLatin1String
* Use QOverload
* Use auto where possible
* Sort includes
* Remove superfluous lines

Change-Id: Iaa524fdb632398feab8431cb91bffe6330a57be8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-10 10:19:31 +00:00
Christian Stenger
0624944a24 Squish: Fix expected color
Change-Id: I9f0b1ceb1b927c86b1f4fc08c0fb2f17ce4f2975
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-02-08 15:59:20 +00:00
Christian Stenger
b0795c3210 Squish: Fix expected Qml error
Change-Id: I06395d6c0643c86a13f97a77c3c82771be9a1de3
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-02-08 15:45:13 +00:00
Christian Kandeler
037ab39cb8 Fix cloning DesktopQmakeRunConfiguration
The value of a terminal aspect is not exported in toMap() unless it was
set by the user, so we need help from the project manager to get the
default value. The QbsRunConfiguration already works this way.
Maybe the terminal aspect could export all of its information and we
could drop the fromMap() override from both run configs, but that should
be a different patch.

Fixes: QTCREATORBUG-21918
Change-Id: I712158f4bcb4dbd3827568dd4e1fe8b21d802f47
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 15:43:57 +00:00
Ivan Donchevskii
1f804e7fc7 ProjectExplorer: Add MSVC2019 flavor support
It is promised to be compatible with prior versions.

Change-Id: I85e433382a66c82e9880401c3a983fef06c03606
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-08 14:04:06 +00:00
Christian Stenger
90e432aa05 LSP: Avoid unneeded copy inside loop
Change-Id: I7c4d61eda6caf0baacdde01392e2457d54286863
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-08 12:09:08 +00:00
Eike Ziller
d07d75a08a Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	qtcreator.pri

Change-Id: I84dc8b9c7a029f2f40c4fa3ef78eef338247a6c0
2019-02-08 12:44:49 +01:00
Eike Ziller
e27744e966 macOS: Fix broken Info.plist
Fixup of dd0156d1fa
For some reason Xcode removed the closing tags when editing the
Info.plist file in its editor...

Change-Id: Ib9e53dce0be13ad0bb03ae46386c632b448b6a9a
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2019-02-08 11:14:56 +00:00
Christian Kandeler
dbf7c9f658 LSP: Fix build
Change-Id: Ic43ce5e2f55dc450fb0a4628dc5de22a4a6f3dbd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-08 10:20:18 +00:00
Christian Kandeler
583e6ff5eb Toolchains: Fall back to C compiler for output parser creation
Otherwise, there will be no output parser for toolchains that register
only a C compiler.

Change-Id: I3f3448ee85a0dc03701a6c9b21ec23b1d8ca2f22
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-02-08 09:57:07 +00:00
Nikolai Kosjar
9d25cb8720 CppTools: Avoid unused values
Value stored to 'newPosStart' during its initialization is never read
[clang-analyzer-deadcode.DeadStores]

Change-Id: Ib8e16cd1bfc3930588e4c10639f463d4f742da0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:44 +00:00
Nikolai Kosjar
c62f811c4b CppTools: Fix some clazy level0 warnings
Use midRef() instead [-Wclazy-qstring-ref]
Use multi-arg instead [-Wclazy-qstring-arg]

Change-Id: I74d79c4d9595aabd6b2b621743055b807652383c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:38 +00:00
Nikolai Kosjar
12f4b1ee86 CppTools: Modernize
Change-Id: I78af9cd4ccddfa4ed744dce96b772ae5644c89d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:32 +00:00
Nikolai Kosjar
69281bcdcf CppEditor: Avoid connecting multiple times to lambda
cppincludehierarchy.cpp:516:8: warning: UniqueConnection is not
supported with non-member functions

Change-Id: I9d4e743aa2fb4c05df85f566ccea7da98587d31b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:40:05 +00:00
Nikolai Kosjar
e0c7722441 CppEditor: Modernize
modernize-orgad
modernize-return-braced-init-list
modernize-use-auto
modernize-use-default-member-init
modernize-use-equals-default
modernize-use-nullptr
modernize-use-override
modernize-use-using

Change-Id: Ifa862782fb7b56ed3f93d9f98685c3af616797c2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:39:58 +00:00
Andre Hartmann
49afb01e0a QtOutputFormatter: Allow standalone file:// links
Either alone on a line, or with text before, or with
text afterwards, separated by colon, space, tab, or
brace as before.

Especially thought to capture cases like

 file:///home/user/main.cpp:157

on a single line, but accept that also as long as
the file link is separated by a word separator from
the sourrounding text.

Fixes: QTCREATORBUG-20406
Change-Id: I25bceb186818c9ea680741573a806f66395c3e16
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:02:36 +00:00
Andre Hartmann
05bb8e9e30 DocumentContentCompletion: Don't propose word under cursor
... unless it is already contained in the text.

For the following text:

  Lorem ipsum dolor sit amet,
  consetetur sadipscing elitr.

Typing "con|" now should only provide "consetetur"
as proposal, as "con" is just currently typed and
therefore no valid completion.

This avoids pressing line down before the first
valid proposal is available.

The exception is, if "con" would already be used
elsewhere in the text.

Change-Id: I7034f4b2b2ebe70e98acc616fb7590118faac0af
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-08 08:02:22 +00:00
Nikolai Kosjar
55f4c28889 CppEditor: modernize-loop-convert
Change-Id: I80382880a3c35ef0b59729bd222a626bc5c4a32b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-08 07:52:23 +00:00
Nikolai Kosjar
612393889a CppEditor: Fix some clazy level0 warnings
Use leftRef() instead [-Wclazy-qstring-ref]
Use multi-arg instead [-Wclazy-qstring-arg]

Change-Id: I4aa67e0d518060cdec4f96cb7a03a9a499f28f27
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 07:51:36 +00:00
Nikolai Kosjar
4b26a8c66e ClangCodeModel: Fix some clazy level0 warnings
Use QString instead of an empty QStringLiteral
  [-Wclazy-empty-qstringliteral]

Use the static QFileInfo::exists() instead. It's documented to be
  faster. [-Wclazy-qfileinfo-exists]

Unused CppTools::ClangDiagnosticConfigs
  [-Wclazy-unused-non-trivial-variable]

Change-Id: Ia4098d1191d6fcfc6e0774f71c39acdea3f0f36c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-08 07:19:29 +00:00
Nikolai Kosjar
ae388a85b9 CppTools: Fix failing tests
Amends 4dd4d088c5.

Change-Id: I9099dd6fa74b0ad8369234cc7dad4cbe1f8624c8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 07:19:16 +00:00
Christian Stenger
7ba74c2ba4 AutoTest: Use TypedTreeItem for TestResultItem
Simplifies code and reduces (visible) static_casts on
the auto test plugin's side.

Change-Id: I31ae3e4f1a32d3e74527ccb36080944848f3b1fa
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-08 05:39:25 +00:00
Eike Ziller
791d791f2c Make deployqt target recursive
So perfparser's deploy target is triggered too

Change-Id: I131a23b46127130967767fd7fee629ac5a97b17a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-07 15:39:58 +00:00
Christian Kandeler
666a970458 QbsProjectManager: Remove unused function
Output parsers are created elswehere these days.

Change-Id: I196d158747883df091f7b55354c3580515d9759e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-07 15:18:55 +00:00