(solved)Simple problem in qml



  • (sorry for my bad english)
    Hello, I am a qml beginner and i have a little problem. I'm trying to do an app for symbian belle devices.
    Here the problem: I want to replace a page content with another page content using a checkbox, but idon't know to do that. Maybe the problem will be more clear seeing the example below.

    I have 3 different pages.
    1°Page code:
    @
    import QtQuick 1.1
    import com.nokia.symbian 1.1

    Page {
    SelectionListItem {
    id: selectionlistitem1
    x: 0
    y: 48
    subItemIndicator: false
    title: "SelectionListItem"
    }

    Rectangle {
        id: rectangle1
        x: 71
        y: 174
        width: 200
        height: 200
        color: "#e41c1c"
    }
    

    }
    @
    2°Page content:
    @
    import QtQuick 1.1
    import com.nokia.symbian 1.1

    Page {
    ProgressBar {
    id: progressbar1
    x: 90
    y: 92
    }

    TextField {
        id: help
        x: 81
        y: 164
        width: 180
        height: 50
        text: "TextField"
    }
    

    }
    @
    In the page 3:
    @
    import QtQuick 1.1
    import com.nokia.symbian 1.1
    Page{
    CheckBox {
    id: checkbox1
    x: 112
    y: 139
    text: "CheckBox"
    }

    }
    @

    Now i want that if I check the checkbox in the page3 the content of First page will be replaced by the content of second page. Please help me.

    [EDIT: Added @ code tags for formatting; mlong]



  • Take a look at the QML Loader{} element.

    The key is when to set source="" or source="page1.qml".

    Maybe this will help.



  • Oh, Thank you very much. It was quite simple!


  • Moderators

    Be sure and label the thread as [Solved]. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.