Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

BB 10 cascades signals when user closing the App

Is there any signal that fires , while the user terminating the app. I need to clear the data from database On terminating the App.

I hope that get a proper solution here,

Thanks

Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: BB 10 cascades signals when user closing the App

yes, there's a signal

 

QObject::connect(app, SIGNAL( manualExit() ), this, SLOT( onManualExit() ));

 then do your stuff and finally

Application::instance()->exit();

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: BB 10 cascades signals when user closing the App

I am doing the same stuff, but in the Qml as follows 

Page {

                id: sharePage
                
                onCreationCompleted: {
                    console.log("First Screen Looaded");
                    if (! myIndicator.running) {
                        // Start the activity here.
                        myIndicator.start();
                       // text = "Stop";

                        //Application.manualExit.connect(onManualExit);
                        Application.pooling.connect(onPooling);

                    }
                }
                function onPooling(poolRequestID) {
                    // Do work here
                    _app.deleteAllPushes();
                    Application.poolingComplete(poolRequestID);
                }
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.TopToBottom
                    }
                    background: Color.Black
                   
                    Container {
                        layout: DockLayout {
                        }
                        leftPadding: 15.0
                        rightPadding: 15.0
                        horizontalAlignment: HorizontalAlignment.Fill
                        verticalAlignment: VerticalAlignment.Fill
                        background: Color.create("#f9393b30")
                        Label {
                            id:translate
                            objectName:"translate"
                           // text:_app.changeOrientation();
                            visible: false
                           }

                        Button {
                            horizontalAlignment: HorizontalAlignment.Left

                            imageSource: "asset:///images/add_remove_icon.png"
                            preferredWidth: 10.0
                            preferredHeight: 10.0
                            leftPadding: 100
                            onClicked: {
                                _app.dropSymbols(1); // Drop Req for Tadawul
                                lightTimer.stop();
                                _app.AddorDelete(1,translate.text);
                                //_app.dropSymbols(1);
                                //_app.clearModel();
                            }
                        }

                        ImageView {
                            imageSource: "asset:///images/title.png"
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center

                            preferredHeight: 71.0
                            preferredWidth: 258.0
                        }
                        Button {
                            horizontalAlignment: HorizontalAlignment.Right

                            imageSource: "asset:///images/search_icon.png"
                            preferredWidth: 10.0
                            preferredHeight: 10.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.0
                            }
                            onClicked: {
                                 lightTimer.stop();
                                _app.dropSymbols(1); // Drop Req for Tadawul
                                _app.loadQuickListSearch(1, translate.text);
                            }
                        }

                    }

                    Container {
                        id:tasiContainer
                       
                        layout: StackLayout {
                        // orientation: LayoutOrientation.RightToLeft//length==1
                            // orientation: (isArabic == 0) ?  LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                            orientation: translate.text.length==6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight

                        }
                        leftPadding: 15.0
                        rightPadding: 15.0
                        background: Color.create("#00a3b8")
                        horizontalAlignment: HorizontalAlignment.Fill

                        topMargin: 20.0
                        Label {
                            id:tasi
                            text: qsTr("Tadawul - TASI") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            textStyle.color: Color.White
                            
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 3.5
                            }
                        }

                        Container {
                            id: tadawulchange
                            layout: StackLayout {

                            }

                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.0

                            }

                            background: tasiperchange.text.indexOf('-') < 0 ? Color.create("#ff105900") : Color.DarkRed
                            verticalAlignment: VerticalAlignment.Center
                            preferredHeight: 20.0
                            Label {
                            	id: tasiperchange
                                text: "0.38%"
                                // textStyle.color: ListItemData.PerChange.indexOf('-') < 0 ? Color.Green : Color.Red //here
                                textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                textStyle.fontSizeValue: 30.0
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 1.5
                                }
                                verticalAlignment: VerticalAlignment.Center
                                horizontalAlignment: HorizontalAlignment.Center
                                preferredHeight: 0.0

                            }

                        }

                        Label {
                            id: tasinetchange
                            text: "29.4"
                            textStyle.color: Color.White
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.0
                            }
                            textStyle.fontSize: FontSize.PointValue
                            textStyle.fontSizeValue: 6.0
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center
                        }

                        Label {
                            id: tasivol
                            text: "7,823.37"
                            textStyle.color: Color.White
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.5
                            }
                            textStyle.fontSize: FontSize.PointValue
                            textStyle.fontSizeValue: 6.0
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                        }

                    }
                    Container {
                        leftPadding: 15.0
                        rightPadding: 15.0
                        layout: StackLayout {
                            orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                        }
                        topPadding: 20.0


                        Label {
                            id: symbolTop
                            text: qsTr( "Company") + Retranslate.onLanguageChanged
                            // Text Style and size etc
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center

                            textStyle.color: Color.White
                        }
                        Label {
                            id: changePer
                            text: qsTr("Change %") + Retranslate.onLanguageChanged

                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0

                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White

                        }
                        Label {
                            id: ltpTop
                            text: qsTr("LTP") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                            
                        }
                        Label {
                            id: high
                            text: qsTr( "High") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                        }
                        Label {
                            id: low
                            text: qsTr("Low") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                        }

                    }
                   function alignmentCenter(){
                        //translate.text.length == 6 ? (horizontalAlignment : HorizontalAlignment.Right) 
                        if(translate.text.length == 6){
                            return HorizontalAlignment.Right
                        }else if(translate.text.length == 7){
                            return HorizontalAlignment.Left
                        }
                    }
                    Container {
                        id:loader
                        objectName: "loader"
                       topMargin: 250
                        leftPadding: 300

                        visible: true
                        layout: StackLayout {
                            orientation: LayoutOrientation.TopToBottom
                        }
                       
                        ActivityIndicator {
                            id: myIndicator
                            objectName: "myIndicator"
                            preferredWidth: 100
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center

                        }
                        Label {
                            id: loadText
                            text: qsTr( "Loading") + Retranslate.onLanguageChanged
                            //leftPadding: 700
                        }
                    }
                    

                    //Integrating
                    Container {
                        layout: StackLayout {
                          //  orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                            orientation: LayoutOrientation.LeftToRight
                        }
                        topMargin: 10
                      

                        ListView {
                            id: tradeList
                            objectName: "tradeList"
                            dataModel: _app.dataModel
                            visible: true;
                            //                            dataModel: _app.dataModel{
//                                onItemAdded: {
//                                    
//                                }
//
//                            }
                            listItemComponents: [
                                ListItemComponent {
                                    type: "header"
                                    Header {
                                        title: {
                                            ListItemData
                                        }
                                    }
                                },

                                // The tradeList Item
                                ListItemComponent {
                                    type: "item"

                                   
                                    Container {
                                        leftPadding: 15.0
                                        rightPadding: 15.0

                                        background: Color.create("#1a1a1a")
                                        preferredHeight: 80.0
                                        topMargin: 6
                                        

                                        layout: StackLayout {
                                            //orientation: LayoutOrientation.RightToLeft
                                           // orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                                            orientation: ListItemData.isArabic.length== 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                                        }
                                       
                                        Label {
                                            id: symbol
                                            text: qsTr( ListItemData.Symbol_En)
                                            //text: ListItemData.Symbol_En.length()>20?Symbol_En.subString(0,15): Symbol_En
                                            
                                            // Text Style and size etc
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 5.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 3.0
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Bold
                                            textStyle.fontSize: FontSize.PointValue
                                           // multiline: true

                                        }

                                        Container {
                                            id: tadawulchange1
                                            layout: StackLayout {

                                            }

                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 2.0

                                            }

                                          //  ListItemData.PerChange.length == 1 ? Color.create("#1a1a1a") :Color.DarkRed
                                          
                                          // background: ListItemData.PerChange.indexOf('-') < 0 ?((ListItemData.PerChange.length() == 1) ? Color.create("#1a1a1a") : Color.create("#ff105900")) : ((ListItemData.PerChange.length() == 1) ? Color.create("#1a1a1a") : Color.DarkRed)
                                            
                                            background: (ListItemData.PerChange.indexOf('-') < 0 )?((ListItemData.PerChange.length==1 ? Color.create("#1a1a1a") : Color.create("#ff105900"))): ((ListItemData.PerChange.length == 1 ? Color.create("#1a1a1a") : Color.DarkRed))
                                         
                                            verticalAlignment: VerticalAlignment.Center
                                            preferredHeight: 20.0
                                            Label {

                                                id: change
                                                text: ListItemData.PerChange
                                               // textStyle.color: ListItemData.PerChange.indexOf('-') < 0 ? Color.Green : Color.Red //here
                                                textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                                textStyle.fontSizeValue: 30.0
                                                layoutProperties: StackLayoutProperties {
                                                    spaceQuota: 2
                                                }
                                                verticalAlignment: VerticalAlignment.Center
                                                horizontalAlignment: HorizontalAlignment.Center
                                                preferredHeight: 0.0

                                            }

                                        }

                                        Label {
                                            id: ltp
                                            text: ListItemData.LTP
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        Label {
                                            id: highValue
                                            text: ListItemData.High
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        Label {
                                            id: lowValue
                                            text: ListItemData.Low
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        onTouch: {
                                            console.log("Text@@@@@@@@@" + arabic.text);
                                        }
                                    }
                                    
                                }
                            ]
                            onTriggered: {
                                var selectedItem = dataModel.data(indexPath);
                                lightTimer.stop();
                                _app.dropSymbols(1); // Drop Req for Tadawul

                                _app.loadQuickWatch(selectedItem.symbol_ID);
                                

                            }
                            onVisibleChanged: {
                                myIndicator.stop();
                                loader.visible = false
                                loadText.visible=false
                            }
                        }

                        Timer {
                            id: lightTimer
                            // Specify a timeout interval of 1 second
                            interval: 500
                            onTimeout: {
                                // call method Qinvikable to load records
                                _app.readRecords();
                              
                            } // end of onTimeout signal handler

                        } // end of Timer
                    }

                }
                //                contextActions: [
                //                    ActionSet {
                //                        title: "Share Settings"
                actions: [

                    ActionItem {
                        title: qsTr("Custom Market Watch") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.GenerateCustWatch(1, translate.text);

                        }
                    },

                    ActionItem {
                        title: qsTr("Alerts") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.AddAlerts(1, translate.text);

                        }
                        imageSource: "asset:///images/alert_title_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Portfolio")+Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.CreatePortfolio(1, translate.text);
                        }
                        imageSource: "asset:///images/portfolio_title_icon.png"

                    },
                    ActionItem {
                        title: qsTr( "News Feeds")+Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            var feeds = newsFeeds.createObject();
                            feeds.navId = {
                                'id': navTab,
                                'langSettings': translate.text
                            }
                            navTab.push(feeds);
                        }
                        imageSource: "asset:///images/news_feed_icon.png"

                    },
                    ActionItem {
                        title: qsTr("Language")+ Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            //_app.ChangeAppLanguage();
                            var go = langsettings.createObject();
                            go.lang = {
                                'lang': _app.getCurrentLocale()
                            }
                            go.setLanguage(_app.getCurrentLocale());
                            navTab.push(go);
                            //_app.changeOrientation();
                        }
                        imageSource: "asset:///images/language_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Support") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/support_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Share to Friends") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/share_iconfrnds.png"
                    },
                    ActionItem {
                        title: qsTr("Subscription Status") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/status_icon.png"
                    },
                    ActionItem {
                        title: qsTr("About mTadawul") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            var about= mTadawulNote.createObject();

                            about.navId = {
                                'id': navTab
                            }
                            navTab.push(about);

                        }
                        imageSource: "asset:///images/about_icon.png"
                    },

                    ActionItem {
                        title: qsTr("Exit Application") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.exitApp();
                        }
                        imageSource: "asset:///images/app_exit.png"
                    }

                ]
                //  } // end of ActionSet
                // ]
            }
  function onManualExit() {

                _app.deleteAllPushes();
                // This must exit the application.
                //exitApplication();
            }
}

 I did not get anything i.e, _app.deleteAllPushes(), is not called...where I am wrong..?

