3

I am developing an application with Qt and qml and I am building it for OSX, iOS and Android. The application contains a StackView which has only three pages. In the second page I have a five MenuItems and five Dialogs.

While this very simple application has an excellent performance when runs on OSX and Android, it delays up to 3-4 seconds to show the second page on iOS.

I have already tried "Qml Profiler" and I have found out that the delay happens during the creation of the qml file that describes the second page.

I have also tried "Qt Quick Compiler" (Commercial Qt) with no significant difference.

main.qml

import QtQuick 2.4
import QtQuick.Window 2.2
import QtQuick.Controls 1.4

ApplicationWindow {
    id: app
    title: "MyApp"
    width: 1024
    height: 768
    visible: true
    StackView {
        id: stackView
        anchors.fill: parent
        initialItem: firstPage
    }
    Component {
        id:firstPage
        FirstPage {
        }
    }
}

firstPage.qml

import QtQuick 2.3
import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2

Item {
    id:firstPage
    signal collectionClicked(string name)
    focus: true
    objectName: "firstPage"
    Rectangle {
        anchors.fill: parent
        color: "blue"
    }
    MouseArea {
        anchors.fill: parent
        onClicked: {
            stackView.push(Qt.resolvedUrl("SecondPage.qml"))
        }
    }
}

SecondPage.qml

import QtQuick 2.3
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2

Item {
    id: itemsPage
    signal itemClicked()

    Rectangle {
        id: myRectangle
        anchors.fill: parent
        color: "red"

        Dialog {
            id: dialog1
            height: 200
            width: 300
            //onAccepted: ;
        }
        Dialog {
            id: dialog2
            height: 200
            width: 300
            //onAccepted: ;
        }
        Dialog {
            id: dialog3
            height: 200
            width: 300
            //onAccepted: ;
        }
        Dialog {
            id: dialog4
            height: 200
            width: 300
            //onAccepted: ;
        }
        Dialog {
            id: dialog5
            height: 200
            width: 300
            //onAccepted: ;
        }

        Menu {
            id: myMenu
            title: "Menu"
            MenuItem {
                text: "Test"
                //onTriggered: ;
            }
            MenuItem {
                text: "Test"
                //onTriggered: ;
            }
            MenuItem {
                text: "Test"
                //onTriggered: ;
            }
            MenuItem {
                text: "Test"
                //onTriggered: ;
            }
            MenuItem {
                text: "Test"
                //onTriggered: ;
            }
        }
    }


    MouseArea {
        anchors.fill: parent
        onClicked: stackView.push(Qt.resolvedUrl("ThirdPage.qml"));
    }
}

ThirdPage.qml

import QtQuick 2.0

    Item {
        Rectangle {
            anchors.fill: parent
            color: "green"
            Text {
                text: "third page"
            }
        }
    }

I have tried for such a long to find a solution. And I think that it is impossible that there is nobody that has ever tried to make a simple qml application for iOS and faced what I have faced.

Thank you, Michael

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
willy
  • 487
  • 5
  • 21
  • Is it slow on the emulator or the device? QML needs OpenGL and that could be slow on an emulator. I have a similar architecture on my app and no performance issues. – Hubi Feb 03 '16 at 13:50
  • 1
    We can't simply answer a question which can be summed up as "my app is slow on iOS". How could we? Generally speaking due to technical limitations you don't have JIT on iOS which result in slower execution. That being said, further guessing is pointless without some code to figure out your setting. – BaCaRoZzo Feb 03 '16 at 16:52
  • @Hubi : I am deploying the application on an iPad device and the delay of loading the 2nd has a significant delay (more then 3 seconds). I have the full code, so you can try it yourself. I trust you that you did not have any performance issues, but I really cannot find out, what am I missing. – willy Feb 05 '16 at 10:40
  • @BaCaRoZzo : Thank you for your fast response. I added all my code, but I think that I am doing something wrong, because my application is very simple and the delay big (more than 3s). – willy Feb 05 '16 at 10:43
  • did you solve your problem? I have the same problem. – Bob Feb 14 '17 at 17:59
  • @Mikhail : sorry for my late response. I did not check the above behaviour in the new versions of Qt. I had tried to make my own custom Dialog (based on Rectangle) and creating my CustomDialog instances on demand. Those two, improved my performance in IOS. I know that I am not answering your question, but at that point I had proffered to avoid using Dialog. – willy Mar 13 '17 at 13:45
  • @michalis ok thank you I will keep it in mind – Bob Mar 13 '17 at 14:23

0 Answers0