Note that there are some explanatory texts on larger screens.

plurals
  1. POseparate .cpp file for every qml in blackberry 10
    primarykey
    data
    text
    <ol> <li>In my application i am using navigation pane. and i want to make separate files for every QML Let suppose this is my file</li> </ol> <hr> <p>applicationui.cpp</p> <pre><code> // initial load // Create scene document from main.qml asset, the parent is set // to ensure the document gets destroyed properly at shut down. QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this); // Create root object for the UI AbstractPane *root = qml-&gt;createRootObject&lt;AbstractPane&gt;(); // Set created root object as the application scene app-&gt;setScene(root); </code></pre> <hr> <p>2.Here i am loading <strong>main.qml</strong> which is like this</p> <pre><code>import bb.cascades 1.0 NavigationPane { id: navigationPane Page { titleBar: TitleBar { // Localized text with the dynamic translation and locale updates support title: qsTr("Page 1") + Retranslate.onLocaleOrLanguageChanged } Container { } actions: ActionItem { title: qsTr("Second page") + Retranslate.onLocaleOrLanguageChanged ActionBar.placement: ActionBarPlacement.OnBar onTriggered: { // A second Page is created and pushed when this action is triggered. navigationPane.push(secondPageDefinition.createObject()); } } } attachedObjects: [ // Definition of the second Page, used to dynamically create the Page above. ComponentDefinition { id: secondPageDefinition source: "DetailsPage.qml" } ] onPopTransitionEnded: { // Destroy the popped Page once the back transition has ended. page.destroy(); } } </code></pre> <hr> <p>3.And in this file I am calling <strong>"DetailsPage.qml"</strong> file which look like this</p> <pre><code>import bb.cascades 1.0 Page { titleBar: TitleBar { // Localized text with the dynamic translation and locale updates support title: qsTr("Second Page") + Retranslate.onLocaleOrLanguageChanged } Container { Label { id: msgLabel objectName: "msgLabel" } } } </code></pre> <hr> <p>step 1: how to create seperate .cpp and .hh file for DetailsPage.qml </p> <p>step 2: I want this becasue i am doing networking operations in .cpp and .hh and designing in QML.</p> <p>step 3: The main reason i am confuse here is if i navigate from QML then total control is with QML and vice versa. On stack first qml can recognize its c++ file but if stack increases then how we should do that. </p> <p>-------Please let me know If you don't understand my problem----------------</p> <hr>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload