Commit Graph

67787 Commits

Author SHA1 Message Date
hjk
4b0f326bd9 QtSupport: Protect QtVersion::detectAbis()
abis() is the public interface.

Change-Id: I7586e67b58ed175de713307a151413141c02ad98
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-05 05:54:45 +00:00
hjk
d10f6a031a Android: Guard against kits without Qt version
... in AndroidConfigurations::updateAutomaticKitList.

Also, simplify code a bit.

Task-number: QTCREATORBUG-23963
Change-Id: I6835721ec8b89dec57d668393178427ffa03ff6d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-05-05 05:54:22 +00:00
Michael Brüning
b80744903e Fix build eror in ChangeLanguageCommand on macOS
Added missing includes.

Change-Id: Ic7823176fd7d7cc05ddbe62133974b3052c6e2e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-04 15:11:07 +00:00
Johanna Vanhatapio
00200d8b90 Doc: Describe 3D Editor local and global orientation mode
Change-Id: Ibe281ba6d06c68a9c5f36a743563b6fc40fe7e0a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-04 12:24:25 +00:00
Christian Kandeler
d08e5c33ff Qbs build: Suppress excessive warnings from Qt with clang 10
We get these thousands of times:
/usr/include/qt/QtCore/qbytearray.h:586: warning: definition of implicit
copy constructor for 'QByteRef' is deprecated because it has a user-
declared copy assignment operator [-Wdeprecated-copy]
    inline QByteRef &operator=(const QByteRef &c)
                     ^

/usr/include/qt/QtCore/5.14.2/QtCore/private/qmetatype_p.h:111: warning:
use of logical '||' with constant operand [-Wconstant-logical-operand]

Change-Id: I5f97f23d9b62ef1cd8d07495c46598d2a34a6d85
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-04 11:57:05 +00:00
Miikka Heikkinen
3e85e93243 QmlDesigner: Close property editor comboboxes on selection change
Change-Id: I6f063a4884367bcf97ff79a5dcac42caf4a01118
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2020-05-04 09:58:37 +00:00
Eike Ziller
be73f41ad4 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ib95ec2c50c4bbaefd4ed0ec5af191ccc846c824f
2020-05-04 10:52:34 +02:00
Orgad Shaneh
21e9947c21 CMake: Fix GCC warnings
warning: control reaches end of non-void function [-Wreturn-type]

https://stackoverflow.com/q/33607284/764870

Change-Id: Ia8d0a8d42d5db786c6800ab91a1ef790fe2387f1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-04 08:41:15 +00:00
Christian Kandeler
f553e3d16a qbs build: Fix sdktool autotest on Windows
Make sure to fix the path separators for the macro that gets passed on
the command line.

Change-Id: I444883e6fc5a2b49d73a1fa52aa1ea26b207185c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-04 08:39:15 +00:00
Christian Kandeler
abd3791bfe ClangParser: Add missing linkification
Change-Id: I3e2af435a0656e72f2315cf58e2617c59623c97c
Reviewed-by: hjk <hjk@qt.io>
2020-05-04 08:38:53 +00:00
hjk
f11b00af7a CppCheck: Split QProcess::start command line manually
Qt6 removed the convenience function taking the whole command line.

Change-Id: I0b77eb15c6cd9cff25028dec4baf4a4a70eba83c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-04 08:00:47 +00:00
Miikka Heikkinen
790ed7ed81 QmlDesigner: Delay item library update if content can't be resolved
Is some situations, such as creating a new project, the item library
model can be updated too early, before the type information is
complete. In those cases, try again after a short delay.

Change-Id: I47d4766656280db46ef7473796dda961b765c026
Fixes: QDS-2023
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-04 07:38:55 +00:00
hjk
0ce0ca0f36 README.md: Fix link to coding style
Change-Id: Id40592c5698af22ffccfc14ade7438c2e33a4fb0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-04 07:28:40 +00:00
Leena Miettinen
b18587742f Doc: Describe downloading Qt Bridge from Qt Marketplace
Adjust the info about exporting and importing assets.

Change-Id: Ibc66fac68e14483fda050b7501fc7e091115ce89
Reviewed-by: Johanna Vanhatapio <johanna.vanhatapio@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-04 06:56:22 +00:00
David Schulz
c16665b9f3 LSP: show tooltips for diagnostics
Change-Id: I9625c77f87c31d3287ab17de42a507a8b068e118
Reviewed-by: Alexis Murzeau <amubtdx@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-04 06:37:46 +00:00
David Schulz
09b69b274d Debugger: Fix crash after adjusting font size
Change-Id: Ic3b415a3791968f972d2f69ec71c8012c572995d
Fixes: QTCREATORBUG-14385
Reviewed-by: hjk <hjk@qt.io>
2020-05-04 04:22:56 +00:00
Denis Shienkov
7ff956f39f BareMetal: Add support for NXP S32 device series for UVSC provider
Now it is possible to choose a target devices series S32xxx from NXP
for debugging:

