platform/upstream/qtdeclarative.git
10 years agoQQmlObjectCreator: Clear sharedState componentAttached in destruction/clear
Albert Astals Cid [Tue, 17 Jun 2014 11:10:35 +0000 (13:10 +0200)]
QQmlObjectCreator: Clear sharedState componentAttached in destruction/clear

Fixes crash when delegate is being deleted while not totally instantiated

Valgrind trace:
==15748== Invalid write of size 8
==15748==    at 0x57A02DB: QQmlComponentAttached::~QQmlComponentAttached() (qqmlcomponent.cpp:985)
==15748==    by 0x57A0318: QQmlComponentAttached::~QQmlComponentAttached() (qqmlcomponent.cpp:989)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D33AE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D34655: QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D33AE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D348A5: QQmlPrivate::QQmlElement<QQuickFocusScope>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D34655: QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x668736B: QObjectPrivate::deleteChildren() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66900EB: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1D4B5: QQuickItem::~QQuickItem() (qquickitem.cpp:2064)
==15748==    by 0x5D33AE5: QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement() (qqmlprivate.h:106)
==15748==    by 0x6689607: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x5D1B012: QQuickItem::event(QEvent*) (qquickitem.cpp:7114)
==15748==    by 0x6659CDC: QCoreApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66599D4: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x665B826: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66B1242: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x8EE2E43: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x8EE3087: g_main_context_iterate.isra.24 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x8EE312B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x66B06BB: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66578EA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x665EF45: QCoreApplication::exec() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x40711B: startShell(int, char const**, void*) (main.cpp:171)
==15748==    by 0x407A74: main (main.cpp:227)
==15748==  Address 0x1be83870 is 64 bytes inside a block of size 112 free'd
==15748==    at 0x4C2C2BC: operator delete(void*) (vg_replace_malloc.c:503)
==15748==    by 0x5815FB0: QQmlObjectCreator::~QQmlObjectCreator() (qqmlobjectcreator.cpp:156)
==15748==    by 0x57A52AA: QQmlIncubatorPrivate::clear() (qscopedpointer.h:62)
==15748==    by 0x57A53C6: QQmlIncubator::clear() (qqmlincubator.cpp:577)
==15748==    by 0x5DCEA20: QQuickLoader::setActive(bool) (qquickloader.cpp:350)
==15748==    by 0x5DCF6D2: QQuickLoader::qt_metacall(QMetaObject::Call, int, void**) (moc_qquickloader_p.cpp:277)
==15748==    by 0x579DC66: QQmlPropertyPrivate::write(QObject*, QQmlPropertyData const&, QVariant const&, QQmlContextData*, QFlags<QQmlPropertyPrivate::WriteFlag>) (qqmlproperty.cpp:1322)
==15748==    by 0x579E76E: QQmlPropertyPrivate::writeValueProperty(QObject*, QQmlPropertyData const&, QVariant const&, QQmlContextData*, QFlags<QQmlPropertyPrivate::WriteFlag>) (qqmlproperty.cpp:1246)
==15748==    by 0x579F2F9: QQmlPropertyPrivate::writeBinding(QObject*, QQmlPropertyData const&, QQmlContextData*, QQmlJavaScriptExpression*, QV4::ValueRef, bool, QFlags<QQmlPropertyPrivate::WriteFlag>) (qqmlproperty.cpp:1578)
==15748==    by 0x580CF69: QQmlBinding::update(QFlags<QQmlPropertyPrivate::WriteFlag>) (qqmlbinding.cpp:266)
==15748==    by 0x580D5BD: QQmlBinding::expressionChanged(QQmlJavaScriptExpression*) (qqmlbinding_p.h:105)
==15748==    by 0x57E6156: QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) (qqmlnotifier.cpp:81)
==15748==    by 0x57E6130: QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) (qqmlnotifier.cpp:76)
==15748==    by 0x57E6130: QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) (qqmlnotifier.cpp:76)
==15748==    by 0x5788FA3: QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) (qqmlengine.cpp:721)
==15748==    by 0x6688232: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x57882A7: QQmlData::destroyed(QObject*) (qqmlengine.cpp:1658)
==15748==    by 0x668FD7D: QObject::~QObject() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x55E8B64: QQmlDMAbstractItemModelData::~QQmlDMAbstractItemModelData() (qqmladaptormodel.cpp:95)
==15748==    by 0x58643DC: QQmlDelegateModelPrivate::release(QObject*) (qqmldelegatemodel.cpp:520)
==15748==    by 0x586440C: QQmlDelegateModel::release(QObject*) (qqmldelegatemodel.cpp:536)
==15748==    by 0x5DFED4F: QQuickItemViewPrivate::releaseItem(FxViewItem*) (qquickitemview.cpp:2349)
==15748==    by 0x5DBAB94: QQuickGridViewPrivate::addVisibleItems(double, double, double, double, bool) (qquickgridview.cpp:497)
==15748==    by 0x5DFC94E: QQuickItemViewPrivate::refill(double, double) (qquickitemview.cpp:1751)
==15748==    by 0x5DFF26A: QQuickItemViewPrivate::layout() (qquickitemview.cpp:1859)
==15748==    by 0x5D275F7: QQuickWindowPrivate::polishItems() (qquickwindow.cpp:271)
==15748==    by 0x5D02B7D: QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*) (qsgthreadedrenderloop.cpp:1150)
==15748==    by 0x5D03167: QSGThreadedRenderLoop::event(QEvent*) (qsgthreadedrenderloop.cpp:1235)
==15748==    by 0x6659CDC: QCoreApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66599D4: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66B00CC: QTimerInfoList::activateTimers() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66B03F0: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x8EE2E43: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x8EE3087: g_main_context_iterate.isra.24 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x8EE312B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==15748==    by 0x66B06BB: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x66578EA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x665EF45: QCoreApplication::exec() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==15748==    by 0x40711B: startShell(int, char const**, void*) (main.cpp:171)
==15748==    by 0x407A74: main (main.cpp:227)

Change-Id: I2c7d38fa5a2566520173bff7ad4e5f9c966d083e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoInitialize velocity
Albert Astals Cid [Mon, 16 Jun 2014 14:51:17 +0000 (16:51 +0200)]
Initialize velocity

Fixes valgrind warning
==21054== Conditional jump or move depends on uninitialised value(s)
==21054==    at 0x5DAE6D4: QQuickListView::viewportMoved(QFlags<Qt::Orientation>) (qquicklistview.cpp:2789)
==21054==    by 0x5D9ED76: QQuickFlickablePrivate::itemGeometryChanged(QQuickItem*, QRectF const&, QRectF const&) (qquickflickable.cpp:296)
==21054==    by 0x5DFC438: QQuickItemViewPrivate::itemGeometryChanged(QQuickItem*, QRectF const&, QRectF const&) (qquickitemview.cpp:1158)
==21054==    by 0x5DAC6A2: QQuickListViewPrivate::itemGeometryChanged(QQuickItem*, QRectF const&, QRectF const&) (qquicklistview.cpp:1369)
==21054==    by 0x5D0D5F2: QQuickItem::geometryChanged(QRectF const&, QRectF const&) (qquickitem.cpp:3365)
==21054==    by 0x5D11822: QQuickItem::setY(double) (qquickitem.cpp:5858)
==21054==    by 0x5C84FED: QQuickTimeLinePrivate::advance(int) (qquicktimeline.cpp:826)
==21054==    by 0x5C85155: QQuickTimeLine::updateCurrentTime(int) (qquicktimeline.cpp:702)
==21054==    by 0x58576FA: QAbstractAnimationJob::setCurrentTime(int) (qabstractanimationjob.cpp:497)
==21054==    by 0x5857BDD: QQmlAnimationTimer::updateAnimationsTime(long long) (qabstractanimationjob.cpp:119)
==21054==    by 0x640C7EC: QUnifiedTimer::updateAnimationTimers(long long) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x58570C8: QQmlAnimationTimer::startAnimations() (qabstractanimationjob.cpp:152)
==21054==    by 0x66895B5: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x6659CDC: QCoreApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x66599D4: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x665B826: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x66B1242: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x8EE2E43: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==21054==    by 0x8EE3087: g_main_context_iterate.isra.24 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==21054==    by 0x8EE312B: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4100.0)
==21054==    by 0x66B06BB: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x66578EA: QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)
==21054==    by 0x665EF45: QCoreApplication::exec() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.3.0)

Change-Id: I72e101140b8bee0b6867cf92902e70660c8d21ab
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoImprove RSS News Qt Quick Demo
Topi Reinio [Thu, 12 Jun 2014 13:05:05 +0000 (15:05 +0200)]
Improve RSS News Qt Quick Demo

    - Add main.cpp for launching, use Qt resource system
    - Update feed URLs
    - New layout and images
    - Make the example scalable, react to orientation changes
    - Use graphical effects and animations
    - Display time and link for each news item
    - Fix license headers to use the correct license

Task-number: QTBUG-37203
Change-Id: I6f8941cbdaed78a3dee30305496b3ea7777ba3e3
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
10 years agoFix QQmlComponent detailed description.
Mitch Curtis [Tue, 17 Jun 2014 11:35:21 +0000 (13:35 +0200)]
Fix QQmlComponent detailed description.

setParent() => setParentItem()

Task-number: QTBUG-39687
Change-Id: I67dc871a6d3b10af321d1f7b08921dcad0a6f19d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoAdd a QQuickWidget - QQuickView comparison example
Laszlo Agocs [Fri, 6 Jun 2014 14:53:33 +0000 (16:53 +0200)]
Add a QQuickWidget - QQuickView comparison example

Besides serving as a side-by-side test tool for QQuickView and
QQuickWidget (including multisampling), it also demonstrates some
useful practices for rendering 3D content via QQuickFramebufferObject.

Done-with: Paul Olav Tvete <paul.tvete@digia.com>
Change-Id: Ie73e998ee91e32ef1535dd6f0f65c8a69addcc5e
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoFix crash in QObjectWrapper
Oleg Shparber [Tue, 17 Jun 2014 22:47:43 +0000 (15:47 -0700)]
Fix crash in QObjectWrapper

This can happen during QObject destruction, when
QObjectPrivate::deleteChildren() itself sets entries
in the children list to zero when deleting. These
zeros cause crash in markChildQObjectsRecursively().

Task-number: QTBUG-38635
Change-Id: I29ad9e793b78ca4e8d73fbb125f46db1b8292f20
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoUse QSignalSpy instead of waitFor in tst_qpacketprotocol
Ulf Hermann [Mon, 16 Jun 2014 09:21:01 +0000 (11:21 +0200)]
Use QSignalSpy instead of waitFor in tst_qpacketprotocol

QTcpServer::waitForNewConnection() blocks the event loop and prevents
the client, that runs in the same event loop, from sending anything.
Also, if the connection is established before waitForNewConnection() is
called we're going to wait for another connection, which will never
happen.

It's not clear if this is actually the cause of the test failures but
blocking the event loop is generally a bad idea and the last change to
the test that actually made a difference to the functionality added
exactly that line, see b36bbe3626bc68ac267d7653fa6408a8f258251d.

Task-number: QTBUG-39655
Change-Id: Ic03a4e7cac78155532588476b99449664c343ee2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoBump version
Oswald Buddenhagen [Tue, 17 Jun 2014 22:28:50 +0000 (00:28 +0200)]
Bump version

Change-Id: I48d18a93971f4595b295aa6a1f70dfbe2b2266a1

10 years agoSeparate renderer out in "OpenGL under QML" example.
Gunnar Sletta [Fri, 13 Jun 2014 11:59:57 +0000 (13:59 +0200)]
Separate renderer out in "OpenGL under QML" example.

The example was promoting very bad practice.

Change-Id: Ibb83780ec33e59ee5aabf65a775705dd0da681e6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoUse newest QtQuick in rssnews demo
Niels Weber [Fri, 13 Jun 2014 11:27:45 +0000 (13:27 +0200)]
Use newest QtQuick in rssnews demo

Task-number: QTBUG-37203
Change-Id: I720e510b875f63eb5c184cd7d8b9eb127674d505
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
10 years agoMerge remote-tracking branch 'origin/stable' into 5.3
Sergio Ahumada [Sat, 14 Jun 2014 16:19:53 +0000 (18:19 +0200)]
Merge remote-tracking branch 'origin/stable' into 5.3

Change-Id: Id783915b0139a90ecfb99f8298b1ff5cf506a1dd

10 years agoFix copy-paste errors.
Richard J. Moore [Fri, 18 Apr 2014 10:53:05 +0000 (11:53 +0100)]
Fix copy-paste errors.

Fix two copy-paste errors identified by static analysis at
http://www.viva64.com/en/b/0251/

Change-Id: I359a4635a4a837995f9ed9bf0182a1ca543725df
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
10 years agoMerge remote-tracking branch 'origin/stable' into 5.3
Simon Hausmann [Fri, 13 Jun 2014 14:45:46 +0000 (16:45 +0200)]
Merge remote-tracking branch 'origin/stable' into 5.3

Change-Id: I9cff3f4d42d58157fd8d17ec172b6a74dc386508

10 years agoFix Stmt:Data object leak
Liang Jian [Wed, 28 May 2014 07:46:51 +0000 (15:46 +0800)]
Fix Stmt:Data object leak

call Stmt::destroyData() whenever a Stmt object is to be removed in
BasicBlock to delete the Stmt::Data object hold in the Stmt object.

Change-Id: I59c939d79b935153e6f8613e54f149120f5198f5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoSet StrongFocus on QQuickWidget
Laszlo Agocs [Thu, 12 Jun 2014 13:10:51 +0000 (15:10 +0200)]
Set StrongFocus on QQuickWidget

Make text input functional out of the box.

Both QGraphicsView and QDeclarativeView (QQuick1) do this so there
is no reason to do this differently for QQuickWidget. For QQuickWindow
and QQuickView the issue does not exist in the first place, they will
accept the focus by default.

Task-number: QTBUG-39605
Change-Id: I74f01b85342df51aa3c0e80baf58ba1619c63438
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDoc: Clarify where JavaScript fits in QML code
Sze Howe Koh [Wed, 11 Jun 2014 23:24:17 +0000 (07:24 +0800)]
Doc: Clarify where JavaScript fits in QML code

- Rewrite the introductory list.

- Rewrite the section about application startup code.

- Flatten sections. Previously, there were two \section1 headings:
  "JavaScript Expressions in QML Objects" and "Running JavaScript at
  Startup". This split wasn't very natural, as startup code needs to be
  called from an object, while imported JS files aren't in objects.

- Some minor formatting/wording changes in unrelated areas.

Change-Id: Ie08f94e2ea77ca84f80491c782bc30612f7ef698
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix EllipseShape for Affectors in QtQuick.Particle
Daniel Oberländer [Thu, 29 May 2014 19:37:54 +0000 (21:37 +0200)]
Fix EllipseShape for Affectors in QtQuick.Particle

EllipseShape was theated like rectangles if set as shape in an Affector
due to an unimplemented containment check (was marked as TODO in source
code). This fix implements the missing check.

Change-Id: I8df1406f147c56e799531fccf4963110c9fdd8ef
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoInitialize QSGPaintedNode with an empty size.
Gunnar Sletta [Thu, 12 Jun 2014 08:02:55 +0000 (10:02 +0200)]
Initialize QSGPaintedNode with an empty size.

Failing to do so would cause it to not update its size when set to 1x1
which in turn would cause it to never update its texture, causing crashes
later during rendering.

Task-number: QTBUG-39555
Change-Id: I099d9ef2d6968ece21f7c03819abfd6685bec430
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
10 years agoAdd node description to painted items.
Gunnar Sletta [Thu, 12 Jun 2014 08:07:59 +0000 (10:07 +0200)]
Add node description to painted items.

Change-Id: I47ad9df1550649131ac5379acbf7d133088c60a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoMake sure shader rewriter stops immediately on an empty string.
Gunnar Sletta [Mon, 9 Jun 2014 08:42:08 +0000 (10:42 +0200)]
Make sure shader rewriter stops immediately on an empty string.

The 'invalid' token didn't really serve a purpose. If a string contains
0 for any reason, it one has reached the end.

Task-number: QTBUG-39505
Change-Id: I3fc9b8f28dc223386a72bbfa28f70fcca0fde223
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix forwarding of keyboard events to multiple target items
Joni Poikelin [Mon, 9 Jun 2014 11:50:29 +0000 (14:50 +0300)]
Fix forwarding of keyboard events to multiple target items

Fix regression when multiple items are set to Keys.forwardTo attached
property. QML items accept key events automatically and event should be
by default in accepted state when entering handler.

Task-number: QTBUG-39168
Change-Id: Ibf6c163c4059269996113634efa48ad2fe4d838d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
10 years agoFurther improve the StocQt demo
Topi Reinio [Tue, 27 May 2014 11:18:00 +0000 (13:18 +0200)]
Further improve the StocQt demo

- Display the price scale on y-axis, highest trade volume on x-axis
- Adjust grid size for the chart based on the active view
- Fix incorrect drawing of volume data
- Correctly scale the chart based on the price/volume ranges
- Align the volume graph to the price chart and improve its look
- Use Date.toDateString() instead of hardcoded month names
- Minor fixes to layout

Task-number: QTBUG-38254
Change-Id: I0e7ef18a152c7678371fb9c01f86d3d91a289472
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Niels Weber <niels.weber@digia.com>
10 years agoMerge remote-tracking branch 'origin/stable' into 5.3
Sergio Ahumada [Wed, 11 Jun 2014 08:03:38 +0000 (10:03 +0200)]
Merge remote-tracking branch 'origin/stable' into 5.3

Change-Id: I595002245ffee7aa739ce6ee9806cf509a5e7405

10 years agoDrag&Drop support for child items in QQuickWidget
Paul Olav Tvete [Tue, 10 Jun 2014 09:09:21 +0000 (11:09 +0200)]
Drag&Drop support for child items in QQuickWidget

This is a quick-fix. The real issue is that QWidget and QWindow
reacts differently when a QDragEnterEvent is rejected.

Change-Id: I3e3e50610c14acfaada9c1b243b88cfe9eae54b2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoStop polish-and-sync timer when the window is destroyed
Laszlo Agocs [Fri, 6 Jun 2014 13:02:21 +0000 (15:02 +0200)]
Stop polish-and-sync timer when the window is destroyed

The threaded render loop continues to run the polish-and-sync timer for
ever in case the QQuickWindow is destroyed while the timer is active.
Instead of pumping the timer events on the render thread for ever, the
timer has to be killed somewhere.

Change-Id: I8e458624e26ebfacb6cc69a4f2fbb3da57ae5e0e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoadd missing signal declaration in Exposing Attributes to QML example
Shawn Rutledge [Tue, 13 May 2014 13:29:06 +0000 (15:29 +0200)]
add missing signal declaration in Exposing Attributes to QML example

Task-number: QTBUG-33985
Change-Id: Id6a2a51467ee5de44bf51fb48e3f9346a832f8f2
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoAdd support for multisampling in QQuickWidget
Laszlo Agocs [Wed, 4 Jun 2014 13:05:00 +0000 (15:05 +0200)]
Add support for multisampling in QQuickWidget

Use a multisampled fbo when the requested format has samples > 0.
Resolving happens after each rendering of the scene.

The blit to the temporary non-multisampled fbo could be avoided,
in theory, by sending the fbo instead of the texture id down the
stack and performing a blit directly to fbo #0. This however
involves a number of potential issues, for example due to the
non-sharability of FBOs between contexts. Hence it is left as a
future exercise.

Task-number: QTBUG-39187
Change-Id: Iae98b969bcbc3bb57e6d73288496f5428913c826
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoKeep QML and JS messages separate in QQmlProfilerService test
Ulf Hermann [Wed, 4 Jun 2014 08:48:47 +0000 (10:48 +0200)]
Keep QML and JS messages separate in QQmlProfilerService test

Like that we can deal with misbehaving clocks in the tested
application.

Task-number: QTBUG-39169
Change-Id: Ia9f9844efb6f20508bccac3ca2d593d01d55fc83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoV4 Yarr JIT: push/pop addressTempRegister.
Erik Verbruggen [Thu, 5 Jun 2014 12:13:39 +0000 (14:13 +0200)]
V4 Yarr JIT: push/pop addressTempRegister.

Change 6572d4e50d73ac60a8974d07de74c27a7f99ebef moved the
addressTempRegister from r3 to r10, so that calculated calls would not
overwrite the fourth argument of a call. However, JSC's Yarr JIT might
also use it for certain loads, so it also needs to save r10.

Task-number: QTBUG-39289
Change-Id: I0a4e725b6b11ab5e772330662049668bed009c05
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix opacity issue in the renderer.
Gunnar Sletta [Wed, 4 Jun 2014 16:59:58 +0000 (18:59 +0200)]
Fix opacity issue in the renderer.