New Developer
Posts: 104
Registered: ‎09-25-2013
My Device: BB 10
My Carrier: BB 10

Re: BB 10 cascades signals when user closing the App

I am doing the same stuff, but in the Qml as follows 

Page {

                id: sharePage
                
                onCreationCompleted: {
                    console.log("First Screen Looaded");
                    if (! myIndicator.running) {
                        // Start the activity here.
                        myIndicator.start();
                       // text = "Stop";

                       Application.manualExit.connect(onManualExit);
                      
                    }
                }
              
                Container {
                    layout: StackLayout {
                        orientation: LayoutOrientation.TopToBottom
                    }
                    background: Color.Black
                   
                    Container {
                        layout: DockLayout {
                        }
                        leftPadding: 15.0
                        rightPadding: 15.0
                        horizontalAlignment: HorizontalAlignment.Fill
                        verticalAlignment: VerticalAlignment.Fill
                        background: Color.create("#f9393b30")
                        Label {
                            id:translate
                            objectName:"translate"
                           // text:_app.changeOrientation();
                            visible: false
                           }

                        Button {
                            horizontalAlignment: HorizontalAlignment.Left

                            imageSource: "asset:///images/add_remove_icon.png"
                            preferredWidth: 10.0
                            preferredHeight: 10.0
                            leftPadding: 100
                            onClicked: {
                                _app.dropSymbols(1); // Drop Req for Tadawul
                                lightTimer.stop();
                                _app.AddorDelete(1,translate.text);
                                //_app.dropSymbols(1);
                                //_app.clearModel();
                            }
                        }

                        ImageView {
                            imageSource: "asset:///images/title.png"
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center

                            preferredHeight: 71.0
                            preferredWidth: 258.0
                        }
                        Button {
                            horizontalAlignment: HorizontalAlignment.Right

                            imageSource: "asset:///images/search_icon.png"
                            preferredWidth: 10.0
                            preferredHeight: 10.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.0
                            }
                            onClicked: {
                                 lightTimer.stop();
                                _app.dropSymbols(1); // Drop Req for Tadawul
                                _app.loadQuickListSearch(1, translate.text);
                            }
                        }

                    }

                    Container {
                        id:tasiContainer
                       
                        layout: StackLayout {
                        // orientation: LayoutOrientation.RightToLeft//length==1
                            // orientation: (isArabic == 0) ?  LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                            orientation: translate.text.length==6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight

                        }
                        leftPadding: 15.0
                        rightPadding: 15.0
                        background: Color.create("#00a3b8")
                        horizontalAlignment: HorizontalAlignment.Fill

                        topMargin: 20.0
                        Label {
                            id:tasi
                            text: qsTr("Tadawul - TASI") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            textStyle.color: Color.White
                            
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 3.5
                            }
                        }

                        Container {
                            id: tadawulchange
                            layout: StackLayout {

                            }

                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.0

                            }

                            background: tasiperchange.text.indexOf('-') < 0 ? Color.create("#ff105900") : Color.DarkRed
                            verticalAlignment: VerticalAlignment.Center
                            preferredHeight: 20.0
                            Label {
                            	id: tasiperchange
                                text: "0.38%"
                                // textStyle.color: ListItemData.PerChange.indexOf('-') < 0 ? Color.Green : Color.Red //here
                                textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                textStyle.fontSizeValue: 30.0
                                layoutProperties: StackLayoutProperties {
                                    spaceQuota: 1.5
                                }
                                verticalAlignment: VerticalAlignment.Center
                                horizontalAlignment: HorizontalAlignment.Center
                                preferredHeight: 0.0

                            }

                        }

                        Label {
                            id: tasinetchange
                            text: "29.4"
                            textStyle.color: Color.White
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.0
                            }
                            textStyle.fontSize: FontSize.PointValue
                            textStyle.fontSizeValue: 6.0
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center
                        }

                        Label {
                            id: tasivol
                            text: "7,823.37"
                            textStyle.color: Color.White
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.5
                            }
                            textStyle.fontSize: FontSize.PointValue
                            textStyle.fontSizeValue: 6.0
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                        }

                    }
                    Container {
                        leftPadding: 15.0
                        rightPadding: 15.0
                        layout: StackLayout {
                            orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                        }
                        topPadding: 20.0


                        Label {
                            id: symbolTop
                            text: qsTr( "Company") + Retranslate.onLanguageChanged
                            // Text Style and size etc
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 2.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center

                            textStyle.color: Color.White
                        }
                        Label {
                            id: changePer
                            text: qsTr("Change %") + Retranslate.onLanguageChanged

                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0

                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White

                        }
                        Label {
                            id: ltpTop
                            text: qsTr("LTP") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                            
                        }
                        Label {
                            id: high
                            text: qsTr( "High") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                        }
                        Label {
                            id: low
                            text: qsTr("Low") + Retranslate.onLanguageChanged
                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                            textStyle.fontSizeValue: 30.0
                            layoutProperties: StackLayoutProperties {
                                spaceQuota: 1.5
                            }
                            verticalAlignment: VerticalAlignment.Center
                            horizontalAlignment: HorizontalAlignment.Center
                            textStyle.color: Color.White
                        }

                    }
                   function alignmentCenter(){
                        //translate.text.length == 6 ? (horizontalAlignment : HorizontalAlignment.Right) 
                        if(translate.text.length == 6){
                            return HorizontalAlignment.Right
                        }else if(translate.text.length == 7){
                            return HorizontalAlignment.Left
                        }
                    }
                    Container {
                        id:loader
                        objectName: "loader"
                       topMargin: 250
                        leftPadding: 300

                        visible: true
                        layout: StackLayout {
                            orientation: LayoutOrientation.TopToBottom
                        }
                       
                        ActivityIndicator {
                            id: myIndicator
                            objectName: "myIndicator"
                            preferredWidth: 100
                            horizontalAlignment: HorizontalAlignment.Center
                            verticalAlignment: VerticalAlignment.Center

                        }
                        Label {
                            id: loadText
                            text: qsTr( "Loading") + Retranslate.onLanguageChanged
                            //leftPadding: 700
                        }
                    }
                    

                    //Integrating
                    Container {
                        layout: StackLayout {
                          //  orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                            orientation: LayoutOrientation.LeftToRight
                        }
                        topMargin: 10
                      

                        ListView {
                            id: tradeList
                            objectName: "tradeList"
                            dataModel: _app.dataModel
                            visible: true;
                            //                            dataModel: _app.dataModel{
//                                onItemAdded: {
//                                    
//                                }
//
//                            }
                            listItemComponents: [
                                ListItemComponent {
                                    type: "header"
                                    Header {
                                        title: {
                                            ListItemData
                                        }
                                    }
                                },

                                // The tradeList Item
                                ListItemComponent {
                                    type: "item"

                                   
                                    Container {
                                        leftPadding: 15.0
                                        rightPadding: 15.0

                                        background: Color.create("#1a1a1a")
                                        preferredHeight: 80.0
                                        topMargin: 6
                                        

                                        layout: StackLayout {
                                            //orientation: LayoutOrientation.RightToLeft
                                           // orientation: translate.text.length == 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                                            orientation: ListItemData.isArabic.length== 6 ? LayoutOrientation.RightToLeft : LayoutOrientation.LeftToRight
                                        }
                                       
                                        Label {
                                            id: symbol
                                            text: qsTr( ListItemData.Symbol_En)
                                            //text: ListItemData.Symbol_En.length()>20?Symbol_En.subString(0,15): Symbol_En
                                            
                                            // Text Style and size etc
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 5.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 3.0
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Bold
                                            textStyle.fontSize: FontSize.PointValue
                                           // multiline: true

                                        }

                                        Container {
                                            id: tadawulchange1
                                            layout: StackLayout {

                                            }

                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 2.0

                                            }

                                          //  ListItemData.PerChange.length == 1 ? Color.create("#1a1a1a") :Color.DarkRed
                                          
                                          // background: ListItemData.PerChange.indexOf('-') < 0 ?((ListItemData.PerChange.length() == 1) ? Color.create("#1a1a1a") : Color.create("#ff105900")) : ((ListItemData.PerChange.length() == 1) ? Color.create("#1a1a1a") : Color.DarkRed)
                                            
                                            background: (ListItemData.PerChange.indexOf('-') < 0 )?((ListItemData.PerChange.length==1 ? Color.create("#1a1a1a") : Color.create("#ff105900"))): ((ListItemData.PerChange.length == 1 ? Color.create("#1a1a1a") : Color.DarkRed))
                                         
                                            verticalAlignment: VerticalAlignment.Center
                                            preferredHeight: 20.0
                                            Label {

                                                id: change
                                                text: ListItemData.PerChange
                                               // textStyle.color: ListItemData.PerChange.indexOf('-') < 0 ? Color.Green : Color.Red //here
                                                textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                                textStyle.fontSizeValue: 30.0
                                                layoutProperties: StackLayoutProperties {
                                                    spaceQuota: 2
                                                }
                                                verticalAlignment: VerticalAlignment.Center
                                                horizontalAlignment: HorizontalAlignment.Center
                                                preferredHeight: 0.0

                                            }

                                        }

                                        Label {
                                            id: ltp
                                            text: ListItemData.LTP
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        Label {
                                            id: highValue
                                            text: ListItemData.High
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        Label {
                                            id: lowValue
                                            text: ListItemData.Low
                                            textStyle.base: SystemDefaults.TextStyles.SubtitleText
                                            textStyle.fontSizeValue: 30.0
                                            layoutProperties: StackLayoutProperties {
                                                spaceQuota: 1
                                            }
                                            verticalAlignment: VerticalAlignment.Center
                                            horizontalAlignment: HorizontalAlignment.Center
                                            textStyle.color: Color.White
                                            textStyle.fontWeight: FontWeight.Default
                                        }
                                        onTouch: {
                                            console.log("Text@@@@@@@@@" + arabic.text);
                                        }
                                    }
                                    
                                }
                            ]
                            onTriggered: {
                                var selectedItem = dataModel.data(indexPath);
                                lightTimer.stop();
                                _app.dropSymbols(1); // Drop Req for Tadawul

                                _app.loadQuickWatch(selectedItem.symbol_ID);
                                

                            }
                            onVisibleChanged: {
                                myIndicator.stop();
                                loader.visible = false
                                loadText.visible=false
                            }
                        }

                        Timer {
                            id: lightTimer
                            // Specify a timeout interval of 1 second
                            interval: 500
                            onTimeout: {
                                // call method Qinvikable to load records
                                _app.readRecords();
                              
                            } // end of onTimeout signal handler

                        } // end of Timer
                    }

                }
                //                contextActions: [
                //                    ActionSet {
                //                        title: "Share Settings"
                actions: [

                    ActionItem {
                        title: qsTr("Custom Market Watch") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.GenerateCustWatch(1, translate.text);

                        }
                    },

                    ActionItem {
                        title: qsTr("Alerts") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.AddAlerts(1, translate.text);

                        }
                        imageSource: "asset:///images/alert_title_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Portfolio")+Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            _app.CreatePortfolio(1, translate.text);
                        }
                        imageSource: "asset:///images/portfolio_title_icon.png"

                    },
                    ActionItem {
                        title: qsTr( "News Feeds")+Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.dropSymbols(1); // Drop Req for Tadawul
                            lightTimer.stop();
                            var feeds = newsFeeds.createObject();
                            feeds.navId = {
                                'id': navTab,
                                'langSettings': translate.text
                            }
                            navTab.push(feeds);
                        }
                        imageSource: "asset:///images/news_feed_icon.png"

                    },
                    ActionItem {
                        title: qsTr("Language")+ Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            //_app.ChangeAppLanguage();
                            var go = langsettings.createObject();
                            go.lang = {
                                'lang': _app.getCurrentLocale()
                            }
                            go.setLanguage(_app.getCurrentLocale());
                            navTab.push(go);
                            //_app.changeOrientation();
                        }
                        imageSource: "asset:///images/language_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Support") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/support_icon.png"
                    },
                    ActionItem {
                        title: qsTr("Share to Friends") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/share_iconfrnds.png"
                    },
                    ActionItem {
                        title: qsTr("Subscription Status") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                        }
                        imageSource: "asset:///images/status_icon.png"
                    },
                    ActionItem {
                        title: qsTr("About mTadawul") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            var about= mTadawulNote.createObject();

                            about.navId = {
                                'id': navTab
                            }
                            navTab.push(about);

                        }
                        imageSource: "asset:///images/about_icon.png"
                    },

                    ActionItem {
                        title: qsTr("Exit Application") + Retranslate.onLanguageChanged
                        ActionBar.placement: ActionBarPlacement.InOverflow
                        onTriggered: {
                            _app.exitApp();
                        }
                        imageSource: "asset:///images/app_exit.png"
                    }

                ]
                //  } // end of ActionSet
                // ]
            }
  function onManualExit() {

                _app.deleteAllPushes();
                // This must exit the application.
                //exitApplication();
            }
}

 I did not get anything i.e, _app.deleteAllPushes(), is not called...where I am wrong..?

Highlighted
Contributor
Posts: 12
Registered: ‎04-08-2013
My Device: Z10 Limited Edition STL100-1
My Carrier: -

Re: BB 10 cascades signals when user closing the App

[ Edited ]

Try this:

 

    onCreationCompleted: {
        Application.setAutoExit(false)
    }

 

The manualExit signal is not emitted if the auto exit flag is set to true.