Commit Graph

4400 Commits

Author SHA1 Message Date
Robert Loehning
70e328c860 Squish: Wait for ClangCodeModel in tst_CSUP02
Change-Id: I02d5647128492db7d2fce3bf84105f98029ac14f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-08 12:45:27 +00:00
Nikolai Kosjar
ed8b910202 Clang: Honor fixits own locations in ClangFixItOperation
The fixits have own ranges/locations and thus might address more than
one file.

Change-Id: I5ee59944bef588e763a91f054a60823593373a0e
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-07-08 08:22:37 +00:00
Robert Loehning
fe8c717a6a Squish: Update QGroupBox object for tst_CSUP01
Change-Id: I247285ba75d474a5c80592607c349b19f5add937
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 13:44:07 +00:00
hjk
e48451b0a3 TreeModel: Consolidate child()/childAt() and rowCount()/childCount()
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.

Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-07 13:39:15 +00:00
Eike Ziller
070e6235fa Merge remote-tracking branch 'origin/4.1'
Change-Id: I35ef0d667c759c959edce91569f05ebc7a8ff4d8
2016-07-05 11:28:32 +02:00
David Schulz
de9f7a8978 Clang: Adjust mangled name test to accept any output.
We get different mangled names on windows and unix. As we do not
actually use the mangled names and to reduce the maintenance for this
test accept any mangled name, as long as it is not empty.

Change-Id: Id154da430db6958eb40e5b409e5fb186778d41c1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-05 06:00:11 +00:00
Nikolai Kosjar
36e7f4541f Clang: Pass on file paths with native separators
libclang 3.8 seems to be sensitive to file paths separators [1]. On Windows,
this led to not updated document annotations and/or crashes after reparsing.

When passing file paths to libclang, convert to native separators.
When getting file paths from libclang, convert back.

This handles:
 * main file path
 * file paths of the unsaved files
 * -I<DIR> arguments, the resource path (for builtins) and the paths to the
   wrapped qt headers
 * included header files from libclang
 * source locations from libclang

Also, minimize the conversion in SourceLocation to a minimum by making
filePath() lazy.

[1] https://llvm.org/bugs/show_bug.cgi?id=28381

Change-Id: If5866f34a6fdc6b34b16c022d3988e8e6eae2a0a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-04 13:08:03 +00:00
Christian Stenger
87ab577992 Squish: Adapt to changes of wizard template
Qt Quick template does no more use a pri file.

Change-Id: I5418d1b945c8981218ddcbcf5423d6c623b377b6
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2016-07-01 10:06:22 +00:00
Robert Loehning
c8150dc918 Squish: Click again when hitting scroll bar in openDocument()
Change-Id: Iae5256c894fbd4fcb8b93fd5b6dbe7b56b428982
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-01 09:19:10 +00:00
Marco Bubke
d027cab44e Clang: Rename Ipc* in ClangCodeModel*
We want to share more functionality of the IPC mechanism and for what we
need more interface classes. But we use this names already for the
ClangCodeModel implementation. So we rename the them to ClangCodeModel*.

Change-Id: Ie320e0d3b993586a9bcc6a5aa0d32427af41202e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-30 09:28:56 +00:00
Eike Ziller
ee1da81f55 Merge remote-tracking branch 'origin/4.1'
Change-Id: If6cd798a25de0c6eb1b386177c11bf8de535aa42
2016-06-30 09:40:29 +02:00
Robert Loehning
e065ab2cd3 Squish: Handle empty selection in QWebEngineView
Change-Id: I7e4d53483f3168e78024dcf87125b44f96453fa2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-29 13:58:06 +00:00
Christian Stenger
76781b40a7 Squish: Adapt suite_qtquick to 4.1 changes
Change-Id: Ic1d178820a3c2b6ce61f9e4fc424bc701eca87e5
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2016-06-29 12:39:24 +00:00
Christian Stenger
b1a1e169a6 Tests: Remove invalid qml file
File seems to be useless and is not used at all.

Change-Id: I7b6d7f8804cdf07c6027abb9822d99bdf5ad9dbf
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 16:36:10 +00:00
Robert Loehning
e0b05758c0 Squish: Fix getHelpViewer() for Qt 5.6
Change-Id: Ica23ec912f95fe10e838e2055d8294be33ef959b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-28 16:13:40 +00:00
Nikolai Kosjar
dc01319cd7 C++: Fix compilation of tst_lexer.cpp
...with MSVC2013.

tst_lexer.cpp(406) : error C2398: Element '1': conversion from
  'CPlusPlus::Kind' to 'unsigned int' requires a narrowing conversion

Change-Id: I1c9415cb02d2f0fa85d48a1abbc688d8f53b5b43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
(cherry picked from commit 04b2194781)
2016-06-28 12:56:56 +00:00
Orgad Shaneh
847637708f Tests: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: If3332a2b4a6d011d2cb74996f5dd750452093f31
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-28 12:54:02 +00:00
Eike Ziller
9cf3e30307 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ic8d82172a97bdf1dbf3d047157cc2c8d853f35cc
2016-06-28 12:13:39 +02:00
Eike Ziller
69fa7a8ffb Merge remote-tracking branch 'origin/4.0' into 4.1
Conflicts:
	src/plugins/projectexplorer/runconfiguration.h
	tests/unit/unittest/unittest.pro