Given the following tree:

OpacityNode
    |
TransformNode (which is a batch root)
    |
GeometryNode

If both opacity and transform nodes were changed this frame, we would
hit the optimized "scrolling" path while traversing the tree and abort
updating that subtree. As a result the opacity change was not
propegated to the geometry node and it would be rendered incorrectly.

Fix this by skipping the optimized path when there are opacity changes
in an ancestor.

Task-number: QTBUG-39190
Change-Id: Ieaebfe3de62b961204bd3103fe9913d60e75e412
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix QQuickWidget offscreen surface format and creation order
Laszlo Agocs [Thu, 5 Jun 2014 13:16:33 +0000 (15:16 +0200)]
Fix QQuickWidget offscreen surface format and creation order

Create the QOffscreenSurface together with, and after, the QOpenGLContext.
This is essential to get a surface that is compatible with the context and
is in line with the QOffscreenSurface usage recommendation from the docs.

Otherwise, if the offscreen surface gets created first, without
knowing what _actual_ format (e.g. EGL configuration) the context
will use, the result is an incompatible surface and context on
systems that offer a different set of configurations for window and
pbuffer surfaces.

This fixes QQuickWidget on EGL implementations that offer both 16 and 24
bit pbuffer configs, but only 24 (or 32) bit window configs.

Task-number: QTBUG-39474
Change-Id: I43925d2b25e28d26d172ce9d22651c25b281b832
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoDoc: Removed redundant link to section in the same page.
Jerome Pasion [Tue, 3 Jun 2014 13:52:49 +0000 (15:52 +0200)]
Doc: Removed redundant link to section in the same page.

There is no need to refer to a different section as it is understood
that those instructions apply to all examples.

Change-Id: I2d0d2d6cbf84790bc4ca2f3deda57ab5d3d1c6c1
Reviewed-by: Martin Smith <martin.smith@digia.com>
10 years agoDoc: Updated "Qt Quick Examples" pages.
Jerome Pasion [Wed, 28 May 2014 14:19:08 +0000 (16:19 +0200)]
Doc: Updated "Qt Quick Examples" pages.

-added instructions about running the example (using \include)
-used the example names as sections in the collection pages
-general editing and documentation polishing
-updated copyright information

Change-Id: I044f29fcc1921a541040505d5821acb06dc4cb35
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoDetect and warn when using QQuickWidget as a native child
Laszlo Agocs [Wed, 4 Jun 2014 10:42:11 +0000 (12:42 +0200)]
Detect and warn when using QQuickWidget as a native child

This is not supported.

Change-Id: I19ed485ee629baa4f3631770ab0c730e0ef6748e
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
10 years agoUse the correct precision specifier in visualizer GLSL.
Gunnar Sletta [Tue, 3 Jun 2014 11:01:49 +0000 (13:01 +0200)]
Use the correct precision specifier in visualizer GLSL.

Task-number: QTBUG-39119
Change-Id: I0ec4909167f5694ce4229df8202c89742be21d0a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
10 years agoFix bindings to when property of States not always working
Simon Hausmann [Wed, 4 Jun 2014 11:49:50 +0000 (13:49 +0200)]
Fix bindings to when property of States not always working

The "when" property is of type QQmlBinding* and we special case that type when
writing property bindings. However in order for that to work, the meta-type for
QQmlBinding* needs to be registered at the point in time when resolving
properties in the type compiler. In Qt 5.1/5.2 this worked by accident due to
a different code paths that implicitly registered the meta-type earlier from a
different location.

There are a couple of property types for which we have special handling, such as
QQmlV4Handler and QJSvalue, besides QQmlBinding*. We do register them explicitly
at engine initialization time, and therefore we should also initialize the meta-type
for QQmlBinding* there.

Task-number: QTBUG-39421
Change-Id: Iec8609848b632afa52aa42cf0b807330c74f6f3a
Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
10 years agoFix method overload calling of Qt slots from JavaScript
kh1 [Wed, 4 Jun 2014 11:17:30 +0000 (13:17 +0200)]
Fix method overload calling of Qt slots from JavaScript

After commit ac57f185d1a2203cd4b585df7bd7af01c3ec33ed we succeed in selecting
the correct overload based on the supplied arguments. However when calling
slots on objects without a property cache, we end up using the local "dummy"
variable to store the synthetic propert data. We also store the currently best
patch in the "best" variable, which is a _pointer_ to the property data of the
match. Suppose we have 5 overloads to choose from, we find that the 3rd is
the best. Then we try the fourth but find it unsufficient and break out of
the loop. Unfortunately the "dummy" property data at this point contains the
data of the fourth (wrong) overload, and our best match variable points to it.
So then when we finally call the method, we do it based on the wrong property
data.

The easy patch is to simply copy the few bytes of property data, so "best" is
stored by value instead of pointer.

Change-Id: Ie2ebbdb88a117770b6c7b9490e1c634077020e9d
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
10 years agoMake ItemViews displayMargin work correctly when set to negative values
Albert Astals Cid [Thu, 15 May 2014 08:02:43 +0000 (10:02 +0200)]
Make ItemViews displayMargin work correctly when set to negative values

We need to call forceLayoutPolish instead of refillOrLayout
so that the visibility is correctly updated. Also update one
line that sets visibility in GridView

Change-Id: I29fa67cdd5196a744fab9507b4104cb83ad4bf5e
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
10 years agoFix worker scripts with cached compilation units
Simon Hausmann [Mon, 2 Jun 2014 12:50:00 +0000 (14:50 +0200)]
Fix worker scripts with cached compilation units

Try to retrieve them from the compilation unit cache instead of from
the file system if possible. The evaluation code can be shared.

In the long run it would be nice to use the type loader here and allow for
worker scripts to have dependencies/imports. But that is a more intrusive
change given the typeloader's dependency on the engine.

Change-Id: I7f9d6be1ff31433d4b14607cf0c25acdf466ac67
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoMake QQuickRenderControl usable (still private)
Paul Olav Tvete [Tue, 3 Jun 2014 12:19:14 +0000 (14:19 +0200)]
Make QQuickRenderControl usable (still private)

QQuickRenderControl needs a QQuickWindow in order to function. This
required the use of a private QQuickWindow constructor, meaning that
only friend classes of QQuickWindow could use QQuickRenderControl.

This change adds a factory function, QQuickRenderControl::createOffscreenWindow().

Task-number: QTBUG-38996
Change-Id: I92f6f1f60045934f3dd33c300352247852463c73
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix crash in QSGRenderContext::invalidate().
Yoann Lopes [Fri, 23 May 2014 13:54:05 +0000 (15:54 +0200)]
Fix crash in QSGRenderContext::invalidate().

QSGRenderContext was holding pointers to QFontEngines without
increasing the font engine's ref count, allowing them to be deleted
before QSGRenderContext could make use of them.

Task-number: QTBUG-36573
Task-number: QTBUG-38313
Change-Id: I0ed28bb44882c55f330c27c23b533b7999d7e04b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoPrevent initial clipping in Context2D
Ulf Hermann [Mon, 2 Jun 2014 10:17:10 +0000 (12:17 +0200)]
Prevent initial clipping in Context2D

