Commit Graph

565 Commits

Author SHA1 Message Date
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
Alessandro Portale
859d847769 QmlDesigner: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: Ic42b5c59fed5a4a01853138542d8156471e86f58
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-07-25 12:53:26 +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
Eike Ziller
0b10ecc718 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakeproject.h
	src/plugins/debugger/debuggerplugin.cpp
	src/plugins/ios/iosrunfactories.cpp
	src/plugins/nim/project/nimproject.h
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunfactories.cpp
	src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp
	src/plugins/qmlprojectmanager/qmlproject.h
	src/plugins/qnx/qnxrunconfigurationfactory.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/winrt/winrtrunfactories.cpp

Change-Id: Ib029fdbaa65270426332f5edd6e90264be5fb539
2018-03-13 11:25:38 +01:00
Thomas Hartmann
c25ba91fc1 Fix compile
Change-Id: I0837b8830735f80dd98928769e603907226ab6e0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-03-09 15:37:37 +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
205c930592 Merge remote-tracking branch 'origin/4.6'
Change-Id: I63f8aebb201936f671b1486ff9420f67e5e3fafc
2018-03-01 15:46:37 +01:00
Thomas Hartmann
8cece3226c QmlDesigner: Fix crash in puppet
The infinite recursion occurs because we call QFileInfo::exists()
even if no change/fix is done, if a file in a resource if actually
missing.

If fileName != fixedPath the ":" prefix has been replaced by an
absolute path and a new call to ::create will early reject.
Typically the directories do not match, so nothing is replaced.
This crashed without the fix.
With the fix we will always remove the ":" prefix
and therefore we do not try to handle the "fixed" case.
Even, a broken path that contains multiple ":" we would
only handle a finite number of times until all ":" are fixed.

Change-Id: Ie13cedc1212bb58a16c61e0137128539d189269d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-02-28 16:14:24 +00:00
hjk
73c72fa6a7 QmlPuppet: Remove unused static function
Change-Id: I8c439f87c30b4b4102f0839cc745120568e6f34f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-02-28 07:23:47 +00:00
Thomas Hartmann
4ab5dbeb3a QmlDesigner: Use file engine to resolve resources in puppet
Task-number: QTCREATORBUG-19729
Change-Id: I1297180e29446429b949fc0bbc1b74055018bc28
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-02-14 11:49:42 +00:00
Thomas Hartmann
a7515d25a9 QmlDesigner: Avoid detachs
The non const overloads of first() and last() do detach
if the reference count is higher than 1.
Therefore we use constFirst() and constLast() instead.

Change-Id: I737cfc428f1c21f16185b9b51175e181c0ec7068
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-23 10:14:12 +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
Robert Loehning
6d60aae8ef QmlPuppet: Check return value of fstat
Change-Id: I2b7c04712a883455d8a5a0daa1225c2ef84a0748
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-09-26 16:44:58 +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
Tim Jenssen
4f03ea96a2 QmlDesigner: fix uninitialzed value warnings
Change-Id: Ieddd83953b2009656ceecea2f9fedecd54ac9ac8
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-19 09:10:29 +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
Thomas Hartmann
35c7360892 QmlDesigner: Remove QtQuick.Controls 1.0 dependcy from Window mockup
It is not required and prevents the mockup from working if QQControls 1
are missing.

Change-Id: Ib439bded6dce6b8e0d6f21e9b22f3dad2a6c0d3a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-20 13:34:34 +00:00
Tim Jenssen
d5342eff77 fix property spelling
Change-Id: I00f84ec8d2c83d7f3937d2e21a24e02ba28991b3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-07-17 10:38:08 +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
Robert Loehning
d12dc00a79 QmlDesigner: Remove unused member
Change-Id: I646ebaed1179fd679b67ec8c942d7b8a592e9900
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-06-07 10:13:58 +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
Tim Jenssen
12c65d2650 QmlDesigner: improve fixResourcePath()
Change-Id: I675dfe507dbe2989b0a015baf75d0423ba088993
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-04-26 09:22:25 +00:00
Eike Ziller
dae2556d2f Merge remote-tracking branch 'origin/4.3'
Change-Id: I44511e06986b7df6007be7daf7051c895a10794b
2017-04-21 15:30:00 +02: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
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02: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
Thiago Macieira
b34dc8fdb2 Cast enum to the an integer type before streaming out to QDataStream
We stream in as int or as qint32, so this is symmetric.

Change-Id: Ic46ff326a6ba46bc877cfffd148325c21241f3b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-04-05 05:13:43 +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
513209cf1f QmlDesigner: Add logging to NodeInstanceView
Change-Id: I95f9f2e089f2d66ba9cf27b631d2478d54b18085
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-01 16:20:48 +00:00
Thomas Hartmann
80d1a6ed42 QmlDesigner: Increase interval for puppet alive timer
Once a second is enough.

Change-Id: I7e8e16bbe2b6f4c47d19d4cb25deada363c752f9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-01 15:32:24 +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
5eeecdb1b4 QmlDesigner: Fixing double free
Calling detach() in setKey() will free the shared memory twice, if
we do not set m_memory to nullptr.
Clean cleanHandleInternal() does always return true, so
checking the value does not make sense.
We have to call cleanHandleInternal() immediately after the close.

Change-Id: I110693d1dd9dae4ff5e52cfd3fdd2f33137af969
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-30 08:29:25 +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