[SOLVED (work-around)] QML Calling overriden functions
Hi, I’m playing with inheritance in QML and don’t know how to call an overridden function. Below is a simple example that, hopefully, explains what I’m trying to do.
Thanks in advance.
Yours
/peter
Parent.qml:
- import QtQuick 1.1
- Rectangle {
- function foo() {
- console.log("Foo in parent")
- }
- }
Child.qml:
- import QtQuick 1.1
- Parent {
- function foo() {
- console.log("Foo in child")
- // here is the problem. Would like to do something like: Parent::foo()
- }
- }
Output:
- Foo in child
While I would like it to be:
- Foo in child
- Foo in parent
7 replies
https://bugreports.qt-project.org/browse/QTBUG-25942 and https://bugreports.qt-project.org/browse/QTBUG-26357 are related to this issue. Both of these are in scope for Qt 5.1.
Cheers,
Chris.
You must log in to post a reply. Not a member yet? Register here!