Change-Id: I3d327b1198df2a7e9268916af9624ce5d21195df
2016-06-28 11:42:03 +02:00
Nikolai Kosjar
04b2194781 C++: Fix compilation of tst_lexer.cpp
...with MSVC2013.

tst_lexer.cpp(406) : error C2398: Element '1': conversion from
  'CPlusPlus::Kind' to 'unsigned int' requires a narrowing conversion

Change-Id: I1c9415cb02d2f0fa85d48a1abbc688d8f53b5b43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-27 10:37:49 +00:00
Marco Benelli
23ac8b4acf QmlJs: test cases.
Change-Id: I98e6a25e9834ee8bdc66dc4f244c35b187d30ddb
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-27 10:37:41 +00:00
Eike Ziller
07fccfe9f1 Merge remote-tracking branch 'origin/master' into 4.1
Change-Id: I56399e6938a5f5096c0b1a1561a54d34a5c96330
2016-06-27 11:40:35 +02:00
Eike Ziller
5fcf0c438f PluginManager: Code clean up
Mostly refactor some explicit loops, and nicer reverse looping.

Change-Id: I102b86da597b37cd496762bd776af73ec407d838
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-24 12:30:05 +00:00
Eike Ziller
667518ad23 Convert some c-style casts
Change-Id: I0d7566d14941a17c3f171b32c9902c22558005bd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-24 12:29:46 +00:00
hjk
61e770e5a7 Tests: Treemodel compile fix
Change-Id: I28132baeb4b5b538f5d8c94c6182b3afe3ac2c78
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-24 12:25:36 +00:00
Nikolai Kosjar
05c1efd8ef Clang: Fix dot-arrow-correction for not-yet-parsed unsaved content
The issue was re-producible with e.g.:

    void g()
    {
        // Type 'foo.' as fast as possible in the next line

    }

This led to "foo->" with completion results as if there was no "foo." at
all in that line.

We relied on a correct position for
translationUnit.sourceLocationAtWithoutReparsing(), but the just typed
characters were not yet reparsed. And we do not want to reparse at that
point since takes too long. We already determine the utf8 position for
the dot character, so simply use that instead.

This completes commit 17c1325cc4.

Change-Id: I669888b5c17ee63b2aec7b16c9921f9d79e281f9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-24 08:31:28 +00:00
Marco Bubke
cc804d542d UnitTests: Disable small string test
Change-Id: I508e43923efc065fce9a79edebeff79606069abd
(cherry picked from commit 505c9be9af)
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-23 12:39:14 +00:00
Nikolai Kosjar
438bd85b84 Clang: Fix updating revision number for all translation units
Change-Id: I1ad305ed081aecadde968e041f7b99a24a1c4784
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-23 06:29:14 +00:00
Thiago Macieira
74fed1d5b7 Fix build on PPC: PPC is defined to 1
$ powerpc-poky-linux-gcc -dM -E -xc /dev/null | grep -i PPC
 #define _ARCH_PPC 1
 #define __PPC__ 1
 #define __PPC 1
 #define PPC 1

Not on PPC64, though (only __PPC__ and __PPC64__ are defined).

Change-Id: Ib57b52598e2f452985e9fffd145812f5098e441d
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-22 17:51:20 +00:00
Dmitry Ashkadov
43075f5fb1 C++: Add support of ref-qualifier for functions.
Now the ref-qualifier (& or &&) of the function declaration
is propagated to GUI. For example,  'Refactor' -> 'Add Definition'
preserves the ref-qualifier.

Change-Id: I8ac4e1cad4e44985e94230aabbd9858a7e929fee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-22 17:47:59 +00:00
Philip Lorenz
c0f3094866 C++: Fix lexing of >> / >>=
The current code always ends up setting the token to T_GREATER_GREATER.

Change-Id: If75ff1f5bccffd5918ec2bf491724cd0981220ae
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-22 17:46:40 +00:00
Nikolai Kosjar
b032038781 Clang: Tests: Use test data working with clang 3.6 *and* clang 3.8
The test data produces different results when it is run with libclang
3.6 and libclang 3.8. (lib)clang 3.8 will generate an error instead of a
warning and suppress further diagnostics. See below.

Use simpler test data that is agnostic to the different clang versions.

$ cat input.cpp
    class X {
	X(X&&) noexcept;
    };

    X::X(X&&) = default;

    int function()
    {
    }

$ clang++-3.6 -fsyntax-only -std=c++11 input.cpp
    input.cpp:5:4: warning: 'X' is missing exception specification 'noexcept'
    X::X(X&&) = default;
       ^
	      noexcept
    input.cpp:2:5: note: previous declaration is here
	X(X&&) noexcept;
	^
    input.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
    2 warnings generated.

$ clang++-3.8 -fsyntax-only -std=c++11 input.cpp
    input.cpp:5:4: error: 'X' is missing exception specification 'noexcept'
    X::X(X&&) = default;
       ^
	      noexcept
    input.cpp:2:5: note: previous declaration is here
	X(X&&) noexcept;
	^
    1 error generated.

Change-Id: I6d786a8b87eb4438fa8db36540db9358181b9a5b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-22 12:39:39 +00:00
Eike Ziller
0e923c2a75 Merge remote-tracking branch 'origin/4.1'
Change-Id: I5cdc704c827a6f5abf4dc39e2a131d53df328bd2
2016-06-22 11:29:12 +02:00
Eike Ziller
4f9016e03f Merge remote-tracking branch 'origin/4.0' into 4.1
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/android/android.qbs
	src/plugins/android/androiddevice.cpp
	src/plugins/autotest/testcodeparser.cpp
	src/plugins/debugger/analyzer/analyzerstartparameters.h
	src/plugins/projectexplorer/devicesupport/desktopdevice.cpp
	src/plugins/projectexplorer/devicesupport/idevice.cpp
	src/plugins/projectexplorer/runconfiguration.h

Change-Id: I2474d06f2309fa71210a8401846bc2ef85bebf1d
2016-06-22 11:09:32 +02:00
David Schulz
de0ceea956 Clang: Adjust mockup code to creator code.
Change-Id: I83c5b7c1af2ee4b77b2f3d8e06b54218838056f3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-06-21 13:37:42 +00:00
David Schulz
8c7913e0ba Clang: Fix compiling unittest on windows.
Change-Id: Id48d494510ee53a9e888e22a752e8210f3d4ae2d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-06-21 13:37:35 +00:00
Marco Benelli
2d03eb8bb9 QmlJs code model: added test cases.
Added test cases and modified the test suite in order to make it
data-driven.  Each sample file can now declare the number of
expected messages.  If there is no declaration, zero is assumed.

Change-Id: Ife3daa10a258f51ea8f896156f6f6af783406b84
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-21 07:40:03 +00:00
Orgad Shaneh
246e72262c CppTools: Separate highlighting for function declarations and calls
Task-number: QTCREATORBUG-15564
Change-Id: Iab1b60e19448202432f98295c89769cd376aa03f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-20 10:55:31 +00:00
Tim Jenssen
29e51517f4 QmlDesigner: fix linking error in tests
Change-Id: I67b47ab3dc509d317786bc7eda6fa13f8877a00d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-20 08:09:07 +00:00
hjk
fb482846fc TreeModel: Add a StaticTreeItem(QString) convenience constructor
Covers the common case and hopefully avoids the recurring MSVC
problem with initializer lists in this location.

Change-Id: I1b2bbb083f9fc86af3b51b8f52615fb70c832b95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-17 08:09:48 +00:00
Orgad Shaneh
0ca1142aae Fix test compilation with MSVC2013
Change-Id: Id34ee1f906e378dd57ca30c585e0a3df4ddc9ffd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-17 05:00:31 +00:00
hjk
b281d6dad7 TreeModel: Introduce a StaticTreeItem
This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.

Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-06-15 08:55:16 +00:00
Thomas Hartmann
159976062e Enable tests for QmlDesigner
Change-Id: I7dda2efdc92d5ec5c736c8e18fa1f6bada935f20
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-15 07:52:31 +00:00
Tim Jenssen
383026abb5 QmlDesigner: remove qDebug in tests
Change-Id: Icbcfffede77acd0b6e2b577aab7a30e73e02717a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-14 18:05:19 +00:00
Thomas Hartmann
d7f24031dc Adding test for standard issues with QtQuick Controls 2
This test is covering the standard issues we had with the
code model regarding QtQuick Controls (2).

We check if ApplicationWindow is derived from QtQuick.Window
and if Button is derived from QtQuick.Item.

Change-Id: I1a2ed894daeb06743fb950bf629a8dcf2b9a78e6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-06-14 15:43:12 +00:00
Tim Jenssen
1d0b45b881 QmlDesigner: fix tests in shadow builds
Change-Id: Iaabe1516a30be520b1b0be0dd5557004312a67ec
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-14 15:06:21 +00:00
Thomas Hartmann
89d22b6eb0 QmlDesigner: Use QtQuick 2 in tests
Also cleaning up some tests.

Change-Id: I531997bc6eb0b9cb8057b7e408bca1c301c88ad0
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-14 14:42:40 +00:00
Tim Jenssen
0a67076ef4 QmlDesigner: remove unused code
Change-Id: I4c888f69d3bedc510f0f0a9f67d96caf17c4bcee
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-10 14:31:45 +00:00
Tim Jenssen
4d008299f3 QmlDesigner: remove outdated tests
Change-Id: I761d2af520f55d4a4bf405ede83af9228d7d7abb
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-10 14:31:37 +00:00
Tim Jenssen
044743d407 QmlDesigner: reduce tests output
Change-Id: Ia68cf7c859323c5ef82969c54f0168bf4a5ebbef
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-10 14:06:14 +00:00