Commit Graph

35869 Commits

Author SHA1 Message Date
Nikolai Kosjar
cadc4b42ba Cpp{Tools,Editor}: Tests: Use QString instead of QByteArray
This is necessary in order to add tests with multi-byte UTF-8 code
points. Otherwise the initial and target source code marker positions
will be calculated on the QByteArray (test code) but used with a QString
(editor document).

Change-Id: I108961b13d32912a4d3193cf26eb59f65d296f57
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:24:10 +02:00
Nikolai Kosjar
41aa2cb3bd C++: Use Token::utf16chars{Begin,End} where appropriate
...especially in CppTools/CppEditor where the offsets are used with a
QString/QTextDocument.

Change-Id: Ic6d18fbc01fb9cc899a9bd2d7424cd2edae487f1
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:51 +02:00
Nikolai Kosjar
57ff992961 C++/CppTools: Pass UTF-8 encoded source to Lexer
The Lexer can handle it now.

Task-number: QTCREATORBUG-7356
Change-Id: I8c4b03a247656e013d44c3cedca4835e133d4036
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:41 +02:00
Nikolai Kosjar
587eb49c4e C++: TranslationUnit::getPosition takes utf16char offsets
...and not byte offsets anymore. This is necessary in order to calculate
the line and column numbers correctly with respect to unicode code
points.

Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:24 +02:00
Nikolai Kosjar
70122b3061 C++: Support for UTF-8 in the lexer
This will save us toLatin1() conversations in CppTools (which already
holds UTF-8 encoded QByteArrays) and thus loss of information (see
QTCREATORBUG-7356). It also gives us support for non-latin1 identifiers.

API-wise the following functions are added to Token. In follow-up
patches these will become handy in combination with QStrings.
    utf16chars() - aequivalent of bytes()
    utf16charsBegin() - aequivalent of bytesBegin()
    utf16charsEnd() - aequivalent of bytesEnd()

Next steps:
 * Adapt functions from TranslationUnit. They should work with utf16
   chars in order to calculate lines and columns correctly also for
   UTF-8 multi-byte code points.
 * Adapt the higher level clients:
    * Cpp{Tools,Editor} should expect UTF-8 encoded Literals.
    * Cpp{Tools,Editor}: When dealing with identifiers on the
      QString/QTextDocument layer, code points
      represendet by two QChars need to be respected, too.
 * Ensure Macro::offsets() and Document::MacroUse::{begin,end}() report
   offsets usable in CppEditor/CppTools.

Addresses QTCREATORBUG-7356.

Change-Id: I0791b5236be8215d24fb8e38a1f7cb0d279454c0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:15 +02:00
hjk
4fefb1ca2a Debugger: Restrict non-negative display convention to non-decimal bases
Change-Id: I95421efa219a85cb81bf1d6a4acbc71eef5736ac
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-05-23 13:06:12 +02:00
Fawzi Mohamed
21dd82ed23 qmljs: codestyle fixes
Change-Id: I1b5a597d92e865d2235b15c62e3bbae362e5b7c0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:04:13 +02:00
Fawzi Mohamed
1d961d4ea4 qmljs: adding dumper for value types
Change-Id: I3ae420ea29ed32b08f95f388b0ced5b5293219da
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:03:43 +02:00
Fawzi Mohamed
35128701cd qmljs: exposing a bit more the existence of private value types
Change-Id: I85e29b0d60234407561ecbeb2883d68c1acb71d6
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:03:18 +02:00
Fawzi Mohamed
56080c4df2 languageutils: improve dumping of fakemetaobjects
adding functions to get a string description of fakemetaobjects
and related fakemeta* objects

Change-Id: Ic65033a245c028993dba1e8c65168a58fbdd8fbc
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-23 10:02:59 +02:00
Christian Stenger
fc58d0abc8 Tests: Fix QUrl test for Qt4...
...by adding capabilities that allow a better differentiation between
Qt4 and Qt5 object structures.

Change-Id: I025d8301c13922e369862eefaad848bbecc76030
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-23 07:48:54 +02:00
Christian Kandeler
ca3c03c4d3 Autotests: Fix qbs build.
We accidentally added QT_NO_CAST_FROM_ASCII to the compiler command line
in the last patch.

Change-Id: I503d5b328d2ffb9812cd8cf79b5d52c8a76f07df
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-22 18:20:46 +02:00
El Mehdi Fekari
55c6351816 Qnx: Fix UI warnings
Change-Id: Ia48031a3347e6267d9f84b5850860903d40bc801
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2014-05-22 18:17:18 +02:00
Christian Kandeler
54f927fbb3 Qnx: Fix build.
Use the right type of include statement.