* https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/s32k-automotive-mcus/s32k-scalable-microcontrollers-for-automotive-general-purpose-and-and-high-reliability-industrial:S32K

Make sure that an appropriate device software pack installed into the
Keil MDK-ARM instance using the "Pack Installer" tool.

Tested with the NXP S32K146 chip using the Segger J-Link debugger.

Change-Id: Ib9b7af591ac15a238c5fdac64deab055e9bf8617
Reviewed-by: hjk <hjk@qt.io>
2020-05-01 10:06:17 +00:00
Thiago Macieira
0bd53651d4 Fix compatibility with Qt 6 QMutex's non-recursive
QMutex in Qt 6 cannot be recursive. So don't call the constructor to pass the
option that isn't needed.

Change-Id: I9709abb1c3734e10a7defffd1607e76745b5cf0a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-30 16:58:11 +00:00
Brook Cronin
96cd1bffae Theme: add controls theme to creator themes and map to controls theme values
Change-Id: Iec6f217e8d3ae6e7f72fdf86c282e1b11b225626
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 15:43:45 +00:00
Thiago Macieira
6a66ced594 Port to Qt 6's absence of QProcess::setupChildProcess
Change-Id: I9709abb1c3734e10a7defffd1607e5b3fd46af0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 15:38:41 +00:00
Mahmoud Badri
9151e0b585 QmlDesigner: Fix navigator selection when index is invalid
This fixes the case when the navigator tree is collapsed and nothing
is selected, then a 3D object is dragged to the 3D editor. With this
fix, the tree is expanded and selection is shown. This also fixes
QDS-1892 partially (i.e. it still happens sometimes but less often).

Task-number: QDS-2024
Task-number: QDS-1892
Change-Id: If9233497d0f3c0daffafd939476d7bd64b005c79
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-30 13:52:52 +00:00
Tobias Hunger
7e6e02eb08 CMake: Warn on build directory changes
Change-Id: I78c5e850e268f4d7d66e40961bca85ef61be0483
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-30 13:10:15 +00:00
Tobias Hunger
dbb640783c BaseStringAspect: Provide a way to place a hook between UI and value
Change-Id: Ie6fd1c3215cba06dd67673b978af9f457f7fa9c8
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-04-30 13:09:32 +00:00
Christian Kandeler
fcd6384f4d qmake: Run the test version of system()
... also when PROEVALUATOR_FULL is not defined.
For more correct parsing. We do not believe that this introduces
additional risk, because the replace version of system() has always been
enabled, and appears to be used more often.

Fixes: QTCREATORBUG-23940
Change-Id: I036a20fdab3f6c51c612912b60686a123440f397
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-30 12:33:40 +00:00
Tobias Hunger
59473389b9 CMake: Remove BuildDirManager
The BuildDirManager was used to switch between different
BuildDirReaders. Now that only the FileApiReader is left, that
infrastructure is no longer needed.

Change-Id: I2d339a3407bb633cff6a8f7502b7b09094f63fef
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 12:08:08 +00:00
Thomas Hartmann
04a61fc16b QmlDesigner: Do not update actions while the rewriter is active
Change-Id: I9cd3c85fab5bbe93012d4279b701f9759c1a46e4
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2020-04-30 10:00:29 +00:00
Thomas Hartmann
f1f7b33959 QmlDesigner: Add more update options to SelectionContext
Since we add more and more actions, updating the actions might become
a bottleneck. This patch adds more fine grained control.
Actions can ignore updates that do not apply.

Change-Id: I98dadfb39a5ec7423b00bf3fc69a9707fc162cba
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2020-04-30 10:00:16 +00:00
hjk
db4f6a0e94 QmakeProjectManager: Suppress parsing for inactive build configurations
Change-Id: I25bf1cd4e1382ecf55df853f4f1ee3c16657a2f4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:34:32 +00:00
hjk
aef30c11b7 QmakeProjectManager: Use private for QmakeProject data
Change-Id: I79855579e0246ba910c1794f30e69ff8dbe18329
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:32:53 +00:00
hjk
f120d78f32 QmakeProject: More and better tracing
Hide the parameters behind yet another macro to get a uniform layout
and avoid parameter evaluation in the normal non-traced case.

