Commit Graph

384 Commits

Author SHA1 Message Date
Thomas Hartmann
80a92d55d3 QmlDesigner: Fix gradients in Qt 5.12.1
In Qt 5.12.1 gradient is a QJSValue.
See commit 1771d298f33543a3fe47decfe0fff10609b01ab1
This patch adds QJSValue support.

Change-Id: I1c37b82bf033c38646564d5453e297258dd4b056
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-01-25 14:56:08 +00:00
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00
Thomas Hartmann
7bff611ee1 QmlDesigner: Call all Component complete handlers
We have to ensure to properly call all Component complete handlers.
A single component usually has QQmlComponentAttached objects,
which we have to iterate over.

Therefore emitComponentCompleteSignalForAttachedProperty() is not correct.

Task-number: QDS-269
Change-Id: I4aed5d511f9f6e21f72efb955fc6db21b70e7c42
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-10-18 14:41:57 +00:00
Tim Jenssen
8d8aa62e4d QmlDesigner: change the import path to QtQuick2 path
Change-Id: I8adb6fdd334647dd85a8a9f95738ac22fc690363
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-10-10 08:36:04 +00:00
Alessandro Portale
9e221f6ff7 QmlDesigner: Improve the quality of state thumbnails
The ImageProvider needs a correct sourceSize. And the puppet needs to
consider the devicePixelRatio.

Change-Id: I408f956fdb4adb23f272c879878e44e88ca76321
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-13 07:08:09 +00:00
Thomas Hartmann
4fd17b6604 QmlDesigner: Fix clazy warning
Use nullptr

Change-Id: I787794c67e89af7bc7a2d82def580bea3c8f2653
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-01 14:38:47 +00:00
Christian Kandeler
e968513036 QmlDesigner: Fix typo in file name
Change-Id: I06086caeaa2144e93203bc0cea902259be5d73c5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-08-01 11:52:35 +00:00
Thomas Hartmann
2cb238471a QmlDesigner: Modernize
modernize-use-using

Change-Id: Ia8eef3d97db7b99ec813a030e1f39ee492d6cf9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-01 07:42:47 +00:00
Thomas Hartmann
ca42e48dac QmlDesigner: Keep Qt 3D scenes from crashing
If we do not set the source property of the Q3DSPresentationItem
nothing is actually rendered.

If a scene is rendered in the puppet we get an invalid OpenGL context
when rendering in the qml2puppet.

Change-Id: I74db0df7de759e830499967bc6985745be291856
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-07-31 12:41:54 +00:00
Orgad Shaneh
1958c2129e Revert "Windows: Match the name case of included files"
It breaks cross-compilation on linux/mingw.

This reverts commit 1c014ed3d9.

Change-Id: I3e8183ec318541a4393ad242eefbdeaa78b7be44
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-07-19 05:44:06 +00:00
Alessandro Portale
1c014ed3d9 Windows: Match the name case of included files
Although Windows is case insensitive, and lower case always works, Clang
complains:

Lexical or Preprocessor Issue: warning: non-portable path to file
'<FooBar.h>'; specified path differs in case from file name on disk

Change-Id: I8f94e9fb62f6afec8aa6b9d08a7c78f6ba8a4435
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-07-12 20:12:30 +00:00
Tobias Hunger
0e71ed1bfc QmlPuppet: Use override consistently
clang-tidy fixes from modernize-use-override check.

Change-Id: Ia9785ef4d5d236d9740abec26359495eaea2fad1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-05-07 15:43:28 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Thomas Hartmann
45dfa5658b QmlDesigner: Increase size of states editor
Change-Id: I5541214ca8aa518a59d0fa6563e59f69f8048eda
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-10 13:19:32 +00:00
Thomas Hartmann
906d2ac9b5 QmlDesigner: Read contentItem after completing
This avoids issues with deferred properties.

Change-Id: Ie9cc0eaa3468bcb21e4817f8c5e3c1b97c8fc99c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-05 09:20:31 +00:00
Thomas Hartmann
8a8b8c4602 QmlDesigner: Add meta hint if item renders children directly
In some cases items render their children directly using an effect.
In this case we do not want to hide the children when calling
refFromEffectItem().
If the hint takesOverRenderingOfChildren is set in the .metainfo hints
for a parent item we forward a flag to the puppet and refFromEffectItem()
is not hiding this item,

Change-Id: I37a8c0ad8a15bc914c220e03b1b744779431d655
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-03-09 15:05:22 +00:00
Eike Ziller
f2ef88aada QmlDesigner: Avoid some unneeded QFileInfo constructions
Change-Id: I0289c3187f07e26d05a7ca591cc8b12b767c3502
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-10-19 06:38:41 +00:00
Tobias Hunger
d366944519 QmlPuppet: Modernize (nullptr and member initialization)
Change-Id: Ifac20a48df8702f9d31042eb8765cbaadb60b25b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 12:40:18 +00:00
Thomas Hartmann
6745536f1e QmlDesigner: Fix @NodeInstance
With @NodeInstance we can override the value of any property.