Change-Id: I1bfce500de00687fb4f947a2ccf69f464f798134
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2014-05-22 17:50:49 +02:00
hjk
62904f32ef Debugger: Also allow formatting negative numbers as hexadecimal
Change-Id: I0324c53b42424f25b1c70c10d3f31b515398712d
Reviewed-by: Tim Sander <tim@krieglstein.org>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-22 17:12:24 +02:00
Christian Stenger
8c353f998e Dumper: Fix missing parameter
Change-Id: Ia75c9d07967d0013f9a351e99757c0acb661d877
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-22 16:34:59 +02:00
Kai Koehne
61a9d40f96 Doc: Mention OpenGL issues in FAQ section
Change-Id: Ia185f15cfdb6106e2212a21ebe4c6b84c9da1fc6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-05-22 16:19:40 +02:00
Thomas Hartmann
c2682f9b0c QmlDesigner.PropertyEditor: Adding signal selectionToBeChanged
Controls can connect to this signal and commit data to the backend
before the slection changes.
This is required since editingFinished signals are usually triggered to
"late".

Change-Id: I99fa27064473ceee2d1a21b25f64a13370fb4cef
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 15:39:05 +02:00
Thomas Hartmann
b5559e73f4 QmlDesigner.PropertyEditor: Use selectionToBeChanged in LineEdit
Commit any data to the backend if the selection will change.
The signal editingFinished is usually triggered to late.

Change-Id: Ib7adfd32a50ae94b017a7587e81721176440a988
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-05-22 15:38:31 +02:00
Thomas Hartmann
10e2a046da QmlDesigner.PropertyEditor: Adding dirty flag to LineEdit
This patch ensures that we only commit data to the backend
if the text actually changed. The signal onEditingFinished is triggered
even if the user did not edit the string.

Change-Id: I2d54f3d79a1c60525e4c9744b364cc014bd407ce
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2014-05-22 15:38:11 +02:00
El Mehdi Fekari
317fe1f447 Qnx: Add support for pure QNX configurations
This is a first patch that adds basic support to manage
user's QNX configurations.

Change-Id: I273939d39e4353dabc2ae3873d7d7be6b3ca9d47
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-05-22 15:06:51 +02:00
Tim Jenssen
f1795d9748 QmlDesigner: styling stateslistview
Change-Id: I29d39230bd1f37cb3d57b14045717d893f51e122
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:59:44 +02:00
Tim Jenssen
2659a9b7fd QmlDesigner: fix stateslistview sizeHint
Change-Id: I86147f80a81ff9095c67bcb296488a2a7345434a
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:59:18 +02:00
Tim Jenssen
c014325d19 QmlDesigner: rename nodeId -> internalNodeId
Change-Id: I8f038479f31a282db256144a3254e438eb6a629f
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:59:11 +02:00
Tim Jenssen
b0ffe15a53 QmlDesigner: rewrite statelistview
Change-Id: I2d2481e2f1a3e0f2d4a5807712e9435b3009e52d
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:58:42 +02:00
Orgad Shaneh
88de3bb21d QmlDesigner: Avoid repetitive calls
Change-Id: Id33e46f925c94a970b001e7f34b7deb56224cc97
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:24:41 +02:00
Orgad Shaneh
caf296500d QmlDesigner: Fix order of initialization
m_resIconSize is passed to m_iconProvider's ctor, so it should
be initialized first.

Change-Id: I7a5dfb648cce029869b1e8a36eee761a5bd46faf
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:16:40 +02:00
Orgad Shaneh
6f5c2ea5b0 QmlDesigner: Pass const values by references
Change-Id: I468b2bebec64680289b24044b0b4e3d5d734f604
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 14:15:19 +02:00
Leena Miettinen
3d23a2dad2 Doc: use environment variables in paths
In the FAQ, so that users can copy-paste paths.

Task-number: QTCREATORBUG-12283
Change-Id: I4b0e7fda5c8877053d69b7b9b3f7f5f1c5093064
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-22 13:35:48 +02:00
Thomas Hartmann
be9a0caa18 QmlDesigner.PropertyEditor: Fix the small color button for gradients
The small ColorCheckButton has to preview the same color as the rest
of the color editor. Before this patch it was showing the color
defined in the backend as rectangle color.
This is not correct in gradient editing mode.
Also the binding in Colorbutton was deleted assigning values
directly.

