Commit Graph

935 Commits

Author SHA1 Message Date
Eike Ziller
058f1e6918 Fix some license headers
Missing the GPL part.

Fixes: QTCREATORBUG-24501
Change-Id: I9e8e033399c050af29927d0ee735f9bcd05345bf
Reviewed-by: hjk <hjk@qt.io>
2020-08-19 07:05:55 +00:00
Tim Jenssen
4fe5b923cd Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Change-Id: Ic720f3adab305c5ef8cd10e713ccabf510eff0c0
2020-08-13 06:39:40 +00:00
Marco Bubke
b5d59c75a7 QmlDesigner: Fix bool handling in the list model editor
Task-number: QDS-2581
Change-Id: I47a9ed4ca55532bb7199a6c5dd4894b7adb7d05d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 09:40:34 +00:00
Marco Bubke
b4027b7943 QmlDesigner: Fix crash for list view model
There was a type, so it crashed. The code is now under tests so we cannot
break it anymore.

Task-number: QDS-2563
Change-Id: I81426a9f8a568b217b7bf9c8c261b24be14ff61a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-08-10 09:40:26 +00:00
Orgad Shaneh
61601899db UnitTest: Fix escaping of LLVM output on Windows
Complements 1929c38a9f.

Change-Id: I95e32baf477e42003f1e97c73fd557b480de33a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-07 05:01:04 +00:00
Christian Kandeler
c24320123b qbs build: Fix spurious re-resolving
The pluginjson module records the VCS state by default, which means qbs
re-resolved the project after every git action. Prevent that.

Change-Id: I24cf1d658ba847b327be018749806856a6e7da1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-31 08:13:40 +00:00
Cristian Adam
3b8f51391b UnitTests: Re-enable CMake unittests
Ammeds 327bec26bf

Change-Id: I34b62532da424b3b4fb0290049150f6ba444283b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-24 10:05:45 +00:00
Christian Kandeler
4aba3da7bd CompilationDatabase: Fix unit test
Amends be97943372.

Change-Id: Ic840f5eca8a83b5bdf3e3864e8859234472911b7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-10 12:57:45 +00:00
Christian Kandeler
782ca5d8d8 Clang: Fix error when including float.h with mingw
Prevent mingw from trying to #include_next a private header from a path
we cannot add to our list of includes.

Fixes: QTCREATORBUG-24251
Task-number: QTCREATORBUG-24027
Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-09 17:24:16 +00:00
Marco Bubke
b73ce9eccf QmlDesigner: Add row move up and move down buttons
Task-number: QDS-2294
Change-Id: Ia1e64d0811f55151dfe529db4868821840a8fba9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-08 09:17:41 +00:00
Marco Bubke
7504c966bf QmlDesigner: Move code from list editor dialog to model
And add tests to the code.

Change-Id: I9fb183729c716a50bbab861d207a212ff704ee7b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-07-08 09:17:26 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
Christian Kandeler
15a1266d50 clangbackend: Do not handle built-in types specially
... when collecing tooltips. The more general functions provide more
information, such as constness.

Fixes: QTCREATORBUG-14950
Change-Id: I6d0a890a695e19e9754b5538ba092a188a3bbbb0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-06 06:32:33 +00:00
Christian Kandeler
4c2938a366 Fix qbs build
Change-Id: Ic19d1f42d98a0bec31f2f5788063f6b2e7d61cef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-03 14:49:01 +00:00
Tim Jenssen
0c6231d7ec Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/tools/clangpchmanagerbackend/source/pchtaskqueue.h

Change-Id: Ibe8ac2fa0eafcbcc86ac445f0be035839e06ff40
2020-07-01 09:40:01 +02:00
Marco Bubke
1e6807c680 QmlDesigner: Add listmodeleditor
Task-number: QDS-2294
Change-Id: I66cae3a0d4265ab112eaf6b04e3a5972d185ff43
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 10:28:07 +00:00
Marco Bubke
32e181f5ce ClangRefactoring: Remove not used pch files
Because we use UUID for pch files every time we rebuild a pch we get
a new file. This patch is collecting and removing this pch files.

Change-Id: Ia8688e7215ee7b41f39b2285323eaa345056bda3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:50 +00:00
Marco Bubke
c924a45fb2 Refactoring: Fix unit tests
One if the LLVM 10 hot fixes was not working.

Change-Id: I1e6cab39ffd5c52f55fb83ff777f6eca457dea35
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:42 +00:00
Marco Bubke
36b72e2bab QmlDesigner: Break dependencies
To get the model under unit tests we have to break every depenedency to
code outside of the unit test scope.

Change-Id: Ib613c3308e48990c55b2ed0cd42bc4b0e1041a01
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-30 09:52:34 +00:00
Tim Jenssen
b8cd87dea0 Merge remote-tracking branch 'origin/qds-1.59' into 4.13
Conflicts:
	src/plugins/clangformat/clangformatplugin.cpp
	src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp
	src/plugins/qmldesigner/qmldesigner.qbs

Change-Id: Ie4a0beeb9fd32ac9683f4e8769988a9c3f3e369a
2020-06-26 16:51:22 +02:00
Artur Shepilko
f3c2f68c39 Sqlite: Fix a compiler warning about unhandled switch-case
Change-Id: Id9cb6ebd6db7f718f8aa3e25d56581f953ad182e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-24 15:04:20 +00:00
Christian Kandeler
f9a5ad4d3c ClangBackEnd: Adapt skipped source ranges from libclang
... so that the first #if is not grayed out.

Fixes: QTCREATORBUG-23714
Change-Id: Ia014fd8cd768ea9530567ba8c712bdc0c4063091
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-19 09:14:24 +00:00
Eike Ziller
1b431fe271 Move Id from Core to Utils
And add a compatibility wrapper for Core::Id, so we don't have to rename
all occurrences from Core::Id to Utils::Id.

