SpaceQuota change of QML

How would you change the spaceQuota in QML?

Label {
  layoutProperties: StackLayoutProperties {
    spaceQuota: 2
  }
}

In view of the above, I could wait for the following?

id.layoutProperties.StackLayoutProperties.spaceQuota = 1

I can see why it does not work but I can not understand how would you in doing so.

In this case, I suggest that you create a new StackLayoutProperties and assign it to layoutProperties directly.

attachedObjects: [
   StackLayoutProperties {
      id: newProps
      spaceQuota: 1
   }
]
Label {
   id: myLabel
   layoutProperties: StackLayoutProperties {
      spaceQuota: 2
   }
}
function changeQuota() {
   myLabel.layoutProperties = newProps;
}

I don't know if you can dynamically change the quota of newProps. I would like to test it for you, but I'm tired and I'm going to bed. Looking forward to your report.

Philipk wrote:
No it does not recognize it without the StackLayout either.

Tags: BlackBerry Developers

Similar Questions

  • Quota of change in QML container

    This doesn't seem to work:

    Container {
        layout: StackLayout { orientation: LayoutOrientation.LeftToRight }
    
        Container { id: cnLeft
            property int quota : 50
            layoutProperties: StackLayoutProperties { spaceQuota: quota }
            background: Color.Red
            Label {
                text: "Left"
            }
        }
        Container { id: cnRight
            property int quota : 50
            layoutProperties: StackLayoutProperties { spaceQuota: quota }
            background: Color.Blue
            Label {
                text: "Right"
            }
        }
    }
    

    Basically, it ignores the quota... unless I hard code the values in the spaceQuota property.

    Is it possible to change the quota AFTER qml has been loaded. (for example, if the length of text changes I want to readjust the parameters of quota accordingly).

    Thank you

    If you want to implement the logic to make the adjustment in QML I think it would be something like this:

    function readjustContainers() {
        // whatever logic
        if (cnRight.needsToBeAdjusted()) {
             cnRight.layoutProperties.spaceQuota = newQuota;
        }
    }
    

    See if it works.

  • Waterfalls of Beta 4 - cannot change the QML file

    Anyone else unable to edit QML files with the new Cascades Beta 4?

    I can edit in text mode, but the default editor is suspended the IDE when an existing QML file is changed.

    Yes I can. I don't have the QML preview because I use Win 8 64 bit, but the QML perspective opens.

    Have you tried a new clean rather than installing on Beta 3 installation?

  • Dynamic changes on qml page does not not via RPC

    Hello

    I want to change a user interface of the qml page dynamically according to the response from the web service of CPC file. If I make a few changes that I need to reload the page qml whenever changes are displayed. If I don't make these changes using JavaScript function so no need to reload the page. The changes are automatically displays on screen.

    How can I change the dynamic UI of the CPC file without reloading the qml file?

    Hello

    Are you sure you are not creating a second instance of the leaf? If you create and show the QML sheet, you will need to find the original instance in C++ code. This thread describes a similar problem:

    http://supportforums.BlackBerry.com/T5/native-development/problem-in-SetProperty/m-p/2611947#M49267

  • Locale app does not change for QML strings

    Hello

    In my application, I need to change language(English/Arabic) with a Menu. It has worked well.

    In my QML, the text is defined as

    text: qsTr("Hello") + Retranslate.onLanguageChanged
    

    My application is installing new translators using following code.

    void LocaleTest::languageChanged(QLocale changedLocale) {
    
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
    
        // Initiate, load and install the application translation files.
        QString locale_string = changedLocale.name();
        std::cout << "Locale is : " << locale_string.toStdString() << std::endl;
        QString file_name = QString("FileHandling_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
        }
        //   Here update text of dynamic text labels.
    }
    

    It works exactly as expected when I change the language within the application works.

    Now, I changed the language of the system parameters. Once QML text is translated into Arabic... I'm changing the language using the Menu. It does not work. Please find below the image.

    Please help me.

    Kind regards

    SHA

    I understood the question. Desperate to first install by default and after Application translator: exec() change the file to the translator.

  • Cannot change the QML files in new SDK

    I can't edit or even load all the QML Momentics files, get the error message;

    "Could not open the Editor: the editor class could not be instantiated." This usually indicates a manufacturer no. - arg missing or that the name of the editor class was misspelled in plugin.xml. »

    The source files are fine.

    Journal of the shows...

    java.lang.IllegalStateException: duplicate the item in the map: MapID: ModelInfoLoader.resolvedSlotIDMap, key: If
    at com.rim.tad.tools.qml.core.internal.util.TypeUtil.mapPutIfNotExist(TypeUtil.java:67)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.resolveSuperInfoList(ModelInfoLoader.java:576)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:385)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.assureParseComponent(ModelInfoLoader.java:428)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.parseComponent(ModelInfoLoader.java:335)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.create(ModelInfoLoader.java:257)
    at com.rim.tad.tools.qml.core.internal.model.semantic.ModelInfoLoader.createModelInfoFromBuiltInFile(ModelInfoLoader.java:186)
    to com.rim.tad.tools.qml.core.internal.editor.QMLEditor. (QMLEditor.java:53)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance (unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (unknown Source)
    the impossible (unknown Source)
    at java.lang.Class.newInstance0 (unknown Source)
    to java.lang.Class.newInstance (unknown Source)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:260)
    at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235)
    at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:875)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:609)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    to org.eclipse.ui.internal.WorkbenchPage.access$ 11 (WorkbenchPage.java:2842)
    to org.eclipse.ui.internal.WorkbenchPage$ 10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    at org.eclipse.ui.actions.OpenFileAction.openFile(OpenFileAction.java:99)
    at org.eclipse.ui.actions.OpenSystemEditorAction.run(OpenSystemEditorAction.java:99)
    at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:221)
    to org.eclipse.ui.navigator.CommonNavigatorManager$ 3.open(CommonNavigatorManager.java:185)
    to org.eclipse.ui.OpenAndLinkWithEditorHelper$ InternalListener.open (OpenAndLinkWithEditorHelper.java:48)

    to org.eclipse.jface.viewers.StructuredViewer$ 2.run(StructuredViewer.java:866)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    to org.eclipse.ui.internal.JFaceUtil$ 1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
    at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:462)
    to org.eclipse.jface.viewers.StructuredViewer$ 6.handleOpen(StructuredViewer.java:1256)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
    to org.eclipse.jface.util.OpenStrategy.access$ 2 (OpenStrategy.java:269)
    to org.eclipse.jface.util.OpenStrategy$ 1.handleEvent(OpenStrategy.java:309)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    to org.eclipse.ui.internal.Workbench.access$ 4 (Workbench.java:2499)
    to org.eclipse.ui.internal.Workbench$ 7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)
    at java.lang.reflect.Method.invoke (unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

    Re-install seems to have fixed.

  • Import an another qml fle

    I have Header.qml

    import bb.cascades 1.2
    
        Container {
            topPadding: 20
            leftPadding: 20
            rightPadding: 20
            layoutProperties: StackLayoutProperties { spaceQuota: -1 }
            horizontalAlignment: HorizontalAlignment.Center
            ImageView {
                imageSource: "asset:///images/ic_logo_black.png"
    
            }
        }
    

    want to import it here

    import bb.cascades 1.2
    import "Header"
    
    Page {
        Container {
            background: Color.LightGray
    
            Header
            {
                id:header
            }
            Container {
    
                preferredWidth: DisplayInfo.width
                leftPadding: 20
                rightPadding: 20
                bottomPadding: 20
                //   preferredHeight: (DisplayInfo.height-(((DisplayInfo.width-50)/3.71)+20))-60
                layout: StackLayout {
                    orientation: LayoutOrientation.BottomToTop
                }
                layoutProperties: StackLayoutProperties {
                    spaceQuota: 1
                }
    
                Container {
                    rightPadding: 20.0
                    leftPadding: 20.0
                    topPadding: 10
                    layout: StackLayout {
                        orientation: LayoutOrientation.LeftToRight
                    }
    
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_help.png"
                        text: "Help"
    
                    }
    
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_phone.png"
                        text: "Contact us"
    
                    } 
    
                }
                Container {
                    rightPadding: 20.0
                    leftPadding: 20.0
                    topPadding: 10
                    layout: StackLayout {
                        orientation: LayoutOrientation.LeftToRight
                    }
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_marker.png"
                        text: "ATM Locator"
                    }
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_display.png"
                        text: "Full Website"
                    }
    
                }
                Container {
                    rightPadding: 20.0
                    leftPadding: 20.0
                    topPadding: 10
                    layout: StackLayout {
                        orientation: LayoutOrientation.LeftToRight
                    }
    
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_user.png"
                        text: "Login"
                    }
                    Button {
                        rightMargin: 10
                        layoutProperties: StackLayoutProperties {
                            spaceQuota: 1
                        }
                        imageSource: "asset:///images/ic_id.png"
                        text: "Register"
                    }
    
                }
            }
        }
    }
    

    part in bold, I get the import file does not exist

    It worked

    I changed my qml in TopHeader.qml file

    and instead of the header, I used TopHeader

    Header is probably something built in already.and was an accident my qml file

  • Injection containers QML on the fly?

    Hello, I'm quite new to the Blackberry development, so far, I can say that I love it. I'm working on an application that requires me to be able to change the QML that is inside a container on the fly. For example:

            // MAIN CONTAINER PLACEHOLDER
            Container {
                id: mainContainer
                // Any way to inject fully built qml files right here, and swap them out on the fly?
            }
    

    I have a menu on the left in the form of a ListView when you press a button at the top left, the current view moves to the right and allows you to use the navigation. When you select a new navigation item, I want to replace what is in the "key container" with the QML file that is appropriate for what the user has selected.

    Thanks in advance for any help!

    You're better off using a delegate control for your particular problem.

    Take a look at the example of Cookbook qml stunts to see how it is easy to do.

    http://developer.BlackBerry.com/Cascades/sampleapps/

  • QML and C++ integration

    I have a problem with QML and C++ integration.

    I have second attached to hand qml (next to main.qml):

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

    When the subject is raised in the listview, this page is pushed in navigationPane:

    onTriggered: {
             var selectedItem = dataModel.data(indexPath);
                 var page = dataPage.createObject();
                  page.name = selectedItem.title;
                  navigationPane.push(page);
                                }
    
    ApplicatonUI::ApplicationUI(bb::cascades::Application *app):QObject(app)...dataPageqml = QmlDocument::create("asset:///dataPage.qml").parent(qml);
    dataPageqml->setContextProperty("pageC", this);
    ...}
    
    void ApplicationUI::processChoice(){
         Page *page = dataPageqml->createRootObject();
         page->setProperty("label", "New text");
    }
    

    DataPage.qml I call onCreationCompleted to call the processChoice() function:

    Page {
        id: page
        onCreationCompleted: {
            pageC.processChoice();
        }
        property string name
        Container {
            WebView{
                horizontalAlignment: HorizontalAlignment.Fill
                minHeight: 700.0
                maxHeight: 700.0
    
            }
            Label{
                id: lb
                objectName: "label"
                text: page.name
            }
        }
    }
    

    In this case, I want to change the text in the label, but nothing happens.

    What I am doing wrong?

    Ty for answers.

    Change

    QML-> setContextProperty ("INAC", this);

    TO

    QmlDocument::defaultDeclarativeEngine()-> rootContext()-> setContextProperty ("INAC", this);

  • Question of NavPane.push/QML

    In order to have a selected item list and open a new Navigation pane, what I need to change my QML file or?

    No you wouldn't change the XML file (assuming that this is where your data in your list are taken from). The event push code is independent of your data source.

  • ListView no header

    Hey, I'm looking for a way to use a ListView which is the only level of depth (that is to say, has no header). I try the example of stamp collector to work this way, but I'm having a lot of problems by pulling it.

    Using this code, I get all the stamps under an empty header:

    mStampModel = new GroupDataModel();
    mStampModel-> setParent (this);
    mStampModel-> clear();
    mStampModel-> insert (mainList);

    but the empty header always appears.

    I guess GroupDataModel is the incorrect data model for this but QListDataModel also seems to want to create a header and I see that DataSetModel is marked as being obsolete (don't know if it would achieve what I want anyway).

    Thoughts, ideas, solutions?

    You can find QStringListDataModel or QVariantListDataModel is sufficient for your needs.

    In stampcollector:

    -change main.qml to remove the header component.

    -Replace stampcollector.h #include and mStampModel of type QStringListDataModel *.   (in an application real you can use your own typedef so you do not have to include in the include file)

    -change of setUpStampListModel to

    mStampModel = new QStringListDataModel;
    mStampModel-> setParent (this);
    mStampModel-> clear();

    mStampModel-> append("hello");
    mStampModel-> append("World");

    Of course app will only run as far as the first list, but try and see if it is what you need

  • NavigationPane - why is this going to work?

    I'm frustrated by NavigationPane do not behave as I would expect when you press the pages of recursively. I have three files QML. MyNavPane.qml, MyFirstPage.qml, and MySecondPage.qml, and suppose that MyFirstPage.qml looks like this:

    Page {
       property NavigationPane mainNavPane
       attachedObjects: [
          MySecondPage {
             id: mySecondPage      }
       ]
       function pushSecondPage() {
          mainNavPane.push( mySecondPage );
       }
    }
    

    .. .While that MyNavPane.qml is as follows:

    NavigationPane {
       id: myNavPane
       attachedObjects: [
          MyFirstPage {
             id: myFirstPage
             mainNavPane: myNavPane
          }
       ]
       function pushFirstPage() {
          push( myFirstPage );
       }
    }
    

    Now the execution of pushFirstPage() works fine and pushes the first page in the navigation stack, however, pushSecondPage() runs without error, but the second page is not pressed. Debugging indicates that mainNavPane correctly to the main NavigationPane.

    If I change MyFirstPage.qml to this:

    Page {
       property NavigationPane mainNavPane
       function pushSecondPage() {
          mainNavPane.pushSecondPage();
       }
    }
    

    ... and MyNavPane.qml to this:

    NavigationPane {
       id: myNavPane
       attachedObjects: [
          MyFirstPage {
             id: myFirstPage
             mainNavPane: myNavPane
          },
          MySecondPage {
             id: mySecondPage
          }
       ]
       function pushFirstPage() {
          push( myFirstPage );
       }
       function pushSecondPage() {
          push( mySecondPage );
       }
    }
    

    ... it works as expected.

    I tried to do that too, but that didn't work either, the second page has not pushed, but no error was reported:

    Page {
       property NavigationPane mainNavPane
       attachedObjects: [
          MySecondPage {
             id: mySecondPage
          }
       ]
       function pushSecondPage() {
          mainNavPane.pushPage( mySecondPage );
       }
    }
    
    NavigationPane {
       id: myNavPane
       attachedObjects: [
          MyFirstPage {
             id: myFirstPage
             mainNavPane: myNavPane
          }
       ]
       function pushFirstPage() {
          push( myFirstPage );
       }
       function pushPage( page ) {
          push( page );
       }
    }
    

    Why only the second method, where the two sheets to be pushed to the NavigationPane itself works, while the other two don't? What Miss me?

    UPDATE: I decided that I needed to know if change the parent of the page to be pushed would work, and it does!

    The first thing I had to do was make a way to change the parent of a QML object, which you can not do normally. I created a new function Q_INVOKABLE on my main user interface class, called changeParent():

    void MyApp::changeParent( QObject* object, QObject* newParent ) {
       object->setParent( newParent );
    }
    

    Then, I changed the function pushPage() in one of my previous examples:

    Page {
       property NavigationPane mainNavPane
       attachedObjects: [
          MySecondPage {
             id: mySecondPage
          }
       ]
       function pushSecondPage() {
          mainNavPane.pushPage( mySecondPage );
       }
    }
    
    NavigationPane {
       id: myNavPane
       attachedObjects: [
          MyFirstPage {
             id: myFirstPage
             mainNavPane: myNavPane
          }
       ]
       function pushFirstPage() {
          push( myFirstPage );
       }
       function pushPage( page ) {
          app.changeParent( page, myNavPane )
          push( page );
       }
    }
    

    ... and now the page pushes perfectly, even though he did not initially belong to the NavigationPane. I also tried to change the parent to zero and that works too, but I felt more comfortable never leave the page hanging out without a parent. Memory leaks can be insidious.

    I also tried to change the parent in creationCompleted Manager, but that properly compiled it screwed up of access to the MySecondPage object in other code. Since mainNavPane have a value during execution of the creationCompleted Manager, QML am confused and thought that mySecondPage no longer exists when I put this code:

    Page {
       property NavigationPane mainNavPane
       attachedObjects: [
          MySecondPage {
             id: mySecondPage
             onCreationCompleted: {
                app.changeParent( mySecondPage, mainNavPane )
             }
          }
       ]
       function pushSecondPage() {
          mainNavPane.pushPage( mySecondPage );
       }
    }
    

    Change this to set the new parent to zero instead of mainNavPane works but is dangerous since mySecondPage will be orphaned until you call pushSecondPage at least once. If you run never push that will leave you mySecondPage when you destroy What's new, which is a memory leak.

    Of course, you can do it instead:

    Page {
       property NavigationPane mainNavPane
       attachedObjects: [
          MySecondPage {
             id: mySecondPage
          }
       ]
       onMainNavPaneChanged: {
          app.changeParent( mySecondPage, mainNavPane )
       }
       function pushSecondPage() {
          mainNavPane.pushPage( mySecondPage );
       }
    }
    

    in this case you need not change the parent again whenever you press the page, probably a better solution.

    Anyway, thanks again for pointing me in the right direction and I hope that it will be useful to others.

  • How to boost navigationPane navigationPane another?

    Hello

    I'm not figure this and need help.

    I am creating a navigationPane to push() to navigationPane another.

    For example:

    hand. QML

    import bb.cascades 1.0
    
    TabbedPane {
        showTabsOnActionBar: true
        Tab {
            title: qsTr("Tab 1")
            NavigationPane {
                id: navigationPane
    
            Page {
                id: tab1
                actions: [
                    // define the actions for first tab here
                    ActionItem {
                        title: qsTr("Page1")
                        onTriggered: {
                            navigationPane.push(page1);
                        }
                    },
                    ActionItem {
                        title: qsTr("Page2")
                        onTriggered: {
                            navigationPane.push(page2);
                        }
                    }
                ]
            }
            attachedObjects: [
                Page1 {
                    id: page1
                },
                Page2 {
                    id: page2
                }
            ]
          }
        }
        Tab {
            title: qsTr("Tab 2")
            NavigationPane {
                id: navigationPane2
            Page {
                id: tab2
                actions: [
                    // define the actions for tab here
                    ActionItem {
                        title: qsTr("Page3")
                        onTriggered: {
                            // run the image animation
                            navigationPane2.push(page3);
                        }
                    }
                ]
            }
            attachedObjects: [
                Page3 {
                    id: page3
                }
            ]
          }
        }
    
        onCreationCompleted: {
            console.log("TabbedPane - onCreationCompleted()")
            OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
        }
    }
    

    Page1.QML

    import bb.cascades 1.0
    
    Page {
        Container {
            Label {
               text: "Page1"
            }
        }
    }
    

    Page2.QML

    import bb.cascades 1.0
    
    Page {
        Container {
            Label {
                text:"Page2"
            }
        }
    }
    

    Page3.QML

    import bb.cascades 1.0
    
    NavigationPane {
        id: navigationPane3
    Page {
        Container {
            Button {
                text: "Page4"
                    onClicked: {
                        navigationPane3.push(page4);
                    }
    
                }
        }
    }
    attachedObjects: [
        Page4 {
            id: page4
        }
    ]
    }
    

    Page3 expected push() on Page4.

    Page4.QML

    import bb.cascades 1.0
    
    Page {
        Container {
            Label{
                text: "Page4"
            }
        }
    }
    

    By the look of it, all it's ok. No errors.

    But when I run the code in debug mode on the device when I try to click on Page3 actionItem it does nothing. It does not grow on Page4.

    Any ideas?

    Thanks in advance!

    Hello

    It is not possible to push NavigationPane in an another NavigationPane, but you can push several pages in a NavigationPane. If I understand what you're trying to do, try to change Page3.qml to:

    import bb.cascades 1.0
    
    Page {
        id: root
        Container {
            Button {
                text: "Page4"
                    onClicked: {
                        root.parent.push(page4); // root.parent points to parent NavigationPane
                    }
    
                }
        }
        attachedObjects: [
            Page4 {
                id: page4
            }
        ]
    }
    
  • Problem of. location() calendar event

    I use the example code for calendar as base point and try to make changes. I'm trying to get the location to display on the screen.

    I changed the QML to

                    ListView {
                        dataModel: calendar.model
    
                        listItemComponents: ListItemComponent {
                            type: "item"
    
                            StandardListItem {
                                title: ListItemData.location
                                description: qsTr ("%1 - %2").arg(ListItemData.startTime).arg(ListItemData.endTime)
                            }
                        }
    

    and I added the location of the template.

    void Calendar::filterEvents()
    {
        // Setup the search parameters with time range as specified by filter criterion
        EventSearchParameters searchParameters;
        searchParameters.setStart(m_searchStartTime);
        searchParameters.setEnd(m_searchEndTime);
        searchParameters.setDetails(DetailLevel::Weekly);
    
        const QList events = m_calendarService->events(searchParameters);
    
        // Clear the old events information from the model
        m_model->clear();
    
        // Iterate over the list of events
        foreach (const CalendarEvent &event, events) {
            // Copy the data into a model entry
            QVariantMap entry;
            entry["eventId"] = event.id();
            entry["accountId"] = event.accountId();
            entry["subject"] = event.subject();
            entry["location"] = event.location();
            entry["startTime"] = event.startTime().toString(Qt::DefaultLocaleShortDate);
            entry["endTime"] = event.endTime().toString(Qt::DefaultLocaleShortDate);
    
            // Add the entry to the model
            m_model->insert(entry);
        }
    }
    

    But nothing is ever displayed. Yet when I break into the event, there is a location. What Miss me?

    Resolved: The EventSearchParameters has a .setDetails flag. The flag that you use dictact what information you get. Just put the correct DetailLevel.

    https://developer.BlackBerry.com/Cascades/reference/bb__pim__calendar__detaillevel.html

  • How can I change the background color of a button in .qml

    Hello, everyone! I have a problem now.

    When I define a componnet in QML button, it has a white background color by default. While I want to change the background color, for example red.

       Container {
            layout: StackLayout {}
            background: backgroundPaint.imagePaint
            attachedObjects: [
                ImagePaintDefinition {
                    id: backgroundPaint
                    imageSource: "asset:///images/background.png"
                }
            ]
            Button{
                text: "button"
                verticalAlignment: VerticalAlignment.Center
                horizontalAlignment: HorizontalAlignment.Center
            }
        }
    

    I read the reference that write it a clickable button with a height fixed and the visual aspect of the button is predefined and cannot be changed and so forth... look herehttp://developer.blackberry.com/cascades/reference/bb__cascades__button.html

    I tried this way to change the theme of the application. But I failed! See more details here http://developer.blackberry.com/cascades/reference/bb__cascades__themesupport.html

    How can I achieve this? Please give me help. Thank you in advance. Please forgive my bad English

    Hello

    Button style is predefined according to me. Dark theme can be activated in the bar - descriptor.xml, but it is applied to the application on a global scale and affect all other controls as well.

    You can use a container with background image instead of a button. Example code:

    http://supportforums.BlackBerry.com/T5/Cascades-development/button-with-a-background-image/m-p/21489...

Maybe you are looking for

  • Firefox crashes or freezes when opened. Help, please!

    My firefox does not open. I have been using Firefox without problems for years until yesterday. I have a Mac OS X 10.10.3. Whenever I open Firefox, it immediately crashes or freezes. I have to go to my dock to "force quit" Firefox. I tried to uninsta

  • Satellite 1900-303: CD recording is not possible

    My 1900-303 doesn't let me save to CD. It seems to work then comes up with an error message asking me to '... ". change drive or firmware update... "I went to the Toshiba download pages and downloaded the firmware stuff and then extracted and downloa

  • Is that the new iOS 9.2.1 update really 2 GB?

    Reading the posts earlier on the last 9.2.1 update and see who confirms that the update must be done with iTunes and that its size is greater than 2 GB.  Is this true?  I don't have the bandwidth to handle.

  • Saving raw data with PCI-6259

    I think registration of raw data because the resolution max of 16-bit card and DAQmx Read gives me a 64-bit (converted to 32-bit) value. It's the waste of hard drive space. However, I couldn't find any information on the format of the raw data of thi

  • 6600 e - all - in - one Officejet

    How can I change the font on my 6600 officejet compatible with quickbooks to print checks? When I try to print a check a box appears and says 'Pilot lack of full font support'. When I moved and you were trying to print the check of some sort, the wor