Change-Id: Ib64d8b6823b82f0a809092b2468c008d73a5525c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 12:18:43 +00:00
Marco Bubke
4beaae0f79 Introduce Breakpad crash handler
Google Breakpad (https://chromium.googlesource.com/breakpad/breakpad) is a
widely used crash handler framework, e.g. by Mozilla and Chromium. It is
providing a platform neutral solution to generate mini dumps, collect
debug information and generate stack traces from those.

Done-with: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Change-Id: I09382e7db0dc9e29b228e7b554fda7b6f5684349
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:24:11 +00:00
Eike Ziller
5a1a20f2ee Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: Ifb1dcc847ba4b32a79b349955fad5207e402cb7b
2017-07-12 10:50:49 +02:00
Marco Benelli
6c41fafbb6 Qmlpuppet: add missing includes
Task-number:  QTCREATORBUG-18498
Change-Id: Ie40a066508bb52f53b8ad528f9d4cf6969fc0632
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-07-10 08:48:46 +00:00
Thomas Hartmann
567a99c5aa QmlDesigner: Replace SwipeView with StackLayout
In the designer we replace a SwipeView with a StackLayout.
Form the perspektive of the designer they are the same
and StackLayout is easier to handle.

Change-Id: I308ec209024e22db9f56e363e27588a40283603c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-15 15:50:48 +00:00
Eike Ziller
6e8ee7479e Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/debugger/cdb/cdbengine.cpp

Change-Id: Ib9aeccc4162c43e9ee3d85847d96678045625dd0
2017-05-09 15:07:30 +02:00
Thomas Hartmann
cf3454d7fd QmlDesigner: Add flag to check for designer
The property runningInDesigner can be checked to find out
if a component is running in the designer.

Change-Id: Ibf35daba4bb30c7d919b1ff149c92b348d7e8059
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-04 12:34:32 +00:00
Tim Jenssen
a991ecec95 QmlDesigner: use initilizer_lists for pairs
Change-Id: I3a1ef67d8af255604494695807331576540b8afa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-04-28 08:58:19 +00:00
Montel Laurent
d29396b164 Use qEnvironmentVariableIsEmpty or qEnvironmentVariableIsSet directly
Change-Id: I4f2e61e4bade9e7b4518d144db8163e596ab6264
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-04-19 08:00:14 +00:00
Montel Laurent
5d27bc747b Use QFileInfo::exists(...) which is faster that QFileInfo(..).exists
Change-Id: I0d2e61d84c74e60ef4f54074a4ca00f2d0835562
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-04-14 13:18:28 +00:00
Thomas Hartmann
4ca71590db QmlDesigner: Fix warning
Change-Id: Iff2c50439521e602bd2703716590a3e95c8ab2b1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 17:00:42 +00:00
Thomas Hartmann
fdb40645a4 QmlDesigner: Unite the bounding rectangle with actual size
This is required to correctly render text elements with padding,
since the bounding rect seems incorrect.

Change-Id: Ifcef2607089a7a2cec071814d5d87bd27da7ace3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-17 13:02:54 +00:00
Thomas Hartmann
bf3008292f QmlDesigner: Add support for high dpi to form editor and puppet
We forward the device pixel ratio to the qml2puppet and
render items in higher resolutions.
We have to set the device pixel ratio on the pixmap manually,
since it is not serialized.
The option IgnoreDevicePixelRaio allows disabling high dpi awareness.
Rendering in high dpi affects performance, but since we
use shared memory this does not seem to be a serious issue.

Change-Id: Ie9219b8fdb37841c24d4fb3f0ca259f0194ef65c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-13 12:04:18 +00:00
Thomas Hartmann
6e30faba73 QmlDesigner: Quick fix for Popup
This is a quickfix for Controls 2 Popup, Drawer, Menu and Dialog.
We pretend everything derived from QtQuick.Controls.Popup
is an item instead of a QQObject.

Change-Id: I603dce8a1a1b08df3e2c1dccc0fa57e7ccef0800
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 12:58:20 +00:00
Thomas Hartmann
d942111ace QmlDesigner: Fix manual puppet build
The overload for the "+" operator is ambiguous.

Change-Id: Iaebd889ef2eaed6e2d4261ecbd9555a6ba73c521
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-22 16:14:04 +00:00
Nikolai Kosjar
ab87035ed3 QmlDesigner: Fix compilation
nodeinstanceserver.cpp: In member function 'void
    QmlDesigner::NodeInstanceServer::setupImports(const
    QVector<QmlDesigner::AddImportContainer>&)':
nodeinstanceserver.cpp:458:71: error: conversion from 'const char*' to
    'QChar' is ambiguous

Change-Id: Ifa4cb2700344aaacc17619f05249f338e9b28d0b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-22 10:01:04 +00:00
Tim Jenssen
cff0c06f0c QmlDesigner: fix import check again
Task-number: QTCREATORBUG-17303
Change-Id: I0f7a054d63234f3f368de65fd6092c494a9055d4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-22 09:19:53 +00:00
Tim Jenssen
571168f9fb QmlDesigner: fix endless loop in check import code
Change-Id: Id1255ed1fd544e0eed75aeeeb2ffb3df8f75dc84
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-21 15:44:33 +00:00
Thomas Hartmann
a6d16f85c4 QmlDesigner: Check for parent is not required
States actually have a parent.

Change-Id: Iaee31dec4d969c2f84224a2d93796d67f39fda77
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-11 07:28:35 +00:00
Thomas Hartmann
f952c3ee4a QmlDesigner: Fallback to create types from source
We fallback to create types from source, if other means failed.
This can be required if the meta info is incomplete/incorrect when
a C++ type is mocked.

Change-Id: I50d45a6f9d7eba3483da10d9e1d7d6644d9aeb96
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 14:30:40 +00:00
Thomas Hartmann
cb86cc3bdd QmlDesigner: Only register mockup object if not available
If a cpp type is somehow available do not create the mockup.

Change-Id: Ibd76429c3d1190c46a223062d77d676f728fe666
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-25 14:05:41 +00:00
Thomas Hartmann
034f1728ea QmlDesigner: Set QQuickItem parent if item is written to a property
The QQuickEngine does the same.

Before in cases like this:

Item {
   Slider {
      handle: Item {
      }
   }
}

The item parent of the handle was the root item instead of the slider.

Change-Id: Ia022c82c6d85c2a957763c56639ac77bca9297e6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-13 11:39:25 +00:00
Thomas Hartmann
4f2557e9cf QmlDesigner: Fix build of qml2puppet
If the qml2puppet is build for the custom Qt then
the build failed because of utils/algorithm.h.

There is currently no reason to use utils/algorithm.h
in the puppet.

Change-Id: I4fb2aa2e7df4a5087ff48318cc416b457779c96e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-07 10:20:23 +00:00
Tim Jenssen
83e128c2d9 QmlDesigner: refactor test import code
Change-Id: I4efaaacbbf2de23b8709535a7b9a2446f0a4b90e
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-06 15:50:11 +00:00
Tim Jenssen
0ca288f518 QmlDesigner: fix a crash when there are missing imports
Task-number: QTCREATORBUG-16963
Change-Id: I0d4c2e018b4849b2a32cd77da8c2f979fd3befb3
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-05 14:14:11 +00:00
Thomas Hartmann
d3b4acfae2 QmlDesigner: Allow qml2puppet to mockup C++ types
This allows Qt Quick Designer to register a component that can serve
as a mockup for known C++ components registered in e.g. main.cpp.

In many cases those components are the interface to the C++ backend.
While the C++ components itself are not relevant for the gui designer,
the user has to be able to instantiate gui components that use such C++
components.

We use the CreateSceneCommand to forward a list of C++ types to
qml2puppet.
Those types are then registered so that the imports and object institation
works.

Change-Id: I1543912f233f9a783998f3c6a1b48981b342ee80
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-04 08:59:24 +00:00
Tim Jenssen
5a11d5cd5b QmlDesigner: use initializer lists
Change-Id: Ie93861c7d8a5b2863ec8b111afceacc2c163715b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-22 13:16:33 +00:00
Thomas Hartmann
9065697572 QmlDesigner: Support .qrc files in the qml2puppet
The code model knows about .qrc files and has a mapping
that we forward to the qml2puppet.
Support for .qrc was broken when introducing the QmlPrivateGate.

Change-Id: I22d1c1add65d0c9a914e471dbe51ef505f308494
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-10 14:24:26 +00:00
Tim Jenssen
bc08c10764 QmlDesigner: do no refresh if there is no parent
Change-Id: I2299437ea97e884f4b7734129eec8246c87208ab
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-04-29 08:06:40 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
Eike Ziller
89c2b2cd32 Support make install also on OS X
It can be helpful, is not much effort, and parts did not restrict the
install target to non-OS X already.

Change-Id: I3501f37f089e981cf3f72d9250c9b9161d1565d6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-04-22 06:46:11 +00:00
Thomas Hartmann
27c00777d5 QmlDesigner: Fix assert
Trying to serialize a void start  using QVariant does assert.
Solution: Ignore properties of type void star.
This was triggered by TreeView.

Change-Id: Idca5646a472fdfce8761861f5bf889bb73300fff
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-21 13:06:49 +00:00