Commit Graph

6116 Commits

Author SHA1 Message Date
Christian Kandeler
26d46fc19d ProWriter: Do not insert a backslash when adding new files
... if the previous line already has a trailing backslash.

Fixes: QTCREATORBUG-24083
Change-Id: Ieabce541da2ef55bcbf3bd14d139b14f3a7575c7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-02 11:20:16 +00:00
Volodymyr Zibarov
9ee693ee22 C++: fix built-in code model to work with shared_ptr on MSVC 2017
These changes target Find Usages feature to work with shared_ptr.
Improve libs/3rdparty/cplusplus and plugins/cplusplus:
parse __declspec() attribute,
call to variadic function template without specified template arguments,
if constexpr,
c++11 attributes [[value]],
function templates with default parameters,
resolve order for function vs template with default parameter,
template operator->() with default arguments,
template specialization with numeric values,
find best partial specialization,
fix partial specialization for non-first specialized argument

Fixes: QTCREATORBUG-7866
Fixes: QTCREATORBUG-20781
Fixes: QTCREATORBUG-22857
Fixes: QTCREATORBUG-17825
Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
2020-05-29 12:39:28 +00:00
Volodymyr Zibarov
28a999be52 CMake Build: Set /permissive- (standards conformance mode) for MSVC
To make errors appear faster when developing on Windows

MSVC 2017 and later have this flag to disallow MSVC-specific C++
language extensions. Use it to make code more correct and more portable.

Set this option with add_compile_options() in root CMakeLists.txt to
apply it to all targets.

Add one #include to unittest/gtest-clang-printing.cpp as workaround for
forward template declaration bug in MSVC http://tiny.cc/fa4tpz

Change-Id: Ie0b19701ad773c79ffd2fed24fffbb1dcb29538c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-05-29 06:51:45 +00:00
Christian Kandeler
1989dbe0d7 Built-in lexer: Recognize also reserved user-defined literals
Otherwise, we trip over uses of operators from the standard
library such as std::chrono's operator"" ms(), potentially breaking
basic code navigation.
Amends 425811291d.

Fixes: QTCREATORBUG-24067
Change-Id: I3b2863ce88ee3787414e7a1acdf25f368041cdb4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-28 08:36:56 +00:00
Michael Brüning
de8eb93637 Add stylesheet merger
Adds classes to merge a template qml file and a qml stylesheet that have
been exported from other design tools into a resulting qml file that can
be used for further processing in Qt Design Studio.

Current issues:

* Sometimes it makes sense to define width and height
  if an anchor is present, but most of the time not.

* Actually if the hierachy was defined (e.g. Text item not child of
  background) most likely the anchors should be ignored.
  But this would be just a "dirty" heuristic. I suggest to let the
  template decide. If the template has anchors those have "precedence".
  It is always possible to define templates without anchors.

Task-number: QDS-2071
Change-Id: I9159514a8e884b7ffc31897aef4551b5efbbcb87
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 18:26:12 +00:00
Tim Jenssen
5b00401850 Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: If4869664ad4cbb5ec56e7c306f47d0bf0f1f075c
2020-05-27 19:02:07 +02:00
Marco Bubke
a9a205486d Sqlite: Improve SqliteStatement column check
We have done it for every getter. Now we do it only once as we ask for
the values. It simplifies the code and the test and could even improve
performance.

Change-Id: Ia7d4a33a77ec7c0a5fda548424fbf8b192f07511
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 13:26:07 +00:00
Marco Bubke
9f9140b196 Sqlite: Remove unused code
Binding by names is slower and we never used it.

Change-Id: Ia6b9b78401f8c2711be34b667ac6f08b44418773
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 13:09:35 +00:00
Marco Bubke
9c44f8d88d Sqlite: Add blob support
Change-Id: Ic2ec5f20c8585241b9e9aaa8465e70b6ab4f004c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 13:09:27 +00:00
Marco Bubke
22c33fb859 Sqlite: Improve LastChangedRowId
Change-Id: I2fe559d4b40f93561e44eb138119416291dc7d41
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 13:09:20 +00:00
Marco Bubke
64cbffe959 UnitTests: Fix LastChangedRowId
Change-Id: I538d068168488eee2662618dede598135c45e396
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-05-27 13:08:55 +00:00
Christian Kandeler
e4fb3de165 C++: Add tests for recent indentation fixes
Change-Id: I90ae2da3a82bff2e966c4327cf8e42f7ebbddd27
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-27 04:45:12 +00:00
Marco Bubke
75da71e1fa Sqlite: Fix test
Change-Id: I04de9c429b7779c5c4ecde4a4a44e3b5e60699b3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:11:14 +02:00
Marco Bubke
55d1f6b46e Sqlite: Relax LastChangedRowId
Change-Id: Ibc4637ebafd4c0cdedfcea5c52da5025435bc4ab
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:11:02 +02:00
Marco Bubke
36fd58fbe9 Sqlite: Add carray extension from Sqlite and a pointer binding
Change-Id: I96c160514ac80458cbcbff0151c685958de71fdd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:10:40 +02:00
Marco Bubke
2f6a226dd3 Sqlite: Forbid double quotes which are not part of the SQL standard
It's anyway easier to write single quotes.

