Commit Graph

6116 Commits

Author SHA1 Message Date
Eike Ziller
d02afbe6b4 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: I2136ba89d3aa3c4c2a0e7a4f9d8ba9cec32924ce
2020-11-30 16:14:32 +01:00
Christian Kandeler
aabdbb7d9e clangbackend: More libclang cursor adjustments
Fixes: QTCREATORBUG-21856
Change-Id: I034b463238b4b8da4c36f95cacab79adf94c11eb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-30 11:35:24 +00:00
Alessandro Portale
a3857a996a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Amends: b2a766a79a

Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py

Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-27 13:26:07 +00:00
Alessandro Portale
81f3452e1c Aggregation/Utils/ExtensionSystem: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

readability-static-accessed-through-instance fixes the places where
the originally non-static, now static functions were called through
instance.

Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-27 09:16:08 +00:00
David Schulz
f3830c68b1 Debugger: Fix dumper test using QVector
QVector is a typedef to QList in Qt6 so cdb reports vector types as
QList<T>

Change-Id: Ic1940bc9e3286906c42d29a9c29882b5b3699312
Reviewed-by: hjk <hjk@qt.io>
2020-11-26 12:23:10 +00:00
David Schulz
e6873b5b24 Debugger: adjust QStringList dumper test for qt6
QStringList is a typedef in qt 6 so cdb reports the type as
QList<QString> now.

Change-Id: I9660935dfb26a2a765411acdec1a3478357040fe
Reviewed-by: hjk <hjk@qt.io>
2020-11-26 11:21:41 +00:00
Eike Ziller
6172fc8a9d Merge remote-tracking branch 'origin/4.14'
Change-Id: I8543d87779c0da6a876caa046f6852737c9ae680
2020-11-26 10:53:34 +01:00
hjk
0ce92b3ac7 Debugger: Adapt QXmlAttributes dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I67ee0fae1308d20b474fe0dd565b46d2a83dd5e3
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-26 08:41:23 +00:00
hjk
35c2d51ec9 Debugger: Adapt QDate{,Time} dumper and test to Qt6
Essentially removing the parts that are gone in Qt6

Task-number: QTCREATORBUG-24098
Change-Id: I49f7ed8ea8e568803850bd4a0118b690248013af
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-25 13:06:28 +00:00
Eike Ziller
8245523653 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/designer/cpp/formclasswizard.h
	src/plugins/designer/cpp/formclasswizarddialog.h

Change-Id: I9f9d166e1a9249022305503f9cbe571136c2a2b1
2020-11-25 11:25:34 +01:00
Eike Ziller
eaec56e6b6 cmake build: Fix issue with tests and CMake < 3.14
For the CPlusPlus target the target sources contain
"$<TARGET_OBJECTS:3rd_cplusplus>" with older CMake versions.
Looks like that was fixed in CMake 3.14.
Work around it by removing TARGET_OBJECT entries, which we definitely
don't want.

Change-Id: I036720f122aa2d0727e85b611f1e32c65fae57ae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-24 09:55:11 +00:00
hjk
56b2158500 Debugger: Adapt QRegion dumper and test to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ie9c75c779595a981e75f20e73bfaccb5d24cf16b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:52:31 +00:00
hjk
0ede48270f Debygger: Adapt QLazilyAllocated dumper test to Qt 6 changes
Task-number: QTCREATORBUG-24098
Change-Id: Id5dde3089af8bffdc7b8d9ebfaf9e6748257fd9f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-24 08:39:40 +00:00
Christian Kandeler
0d12c8cba8 clangbackend: More cursor adjustments
Fixes: QTCREATORBUG-21534
Change-Id: Ia8a6f277b186bd6decdfec26bfca30b36802c1c2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-23 13:03:34 +00:00
hjk
c80313f777 Debugger: Adapt QHash dumper for Qt6
This is a completely new structure, also effective order when
iterating is completely different.

QHashIterator doesn't work yet.

Task-number: QTCREATORBUG-24098
Change-Id: I917cacf7952d9d54a31d14a0691213ab944d0d8f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-23 12:26:24 +00:00
Christian Stenger
6b62a99a8a cmake: Fix building debug with release libclang
Parts of QC cannot be linked against a release build of clangTooling
libs and vice versa when building on Windows.
Check whether the provided libs match the current build mode and
disable respective parts if necessary.
Re-use this information to decide whether unittest should be build
or not.

Change-Id: Ibc2aab0d7886e78ebbf8f15a43152efad49f1eff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-23 11:07:49 +00:00
Christian Kandeler
b0dd6b748f clangbackend: Try harder to get the proper cursor
... in cases where it appears that clang_annotateTokens() did not do
what we wanted.