Don't set an initial clip path and only start clipping once a clip
path has manually been set.

Task-number: QTBUG-39114
Change-Id: Id277775d6eb0be87bead0e5d076f32a07ebdfe5c
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoRecognize "in" keyword in vertex shaders
Laszlo Agocs [Mon, 2 Jun 2014 10:07:13 +0000 (12:07 +0200)]
Recognize "in" keyword in vertex shaders

Checking only for "attribute" is not sufficient: with newer GLSL versions
"in" is used.

Task-number: QTBUG-39143
Change-Id: Ibdb5940f5aba1485ecaad2e2c4a3aa7150af6d99
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDestroy the FBO in QQuickWidget while a context is current
Laszlo Agocs [Mon, 2 Jun 2014 08:21:56 +0000 (10:21 +0200)]
Destroy the FBO in QQuickWidget while a context is current

When creating the new FBO, it will try to restore the previous FBO
after initialization. The internal tracking of the current FBO goes
horribly wrong when a QOpenGLFramebufferObject is destroyed with
no context current. In 5.4 the problem is solved by removing the
tracking altogether. Here QQuickWidget is fixed to play nice and
destroy QOpenGLFramebufferObject always with the context current.

Task-number: QTBUG-39389
Change-Id: Ic6917696ed61f284d661a578c9c7f2e0673c412d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix QQuickWidget cleanup and invalidation sequence
Laszlo Agocs [Fri, 30 May 2014 11:53:25 +0000 (13:53 +0200)]
Fix QQuickWidget cleanup and invalidation sequence

Make sure the context/surface are still alive and current while destroying
the render control.

Task-number: QTBUG-39034
Change-Id: I6ff0069985a9121a63025bfb165493b3f003391d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDump all received messages if tst_QQmlProfilerService fails
Ulf Hermann [Mon, 2 Jun 2014 14:32:16 +0000 (16:32 +0200)]
Dump all received messages if tst_QQmlProfilerService fails

Without all the context we can't really tell what happened.

Task-number: QTBUG-39169
Change-Id: Ic5192498440a0d55c279549243dfce65f8168317
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoDisable qmlscene and qmlplugindump when doing static builds
Simon Hausmann [Mon, 2 Jun 2014 08:16:07 +0000 (10:16 +0200)]
Disable qmlscene and qmlplugindump when doing static builds

Both of these tools rely on the ability to load plugins in order to function.
QmlScene in particular can theoretically be used with just "QtQml" imports
and QObjects, but that's not very useful for the _scene_ type of applications
qmlscene is intended for ;-). And in a static build it can't load QtQuick.

Task-number: QTBUG-39003
Change-Id: I0d4328dc4eb5c4e3153668e65a12f8eb3757f660
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoKeep the internal state about the bound fbo up to date
Laszlo Agocs [Fri, 23 May 2014 08:27:49 +0000 (10:27 +0200)]
Keep the internal state about the bound fbo up to date

When binding an FBO directly via glBindFramebuffer, the QOpenGLContext's
internal current_fbo, that is maintained by QOpenGLFramebufferObject,
becomes out of sync. This will lead to QOpenGLFramebufferObjects thinking
they are still bound.

This fix prevents ShaderEffect items in QQuickWidget from complaining
about "'recursive' must be set to true when rendering recursively". Ideally
the entire tracking of the current fbo should be removed, since it cannot
be done robustly enough, but that will likely happen in 5.4 only.

Task-number: QTBUG-38994
Change-Id: I39015d90bb2e0985d2a084b79ffe2004a9bc9f07
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoQNX: Fix qquicktext auto test
Bernd Weimer [Thu, 24 Apr 2014 16:21:48 +0000 (18:21 +0200)]
QNX: Fix qquicktext auto test

Change-Id: I06acf7dcd6e83c6b665163f4eb9e5ee55ecf85b2
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix potential null pointer dereferencing
Frederik Gladhorn [Wed, 14 May 2014 16:45:03 +0000 (18:45 +0200)]
Fix potential null pointer dereferencing

These were found by
http://www.viva64.com/en/b/025
most issues are rather cosmetic.

Change-Id: I7cc12610aae6a43d26bedb9b480863c0695ddfa3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix copy and paste error
Frederik Gladhorn [Wed, 14 May 2014 11:50:32 +0000 (13:50 +0200)]
Fix copy and paste error

Fix first error "Null pointer dereferencing" identified by static analysis from
http://www.viva64.com/en/b/0251/

Change-Id: I984d6ac2c22fddfe5ccb507f5d95d3329bed0563
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix AccessibleAttached property documentation
Frederik Gladhorn [Thu, 22 May 2014 12:19:12 +0000 (14:19 +0200)]
Fix AccessibleAttached property documentation

Task-number: QTBUG-37908
Change-Id: Ib8cfa284c2be522628359f7585b0a96addfd5ed4
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoDon't add the database before verification
Rob Hoelz [Tue, 22 Apr 2014 05:11:25 +0000 (00:11 -0500)]
Don't add the database before verification

The local storage facility exposed to QML has a bug; if you attempt to
open a versioned connection, the version is wrong, and you try to handle
that error, the connection is still stored in a connection pool, but in
an unopened state.  The next time you attempt to connect, no matter if
you have the version right or not, the database handle will complain
about being unopened.

See also http://qt-project.org/forums/viewthread/38458/

Task-number: QTBUG-38543
Change-Id: I921b94621009f4968144e1cc513c17b4924a792a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
10 years agoFix emission of QQmlListModel::rowsAboutToBeXxx() signals
J-P Nurmi [Tue, 27 May 2014 12:14:52 +0000 (14:14 +0200)]
Fix emission of QQmlListModel::rowsAboutToBeXxx() signals

Call beginInsertRows(), beginMoveRows() and beginRemoveRows() before
the change to ensure that rowsAboutToBeInserted(), rowsAboutToBeMoved()
and rowsAboutToBeRemoved() get emitted before the change as appropriate.

NOTE: This patch solves the problem for the most common use case, when
ListModel is used without WorkerScript. QQmlListModelWorkerAgent needs
similar changes in order to fix the signals when ListModel is used with
WorkerScript (QTBUG-39321).

Task-number: QTBUG-39279
Change-Id: Idec5167d70b242f6f7d8b7cff008e130afc62505
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoFix QSGPlainTexture object leak
Liang Jian [Wed, 28 May 2014 04:48:56 +0000 (12:48 +0800)]
Fix QSGPlainTexture object leak

Delete m_texture in the destructor of QSGTextMaskMaterial class

Change-Id: I0f3c59d2c5f094dcbc02eafa6ed782d16315eb44
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix tst_textinput.qml
Bernd Weimer [Wed, 14 May 2014 08:47:48 +0000 (10:47 +0200)]
Fix tst_textinput.qml

On platforms that have QT_NO_CLIPBOARD defined copy/paste/cut functions
are not available.