Change-Id: Ie71c39d9cdd83e0b898efe70a1912d8257ac991e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:09:47 +02:00
Marco Bubke
dc2192ef8a Sqlite: Dont compile Utf-16 support
We don't support it anyway.

Change-Id: I35fa859f3c9d7389e3d00d584832a814acb39c80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-26 18:09:26 +02:00
Christian Kandeler
9c3d4dcc88 qbs build: Make the pkg-config dependency in unittest.qbs non-required
We don't want an error if pkg-config is not installed.

Change-Id: I142abe3d21649a9010b91707532eb733e2103583
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-26 13:10:22 +00:00
Christian Kandeler
c9672f4ffa qbs build: Fix unittest project file
There were some subtle errors that lead to test failures.

Change-Id: Ibea24a8a45a47a5c3239da77bd4ed7ddca61ec57
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-26 13:08:32 +00:00
Christian Kandeler
949bb0e67b ClangCodeModel: Show value in tool tips, if possible
When hovering over a constant expression, it's probably helpful
to show that value to the user.
Requires clang 11 to fully work. For now, it only shows the value for
variable initializations.

Fixes: QTCREATORBUG-23967
Change-Id: I6b844231bac50993c2fa2fa82c552ad9cef590df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-26 08:50:58 +00:00
hjk
14666c801a Debugger: Drop 'set print object on' for GDB
This does not seem to affect the code paths we are using through
Python.

Task-number: QTCREATORBUG-23965
Change-Id: I2e20d6d3c1937d56293e81b74c453e83a92ddc4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-25 10:01:03 +00:00
Nikolai Kosjar
0bf7bacb4f Clang: Disable a clangformat test for vanilla clang
...that requires a custom patch to work.

Change-Id: I954286f47112b660dc6ee681dac2250a9e8da0df
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-22 08:59:28 +00:00
Nikolai Kosjar
8df8502090 Clang: Disable a completion test for LLVM/Clang 10
For the case

  struct Foo;
  void f(Foo *foo) { foo->/*COMPLETE-HERE*/ }

no completions are expected as "Foo" is only forward declared.

This seems to be handled correctly in current LLVM/Clang master
(upcoming version 11), but wasn't with previous versions as pointless
non-member-completions were returned.

As our workaround is not applicable anymore with LLVM/Clang 10, disable
the corresponding test for that version as we cannot do anything about
it.

Change-Id: Ia02696175d0d532e16bc16a1010821b4aed20f8b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-22 08:42:09 +00:00
Christian Kamm
40dd6fc185 QmlJS: Add workaround for missing imports in Qt >=5.15.0
The QtQuick module plugins.qmltypes in Qt 5.15.0 do not contain
QML types like QtObject. Instead, they are found in the QtQml module.

Something similar applies to QtQml and QtQml.Models and
QtQml.WorkerScript.

As Qt 5.15 can't use the "import" command in the qmldir file, this code
instead detects the 5.15 QtQuick and QtQml modules and adds the
dependent imports manually, as a workaround.

Change-Id: I982e349298eb7200372390dfc384fb43a762b253
Task-number: QTCREATORBUG-23986
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-21 07:54:08 +00:00
Christian Kamm
f64146741d QmlJS: Use "import" commands from qmldir files
qmldir files can have lines like "import QtQml". These were already
parsed, but not stored in LibraryInfo. Store them.

When imports are resolved in Link and a library has such an import, also
load the module it refers to, with the same version and "as" scope.

Add a test to verify the behavior works.

Change-Id: I80b260bfaa36a9e5de0849fa5632b3361077ef01
Task-number: QTCREATORBUG-23986
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-21 07:53:44 +00:00
Eike Ziller
8292807e0d Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/android/androidextralibrarylistmodel.cpp

Change-Id: Ica69c24e83deff819e640dcb4c2682a554d8a2d2
2020-05-19 15:23:16 +02:00
Nikolai Kosjar
e2a68edbc1 Clang: Adapt test DiagnosticSlowTest.Text for LLVM/Clang 10
Change-Id: I99ac001d1231f14cd5cda9268d925fa442b16a35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-19 12:28:17 +00:00
Christian Stenger
cad625c739 Squish: Remove pastecode.xyz from tests
Service is unavailable.

Task-number: QTCREATORBUG-24002
Change-Id: I012681ec1ec1deb30387e1762fe72a877e56fa10
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-05-19 09:53:27 +00:00
Christian Kandeler
b92c22a102 qbs build: Add project files for clang unit tests
Change-Id: I2cd02d94fb886bb49c66fa2508a63dc3480a7c23
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-19 09:26:45 +00:00
Nikolai Kosjar
009e9d783d Clang: Fix leak in TranslationUnitUpdaterSlowTest
Change-Id: I75b349c5af80de01a2fb499b7335692eedcae6eb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-19 08:17:39 +00:00
Eike Ziller
3c59d02286 CMake build: Favor qtc_exted_... with CONDITION over custom if
Change-Id: I2c575b69fb6c2535f789313234400f6f6a63a08b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:38 +00:00
Eike Ziller
3c535503cb CMake build: Avoid using extend_qtc_target directly
Also add a extend_qtc_test which checks if the test is known.

Change-Id: Idd3b3a02ac61fce2622cb8681233cfbd96a77bc4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:26 +00:00
Eike Ziller
52b7ec058b Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: I1583fa81adc0218ad4657baa347c08e9e29f88e6
2020-05-15 14:49:11 +02:00
Nikolai Kosjar
09353d927b ClangTools: Fix ReadExportedDiagnostics.* tests
These fail

 [  FAILED  ] ReadExportedDiagnostics.Tidy
 [  FAILED  ] ReadExportedDiagnostics.Tidy_Clang
 [  FAILED  ] ReadExportedDiagnostics.Tidy_ClangAnalyzer
 [  FAILED  ] ReadExportedDiagnostics.Clazy

as 07ec6de8d9 introduced Diagnostic::name
but did not adapt tests and printing.

Change-Id: Icadace9c23ad1ad03eee7ad394bbc0211aea31f3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-05-15 05:10:11 +00:00
Marco Bubke
33a833d187 Sqlite: Add null value
So we can distingish between a null value and zero or an empty string.

Change-Id: I9122fdafdf85cf04dcf8bca7bf294be9b28ee251
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 18:02:18 +00:00
Marco Bubke
4b7aeae749 Sqlite: Add check constraint
Change-Id: Ib4b909da40c7fe07dcb6a07c4650a720313391c2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 10:30:44 +00:00
Marco Bubke
77c81aa8b0 ClangPchManager: Fix tests
Change-Id: Ide9adf326dda4b995636d629a6b2eed829f42b34
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 09:52:55 +00:00
Marco Bubke
c4bbc74e37 Sqlite: Improve constraint support
Now you can add more than one constraint. And we added some
new constraints too.

Change-Id: I849d2d2ef6e44c897a65ff2bdfe8d172a345c991
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 09:15:00 +00:00
Marco Bubke
a86fd58e40 Sqlite: Improve LastChangedRowId
Sometimes we want not only the row id from one table but two or three.

Change-Id: I6d5444a71ecbfe6c1af8073be80b04932ea9268d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-14 09:14:35 +00:00
Nikolai Kosjar
2fb43e6e04 Clang: Fix typo in tests
Change-Id: I37ce70c06f98d6bc5f359f9fe34fd73a1cc51795
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-14 05:19:36 +00:00
Nikolai Kosjar
3ddf93ba64 Clang: Remove dead code code path from tests
Change-Id: I75445ad849b701b648e53d120d4796f29092ba15
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-13 12:57:16 +00:00
Robert Loehning
a90ec2809c Squish: Don't expect pastes to pastebin.com to appear in list
Change-Id: I02a73244e3aecad906f2c08b37d60ebe1880f534
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 20:29:02 +00:00
Christian Kandeler
eb96f9900a Fix clang 10 warnings about unnecessary copies in range loops
Change-Id: I3b57869b5a04528518bc432b76768b01e3f53e81
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 13:45:43 +00:00
Marco Bubke
a4b00a7742 Sqlite: Add update hook and use it to get the last changed id
Sqlite has a function to get the last inserted rowid but very often you
want to get the updated rowid too.

Change-Id: Ie276a5039682813ad16597433996a2959f54d9ba
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-12 13:05:57 +00:00
Tim Jenssen
03a1282bdd Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: Ic0edcce1268b9cc47c91364eeb84e3b3f7dfe134
2020-05-12 10:04:10 +02:00
Christian Kandeler
8e1169f4bf qbs build: Take differences between clang and "apple clang" into account
In particular, clang with version number 10 is not really clang 10 on
macOS.

Change-Id: I8be489fa9cffd63c1ea8f13d181686ab1a575ec6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-12 07:31:39 +00:00
Eike Ziller
20ef5c6de3 Merge remote-tracking branch 'origin/4.12'
Change-Id: Ibbf9f16677a58bdcdd3ce63701ffa34db6f44916
2020-05-11 11:36:22 +02:00
Christian Kandeler
27ea67728f qbs build: Suppress more warnings
Amends d08e5c33ff.

Change-Id: Ic842dda51b21427e1989190b44508d54aa1e7120
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-05-07 15:25:31 +00:00
Marco Bubke
f02934458e Sqlite: Add foreign key support
It is still only support references in columns but so far it is enough.

Change-Id: Iebb4866cf738d651270e54357b5e4a2837f05417
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-05-07 12:14:58 +00:00
Tim Jenssen
d5b83fc637 Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: Ic3ae0fd8c779c0bac8a0f01e87043251b3ce7fd4
2020-05-06 19:51:29 +02:00