Fixes: QTCREATORBUG-21522
Change-Id: I272061cb6c4b51a5d779ace5b4e06912c0a386e5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-23 09:59:27 +00:00
Eike Ziller
f534624fce Fix build with newest Qt 6
No implicit casts from QString to QFileInfo anymore, and a few more
QChar(int) fixes.

Task-number: QTCREATORBUG-24098
Change-Id: I3326fc0701a9259c7bdd2d8c3025de0a4774f8aa
Reviewed-by: hjk <hjk@qt.io>
2020-11-20 15:43:25 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Marco Bubke
9b6944086b MultiLanguage: Add image generation for excel export
Change-Id: Ied15381d94c391c86438c66fe88f755421bb3492
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-19 13:22:44 +00:00
hjk
a812bd7303 Debugger: Make qfloat16 dumper test pass with Qt 6
45.3 is represented as 45.28125 in Qt 5, but as 45.3125 in Qt 6.
Actually an improvement.

Task-number: QTCREATORBUG-24098
Change-Id: I779bfd8a2b4a2ae91f5e40dbe54ba75000531f4c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-19 10:23:27 +00:00
hjk
92cd7f3c06 Debugger: Adapt QMap and QMultiMap dumper to Qt6
Chicken out of the QStringList == QList<QString> in Qt 6 dilemma
by using QList<QString> everywhere, that's not important for the
QMap test. value/key vs first/second nevertheless needs adaptation.

Task-number: QTCREATORBUG-24098
Task-number: QTCREATORBUG-23806
Change-Id: I4bdb8222978de7e7f1596be380e0fedc8f9d1a06
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-19 07:24:26 +00:00
Christian Kandeler
7aec256087 QmlDesigner & friends: Fix various new warnings
Change-Id: Ia5e3d47e70e1881e70652f090ccc61543535df4e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-18 17:05:51 +00:00
Alessandro Portale
a1ff9d170f CppTools: "CLANG-UPGRADE-CHECK: Update known language features macros."
Clang++ 11 has __cpp_constexpr_in_decltype

Change-Id: I450a79f2af8cd6aca51b95b11b3c06b9682c0418
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-18 15:40:15 +00:00
Leander Schulten
2ce783f96d ClangSupport: Remove unused circular includes
Change-Id: I89e54fad34084ef683bb24fa2db7ef858a8b4759
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-18 12:53:13 +00:00
Eike Ziller
381c5656e7 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mesonprojectmanager/project/mesonprojectparser.h

Change-Id: Id38d20ce20981dcdc322fe5d1d7647f4bec89d8a
2020-11-13 16:03:26 +01:00
Christian Kandeler
dc66d30076 CPlusPlus: Support C++11 attributes also for function parameters
Fixes: QTCREATORBUG-24636
Change-Id: I9dc3d2cc6ca102b09f6b040455fa901c362dae7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-12 13:16:34 +00:00
Christian Kandeler
59f8bd4702 CPlusPlus: Expose "static" specifier also for function declarations
To be able to do this, the parser needs to store the decl specifier list
in FunctionDeclaratorAST objects, the same way it is done for
FunctionDefinitionAST.

Task-number: QTCREATORBUG-24894
Change-Id: I475fb08b1f14c63f3050d72dff200c1b08df5789
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-11 15:41:27 +00:00
Eike Ziller
6d7e5eb8d1 Fix CppProjectUpdater cancelAndWaitForFinished
The code was pushing an additional QFutureInterface through the whole
chain of functions, which was used for canceling. But since it was never
started (and never finished, and never used for reporting results),
calling waitForFinshed on it never had any effect with Qt5 and locks up
with Qt6.

Instead of using a separate QFutureInterface, use the actual QFuture
that is available and intended for it.

Fixes: QTCREATORBUG-24902
Change-Id: I5a49bcecc9cf70fbffa93aee4293004f9369df58
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-11 12:49:33 +00:00
Marco Bubke
d1d95e78d6 UnitTests: Fix double deletion
Change-Id: Id28f739a3f6b0c200386edf67914886ae06e2999
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:41:54 +00:00
Marco Bubke
2a2dfbec73 QmlDesigner: Add states to ImageCache
Task-number: QDS-2998
Change-Id: I8e65881181ae1010ef1f8bab92fa71d92c961bcd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:35:12 +00:00
Marco Bubke
2ee63af4cd UnitTests: Setup an environment for every test run
So there are no old file an temporary file.