Task-number: QTCREATORBUG-12204
Change-Id: Iad5263ccccba10fdb4f2b757f6965d500c50ac53
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-05-22 13:26:19 +02:00
Erik Verbruggen
ee200a7be0 C++: fix follow-symbol-under-cursor for #import <xyz>
Task-number: QTCREATORBUG-12254
Change-Id: I4179c78f3ce6bf2236f8375da1765122a974118c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-22 13:11:41 +02:00
Fawzi Mohamed
a1e4efe2e3 qmljs: adding missing Qt attributes/functions
Change-Id: I2dbe6fdaf5850e5ea10efb5330b1a32c73945f3a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 10:56:42 +02:00
Thomas Hartmann
2c7a06b8da QmlDesigner: Remove unused class
Change-Id: If2c7c19d6c41398bc2dae54f0544900f94ab788e
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 10:45:01 +02:00
Thomas Hartmann
892cb7d225 QmlDesigner: Remove unused class
Change-Id: I67bc215fcbaea2b40fa1e54a91d2ec9a3fe65d6d
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 10:22:07 +02:00
Fawzi Mohamed
a4cb022fa3 qmljs: fixing font type name
Change-Id: I3c6d827868a4e36eeedeac25887be64a7969c620
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 10:08:37 +02:00
Orgad Shaneh
d7c68892ab QmlDesigner: Fix potential null dereference
Change-Id: I291d07548bbbe7c7ab75dc55004e3c44c4bf0020
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-22 07:44:23 +02:00
Thomas Hartmann
3432e0973b QmlDesigner: Remove unused class
Change-Id: Ia894e381251b56be44e56c9c798ec22713cbeabc
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-22 07:44:04 +02:00
Orgad Shaneh
7f924976e0 QmlJS: Cleanup whitespace
Change-Id: Ifd6ec2a2aa33e1adca5afa8f41c4b4619ed017b5
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-05-22 04:54:54 +02:00
Orgad Shaneh
d97c578eb3 QmlJSEditor: Use preincrement
Change-Id: Ic1db8e0626a7c81bac6dc5bb89a33a55fab2fd6b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-05-21 21:17:02 +02:00
Orgad Shaneh
f189b17b83 QmlDesigner: Fix indentation
Change-Id: I4bc8fa05f9ce2e7ac7b45cae85fd7a90af398023
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 21:16:32 +02:00
Orgad Shaneh
155ab185cf QmlDesigner: Fix duplicate condition
Change-Id: Ic89ac122b53ba3988a9d77d9f072dd5eec19f4fd
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 21:16:24 +02:00
Orgad Shaneh
33ef82f41b QmlDesigner: Fix argument name
It shadows a member variable

Change-Id: Ibc5b993ef27798d504270091ca4762d2c121b278
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 21:15:48 +02:00
Orgad Shaneh
28ba41089c QmlDesigner: Remove duplicate condition
Change-Id: I05cae6b7691c45f6db0a5451c149cda50ebf6ad0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 21:15:41 +02:00
Orgad Shaneh
ca55fd8fc9 QmlDesigner: Fix indentation and add braces
Change-Id: I2cc4d52aff63f236a7027a9418f623c20a9fe33c
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 21:15:33 +02:00
Thomas Hartmann
8bbeac0b05 QmlDesigner: Remove unused class
Change-Id: Id31e98601628b8c941f5dc8efdcc220c584a0eb0
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-21 18:36:17 +02:00
Thomas Hartmann
4327b8993e QmlDesigner: Remove dead code
Change-Id: I4ef9292c78d3974e9608e2c06329b50e2fa97751
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-21 18:31:27 +02:00
Thomas Hartmann
ebe4fa187f QmlDesigner.PropertyEditor: Remove dead code
Change-Id: Id1d712511bf76c974af458d7661358db16a1dafb
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 18:26:54 +02:00
Thomas Hartmann
0e680f8f46 QmlDesigner.PropertyEditor: Cleanup
Change-Id: Ic0545a022d2dd2d2911ceaedec9137e60a332e4d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2014-05-21 18:07:47 +02:00
Christian Kandeler
6706659bb1 qbs build: Introduce item QtcProduct.
QtcAutotest, QtcLibrary, QtcPlugin and QtcTool share quite a bit of
code, which is now factored out into this new item from which they all
derive.

Change-Id: Ic947a19e121f37d34968b29c94dd02648da1cd5b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-05-21 17:33:36 +02:00
Thomas Hartmann
17485ae7d0 QmlDesigner.PropertyEditor: Remove unused files
The GenericPropertiesWidget is completely out of scope
and unused.

Change-Id: Ibd43bca724e87cca2d5f639e5bc9999a1f9af6ce
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2014-05-21 17:22:20 +02:00