Commit Graph

567 Commits

Author SHA1 Message Date
Orgad Shaneh
ed12120bf2 QmlDesigner: Fix test compilation
Change-Id: I092b28d10af15edff77a6806cd71554cc5be0d73
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-29 23:58:48 +00:00
Thomas Hartmann
325f63c732 QmlDesigner: Implementing dynamic node properties
The model now supports dynamic node properties. e.g.:
Item {
    property Item item: Item {
    }
}


In this case Property::dynamicpropertyType() is Item and
Property::isDynamic() is true.

To create such a property I added:
NodeProperty::setDynamicTypeNameAndsetModelNode().

It is not supported to reparent nodes in an out of
dynamic node properties. The model throws an exception in this case.
This is currently not required on the application level and not
supported by the rewriter.

Change-Id: Ie05325663c481d8583dc45bee38b559c190fbb30
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-22 10:57:29 +00:00
Marco Benelli
11dea636a0 QmlJs code model test cases
Change-Id: If9ee9a946fc973a6dcc47625f5b26ca0a203be42
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-09-05 07:13:36 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
Oswald Buddenhagen
45b854dbd5 enable c++11 really globally
... and remove all instances that became redundant now.
this excludes everything that comes from outside qtc, or looks like it
could "leave" it.

Change-Id: Idc8baad17cd1ffdc5e160ec48ea3292d633a2562
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-02 07:52:38 +00:00
Orgad Shaneh
1b34f2a4b8 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia90424d479936a898705c433e5810c77ae088b2c
2016-07-22 15:18:00 +03:00
Christian Kandeler
572b874941 Autotests: Fix qbs build
Change-Id: I362ab24a4f0d74073aef754ffbf60a7c8758af95
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-18 04:51:17 +00:00
Eike Ziller
7e1b4ccebb Merge remote-tracking branch 'origin/4.1'
Change-Id: I041b949aff8bee481a572ba6f7e2ef72b9010923
2016-07-15 14:10:38 +02:00
Christian Stenger
6063c185cb Tests: Provide qbs file for newly added test
Change-Id: I0b6c41b8c8dbb3ef84bd106aa26357267f5de9a6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2016-07-15 04:38:40 +00:00
Christian Stenger
7583557dcc Tests: Fix test when using shadow build
Change-Id: I82ebdbd63a221802f24b2ef17ca6c076151fba0c
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-07-15 04:38:33 +00:00
Thomas Hartmann
e1f9cba249 QmlDesigner.Test: Adding test for implicit components
Implicit components like delegates have to be marked by the rewriter.

Change-Id: I5b9c3e14f26c817e058f2db1e955333d43208719
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-13 12:35:41 +00:00
Tim Jenssen
1b90a938a3 QmlDesigner: disable debug outputs
+ prettify code

Change-Id: I1749ba5a92b5a1afb1c98bf621aec98cbc838405
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-13 12:24:37 +00:00
Thomas Hartmann
bafdc3562d QmlDesigner.Tests: Move test from Qt Quick 1 to Qt Quick 2
Change-Id: I644d86fe77758bc94216db724c7c86bb2d9c205e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-13 12:06:11 +00:00
Thomas Hartmann
137dee313a QmlDesigner.Tests: remove unnecessary processEvents
- it does not change anything nor behavior nor speed

Change-Id: I9c2cc58eb07a9a432c3fe4fe45daca78e6f29cc0
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-13 11:52:23 +00:00
Thomas Hartmann
64dfb6f0e1 QmlDesigner.Tests: Fix loadGradient()
The order of nodes from directSubModelNodes() was not defined,
since we collect the nodes from different properties ("default/data"
and "gradient").

If we use the interface of NodeListProperty and explicitly
use the default property, then the order is defined.

Change-Id: I7982fa7749d1795ad39a7b76792ad794e49fa9ea
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-13 11:51:26 +00:00
Eike Ziller
ee1da81f55 Merge remote-tracking branch 'origin/4.1'
Change-Id: If6cd798a25de0c6eb1b386177c11bf8de535aa42
2016-06-30 09:40:29 +02: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
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
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
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
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
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
Thomas Hartmann
568e80b591 QmlDesigner: get tests compiling and running
105 passing, 1 failing, one test seems flaky
I skip many nodeinstance/puppet related tests,
because the tests/test framework cannot deal with the qml2puppet/emulation
layer being out of process.

Change-Id: I5b254c7e6e944b8fbd8ba490c1e8bb43d0eb38c3
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-10 11:57:06 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
Victor Heng
11ef0db2fd QmlJS: Keep pragma directive when reformatting QML files
Change-Id: I1f11e95565a90e4fc7b908c03d49f6abbd37b8be
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2016-05-19 09:55:11 +00:00
Tim Jenssen
7e08363052 qbs build: remove unnecessary script dependency
Change-Id: I0e5764ffc9a6146932c43d96a31138451260c161
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-05-13 11:42:43 +00:00
Marco Benelli
22acc52d71 Qml code model: handle modules dependencies.
Fix the broken hierarchies between qml objects.

Change-Id: Id36c735cab0129af382fab7b9dd90c228304168c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-19 11:18:21 +00:00
Eike Ziller
8a77eacf8d Merge remote-tracking branch 'origin/4.0'
Change-Id: Ied609608f6b12aa923c67777bc5a273c4d8fbcbb
2016-04-15 10:07:55 +02:00
Sune Vuorela
55bfa4401f Keep readonly qualifier
Let's not reformat readonly qualifiers away. They are likely there for a
reason.

Task-number: QTCREATORBUG-15745
Change-Id: Iaab7a8edb47fccd0cf36759750500a93be45bbc2
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-04-13 07:59:44 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Christian Stenger
f862583f23 Tests: Fix crash in qml codemodel check
The test accesses indirectly the static instance of the
QmlJS::ModelManagerInterface which is not instantiated at all and
leads to a crash of the test.

Change-Id: I2b047e1ee8d679dd3764ca5c36709b599161a60c
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-04-06 09:03:10 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
Tim Jenssen
61411f9415 Keep QT_RESTRICTED_CAST_FROM_ASCII in the designer
There is no reason to undefine QT_RESTRICTED_CAST_FROM_ASCII (anymore).

Change-Id: Iabeacc8a89d662e78986e2dc275c2096a9c9e519
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-03-23 11:57:42 +00:00
Tobias Hunger
954569387c Update License according to agreement with Free Qt Foundation
* Update license information in tests directory

Change-Id: I311441dd37d053ca3175e44b284258e232ee93e0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 16:01:06 +00:00
Marco Benelli
30ef3a3afc QmlJs: added a new test case in reformatter test.
Change-Id: I4f6c78cd9d2a2e407ef26e498418617efeee5bba
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:15 +00:00
Marco Benelli
b4e42171fd QmlJs: updated .pro file in fileformat test.
Change-Id: I1c6fb32820d8a5e58900c2812f43045bd588aff2
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-11-05 13:30:04 +00:00
Eike Ziller
c868b9f3ed Merge remote-tracking branch 'origin/3.5'
Change-Id: Ife5fdcd71b0adc99d4297a28a64515e9e93d7864
2015-09-04 09:19:28 +02:00
Marco Benelli
86bca29f36 Fixed QT variable value in importscheck.pro .
It now use the 'qml' feature instead of the deprecated 'script'

Change-Id: Ie2e4148e586503be11d233b7f544cf4f3c040bdb
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-09-01 14:49:38 +00:00
Christian Kandeler
ed30c612f4 qbs build: Remove workarounds for fixed qbs bug.
That was most likely QBS-755.

Change-Id: I43d0316113fcca79554bfee9eee9b8bd706fce07
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-08-28 08:13:11 +00:00
BogDan Vatra
28d2b16165 Allow plugins to insert custom imports.
This patch allows a plugin to insert custom imports. These imports are
used by QtC for syntax highlighting and code completion. This way a
plugin can register types and objects that are available only at
runtime.

This is an example of an imports function implementation:

QList<Import> MyPlugin::imports(ValueOwner *valueOwner, const Document
*context) const
{
  // context is needed to know from which project is the opened document
  // in this example we don't care about multiple projects

  Import import;
  import.object = new QmlJS::ObjectValue(valueOwner, "<defaults>");
  import.valid = true;
  const ComponentVersion version(1, 0);
  import.info = ImportInfo::moduleImport("MyPlugin", version,
QString());
  auto myType = valueOwner->newObject(nullptr)
  myType->setMember("myProperty", valueOwner->valueOwner->intValue());
  // add more properties & methods/signals to myType

  import.object->setMember("MyType", myType);

  // in this example we return only one, but you care return more than
one
  return QList<Import>(import);
}

Change-Id: I395c273c7b15a9e4ed5a89a81d70ff92db2b7c0c
Reviewed-by: Marco Benelli <marco.benelli@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-05-28 06:17:58 +00:00
Daniel Teske
08c573fb0d QmlProjectManager: Remove dependency on qt quick 1 in a test
Seems it wasn't actually required at all

Change-Id: I4c622057b7fd85a64f99368eb07b502aee524955
Task-number: QTCREATORBUG-14217
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-04-09 14:50:34 +00:00
Friedemann Kleint
1b9be30371 Clean headers in lib qmljs and plugins qmljstools, qmljseditor.
Change-Id: I3256db8f4d42b6326d986d754b45e6c6c2030839
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 08:17:10 +00:00
Orgad Shaneh
b6de2d1bd8 QmlDesigner: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I492792bb9e5655c55795e938031efc557c9a462f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2015-02-18 09:53:25 +00:00