Change-Id: Ida22703b5842b094f9a0f26562cd0908542e044f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:34:18 +00:00
Marco Bubke
f90bc7fa37 QmlDesigner: Improving SessionChangeSets
Task-number: QDS-2998
Change-Id: I9b559bf593dd968172649d1f6c45fb9fb454f1a5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:32:39 +00:00
Marco Bubke
c3aad50184 QmlDesigner: Add waitForFinished to ImageCache
Task-number: QDS-2998
Change-Id: I5ffb63b7345a17ccb499db876bb4dbb0a946ed85
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-10 14:32:30 +00:00
Eike Ziller
1d2b5db02f Merge remote-tracking branch 'origin/4.14'
Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
2020-11-10 13:42:46 +01:00
Christian Kandeler
e41f3eb607 CPlusPlus: Fix "find usages" categorization for sizeof and array access
Task-number: QTCREATORBUG-24894
Change-Id: I65fa097785b19e181f15178ad6d30608899316c0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-09 12:50:07 +00:00
Christian Kandeler
882dd60aad C++: Extend alias declaration support in built-in parser
The type-id in an alias declaration can also define a new type.

Change-Id: I65dc397d2526c56334676c6ab522564f6748d594
Task-number: QTCREATORBUG-24875
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 10:56:17 +00:00
Christian Kandeler
42d34015e2 CPlusPlus: Provide information about the "static" specifier
... to the function type.
This fixes the issue for function *definitions*. For function
*declarations*, we need to amend the parser.

Task-number: QTCREATORBUG-24894
Change-Id: I02043d8b974c2c64dcd739c7e05ce44fd277b5d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 10:55:38 +00:00
Christian Kandeler
1988d89198 CPlusPlus: Check for static member functions in FindUsages
Static member functions cannot modify the object and therefore must not
be reported as writable references.
Note that this does not have an effect yet, as the function type lacks
information about the "static" specifier.

Task-number: QTCREATORBUG-24894
Change-Id: Ib04a17864a0ca5b7610579a2f5efbcfde257e08a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-09 09:51:08 +00:00
Christian Stenger
f2b5c29494 Tests: Fix linking of test project
Avoid fail to link when using Qt5.15.1 and MSVC 2017.

Change-Id: Ief4edce7490c4828c46033c7a055acb6173c94e1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-06 05:22:02 +00:00
Christian Kandeler
de1e12f3af CPlusPlus: Correctly categorize post-increment and -decrement accesses
Change-Id: Id21c13ea58f6747c226d91aff2b00c3409faa880
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:24:33 +00:00
Christian Kandeler
a88266798f CPlusPlus: Differentiate declarations with an initializer
... from those without one, and display the former like write accesses.

Task-number: QTCREATORBUG-24894
Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:02:52 +00:00
Christian Kandeler
cf6757406d CPlusPlus: Properly categorize usages in if statements
Change-Id: I5f6e5fa14ea51cd9e61a9e2e96c110ca618be429
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-11-04 13:02:34 +00:00
Marco Bubke
c3873fcf40 Sqlite: Add change set iterator
Task-number: QDS-2998
Change-Id: I7bfa8af51d9d7e6122902ee132ad51019e20afb5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-03 09:19:54 +00:00
Christian Kandeler
89644e4a06 CPlusPlus: Properly categorize usages in switch and case statements
Change-Id: Iafbbdcca23db38d82bbc5bb24a39dac2a6d0a764
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-02 16:03:28 +00:00
Christian Kandeler
e35dfd592f clangbackend: Fix highlighting for #include directives
These were falsely categorized as string literals. No one ever noticed,
because highlighting information for string literals was ignored until
baf25e4cdb.

Change-Id: Ib59fde04359aecb6da3995de1a9febbbf41b12c8
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-02 16:03:11 +00:00
hjk
9879820864 Debugger: Fix some instructions in manual tests
Compilers are getting better at removing unused code.

Task-number: QTCREATORBUG-24819
Change-Id: I8a677a4057312e9581e520ceae9ae63a2dc8bc43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-02 13:44:49 +00:00
Thomas Hartmann
9496732db5 QmlDesigner: Fix and cleanup tests
Change-Id: Id26c3447025744619e9bc80da202aaa49be9567b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-02 13:17:36 +00:00
Eike Ziller
d54f7b0eb2 Fix building tests with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I192245125f04f8350597bbe481d80d3f8ba0cae0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-30 15:15:25 +00:00
Marco Bubke
80d25cdebd CppRefactoring: Disable failing tests
Has to fixed later or removed completely.

Change-Id: I3a62b4ecde60f6877164e994e664f7b015b9d3fc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-28 11:33:29 +00:00