Change-Id: Iaf24b0f1b285c8f664f8b3476ae82c39c1a2d7dd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-30 09:29:06 +00:00
Tobias Hunger
0b9513f273 CMake: Simplify CMake Build System states a bit
Merge handleParsingSucceeded and handleParsingSuccess as well as
handleParsingFailed and handleParsingError.

Change-Id: If4f84bdfa2f59cfa0037a941372a1929996be3bd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 08:06:39 +00:00
Tobias Hunger
60064620c8 CMake: Document interactions around CMakeBuildSystem
Change-Id: Id4f379eefcccf2d0517e5c3b72c9b88957243651
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 08:06:28 +00:00
Tobias Hunger
902b1c3b9e CMake: Disable switching between different readers
Remove the code that switches between different types of
readers based on what the different CMake binaries support.

This is no longer needed since only file-api is supported now.

Change-Id: Ia86d143f5e2cecc2bcd68ab7d62503915a32d223
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 08:06:18 +00:00
hjk
2a664afaa1 App: Add mechanism to not propagate LD_PRELOAD
LD_PRELOAD is useful e.g. to preload custom malloc implementations
for profiling purposes. At times, it makes sense to not propagate
that to spawned child processes. This here allows to prevent that
by setting another variable, QTC_DO_NOT_PROPAGATE_LD_PRELOAD, in
the environment.

Change-Id: Ib8944685488a18a651d351b8a64dd8d7a7e48837
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-30 08:01:21 +00:00
Christian Kandeler
ce428cfeef QmakeProjectManager: Differentiate between different types of projects
... by using different icons in the tree.
So far, Qmake project nodes looked annoyingly uniform, which was a
hindrance to understanding their structure. We now use the same
differentiation as in qbs, that is "project" (SUBDIRS pro file),
"product" (app/lib/other) and "group" (pri file), which conveys much
more information at a quick glance.

Change-Id: I04ca2aeccb9240876c0fb5cd1310e0b199eb3e97
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-30 07:56:31 +00:00
Cristian Adam
732b17a2c4 qtcreatorcdbext: use std::unique_ptr instead of std::auto_ptr
Qt6 will require C++17, which has removed std::auto_ptr

Change-Id: I4f87ce0196799269735a878592ef3e930e94d4fc
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-30 07:17:04 +00:00
Eike Ziller
d7520dece5 CMake build/Linux: Install desktop and appstream files
Fixes: QTCREATORBUG-23906
Change-Id: I9d796c8826dbb4beb980aa29b75526fe96093921
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-30 07:06:20 +00:00
David Schulz
7d429c54e3 Debugger: remove unused variable
Change-Id: I7cddb9cd8ec3b058e04409e6a56490297660ed03
Reviewed-by: hjk <hjk@qt.io>
2020-04-30 06:23:53 +00:00
Orgad Shaneh
8542699b89 KSyntaxHighlighter: Sync with original repository
from commit ff67bbbeff62d8b91b83d74c0c27dfee00f39a00.

CMakeLists.txt excluded.

Task-number: QTCREATORBUG-22558
Change-Id: I405e23e63483aa9a7e2daf899a335bd71e1b036e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-30 04:25:35 +00:00
Alexis Murzeau
5d9d0b876a LSP: underline code with diagnostics from the language server
When the language server reports diagnostics, it also reports to which
part of the code the diagnostic applies.

That part of the code wasn't emphasized before, there is only an icon
next to the line and part of the diagnostic message in the text editor,
but no exact clue of which word is targeted by the diagnostic.

This commit add information about the affected code by diagnostics using
extra selection of type CodeWarningsSelection as other plugins do (like
the clang code model).

If a diagnostic has no severity or is not Error, Warning is used (the word
will be underlined in yellow).
Diagnostics can be either Error, Warning, Information or Hint.

For example, clangd uses Hint for remarks and Information for notes.
Notes can be related to a warning or an error, for example
when a function call has an incorrect number of argument, the call site
will have an error diagnostic with red color and the called function
declaration will have a Hint diagnostic with a yellow color.

Change-Id: Ifa433553be95a4913541d5570a2758ac213e7075
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:51 +00:00
Alexis Murzeau
aa68902b62 LSP: update semantic highlighting to use more colors
The actual highlighting of the C++ code using clangd doesn't use many
colors to differentiate symbols (for example, fields of a class).

This commit makes symbols more visible for these categories:
 - static methods
 - preprocessor macros
 - struct and class fields
 - static fields

Change-Id: I001325cf5e48aa07d7397b2b7ac98a65501e1d5d
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:39 +00:00
Alexis Murzeau
6118463d39 LSP: Fix language server desynchronisation when whole file contents change
When the whole file contents are changed, for example because of changing
the highlight definition when there is several candidates, the language
server will behave as if the file's content was the result of
concatenating two times the file's content (leading to duplicate
declarations errors for C++).

The issue is that when this happens, the didChange message indicate
only the added portion of the change without the removal of the whole file
beforehand (ie: the range is empty and the text is the whole file content).

This is because charRemoved and charAdded are equal to the length of the
document which is not exactly the number of /visibles/ characters, but also
including some invisible formating characters according to QTBUG-80662.

This causes the QTextCursor to ignore the second setPosition because of
invalid position out of range.

Fix this using the same code as QWidgetTextControlPrivate::_q_contentsChanged
that is to use qMin to ensure the end position is not after the end of
the document according to QTextCursor.
For charsAdded, document->textAt takes care of that itself, via
Utils::Text::textAt.

See also: QTBUG-32583, QTBUG-80662

Change-Id: If781707d42253f4659005754efa73d872577f738
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:31 +00:00
Alexis Murzeau
e430bfa05a LSP: Fix error when opening a file with spaces in its path
When doing Follow Symbol Under Cursor to a file that has a path with
spaces, QtCreator will show a message box with an error.

The issue is that the resolved file path can still have %20 encoding
after the QUrl::toString convertion to QString.
This is because toString does not support QUrl::FullyDecoded and fallback
to PrettyDecoded instead which won't replace %20 with a space.

To fix this, QUrl::fromPercentEncoding must be used.

Also, an existing use of QUrl::fromPercentEncoding is changed to have
an utf-8 input QByteArray instead of local8Bit as fromPercentEncoding
convert %-encoded values to raw values and then convert the result
from utf-8 to unicode QString.

Change-Id: I784bcc30a67b45dcd218170854d480ebeef4237e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:28 +00:00
Alexis Murzeau
9ca930554f LSP: fix outline's selected item when writing
When receiving textDocument/documentSymbol or
textDocument/symbolInformation, the outline widget and the outline
combobox is cleared and updated with received symbols.
This causes the selected index to become the first item of the list when
writing text.

Fix the issue by updating the selected index after having updated the
outline widget and outline combobox.

Change-Id: I52541940f8a979cbf130da4383db48c470fc94e1
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:24 +00:00
Alexis Murzeau
15419cb145 LSP: Fix completion assist that could be the wrong provider
When a document is opened that uses a language server, it would not gain
the completion assitance from the language server in some cases.
Instead, the default completion assist provider is used, which in case of
the TextEditor, will only provide basic autocompletion.

The reason is that Client::activateDocument is not called if the document
is not in LanguageClientManager::m_clientForDocument when
Client::openDocument is called. The check is at the end of that function.
When the issue happens, openDocument is called indirectly from
LanguageClientManager::documentOpened.

The fix is to change the order of instructions in
LanguageClientManager::documentOpened so m_clientForDocument is updated
before calling openDocumentWithClient.

This way, the language server's completion assist is really used as it
should.

Change-Id: I0d2b3b8573e97c0c0c4bd517775668d41a4a797b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-29 19:36:20 +00:00
Henning Gruendl
06c0f74fec QmlDesigner: Add radius to transition item
* Add support for rounded corners on transition item
* Cleanup connection drawing

Task-number: QDS-1788
Change-Id: I53698687b911ad9a43309c53bb599b7f0212f90d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-04-29 19:00:26 +00:00
Christian Stenger
626807c94e QmlJS: Fix line number for string literals
When a string value's first line ends with an EOL the
line number for the next line got wrong which in turn
confused the syntax highlighter.

Fixes: QTCREATORBUG-23777
Change-Id: I37eed839a2e63cf470b9bc2ac0596ab8bc8d373c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-29 16:09:08 +00:00
Tobias Hunger
494b9f5287 CMake: Remove servermode support
Task-number: QTCREATORBUG-23915
Change-Id: I2a58e1d6d95c28e25787722fa37448d86c4aebc9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-29 14:30:16 +00:00
Eike Ziller
5feec21cbd Packaging: Install documentation
Fixes: QTCREATORBUG-23912
Change-Id: I2e28c9f9000dca1216ec31bad307031937223e83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-29 14:25:58 +00:00
Christian Stenger
549b5719f6 QmlJS: Fix lexer handling of escape sequences (again)
The lexer handled escape sequences already, but not fully
correct.
This effectively reverts 63db0f271f and fixes the wrong
offset.

Task-number: QTCREATORBUG-23830
Change-Id: I2cc1e9df5c0218cf9ee80998adce69bbc2eb4dab
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-29 13:48:11 +00:00