QML types without their own properties end up with parent's type name

Bug #1182369 reported by Nick Dedekind
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Autopilot Qt Support
New
Undecided
Unassigned

Bug Description

Found this in the Indicators. Not sure if it's a problem with autopilot or qt.
If the subclass does not have it's own local properties the class name end's up at the first ancestor which does.

eg: (from indicators-client)

"BasicMenu.qml"
ListItem.Standard {
    property bool listViewIsCurrentItem : false
    property QtObject menu
    . . .
}

"Menu.qml"
BasicMenu {
    . . .
    color: "#221e1c"
    HLine { ... }
    HLine { ... }
    . . .
}

"SwitchMenu.qml"
Menu {
    id: _switchMenu
    . . .
   control: Switch { ... }
   DBusActionState { ... }
    . . .
}

self.app.select_single("SwitchMenu", "_switchMenu") returns None
self.app.select_single("*", "_switchMenu") returns a BasicMenu_QMLTYPE_XXX

If you add a local property to SwitchMenu (eg property alias checked : switch.checked)
self.app.select_single("SwitchMenu", "_switchMenu") returns a SwitchMenu_QMLTYPE_XXX

Could be something to do with the metaType className ?

description: updated
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Yes, this is known. Thing is, that's an optimisation of the QQmlEngine itself. By the time autopilot-qt introspects the Object tree this has already happened. So not really sure if there is anything I can do. I guess the only solution would be to disable that optimisation feature in the QQmlEngine. Not sure if its worth the efforts tho. If you have and ideas how deal with this, it would be more then welcome.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.