This allows us to use Id also in Utils, which makes it possible to e.g.
move Core::InfoBar to Utils without work arounds.

Change-Id: I5555d05b4e52f09d501dbfe5d91252a982a97c61
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-06-18 05:58:23 +00:00
Christian Kandeler
0861ba2fc9 sqlite: Fix qbs build
Exporting the full sqlite interface can lead to run-time conflicts with
the system sqlite that Qt's SQL support pulls in.
So re-build the sources for the unit test, as in the qmake build.

Change-Id: I8394b9c0aa4e21704bc84600f40b8f5d706ad66d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-16 12:43:00 +00:00
Marco Bubke
270e7b4ea5 UnitTests: Fix fake project.h
Change-Id: I5bd3be88c900af0caaccf8ca3ba2793f20ccf6f8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-06-16 12:24:28 +00:00
Eike Ziller
e2670bf3e6 CMake build: Build tests with relaxed QString casting
Like in the qmake build.

Change-Id: I216649123b4f25e5c01f2a71162fc200e0a36d85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 14:30:08 +00:00
Christian Kandeler
11f7c4da9f clangbackend: Fix libclang's priority adjustments
... for member qualifiers.
For instance, when doing completion on a non-const object, non-const
member functions get a higher priority than const member functions. This
does not seem particularly sensible and can make our list of completions
appear unordered.
As each matching qualifier only increases the priority by one and the
base priorities are generally further apart, we can fix this problem by
considering two priorities as equal if they are sufficiently close.

Task-number: QTCREATORBUG-6242
Change-Id: I1d04fdf68869cf07cc00626aaac3030b360c2546
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 09:39:57 +00:00
Christian Kandeler
ff348e0dcc Unittest: Fix qbs build
Change-Id: I2f573b820745ecbbf5fc00931b4f96b3d43f634a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-12 09:15:19 +00:00
Christian Kandeler
aaacfb4945 Fix a clang unit test
This particular test was apparently supposed to check that the two
occurrences of "foo" (one const, one non-const) appear next to each
other in the list of completions. However, there is only one occurrence
of "foo" and the test only succeeded because it happens to be at index 0
and -1 is returned for the second lookup, resulting in a absolute
difference of 1.
So let's explicitly check for that instead.

Change-Id: I6049689911decc114239f2be7e63b091a4a18226
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-11 15:24:07 +00:00
Tim Jenssen
3acdb7891b Merge remote-tracking branch 'origin/qds-1.59'
Change-Id: I8891e7490a7fd51997a3b57561961f6134be3252
2020-06-11 12:54:10 +02:00
Tim Jenssen
83148cbb89 unittest: another adjustment to new constructor
Change-Id: Id1d38fcca8f4b51dea2c17b466521534b73d7ae7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-10 15:22:08 +00:00
Marco Bubke
50d3067bcd UnitTests: Refactor printing
Move standard printing functions to extra header.

Change-Id: Ib032047235297dfe3ac0bcdbd39c353493f3ae0d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 13:34:37 +00:00
Marco Bubke
5a7a6cb02d Sqlite: Remove last usages of UpdateCallback
Change-Id: Ie7ffe06c55a7827fae20996e5b0eadb9892b9e23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 13:34:27 +00:00
Christian Kandeler
4fbd68183b clangbackend: Fix lexicographical sorting of completions
Utf8String has a weird operator<, so we did not get the expected results
from our string comparisons.

Task-number: QTCREATORBUG-6242
Change-Id: I0e94dc42d6e04ab833efcce41463b7024455b6d8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-10 12:50:50 +00:00
Tim Jenssen
bca0c2c3f4 clangrefactoring: fix cmake and qbs after file rename
Change-Id: Ic78df938ad4edced664ef968d834c59110f4ab37
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-06-10 11:32:30 +00:00
Marco Bubke
acf5329422 Sqlite: Fix null handling
Most of it is only silencing a warning but one is fixing a faulty test. So
writing null values should now be working.

Change-Id: If702e1fc8176a9e0ae82a5589c719d567929202b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-10 09:05:00 +00:00
Marco Bubke
06866c3ee9 Sqlite: Use a more efficient update hook
Change-Id: Ic6df1f4ba6b914c7751faf7cf89083fa50a92793
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-09 14:48:27 +00:00
Cristian Adam
be339abb16 CMake Build: Fix unittests
Change-Id: I4214954d880d19dbe9a070d031c417dc3caf068a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-09 12:44:29 +00:00
Eike Ziller
c644e7c80a Merge remote-tracking branch 'origin/qds-1.59'
Conflicts:
	src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
	src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp

Change-Id: Ifa7c66330c1995378280cdb4c57c30015dc11b68
2020-06-08 16:04:15 +02:00
Tim Jenssen
42cad89708 fix tests
Change-Id: I5a0f10e6afb85dc0306e224710d2c103f24404f3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-08 13:02:40 +00:00
Marco Bubke
cf441e8198 Sqlite: Add primary key table constraint to table builder
Change-Id: I60c158eb76db2217a2d045053bb8e47eef75ff7a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 09:57:47 +00:00
Marco Bubke
a61eff0079 Sqlite: Add session support
Session are captured by hooking in the sqlite changes. They are saved in
blobs and containing inserts, update and deletes. Because the are
semantically coupled to translactions we add a

Change-Id: Ie095558ebc50601fcaae32958ebeeb98b72d73b9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-06-05 09:52:42 +00:00
Eike Ziller
c9d357fdac Fix unittest build if Clang refactoring is turned off (now the default)
Change-Id: Ib129d2872a4550e14a888c1d98c4b78012a08982
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-03 10:31:17 +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
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
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