Change-Id: I28be021f45cd5a5fe8aaad2752d379c3eebea8cf
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
10 years agoQQuickWidget: Support drag and drop
Paul Olav Tvete [Mon, 26 May 2014 12:04:16 +0000 (14:04 +0200)]
QQuickWidget: Support drag and drop

Relay drag/drop events to the offscreen QQuickWindow.

Task-number: QTBUG-39167
Change-Id: Iaf59fb899d16ac96fc94f1df8c3a939e9bd0f92f
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
10 years agoFix type of AnimationController::animation in documentation.
Mitch Curtis [Fri, 23 May 2014 12:15:55 +0000 (14:15 +0200)]
Fix type of AnimationController::animation in documentation.

Change-Id: I3122ba1d7e9f1c396bef347cd1fd7df8ab32ff47
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoPhotoviewer: Allow using the Android back button to go back.
Niels Weber [Thu, 22 May 2014 15:02:59 +0000 (17:02 +0200)]
Photoviewer: Allow using the Android back button to go back.

Don't show back button on Android, as the system back button can
now be used.

Task-number: QTBUG-38122
Change-Id: Ia3a677f4626eaf34e23dfcc7997e4b850d8b7020
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
10 years agoFix compilation on MSVC 2008
Simon Hausmann [Fri, 23 May 2014 08:05:51 +0000 (10:05 +0200)]
Fix compilation on MSVC 2008

We are using std::lower_bound on a vector where the item we search for
is of a different type than the items in the container. MSVC 2008's STL
is very happy to check all sorts of constraints and also compare the order
of items within the container. That means it tries to call the compare function
not only with the key we're searching and one item but also two items from
the container. The existing compare function can't satisfy that constraint,
so instead we'll go back to the old approach of a proper functor that
operates outside of the class scope, in order to build with older compilers.

That functor now offers all necessary overloads.

Task-number: QTBUG-38873
Change-Id: I6f350106f98cb03a4ff7e1671a84e67f629cedd3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
10 years agoFix crash (failing assertion) when declaring a non-string id property
Simon Hausmann [Wed, 21 May 2014 14:11:24 +0000 (16:11 +0200)]
Fix crash (failing assertion) when declaring a non-string id property

This isn't very useful QML, but the following was "legal" in 5.1:

    property int id:
    id: foo

The integer property was not set, but the object's name (id) was still set.
With 5.3 this causes a failing assertion, which shouldn't happen. We should
do the same thing as the old code in QQmlComponent::buildProperty did for
id properties: Set them only if they're of string type.

Task-number: QTBUG-38463
Change-Id: I0da58557fbfb0944f53127e0ee77117ac33ce250
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix QQmlScriptString::isEmpty for script strings without source code
Simon Hausmann [Wed, 21 May 2014 10:19:15 +0000 (12:19 +0200)]
Fix QQmlScriptString::isEmpty for script strings without source code

The source code is not strictly required anymore and QQmlScriptString should
return true with isEmpty() if the object is conceptually empty (not usable),
not only when the source code is empty. It can still have a valid binding id
and thus be used in QQmlExpression.

Change-Id: I777717f2217d0c46e059c382761a1044881c5978
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agodeduplicate and decruft SUBDIRS list
Oswald Buddenhagen [Fri, 23 May 2014 15:54:48 +0000 (17:54 +0200)]
deduplicate and decruft SUBDIRS list

Change-Id: I56266efbe1623a529c3cf3609254abda443cf940
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoFix crash when sharing data structures between 32-bit and 64-bit
Simon Hausmann [Wed, 21 May 2014 08:34:29 +0000 (10:34 +0200)]
Fix crash when sharing data structures between 32-bit and 64-bit

The data structures in QV4::CompiledData are intended to be shareable
between different architectures (if endianness is the same). This requires
us to pack them, which is possible with MSVC and GCC (which also includes
clang)

Change-Id: I078254b9d314f60f8973a0c9404f53af41a48fb8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix cached compilation units for file imports
Simon Hausmann [Mon, 19 May 2014 10:22:55 +0000 (12:22 +0200)]
Fix cached compilation units for file imports

If the file doesn't exist in the file system anymore, check if it's at
least in the unit cache, as we can still load it from there. This is
used for file imports where 'import "someDirectory"' results us in trying
to locate someDirectory/<Type>.qml for any instantiation of <Type>.

Change-Id: I590161f1d2d133a49ca1b611d9a7e96d52d0bf13
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoV4 JIT: fix usage of d1 on ARM.
Erik Verbruggen [Mon, 19 May 2014 12:35:04 +0000 (14:35 +0200)]
V4 JIT: fix usage of d1 on ARM.

The d1 register is used by the JIT as a scratch register, so it is not
available for the register allocator. If it would be used for register
allocation, the JIT code generation might override it with something
else, thereby clobbering the result.

Change-Id: Iaf7db873d78e84c28ac9ea341f9d6da76330fe81
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRecord synchronous and asynchronous events separately in profiler test
Ulf Hermann [Thu, 22 May 2014 10:18:44 +0000 (12:18 +0200)]
Record synchronous and asynchronous events separately in profiler test

Render events as well as frame painting and keyboard and mouse
interaction happen largely independently of QML engine events. We
cannot rely on a specific composite order of both types. The tests
are written in a way that allows us to rely on a specific order
within each group, though.

Pixmap cache events are a special case and need their own category
as the load start events are synchronous while all others are
asynchronous. Still, there is a defined ordering between them.

Task-number: QTBUG-39169
Change-Id: I35220a22dcb08ea0bb7286e27347c287a5ce7983
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoSamegame: Add qsqlite as a needed QTPLUGIN
Caroline Chao [Wed, 21 May 2014 08:35:33 +0000 (10:35 +0200)]
Samegame: Add qsqlite as a needed QTPLUGIN

Required plugin are currently not detected automatically (QTBUG-35195).

Change-Id: I58e21ff2219ed5ef3042a07d19dbfa914a10f2e5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
10 years agoMark clip node dirty regardless of how its geometry was changed.
Gunnar Sletta [Wed, 21 May 2014 15:19:50 +0000 (17:19 +0200)]
Mark clip node dirty regardless of how its geometry was changed.

Task-number: QTBUG-38473
Change-Id: If6f91f1a82b89de01d254af34128b9aefebaad2d
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
10 years agoRe-enable qquicktextinput test on Mac OS X
Simon Hausmann [Fri, 25 Apr 2014 11:15:52 +0000 (13:15 +0200)]
Re-enable qquicktextinput test on Mac OS X

Fixed in qtbase with commit 40b195d0f9ee7ef1b917a635bb073fa108b2ed40

Change-Id: I4af6080dde9c6356c11f09a6ded86ce9ce28b6e0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
10 years agoFix failing assertion inside MSVC STL in debug builds
Simon Hausmann [Tue, 29 Apr 2014 12:45:13 +0000 (14:45 +0200)]
Fix failing assertion inside MSVC STL in debug builds

When using FunctionObject's call() method, we use std::copy to copy the
arguments over to the new call context. Unfortunately std::copy has an
assertion in there to check that we're not copying out of bounds.  What the STL
doesn't know is that the Value args[1] array is dynamically allocated and
easily expands beyond just one entry.

Fall back to copying by hand to work around this issue.

Task-number: QTBUG-38195
Change-Id: I6e254b1c893ccf5cad2358179cda1b07b00228e0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix Number.toExponential with parameter
Simon Hausmann [Tue, 29 Apr 2014 15:15:55 +0000 (17:15 +0200)]
Fix Number.toExponential with parameter

The fractionDigits parameter was unfortunately ignored, due to an accidental
double variable declaration, the latter in a narrower scope shadowing the
former in the correct scope.

Task-number: QTBUG-38577
Change-Id: I28f35466d2d744e84b86a3ca6b3371eb86869b55
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDon't crash on Android
Paul Olav Tvete [Wed, 21 May 2014 12:10:02 +0000 (14:10 +0200)]
Don't crash on Android

If the platform plugin does not support the features needed
for QQuickWidget, then don't try to use it. This is a minimal
change to stop applications from crashing: it does not give
the application a way to find out if QQuickWidget is supported,
since that would mean new API, which we can't do in a patch
release.

Task-number: QTBUG-38268
Change-Id: I975a03b105b1d5c21a1d8ae440a5802ce8c1967b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoFix copy and paste error
Frederik Gladhorn [Wed, 14 May 2014 11:39:16 +0000 (13:39 +0200)]
Fix copy and paste error

Fix error 14 identified by static analysis from
http://www.viva64.com/en/b/0251/

Change-Id: I5f0fa6bd1f14db8e4a86c27610666df6dfd60b1c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix copy and paste error
Frederik Gladhorn [Wed, 14 May 2014 11:25:23 +0000 (13:25 +0200)]
Fix copy and paste error

Fix error 10 identified by static analysis from
http://www.viva64.com/en/b/0251/

Change-Id: I42ba9caa43c2c4925774bdc6aa7942a83cb37ba5
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFocus event fix for QQuickWidget
Paul Olav Tvete [Wed, 21 May 2014 08:49:07 +0000 (10:49 +0200)]
Focus event fix for QQuickWidget

Relay focus in/out events to the offscreen QQuickWindow, and also
make the offscreen window believe it has the focus when the
render window has it.

Task-number: QTBUG-39033
Change-Id: Ib50b134e635833ad3813693ca272f04607c525b8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
10 years agoMake a pro file based project out of the photoviewer example
Niels Weber [Mon, 12 May 2014 11:27:24 +0000 (13:27 +0200)]
Make a pro file based project out of the photoviewer example

Having a .pro file project is necessary to be able to deploy to
Android. Further patches for Android support will be needed, but
this is the base.

Task-number: QTBUG-38122
Change-Id: I878ec1df50d7375ae9153f8a34f763b5678d7774
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Reviewed-by: Sami Makkonen <sami.makkonen@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
10 years agoMerge remote-tracking branch 'origin/release' into stable
Iikka Eklund [Tue, 20 May 2014 10:26:14 +0000 (13:26 +0300)]
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I939d6b9d10b3f50d9024b80d7a215b8fd04e8d56

10 years agoFix improper antialiasing property behavior
Oleg Shparber [Mon, 19 May 2014 07:53:39 +0000 (00:53 -0700)]
Fix improper antialiasing property behavior

For components antialiased by default the property was returned
as false if default true value was set to true again.

Task-number: QTBUG-39047
Change-Id: I16960a12b6d38a0d9e487fc6612610c39c4949d4
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoFix tst_qquicktextedit::cursorRectangle_QTBUG_38947()
J-P Nurmi [Sat, 17 May 2014 10:42:43 +0000 (12:42 +0200)]
Fix tst_qquicktextedit::cursorRectangle_QTBUG_38947()

Fix the uninitialize variable and make sure the test creates
a window that has a sensible (200x200) size.

Change-Id: I02616ab3c832276921e84ae98b7ed926d8fc5f5e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
10 years agoFix crash with running animators on re-shown windows.
Gunnar Sletta [Thu, 15 May 2014 19:01:06 +0000 (21:01 +0200)]
Fix crash with running animators on re-shown windows.

The non-threaded render loops would clean up the nodes for a window
when it was hidden, but the animators kept running and had a reference
to the deleted nodes. This was not a problem for the threaded render
loop as it would wipe the animator controller as well which would
clean the jobs.

Fix it by triggering a reset of all nodes in the animators when the
window is told to clean up. If an animator is ticked when it doesn't
have a node, it will simply do nothing. When the window is made visible
again, we call initialize on all animators to find the new node.

Task-number: QTBUG-37995
Change-Id: Ie5609d95db29f4b2b30ca5bf641dce901e528389
Reviewed-by: Michael Brasser <michael.brasser@live.com>
10 years agoTextEdit: fix cursor rectangle positioning
J-P Nurmi [Mon, 12 May 2014 16:09:08 +0000 (18:09 +0200)]
TextEdit: fix cursor rectangle positioning

QQuickTextControl::cursorRectangleChanged() wasn't emitted as
appropriate when dragging mouse => The cursor delegate was stuck
in wrong position under certain circumstances, especially when
selecting multiple lines.

Task-number: QTBUG-38947
Change-Id: Ib5b0d2f6ea2a1b3712fbaba4a7ad1865d2b0a74e
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
10 years agoAccessibility: add focus action
Frederik Gladhorn [Tue, 13 May 2014 15:45:17 +0000 (17:45 +0200)]
Accessibility: add focus action

This at least implements the focus action for items with activeFocusOnTab
which works with most controls. VoiceOver for example uses this action.

Task-number: QTBUG-38870
Change-Id: I3bdaacec6b07e9baf020499e2e4826e42fe316f0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
10 years agoDoc: Polish property binding explanations
Sze Howe Koh [Tue, 13 May 2014 23:59:18 +0000 (07:59 +0800)]
Doc: Polish property binding explanations

- Minor rearrangements
- Express things more clearly and/or concisely
- Add links

Change-Id: If1ed639609e39ed1a2c12aed3971da3ee2c8f8a0
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoDoc: Describe property bindings in terms of relationships
Sze Howe Koh [Wed, 14 May 2014 14:33:34 +0000 (22:33 +0800)]
Doc: Describe property bindings in terms of relationships

- This patch aims to help readers think about bindings more
  "declaratively" by introducing a new (albeit very leaky) level of
  abstraction: Treat bindings as finitary relations, rather than mere
  JavaScript expressions.

- In essence, property bindings are for describing relationships between
  properties. The fact that the QML engine reactively updates a
  property's value when its dependencies change, and the fact that
  arbitrarily complex expressions are valid bindings, are simply
  implementation details.

- Discourage the use of side effects in property bindings. They are not
  essential for the main purpose of property bindings, they break the
  finitary relation model, and their use can reduce code
  readability/maintainability/toolability.

- Discourage complex property bindings for similar reasons.

Change-Id: I5a0a03bd02768d4c504797a0f86569f3ac066e96
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoFix typo in Image documentation.
Mitch Curtis [Thu, 15 May 2014 11:31:16 +0000 (13:31 +0200)]
Fix typo in Image documentation.

Change-Id: Ifa01f3e464c170e5f4739cea4380f1b08eeccc7e
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
10 years agoV4 IR: change BasicBlockSet::const_iterator to use std::find.
Erik Verbruggen [Thu, 8 May 2014 10:14:09 +0000 (12:14 +0200)]
V4 IR: change BasicBlockSet::const_iterator to use std::find.

When the storage in the BasicBlockSet is a std::vector<bool>, the
begin() iterator and the ++operator now use std::find. Good STL
implementations have an optimized version specifically for
std::vector<bool> that is a lot faster than the iterating that was used
before. The change also makes the code more readable.

Change-Id: Ic37bac694c133c597b3d61a91b04a0b758516dc3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix regression in QJSValueIterator::next() since Qt 5.1.1
Gunnar Sletta [Wed, 14 May 2014 07:30:37 +0000 (09:30 +0200)]
Fix regression in QJSValueIterator::next() since Qt 5.1.1

Iteration on the form "while (next) { .. }" would skip
the last element.

Change-Id: I50692a5a75e23e423e82b7a39e1892f505e4c612
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoDoc: add docs for Photo Surface demo
Leena Miettinen [Wed, 7 May 2014 13:44:17 +0000 (15:44 +0200)]
Doc: add docs for Photo Surface demo

Change-Id: Id6f40b1b769fdd103cfb2afda172b1daf9b1a105
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
10 years agoImplement proper support for layoutChange in QQmlDelegateModel
Daniel Vrátil [Wed, 16 Apr 2014 16:33:24 +0000 (18:33 +0200)]
Implement proper support for layoutChange in QQmlDelegateModel

Current implementation is treating model layoutChange the same way as modelReset,
which causes problems when using ListView on top of a QSortFilterProxyModel. The
model emits layoutChanged whenever a data within sorting column change. Treating
it as modelReset leads to poor performance on large models and caused UI issues,
because the scrolling position is reset every time.

This patch implements proper handling for layoutChanged signals by first handling
all items moves and then simulating dataChange for all items.

This fixes regression from Qt 5.1 introduced by Change I16b859d9

Task-number: QTBUG-37983
Task-number: QTBUG-34391
Change-Id: I6d3873b7b87e7f0e8fc0c1ed5dc80c6f8fdf6c22
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Michael Zanetti <michael.zanetti@canonical.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
10 years agoDoc: Fix invalid cross-reference
Kevin Funk [Sun, 11 May 2014 16:55:39 +0000 (18:55 +0200)]
Doc: Fix invalid cross-reference

Change-Id: Ib344215f240705100da8d949ac86b57af26a97ef
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
10 years agoFix QJSEngine::evaluate using the wrong execution context
Simon Hausmann [Mon, 5 May 2014 13:45:54 +0000 (15:45 +0200)]
Fix QJSEngine::evaluate using the wrong execution context

In contrary to what the documentation says, QJSEngine in Qt 5.x executes
in the context of the global object (QScriptIsolate always called enter
on the QV8Engine's "root" context, thus making it current). The v4
implementation unfortunately did what the documentation said and used
the current context, which is wrong in many ways. For example it completely
breaks the optimization of stack allocated contexts, because when a C++
callback is called from within a JS function with a stack allocated context
and that C++ code calls QJSEngine::evaluate and creates new closures, the
stack context would become an outter context and cause crashes during GC.

This patch restores the behavior of Qt 5.0/5.1 and fixes the documentation.

Task-number: QTBUG-38530
Change-Id: Ie6481f02e676954cc94b188a1c87c88e7c56dafa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix crash on host/target word size mismatches
Simon Hausmann [Wed, 7 May 2014 11:51:26 +0000 (13:51 +0200)]
Fix crash on host/target word size mismatches

When compiling on a 64-bit host and using the QV4::CompileData on a 32-bit
target, the size of QArrayData is different. Therefore we cannot use it in
the QV4::CompiledData and have to resort to storing only the characters in
there. We can at least still use fromRawData when extracting strings, but the
QStringData will have to be allocated now.

Change-Id: Ia9dab1722ed72186451b65ba74457051c6ce3155
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
10 years agoFix some typos in usage string.
Jeff Tranter [Thu, 8 May 2014 20:37:14 +0000 (16:37 -0400)]
Fix some typos in usage string.

Fix some spelling errors in the command usage string.

Change-Id: Iee94987d0a3dff78e39f588b4c21415ed40a514c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
10 years agoFix tst_textedit.qml
Bernd Weimer [Tue, 29 Apr 2014 06:51:58 +0000 (08:51 +0200)]
Fix tst_textedit.qml

On platforms that have QT_NO_CLIPBOARD defined copy/paste/cut functions
are not available.

Change-Id: Ia2c82d0d3910f89642b1c3ef719caee88da3999e
Reviewed-by: Damian Jansen <damian.jansen@gmail.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
10 years agoRemove V8 profiler service
Ulf Hermann [Wed, 7 May 2014 09:21:40 +0000 (11:21 +0200)]
Remove V8 profiler service

It's broken and useless and it sends confusing data to the profiler
client.

Task-number: QTCREATORBUG-12188
Change-Id: I944cf19a78ee4378d5773e7aa80876f199a0f03b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
10 years agoV4 IR: remove unused fields from BasicBlock
Erik Verbruggen [Thu, 8 May 2014 08:52:00 +0000 (10:52 +0200)]
V4 IR: remove unused fields from BasicBlock

Also reserve maximum used size for the in/out edge vectors.

Change-Id: I227a2aa0a5211a6425da3aa7318daa120eadfd6c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoRe-fix the warning from cached-powers.cc
Thiago Macieira [Thu, 8 May 2014 06:58:01 +0000 (23:58 -0700)]
Re-fix the warning from cached-powers.cc

This file is now getting included in a different module. See also
e02cb2b31ab0b171f11d278305d9f532f005bc80,
60aed669345be33b916c44556555b922aa3ed928, and
66e72c2cf08c2d2c381c6c22e4760d0df758af52.

Change-Id: Ic886bdf823d5dd6d9ae3df64608d8bb9d901661f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
10 years agoAndroid: Add support for new input method query API
Paul Olav Tvete [Wed, 7 May 2014 13:02:29 +0000 (15:02 +0200)]
Android: Add support for new input method query API

Change 93fd268d implemented the new API, but missed the final
piece that actually made use of it.

Task-number: QTBUG-38824
Change-Id: Iea28f2cbb8c6d749d781dcf7437552597977f9ac
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
10 years agoItem views: prevent negative cache buffer
J-P Nurmi [Tue, 6 May 2014 10:22:32 +0000 (12:22 +0200)]
Item views: prevent negative cache buffer

A negative cache buffer does not make much sense, and the item views
would go crazy and start creating/destructing delegates endlessly.

Task-number: QTBUG-38725
Change-Id: I1fbba1f3130a99af67fbc4c2aba4d3199d0554a9
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>