call in QML Appworld

Hello good evening brothers, how could invoke in QML Appworld to use an icon in my app with it.

Here's some code for you

Page {
            id: tab2
            Button {
                id: awbutton
                text: "Click me"
                attachedObjects: [
                          Invocation {
                                id: invoke
                                query: InvokeQuery {
                                mimeType: "application/x-bb-appworld"
                                uri: "appworld://content/124432"
                                }
                        }
  ]

            onClicked: {
            invoke.trigger("bb.action.OPEN")
              }

        }
}

Tags: BlackBerry Developers

Similar Questions

  • Trouble to C++ signal to call a QML slot

    Hello

    I can't get a signal from C++ code to call a function of slit in my QML.  I have currently resembles right (compared to the examples I have seen online), but the slit function is never called.  Can you see a problem?  Here is my code:

    applicaitonui. HPP:

    class ApplicationUI: public QObject {
    Q_OBJECT
    public:
        ApplicationUI(bb::cascades::Application *app);
    
        virtual ~ApplicationUI() {
        }
    
    signals:
        void successfulAuthentication();
    
    private:
        ActivityIndicator *mActivityIndicator;
        QNetworkAccessManager *mNetworkAccessManager;
    };
    
    #endif
    

    applicationui.cpp:

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app) {
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("app", this);
    
        AbstractPane *root = qml->createRootObject();
    
        mActivityIndicator = root->findChild("indicator");
    
        connect(this, SIGNAL(successfulAuthentication()), root,
                SLOT(onSuccessfulAuthentication()));
    
        // set created root object as a scene
        app->setScene(root);
    }
    

    main.cpp:

    ...
    
    emit successfulAuthentication();
    
    ...
    

    hand. QML:

    // Default empty project template
    import bb.cascades 1.0
    import bb.system 1.0
    
    NavigationPane {
        id: navigationPane
        Page {
            id: loginPage
            Container {
                layout: StackLayout {
                    orientation: LayoutOrientation.TopToBottom
                }
    
                ...
            }
        }
        function onSuccessfulAuthentication() {
            console.log("onSuccessfulAuthentication()");
        }
    }
    

    I don't know if it is possible to connect on the side of C++, but in QML, you can do something like:

    NavigationPane {
      onCreationCompleted: {
        app.successfulAuthentication.connect(onSuccessfulAuthentication)
    

    Or use the element of {QtQuick 1.0 connections (it should be placed in attachedObjects):

    http://supportforums.BlackBerry.com/T5/Cascades-development/QML-connections-element/m-p/2063301#M955...

  • call a QML file code c ++

    Hello.

    I am newbie to blackberry 10 development...

    actaully I got the credentials to the server and power analyzes the user name and password...

    now I have to redirect to the new file qml by c ++.

    So I will be gratefull if you guide or help me...

    Thanks to anticipate...

    You should find a lot of code when you check out the samples.

    to send a signal of c ++ you define first the signal in the header. Here's an example, let's say this is in app.hpp:

    signals:
        void numberOfItems(int numberOfItems);
        void numberOfItemsError(QString message);
    

    to send the signal in c ++ you write

    emit numberOfItems(5);
    

    to receive the signal in QML, you must register at the first class (this is already done when you create a new application of waterfalls).

    Just to show you, that it would look like this:

    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    qml->setContextProperty("app", this);
    

    Qml, you connect the signal to a qml function, for example onNumberOfItems

    app.numberOfItems.connect(onNumberOfItems)
    

    the function is executed when the signal is emitted:

    function onNumberOfItems(number){
      console.log("number of items: "+number);
    }
    

    That should cover it. It gets a little more complicated when you want to send complex objects with the signal.

  • Call C++ qml button Fuctions

    Button * newButton = root->findChild ("eat");
    Connect (newButton, signal(Button::clicked()),this,slot(ont()));)

    You may need to provide a little more information for anyone to determine what the problem is. But try the link below, it has good examples of C++ / QML integration and then ask your question on this basis, with more details

    https://developer.BlackBerry.com/Cascades/documentation/dev/integrating_cpp_qml/index.html

  • Can headless part of the application calls a function QML?

    Normally, when you write code in c ++ in the part of the user interface of the code, I am able to call the function of any file QML by writing the code below.

    QmlDocument *qmldoc = QmlDocument::create("asset:///Functions.qml");
    AbstractPane *root = qmldoc->createRootObject();
    QMetaObject::invokeMethod(root, "printResult");
    

    In headless of demand, I create another qml file, called "NotificationHandler.qml" in the current folder of the game without head. In one of the file c ++ without head when I write the same thing, it gives an error indicating that

    C:/bbndk/target_10_3_0_698/qnx6/usr/include/bb/cascades/resources/qmldocument.h:366: undefined reference to `bb::cascades::QmlDocument::QmlDocument(QUrl const&)'
    

    Below, you will find all the code inside the service.cpp which is the game file without the application head.

    #include "service.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    #include 
    
    using namespace bb::cascades;
    using namespace bb::platform;
    using namespace bb::system;
    
    Service::Service() :
            QObject(),
            m_notify(new Notification(this)),
            m_invokeManager(new InvokeManager(this))
    {
        m_invokeManager->connect(m_invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)),
                this, SLOT(handleInvoke(const bb::system::InvokeRequest&)));
    
        NotificationDefaultApplicationSettings settings;
        settings.setPreview(NotificationPriorityPolicy::Allow);
        settings.apply();
    
        m_notify->setTitle("NotificationWork Service");
        m_notify->setBody("NotificationWork service requires attention");
    
        bb::system::InvokeRequest request;
        request.setTarget("com.example.NotificationWork");
        request.setAction("bb.action.START");
        m_notify->setInvokeRequest(request);
    
        onTimeout();
    }
    
    void Service::handleInvoke(const bb::system::InvokeRequest & request)
    {
        if (request.action().compare("com.example.NotificationWorkService.RESET") == 0) {
            triggerNotification();
        }
    }
    
    void Service::triggerNotification()
    {
        qDebug() << "first";
    
        QmlDocument *qmldoc = QmlDocument::create("asset:///NotificationHandler.qml");
        AbstractPane *root = qmldoc->createRootObject();
        QMetaObject::invokeMethod(root, "startNotificationService");
    
        qDebug() << "second";
        // Timeout is to give time for UI to minimize
        // QTimer::singleShot(2000, this, SLOT(onTimeout()));
    }
    
    void Service::onTimeout()
    {
        Notification::clearEffectsForAll();
        Notification::deleteAllFromInbox();
        m_notify->notify();
    }
    

    I use the same logic, but apparently it is forbidden to treat the QML files in without the request or I have made a serious mistake. Could you please help?

    I thank very you much.

    usually the part without head does not reference libraries of stunts because they have a serious memory footprint.
    The part without being limited in memory head, which gives it its own UI isn't usually a good idea.

  • Call the function QML from C++ (simple question)

    I guess that's a pretty easy question but I'm a bit new apart from development c ++ of BB10. I have a QML file in the assets folder called Functions.qml which has only onne inside functions.

    import bb.cascades 1.3
    
    Page {
        objectName: "funct"
        function printStat() {
            console.log("hello");
        }
    }
    

    In one of the functions in applicationui.cpp there is a function called resendNotification() (you may know this code from the model of the app without head)

    void ApplicationUI::resendNotification()
    {
        InvokeRequest request;
        request.setTarget("com.example.TestNotificationService");
        request.setAction("com.example.TestNotificationService.RESET");
        m_invokeManager->invoke(request);    // --> call the printStat() function of Functions.qml file
        Application::instance()->minimize();
    }
    

    My question is, before you minimize the app How can I call the function printStat() of the qml file? I have always developed my apps in QML so never had to deal with c ++. Should be easy enough to call a function well.

    Thank you in advance!

    first step is to find the object by ObjectName using findChild, usually from your element root (navigationPane).
    example:
    NAV-> findChild ("myTextField")

    If you have the object of another source that is fine too, of course.

    second step is to use QMetaObject::invokeMethod with the object and the name of the method.
    Example:
    QMetaObject::invokeMethod (container, "setText", Q_ARG (QVariant, text));

  • ImageButton error call .qml (beta 3 of waterfall)

    Hello friends, after beta 3 came the waterfall had several errors of new variables and some chains of command in my mobile, entiendiendo already realized a few fix a little problem I had this code works perfectly in Beta 3, I have a button called a qml

            ImageButton {
                id: donar
                defaultImageSource: "asset:///images/donacion.png"
                pressedImageSource: "asset:///images/donacion.png"
                layoutProperties: AbsoluteLayoutProperties {
                }
                onClicked: {
                navigationPane.deprecatedPushQmlByString("donaciones.qml");
                }
                preferredWidth: width
                preferredHeight: height
                translationX: 80.0
                translationY: -60.0
            }
    

    But when I run the application in the alpha dev and I click on the ImageButton control I opened the QML, I think it's due to the structuring of new programming language, could help me with this problem to invoke the QML?

    Greetings.

    I have the Alpha of Dev with Os 10.0.9.44

    Hello

    Please check below link

    https://developer.BlackBerry.com/Cascades/documentation/dev/dynamic_qml/index.html

    Use ComponentDefinition.

    Thank you.

    --------------------------------------------------------------------------------------------------------------------------------------------

    feel free to press the button like on the right side to thank the user who has helped you.

  • Call the InvocationManager from an application thumbnailed

    In some of my experiences to see what is happening with the problems I see in this thread:

    http://supportforums.BlackBerry.com/T5/native-development/InvokeTargetReply-finished-signal-not-FIRI...

    I try to call the method invoke() of InvocationManager while my application is thumbnailed, and none of these calls actually occur.  This is the case if I try to call using QML or C++.  When I try to call via QML, I get an error like this:

    "Call failed for action ="bb.action.OPEN", target is" sys.appworld ", reason ="BadRequest ".

    and I did not quite add enough diagnostic code to the route of C++ to see what error information is available, but before we go too far down an experiences w / these rat hole, anyone know if it is even possible to successfully invoke another application while your application is thumbnailed?

    I don't see why it shouldn't be, because your application can run code, although it's thumbnailed.

    You cannot rely on applications for benefits or cards so that your application is reduced to a minimum. Such calls will only work if your application is in the foreground. It is an intentional restriction to avoid problems UX to interrupt what the user is doing.   This is the same reason why we don't allow RFA benefits or cards from an application without a head.

  • Find all the item in the list in QML

    I use ListView to display the list item. I'll put the data in the list using datamodel.

    At some point, I want to know what that any element is in the list. Is it possible to do this?

    for ex: list.getInput that returns all list items

    Welcome on the support forums.

    check the API of the datamodel you use, for example groupdatamodel
    https://developer.BlackBerry.com/native/reference/Cascades/bb__cascades__groupdatamodel.html

    all methods marked as Q_INVOKABLE can be called from qml, for example first() and after() you can iterate through its members.

  • To access the classes of CPP in qml.

    I have set up to access the classes of PCB in qml in two ways: -.

    1. create an attached object and the id of the class of CPP special and then access via the id.

    2. fix the CPP on the qml class before pushing the page using the setContextProperty.

    I wanted to know exactly when to use these two methods. There a difference in terms of scope and memory. Please explain.

    Great Question!

    Local objects:

    Attached to objects, or who inherit from classes of cascades, is the simplest way to expose c ++ objects that relate to user interface elements. This is what you use if you want this object to BELONG to this context qml. It is created by the qml context when createObject is called (your qml file is loaded) and destroyed with the user interface objects. You can create many of these objects, anywhere you need. However, if you want to expose global properties, it is probably not a good approach.

    The only time you would use objects attached to global stuff is if you expose a singleton class to allow qml set locations to manage signals (OrientationHandler is an example of that, without an OrientationHandler object, that you have nothing to connect).

    Global objects:

    Context properties can be considered global variables for a particular context, but with inheritance: context properties are passed to the contexts of the child. These objects are the PROPERTY of c ++, must be created before the creation of the object (createObject is called) and must remain valid for the lifetime of any context, they are placed in, but then destroyed is no longer necessary.

    The disadvantage of context properties changing them can be expensive. If you set a context property after the createObject call (that is to say an object exists that was created from this context), then all links in javascript in this context will be re-evaluated. However, you can mitigate this issue by exposing an object that contains the value as a property, so that links to branch on change of signals well if necessary.

    Inheritance is where shine context properties. There is a context root, which is in this context of default parent for new contexts. If you set a context property of the root context, it is available everywhere in any document qml. Here is an example of how do:

    QmlDocument::defaultDeclarativeEngine()->rootContext()->setContextProperty("app", myApp);
    

    Note: when I speak of createObject, I'm talking about QDeclarativeContext::createObject. It is called internally by QmlDocument::createRootObject.

    For more information on the Qml contexts, see http://qt-project.org/doc/qt-4.8/qdeclarativecontext.html

    For more information about the inner workings of qtdeclarative, see http://qt-project.org/doc/qt-4.8/qdeclarativeengine.html and http://qt-project.org/doc/qt-4.8/qdeclarativecomponent.html

    http://Qt-project.org/doc/Qt-4.8/qtbinding.html is still relevant as well

  • Custom QML component not recognized

    From my understanding, to create a custom component of QML, you basically just create a new QML file, create the user interface, and you can immediately call the file name component. He does not like that for my application.

    Currently I have in my assets from the main.qml file, and I want to create a custom separator, so I create a new folder in assets called common, and I create a new QML file with QML container model, called CustomDivider.qml. So far, I'm following the example of Cookbook very well.

    The end result of my CustomDivider.qml is literally that:

    import bb.cascades 1.0

    {Of container

    Divider {}

    topMargin:10

    bottomMargin:1

    }

    }

    In my main.qml, I call CustomDivider {}, and it is not recognized by the IDE. When I run my application, the screen turns black, indicating that something is wrong

    Can someone tell me what exactly is the problem?

    You can also use import "nom_de_dossier".

  • How to send data from c ++ to qml to an another qml.

    Hello

    I'm quite confused about a simple problem, I'm sure. Let me put some of my code and then I'll ask my question

    hand. QML

    // Default empty project template
    import bb.cascades 1.0
    import bb.data 1.0
    
    // creates one page with a label
    
    TabbedPane {
        Menu.definition: MenuDefinition {
            actions: [
                ActionItem {
                    title: "Refresh"
                }
            ]
        }
        showTabsOnActionBar: true
        Tab {
            title: qsTr("Employee")
            NavigationPane {
                id: everyonePane
                Page {
                    id: everyoneFeed
                    ListView {
                        objectName: "FeedView"
                        id: FeedView
    
                        layout: StackListLayout {
                            headerMode: ListHeaderMode.Sticky
                        }
                        listItemComponents: [
                            ListItemComponent {
                                type: "item"
                                DetailFeed {
                                }
                            }
                        ]
                    }
                }
                attachedObjects: [
                    ActivityIndicator {
                        objectName: "indicator"
                        verticalAlignment: VerticalAlignment.Center
                        horizontalAlignment: HorizontalAlignment.Center
                        preferredHeight: 200
                        preferredWidth: 200
                    }
                ]
                onCreationCompleted: {
    
                }
            }
        }
        Tab {
            title: qsTr("TimeSheet")
            Page {
            }
        }
        Tab {
            title: qsTr("Calendar")
            Page {
            }
        }
    }
    

    detailView

    import bb.cascades 1.0
    
    Container {
        layout: StackLayout {
            orientation: LayoutOrientation.TopToBottom // this line stacks everything below
        }
        bottomPadding: 20
        Container { // single row
            id: row1
            // individual row container
            layout: DockLayout {
            }
            preferredWidth: maxWidth
            Container { // container for image
                preferredWidth: 150 //size of image if known
                preferredHeight: 150
                topPadding: 10
                leftPadding: 20
                horizontalAlignment: HorizontalAlignment.Left
                verticalAlignment: VerticalAlignment.Center
                ImageView {
                    preferredWidth: 150 //size of image if known
                    preferredHeight: 150
                    imageSource: "asset:///images/person.jpg" // some image
                }
            }
            // stack labels
            Container { // container for labels
                horizontalAlignment: HorizontalAlignment.Left // align this container to the left
                translationX: 200
                verticalAlignment: VerticalAlignment.Center
                layout: StackLayout {
                    orientation: LayoutOrientation.TopToBottom // this stacks the labels
                }
                Label {                objectName: "firstname"
                    text: "first label"
                }
                Label {
                    text: "second label"
                }
            }
        }
        Divider {
        }
    }
    

    Employee.cpp

    // Default empty project template
    #include "Employee.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    
    using namespace bb::cascades;
    
    QString mQueryUri;
    
    Employee::Employee(bb::cascades::Application *app) :
            QObject(app) {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        mQml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        mRoot = mQml->createRootObject();
    
        // Retrieving my activity indicator
        //mActivityIndicator = mRoot->findChild("indicator");
        //mActivityIndicator->start();
    
        // Retrieving my list from QML
        mListView = mRoot->findChild("dribbbleFeedView");
        GetFeed("everyone");
    
        // set created root object as a scene
        app->setScene(mRoot);
    }
    
    void Employee::GetFeed(QString feedType) {
        // First off we initialize our NetworkManager
        QNetworkAccessManager* netManager = new QNetworkAccessManager();
        if (!netManager) {
            qDebug() << "Unable to create QNetworkAccessManager!";
            emit complete("Unable to create QNetworkAccessManager!", false);
            return;
        }
    
        // First off we initialize our NetworkManager
        netManager = new QNetworkAccessManager();
        if (!netManager) {
            qDebug() << "Unable to create QNetworkAccessManager!";
            emit complete("Unable to create QNetworkAccessManager!", false);
            return;
        }
    
        mQueryUri = "http://mycompany" + feedType;
        // We setup our url
    
        QUrl url(mQueryUri);
        QNetworkRequest req(url);
    
        // Setup the reply and connect to the reply function
        QNetworkReply* ipReply = netManager->get(req);
        connect(ipReply, SIGNAL(finished()), this, SLOT(onReply()));
    }
    
    void Employee::onReply() {
        QNetworkReply* reply = qobject_cast(sender());
    
        QString response;
    
        bool success = false;
        if (reply) {
            if (reply->error() == QNetworkReply::NoError) {
    
                int available = reply->bytesAvailable();
                if (available > 0) {
                    int bufSize = sizeof(char) * available + sizeof(char);
                    QByteArray buffer(bufSize, 0);
                    int read = reply->read(buffer.data(), available);
                    response = QString(buffer);
                    success = true;
                    Q_UNUSED(read);
                }
            } else {
                response =
                        QString("Error: ") + reply->errorString()
                                + QString(" status:")
                                + reply->attribute(
                                        QNetworkRequest::HttpStatusCodeAttribute).toString();
                qDebug() << response;
            }
            reply->deleteLater();
        }
        if (response.trimmed().isEmpty()) {
            response = "Request failed. Check internet connection";
            qDebug() << response;
        }
    
        bb::cascades::GroupDataModel* dm = new bb::cascades::GroupDataModel(
                QStringList() << "id");
    
        dm->setGrouping(bb::cascades::ItemGrouping::None);
    
        // parse the json response with JsonDataAccess
        bb::data::JsonDataAccess ja;
        QVariant jsonva = ja.loadFromBuffer(response);
    
        QVariantList feed = jsonva.toMap()["employee"].toList();
    
        QVariantMap player;
    
        foreach (QVariant v, feed)
        {
            QVariantMap feedData = v.toMap();
            dm->insert(feedData);
        }
    
        mListView->setDataModel(dm);
        mListView->setVisible(true);
    }
    

    OK so here is my question. I load a listview, in my hand, calling another qml, detailview. Given that my PPC is load my json file how can I send what I receive in my datamodel in my detailfeed can I change we tell the label with objectName: "firstname" to change the text for datamodel.name?

    Hope I am clear enough.

    Thank you

    I think that you can access ListItemData in detailView.qml. Say ListItemData.id.

    Why do you add only a mapping in groupdata. I think you need to add all the necessary fields such as firstname and so on. Right?

    bb::cascades::GroupDataModel* dm = new bb::cascades::GroupDataModel(
                QStringList() << "id");
    
  • How can I access a qml component in C++ of a page has been dynamically generated?

    Hello

    I am new to QML and stunts development and I have the following scenario. On my main page, I have a ListView and when you tap on a list item, a new page is created dynamically and push in the navigation stack. I am able to see the new page, but it is empty. Qml to this new page code is defined in a separate file called DirectionViewer.qml. To achieve this, in my main.qml file I have the following code:

    attachedObjects:]
    {ComponentDefinition}
    ID: directionViewer
    Source: "DirectionViewer.qml".
    }
    ]

    In DirectionViewer.qml, I created another display of list and gave it a name of object called directionList. My question is, how do I access 'directionList' in C++, so that I can put the dataModel of the list of my C++ code?

    Thank you.

    Write a method in C++ and pass your ListView.

    void ListViewUtil::setDataModel(QObject* listViewObject)
    

    In C++, you can cast QObject to ListView.

    ListView listView = dynamic_cast(listViewObject);
    

    Then set the data model.

  • to access the variables in a page in another page qml

    Hey gang,

    I've been watching some of the other problems autour to access the variables from one page on another page qml qml, and I can't get this to work.

    I have a page, main.qml with a NavigationPane.  The NavPane has a Page and some containers.

    I have a property defined in the NavigationPane like this:

    NavigationPane {
        id: mainNav
        backButtonsVisible: true
        property int customInt: 2
    
        onCustomInt: {
            console.log("  -------------> App: customInt");
        }
    

    I have a ComponentDefinition for next page, called SettingsPage.qml.  In the settings, I have two drop-down lists and a slider.

    Page {
        actionBarAutoHideBehavior: ActionBarAutoHideBehavior.HideOnScroll
        id: pgSettings
    
        ScrollView {
            id: pageScroller
            scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFit
            Container {
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                Label {
                    text: "Settings"
                    textStyle.fontSize: FontSize.XLarge
                }
            Container {
                id: dropDown1
                topPadding: 25
                bottomPadding: 25
                rightPadding: 25
                leftPadding: 25
                DropDown {
                       id: ddOption1
                       title: "Option 1"
                       verticalAlignment: VerticalAlignment.Center
                       horizontalAlignment: HorizontalAlignment.Center
                      Option {id: o1o1; text: "One"; }
                      Option {id: o1o2; text: "Two"; }
                      Option {id: o1o3; text: "Three"; selected: true; }
                      Option {id: o1o4; text: "Four"; }
    
                    onSelectedIndexChanged: {
    
                        switch (selectedIndex){
                            case 0:
                                //
                                console.log(" -->App: Option 1 Selector, On");
                                customInt = 0;
                                break;
                            case 1:
                                //
                                console.log(" -->App: Option 1 Selector, Off");
                                customInt = 1;;
                                break;
                            case 2:
                                //
                                console.log(" -->App: Option 1 Selector, Top (default)");
                                customInt = 2;
                                break;
                            case 3:
                                //
                                console.log(" -->App: Option 1 Selector, Bottom");
                                customInt = 3;
                                break;
                        }
                    }
                }
            } }
    

    I look forward to the the statement will change the level property NavPane, called customInt, but it doesn't.

    the output of the console shows that the ' App: Option 1 selector "gets selected in the dropdown list selected index changes, but the onCustomInt() funtion slot never gets called.

    I tried "mainNav.customInt = X" too, but the parameters cannot solve the mainNav.  I get "unknown symbol 'mainNav'" error with alittle bulb.

    what I am doing wrong?

    When you call the second page, SettingsPage.qml, set it as an object.

    Don't do the following:

    attachedObjects: [
    
        ComponentDefinition {
            id: settingsPageDefinition
            source: "SettingsPage.qml"
        }
    ]
    

    Follow these steps:

    attachedObjects: [
        // Definition of the second Page, used to dynamically create the Page above.
        ComponentDefinition {
            id: settingsPageDefinition
            Settingspage{
    
            }
        }
    ]
    

    Then the second page main navigation page in the IDE.  I had the same problem with a multi-page application, I created.

  • Push a page of .qml using C++ defines the Navigation pane.

    If I have a navigation pane, as defined in C++...

    nav =  qml->createRootObject();
    

    How to push a page called page.qml? The only documentation I can find is to build the C++ page, that I don't intend to do. The purpose of the Page doesn't seem to have a constructor that takes a file as input qml Page, so I don't know how to create a Page object to him, pushing with the NavigationPane function-> push(Page*).

    First, you must load the qml file and create the object on the page of the qml. Then push the page in the navigation pane.

    This code can help you!

    NavigationPane *nav_pane = new NavigationPane;
    
    QmlDocument *qml = QmlDocument::create("asset:///MyListView.qml").parent(this);
    Page *new_page = qml->createRootObject();
    nav_pane->push(new_page);
    app->setScene(nav_pane);
    

    -Looks

    Riadh

Maybe you are looking for