[Interest] Aliases to children properties

Николай Шатохин n.shatokhin at gmail.com
Thu Apr 11 13:08:01 CEST 2013


Hello.

I created dialog:

import QtQuick 2.0

import Ubuntu.Components 0.1

import Ubuntu.Components.Popups 0.1


Item {

    signal confirmed;

    signal canceled;


    property alias title: dialog.title

    property alias text: dialog.text


    signal show(variant caller);


    Component {

         id: dialogComponent


         Dialog {

             id: dialog

             title: "Exit Game"

             text: "Are you sure that you want to exit?"


             Button {

                 text: "cancel"

                 onClicked:

                 {

                     canceled();

                     PopupUtils.close(dialog);

                 }

             }

             Button {

                 text: "confirm"

                 color: "orange"

                 onClicked:

                 {

                     confirmed();

                     PopupUtils.close(dialog);

                 }

             }

         }

    }


    onShow:

    {

        PopupUtils.open(dialogComponent, caller)

    }

}


But I has problem:


qrc:/ConfirmationDialog.qml:8:23: Invalid alias reference. Unable to
find id "dialog"


So, how to create this aliases?


Best regards,

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130411/491c5dc2/attachment.html>


More information about the Interest mailing list