Merge lp:~thomir-deactivatedaccount/autopilot-qt/fix-1218971 into lp:autopilot-qt

Proposed by Thomi Richards
Status: Needs review
Proposed branch: lp:~thomir-deactivatedaccount/autopilot-qt/fix-1218971
Merge into: lp:autopilot-qt
Diff against target: 15 lines (+5/-0)
1 file modified
driver/qtnode.cpp (+5/-0)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/autopilot-qt/fix-1218971
Reviewer Review Type Date Requested Status
Olivier Tilloy (community) Needs Fixing
PS Jenkins bot continuous-integration Approve
Autopilot Hackers Pending
Review via email: mp+197436@code.launchpad.net

This proposal supersedes a proposal from 2013-09-10.

Commit message

Add support for QQuickRootItem.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote : Posted in a previous version of this proposal

I’m testing with the example QML attached to bug #1218971, and it’s definitely better, but I’m now seeing two instances of the Dialog component as children of the QQuickRootItem (with the same id, so it’s the same instance listed twice). That’s one too many.

review: Needs Fixing
Revision history for this message
Olivier Tilloy (osomon) wrote : Posted in a previous version of this proposal

Looks good, and I verified that it fixes bug #1218971. Thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote : Posted in a previous version of this proposal

Looks like this fails to build now:

/usr/include/c++/4.8/ext/new_allocator.h:120:4: error: no matching function for call to ‘QtNode::QtNode(QQuickItem*, std::basic_string<char>)’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
/usr/include/c++/4.8/ext/new_allocator.h:120:4: note: candidates are:
qtnode.cpp:48:1: note: QtNode::QtNode(QObject*)
 QtNode::QtNode(QObject* obj)
 ^
qtnode.cpp:48:1: note: candidate expects 1 argument, 2 provided
qtnode.cpp:40:1: note: QtNode::QtNode(QObject*, QtNode::Ptr)
 QtNode::QtNode(QObject *obj, QtNode::Ptr parent)
 ^
qtnode.cpp:40:1: note: no known conversion for argument 2 from ‘std::basic_string<char>’ to ‘QtNode::Ptr {aka std::shared_ptr<const QtNode>}’
In file included from qtnode.cpp:1:0:
qtnode.h:27:7: note: QtNode::QtNode(const QtNode&)
 class QtNode: public xpathselect::Node, public std::enable_shared_from_this<QtNode>
       ^
qtnode.h:27:7: note: candidate expects 1 argument, 2 provided
qtnode.h:27:7: note: QtNode::QtNode(QtNode&&)
qtnode.h:27:7: note: candidate expects 1 argument, 2 provided

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good and I verified that it fixes bug #1218971.

However I’m also seeing that all elements that are parented to the window appear twice in the hierarchy of objects: once under QQuickWindow, and once under QQuickRootItem. See for yourself with this example:

    import QtQuick 2.0
    import QtQuick.Window 2.0
    import Ubuntu.Components 0.1
    Window {
        width: units.gu(40)
        height: units.gu(20)
        Button {
            text: "test"
        }
    }

This will probably break existing tests that make use of select_single(…).
Ideally, QQuickRootItem shouldn’t appear in the hierarchy of objects, its children should be parented to the QQuickWindow directly (and de-duplicated if needed).

review: Needs Fixing

Unmerged revisions

74. By Thomi Richards

Merged trunk, fixed build error.

73. By Michael Zanetti

revert last change

72. By Michael Zanetti

dummy change to make jenkins pick it up

71. By Michael Zanetti

correctly add QQuickRootItem to the list of QQuickWindow's childs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'driver/qtnode.cpp'
2--- driver/qtnode.cpp 2013-09-03 04:45:05 +0000
3+++ driver/qtnode.cpp 2013-12-02 20:36:52 +0000
4@@ -188,6 +188,11 @@
5 }
6 }
7
8+ QQuickWindow* window = qobject_cast<QQuickWindow*>(object_);
9+ if (window) {
10+ children.push_back(std::make_shared<QtNode>(window->contentItem(), shared_from_this()));
11+ }
12+
13 #else
14 foreach (QObject *child, object_->children())
15 {

Subscribers

People subscribed via source and target branches

to all changes: