1

I am relatively new to sailfish OS programming and while using the silicaFlickable for opening new page depending on the option provided by the user.

output of multiple screens

I see the output of multiple screens and am unable to find anything regarding the help in the documentation of qt. My code is:

ApplicationWindow
{
    id: mainPage
    SilicaFlickable{
        anchors.fill: parent
        PullDownMenu {
            id:pullDownMenu
            MenuItem{
                id: decimalTo
                text: qsTr("Decimal")
                onClicked: pageStack.push(Qt.resolvedUrl("./pages/Decimal.qml"))
            }
            MenuItem{
                id:binaryTo
                text: qsTr("Binary")
                onClicked: pageStack.push(Qt.resolvedUrl("./pages/Binary.qml"))
            }
        }
        /*cover: Qt.resolvedUrl("cover/CoverPage.qml")
        allowedOrientations: defaultAllowedOrientations*/
        Column{
            anchors.fill: parent
            anchors.margins: Theme.paddingLarge
            spacing: Theme.paddingLarge
            PageHeader{
                title: "Number system convertor"
            }
            Label
            {
                width: parent.width
                anchors.leftMargin: Theme.paddingLarge
                anchors.rightMargin: Theme.paddingLarge
                horizontalAlignment: Text.AlignHCenter
                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
                textFormat: Text.RichText
                text: "Please select the input number system from the flickable menu. Pull down to see the options."

            }
        }
    }
}

The decimal or the binary page that opens is currently just the default firstpage.qml and secondpage.qml that get generated when we make a new project.

PS: I am restarting coding after a long time and this is my first app.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
wm_r
  • 11
  • 2

1 Answers1

0

You should try to wrap the inner of ApplicationWindow in a Page object:

ApplicationWindow {
  Page {
    id: mainPage
    SilicaFlickable {
      ...
    }
  }
}

But normally you would do sth like

// myApplication.qml
import QtQuick 2.0
import Sailfish.Silica 1.0

ApplicationWindow {
    id: mainWindow
    initialPage: Qt.resolvedUrl("MainPage.qml")
}

// MainPage.qml
import QtQuick 2.0
import Sailfish.Silica 1.0

Page {
  id: mainPage
  ....
}
Neversun
  • 21
  • 4