BB cascade application closing.

I would like to know if an application is closed by dragging the screen from the bottom to the high force to run the output from the application or is it sent to accessible backgroung later in the same State closing in this way.

When you close the application by pulling the lower forces albums it does not close until, unless you will not close it by clicking on the bottom right of the active closing application frame icon.

In this situation it will rest in the State of the background, and you can switch to any other task and after that, when you open the app through its active frame condition, he will be in the same condition as you left it.

For more information are contiguous if you please go through the videos from the blackberry.

Tags: BlackBerry Developers

Similar Questions

  • Method that returns the bb::cascades:Application?

    Hi, is there a method that returns the bb::cascades:Application?

    I solved the problem by simply passing the request of my class that needs it. If its solved because there is no such method I think.

  • Is it possible for a Cascade application change the Notification Mode to vibrate at normal

    I am interested in creating a timer application that returns my phone in 'Vibrate only' notification 'Normal' after a period of time defined.  I knshow you need to set permissions, but I didn't know anything like that to give permission to do so.  I have a Z10 with 10.2.1 on it.

    Is this possible or not BB 10.2.1 avoid this?   It would be nice to be able to do.

    A snippet of code showing how to set up permissions for this would be useful.

    You can change the Notification Mode since 10.2, here's what you need to do.

    Add this line to the bottom of the file bar - descriptor.xml, under the tab "source":

    access_notify_settings_control
    

    Add this line to your .pro file:

    LIBS += -lbbplatform
    

    Add this to your file:

    #include 
    
    public: Q_INVOKABLE void switchMode();private:
        bb::platform::NotificationGlobalSettings* notificationGlobalSettings;
    

    Add this to your .cpp file:

    void YourClass::switchMode()
    {
        if (notificationGlobalSettings->mode() == bb::platform::NotificationMode::Normal) {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Vibrate);
            break;
        } else if (notificationGlobalSettings->mode() == bb::platform::NotificationMode::Vibrate) {
            notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
            break;
        }
    }
    

    Simply call switchMode() function in c ++ or QML to switch between the Normal and the vibrator. Note that this code will do nothing if the mode is set to anything else than Normal or vibrate. If you prefer to scroll through all the available Notification mode, use this function:

    void YourClass::switchMode()
    {
        switch (notificationGlobalSettings->mode()) {
            case bb::platform::NotificationMode::Normal : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::PhoneOnly);
                break;
            }
            case bb::platform::NotificationMode::PhoneOnly : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::Vibrate);
                break;
            }
            case bb::platform::NotificationMode::Vibrate : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::Silent);
                break;
            }
            case bb::platform::NotificationMode::Silent : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::AlertsOff);
                break;
            }
            case bb::platform::NotificationMode::AlertsOff : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
                break;
            }
            default : {
                notificationGlobalSettings->setMode(bb::platform::NotificationMode::Normal);
                break;
            }
        }
    }
    
  • Emergency program will not process applications closed error code 0 x 80070005

    My MS convenience store starts but closes evertime regardless of the program, application or problem I have my troubleshoter of windows opens then closes "is an error produced and convenience store must close." Error code 0x80070005

    Hey Stan,

    I would say contact Microsoft Fix Center support team for assistance. They should be able to help you.

    See the link.

    http://social.Microsoft.com/forums/is/fixitcenter/threads

  • RoboHelp HTML Application closed

    I was working on another system while my RoboHelp project has increased. I might have too much upward at the same time. I received a message that the RoboHelp HTML Application has encountered a problem and needs to close. I don't have the ability to close properly. I chose to send an error report, but I don't know what will happen. I tried to click the Debug button and nothing happens. When I try to load my project, it gives me this error message and it will not appear. Does anyone know what I can do to locate the problem and get my project to work again?

    Jencie

    IT WORKED! Is there anything else I should do to restore whatever it is?

    Thanks a lot for your help!

  • How to get the timestamp to install official application?

    Is it possible to get the runtime the timestamp to install official application or datetime?
    I not looking for third-party solutions or workaround, but just the bb: official package.

    It seems that it's not accessible, I looked at those:
    BB::application
    BB::Cascades:application
    BB::ApplicationInfo
    BB: PackageInfo

    And none has the information you're looking for.

    Of course, it is quite easy to do it yourself with QSettings:
    QSettings settings;
    If (! settings.contains ("installDate")) {}
    settings.setValue ("installDate", QDateTime::currentDateTime());)
    }

  • strange question Application: instance()

    Hi all

    I have this strange problem if the following code is executed as a slot:

    void myapp::SomeSlot(QString result){        1. Label * pChild;
        2. pChild = bb::cascades::Application::instance()->findChild("testDialogLabelUser");
        3. pChild->setText(result);}
    

    It works very well. But if I have another static member function invoke the above code, on the 2 nd line, pChild is 0 - and this is why the code does not work. This may be the cause of ideas? PS This is the static function:

    void myapp::Wrapper_To_Call_Display(void* pt2Object, QString text)
    {
    
        myapp* self = (myapp*) pt2Object;
    
          // call member
        self->SomeSlot(text);
    }
    

    Solved.

    Apparently, the problem was that until the signal has been issued, I was showing the QML file that contained the testDialogLabelUser Label, this was however not the case more withth the static function...

  • reproduce the error login name and after application crash

    Hello

    I have attached the code that generates the duplicate connection name error and after they crash the application.

    Note :-in app when you press tab 3 at that point they extract data and once you press tab 3 then app crash,.

    So please update me as soon as possible.

    Thank you

    Umang.

    Still awaiting response that you will find attached code or I also include the code here

    QML

    // Default empty project template
    import bb.cascades 1.0
    
    TabbedPane {
        id: tabMeniuNavigation
    
        //showTabsOnActionBar: true
        Tab {
            title: qsTr("All")
            id: tab1
            Page {
                Container {
                    // define tab content here
                    Label {
                        text: qsTr("Tab1")
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle {
                            base: SystemDefaults.TextStyles.TitleText
                        }
                    }
                }
            }
        }
        Tab {
            id: tab2
            title: qsTr("Tab2")
            Page {
                Container {
                    // define tab content here
                    Label {
                        text: qsTr("Tab2")
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle {
                            base: SystemDefaults.TextStyles.TitleText
                        }
                    }
                }
            }
        }
        Tab {
            id: tab3
            title: qsTr("Tab3")
            content: Page {
                Container {
                    ListView {
                        objectName: "otherNoteListView"
                    } // ListView
                }
            }
            onTriggered: {
                app.medicialListData();
            }
        }
        Tab {
            id: tab4
            title: qsTr("Tab4")
            Page {
                Container {
                    // define tab content here
                    Label {
                        text: qsTr("Tab 4")
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle {
                            base: SystemDefaults.TextStyles.TitleText
                        }
                    }
                }
            }
        }
        Tab {
            id: tab5
            title: qsTr("Tab5")
            Page {
                Container {
                    // define tab content here
                    Label {
                        text: qsTr("Tab5")
                        horizontalAlignment: HorizontalAlignment.Center
                        textStyle {
                            base: SystemDefaults.TextStyles.TitleText
                        }
                    }
                }
            }
        }
        onCreationCompleted: {
            // this slot is called when declarative scene is created
            // write post creation initialization here
            console.log("TabbedPane - onCreationCompleted()")
    
            // enable layout to adapt to the device rotation
            // don't forget to enable screen rotation in bar-bescriptor.xml (Application->Orientation->Auto-orient)
            OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
        }
    }
    

    CPP

    // Default empty project template
    
    #include "FindMedicin.hpp"
    #include "customListMedicinitemfactory.h"
    
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::data;
    
    FindMedicin::FindMedicin(bb::cascades::Application *app) :
            QObject(app) {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("app", this);
    
        // create root object for the UI
        root = qml->createRootObject();
        // set created root object as a scene
        app->setScene(root);
    }
    
    FindMedicin::~FindMedicin() {
    
        QSqlDatabase::removeDatabase(mDbNameWithPath);
        delete medicinListView;
        model->registerUserData();
    
    }
    
    QString FindMedicin::copyFileToDataFolder(const QString fileName) {
        // Since we need read and write access to the file, it has
        // to be moved to a folder where we have access to it. First,
        // we check if the file already exists (previously copied).
        QString dataFolder = QDir::homePath();
        QString newFileName = dataFolder + "/" + fileName;
        QFile newFile(newFileName);
    
        if (!newFile.exists()) {
            // If the file is not already in the data folder, we copy it from the
            // assets folder (read only) to the data folder (read and write).
            QString appFolder(QDir::homePath());
            appFolder.chop(4);
            QString originalFileName = appFolder + "app/native/assets/" + fileName;
            QFile originalFile(originalFileName);
    
            if (originalFile.exists()) {
                // Create sub folders if any creates the SQL folder for a file path like e.g. sql/quotesdb
                QFileInfo fileInfo(newFileName);
                QDir().mkpath(fileInfo.dir().path());
    
                if (!originalFile.copy(newFileName)) {
                    qDebug() << "Failed to copy file to path: " << newFileName;
                }
            } else {
                qDebug() << "Failed to copy file data base file does not exists.";
            }
        }
    
        return newFileName;
    }
    
    //Find Pharama
    void FindMedicin::medicialListData() {
        CustomListMedicinItemFactory *otherNoteItemFactory =
                new CustomListMedicinItemFactory();
        qDebug() << "MediaList Data Called.";
    
        // create a data model with sorting keys for firstname and lastname
        model = new GroupDataModel(QStringList() << "field1");
    
        mDbNameWithPath = copyFileToDataFolder("sql/FindMedicin.db");
    
        // load the sql data from contacts table
        SqlDataAccess sda(mDbNameWithPath);
    
        //sda = new SqlDataAccess(mDbNameWithPath, this);
        if (sda.hasError()) {
            DataAccessError err = sda.error();
            //DataAccessError* err = sda.error();
            qWarning() << "SQL error: type=" << err.errorType() << ": "
                    << err.errorMessage();
    
        }
        QVariant list = sda.execute("select * from medicin_detail");
        // add the data to the model
        qDebug() << list.value();
        model->setGrouping(ItemGrouping::None);
        model->insertList(list.value());
        // create a ListView control and add the model to the list
        medicinListView = root->findChild("otherNoteListView");
        medicinListView->setObjectName("");
        medicinListView->setDataModel(model);
        medicinListView->setListItemProvider(otherNoteItemFactory);
    }
    

    more code as an attachment.

  • Application crashes when I join class presentation

    So I tried to figure out how to get the filepath link to invoke my camera.  I'm at the point where I tried everything nothing helped.  My last attempt was tie the class is exposed from my source code in my QML.

    in main.cpp:

    using ::bb::cascades::Application;
    // this allows us to write "Application"
    // instead of "bb::cascades::Application"
    
    void myMessageOutput(QtMsgType type, const char* msg) {
        Q_UNUSED(type);
       fprintf(stdout, "%s\n", msg);
       fflush(stdout);
    }
    // main() is the entry point of the application. It will be called by the
    // operating system when you start the application. You should never call this
    // yourself.
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
    
        qmlRegisterType("bb.platform", 1, 0, "RouteMapInvoker");
            bb::data::DataSource::registerQmlTypes();
            qmlRegisterType("bb.platform", 1, 0, "LocationMapInvoker");
            bb::data::DataSource::registerQmlTypes();
        // "Application" is the BB cascades class that handles interaction the
        // with BB10 operating system.
        Application app(argc, argv);
    
    #ifndef QT_NO_DEBUG
       qInstallMsgHandler(myMessageOutput);
       #endif
    
        // Register this type so qml can refer to enums and other symbols
        // declared in the App class.
        qmlRegisterType("Custom.lib", 1, 0, "ApplicationUI");
    
        // Create an instance of App on the stack. App's
        // constructor registers itself with Application object using setScene().
        // See app.cpp
        app.setCover(new ActiveFrame());
        ApplicationUI mainApp;
    
        // Start the application event loop (run-loop).
        return Application::exec();
    
        // When the loop is exited the Application deletes the scene which deletes
        // all its children (per Qt rules for children)
    }
    

    ApplicationUI.hpp:

    class ApplicationUI : public QObject
    {
        // Classes that inherit from QObject must have the Q_OBJECT macro so
        // the meta-object compiler (MOC) can add supporting code to the application.
        Q_OBJECT
    
        Q_PROPERTY(bb::cascades::DataModel* dataModel READ dataModel CONSTANT)
    
    public:
    
        // Describes the possible storage locations
        enum StorageLocations
        {
            StoreInQSettings, ///< objects are stored in QSettings
            StoreInFile       ///< objects are stored in custom files
        };
    
        // This allows the enum to be referred to in the qml file.
        // Note: the class also has to be registered using qmlRegisterType().
        // See the main.cpp file.
        Q_ENUMS(StorageLocations)
    
        // Creates a new App object
        ApplicationUI(QObject *parent = 0);
    
        // destroys the App object
        ~ApplicationUI();
    
        Q_INVOKABLE
            void inviteUserToDownloadViaBBM();
        Q_INVOKABLE
            void updatePersonalMessage(const QString &message);
    
            // Creates a new location object and saves it.
        Q_INVOKABLE bool addObject(const QString &name, const QString &description, const QString &datefield, const QString &lat, const QString &lon, const QString &categoryfield, const QString &mapurl, const QString &itempic);
    
        // Read all the objects from the selected storage location and
        // put them in the data model
        Q_INVOKABLE void refreshObjects();
    
        // Remove all the objects from the selected storage location.
        Q_INVOKABLE void clearObjects();
    
        // Change the first and last name of the location with the
        // provided id. Update the data model and storage.
        Q_INVOKABLE bool updateObject(const QString &id, const QString &name, const QString &description, const QString &datefield, const QString &lat, const QString &lon, const QString &categoryfield, const QString &mapurl, const QString &itempic);
    
        // Delete the location with the given id from the selected storage location.
        Q_INVOKABLE bool deleteObject(const QString &id);
    
        // Change the location we're using for the data, and
        // refresh the list.
        Q_INVOKABLE void setStorageLocation(StorageLocations strLocation);
    
            Q_INVOKABLE void addPinAtCurrentMapCenter();
            Q_INVOKABLE void clearPins();
            Q_INVOKABLE void updateDeviceLocation(double lat, double lon);
            Q_INVOKABLE QString getValueFor(const QString &objectName, const QString &defaultValue);
            Q_INVOKABLE void saveValueFor(const QString &objectName, const QString &inputValue);
            Q_INVOKABLE void InvokeCamera();
            Q_INVOKABLE void InvokeSettings();
            Q_INVOKABLE void InvokeImageViewer(const QString &urlPic);
    
            public slots:
            void childCardDone(const bb::system::CardDoneMessage &message);
    
            signals:
            void cameraCaptureCompleted(const QString &imageLink);
    //        void filterChanged();
    
    ........
    

    in my ApplicationUI.cpp

    ApplicationUI::ApplicationUI(QObject *parent)
        : QObject(parent)
        , m_lastCustomerID(0)
        , m_storageLocation(StoreInQSettings)
        , m_storage(new SettingsStorage)
    
    {
    
        // prepare the localization
            m_pTranslator = new QTranslator(this);
            m_pLocaleHandler = new LocaleHandler(this);
            invokeManager = new bb::system::InvokeManager();
            invokeManager->setParent(this);
    
            if(!QObject::connect(m_pLocaleHandler,
                SIGNAL(systemLanguageChanged()),
                this,
                SLOT(onSystemLanguageChanged()))) {
                // This is an abnormal situation! Something went wrong!
                // Add own code to recover here
                qWarning() << "Recovering from a failed connect()";
            }
    
            connect(invokeManager,
            SIGNAL(childCardDone(const bb::system::CardDoneMessage&)), this,
            SLOT(childCardDone(const bb::system::CardDoneMessage&)));
    
            // initial load
            onSystemLanguageChanged();
    
        // Initialize the data model before the UI is loaded
        // and built so its ready to be used.
        initDataModel();
    
    //    qmlRegisterType("uri",1,0,"App");
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("_app", this);
    
        AbstractPane *root = qml->createRootObject();
    
    .....
    
    void ApplicationUI::InvokeCamera()
    {
        bb::system::InvokeManager manager;
        bb::system::InvokeRequest request;
        request.setTarget("sys.camera.card");
        request.setAction("bb.action.CAPTURE ");
        request.setMimeType("image/jpeg");
        InvokeTargetReply *targetReply = manager.invoke(request);
    
    }
    
    void ApplicationUI::childCardDone(const bb::system::CardDoneMessage &message)
    {
        QString imageLink;
        if (message.reason() == "done") {
    
            imageLink = "file://" + message.data();
        }
        qDebug() << message.reason() << "\n";
        qDebug() << message.dataType() << "\n";
        qDebug() << "file://" + message.data() << "\n";
    
        emit cameraCaptureCompleted(imageLink);
    }
    

    in my QML:

    import bb.cascades 1.0
    import Custom.lib 1.0
    
    Sheet{
    
    Page{
    
    Container{
    
    Label{id: itemPic}
    
    Button{
    
    onClicked: {
    _app.InvokeCamera()
    }
    
    }
    
    }
    
    attachedObjects: [
    
    ApplicationUI {
    onCamerCapturedCompleted: {
    
    itemPic.setText(imageLink)
    
    }}
    ]
    }
    }
    

    As soon as I attach the class the application does not start and the accident, if I change it it is fine.

    Hello

    Instance of ApplicationUI is already exported to QML as _app. One possible approach connects the signal to a JS function:

    Sheet
    {
      onCreationCompleted: {
        _app.cameraCaptureCompleted.connect(captureCompleted)
      }
    
      function captureCompleted(imageLink) {
        console.log("imageLink: " + imageLink)
      }
      ...
    
    }
    

    Element using Qt Quick "Connection" is another option.

    This code should be deleted (it creates a second instance of ApplicationUI, which probably was not provided):

    qmlRegisterType("Custom.lib", 1, 0, "ApplicationUI");
    
    ...
    
    attachedObjects: [
    ApplicationUI {
    onCamerCapturedCompleted: {
    itemPic.setText(imageLink)
    }
    
  • Problem with the file opened in the application via InvokeRequest

    Hello

    my application opens the file and reads its binary content. I have a small problem to open a file from a navigation or an attachment.

    But first here's how my app works. I have a signal/slot-connection in my applicationUI constructor:

    ApplicationUI::ApplicationUI(bb::cascades::Application *app) : QObject(app), m_invokeManager(new bb::system::InvokeManager(this)) {
    
      bool ok;
    
      // Since the variable is not used in the app, this is added to avoid a
      // compiler warning.
      Q_UNUSED(ok);
    
      ok = QObject::connect(m_invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)), this, SLOT(handleInvoke(const bb::system::InvokeRequest&)));
    
    }
    

    So if the user clicks on a file it can open in the following C++ function:

    void ApplicationUI::handleInvoke(const bb::system::InvokeRequest& request) {
    
        QString workingDir = QDir::currentPath();
    
    // Initiate the appropriate target based on the invoke.target-key
        if (request.target() == "com.myapp.card.previewer") {
    
            m_uri = request.uri().toString();
    
            QString FileToOpen = m_uri.replace(QString("file://"), QString(""));
    
            bb::cascades::Page* PageToOpen = ApplicationUI::doLoadPageDetails(FileToOpen);
    
            if (PageToOpen != NULL) {
                initPreviewerUI();
            } else {
                ShowToast("FEHLER! Seite kann nicht geladen werden");
            }
        }
    }
    

    The doLoadPageDetails () - function creates a page and filled with binary content of reading a file. If the file contains errors or is corrupted an exception is thrown.

    And here is my problem. When I opened a file corrupted first the screen becomes darker before opening the app. The I get error messages, exactly as I want. But the screen stays dark. I can't take another navigation element. Also, I can't use the back button. The only solution is to wipe the screen and then use the active frame to close the filebrowser and reopen it.

    That I can't use it with attachments to emails. When I open on and the screen is dark, I can't close the view for emails. So to see the mails again I have to restart the BB decive.

    I'm not fluent in English, but I hope you understand my problem. Is it possible to cancel the invokeRequest when the file is corrupted? Or what can I do here?

    Well, the solution was to use a Toast message but the dialog box. Because that prevents the application and I can't and shows just the message, with the button on this dialog box, I cannot tell the app to close.

  • How QMetaObject::invokeMethod solved: no method bb::cascades:QmlListView error?

    Hi all

    When I try to call QMetaObject::invokeMethod at that time where I get error below.

    "QMetaObject::invokeMethod: no such bb::cascades:QmlListView:detailNews (QVariant) method.

    Down here I have attached a code please check and let me know how I can fix this issue?

    ApplicationUI.cpp

    NewsList.cpp

    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::data;
    
    QString getValueByKey(QVariant qVariant, QString qStrKey);
    QString getValueByKey(QVariant qVariant, QString qStrPath, QString qStrKey);
    QVariantList getListByPath(QVariant qVariant, QString qStrPath);
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
            QObject(app), root(0)
    {
        // prepare the localization
        m_pTranslator = new QTranslator(this);
        m_pLocaleHandler = new LocaleHandler(this);
    
        bool res = QObject::connect(m_pLocaleHandler, SIGNAL(systemLanguageChanged()), this,
                SLOT(onSystemLanguageChanged()));
        // This is only available in Debug builds
        Q_ASSERT(res);
        // Since the variable is not used in the app, this is added to avoid a
        // compiler warning
        Q_UNUSED(res);
    
        // initial load
        onSystemLanguageChanged();
    
        // Create scene document from main.qml asset, the parent is set
        // to ensure the document gets destroyed properly at shut down.
        /* QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
         // Create root object for the UI
         AbstractPane *root = qml->createRootObject();
    
         // Set created root object as the application scene
         Application::instance()->setScene(root);*/
        QmlDocument *qmlLoadingDialog = QmlDocument::create("asset:///LoadingDialog.qml").parent(this);
        dialogLoading = qmlLoadingDialog->createRootObject();
        languageLocalList = languageList();
        home_Page();
    }
    
    void ApplicationUI::onSystemLanguageChanged()
    {
        QCoreApplication::instance()->removeTranslator(m_pTranslator);
        // Initiate, load and install the application translation files.
        QString locale_string = QLocale().name();
        QString file_name = QString("Godfessions_%1").arg(locale_string);
        if (m_pTranslator->load(file_name, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(m_pTranslator);
        }
    }
    
    void ApplicationUI::home_Page()
    {
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        //QmlDocument *settingqml = QmlDocument::create("asset:///Setting_Page.qml").parent(this);
        qml->setContextProperty("app", this);
        root = qml->createRootObject();
        m_newListView = root->findChild("newsListView");
        root->setParent(this);
        Application::instance()->setScene(root);
    
        showLoadingDialog();
        getCategories("12143");
        newsListWebServices("12143");
        closeLoadingDialog();
    }
    
    void ApplicationUI::detailNews(QString news_Id)
    {
        qDebug() << "Detail News Get" << news_Id;
    }
    
    /** * Prepared by :- Umang Shah * **/#include "NewListItem.hpp"
    
    #include #include #include #include #include #include #include #include 
    
    using namespace bb::cascades;
    
    NewListItem::NewListItem(ListView * listView) : CustomControl(0){ this->listView = listView; QmlDocument *qml = QmlDocument::create("asset:///CustomRowNewsList.qml").parent(this); root = qml->createRootObject(); m_newsName = root->findChild

    It also seems that you have an incorrect class here.  You are detailNews method is in your ApplicationUI class, but you are trying to call on the ListView, not your ApplicationUI object.

    I recommend having a read through our documentation of signals and Slots , which should help you to achieve what you're trying to do.

  • How to combine code C++ of Cascade with the native C code in a project?

    Purpose: Using C++ Cascade camera video sample with native C sensor log.

    and function by using Cascade C++ user interface with native C detection function.

    Problem: After putting code of Cascade C++ native code C, the library shows unresolved inclusion.

    Question: How do I combine code C++ of Cascade with the native C code in a project?

    Minimal code:

    #include
    #include

    #include 'printf.h.

    #include
    #include
    #include

    #include "hellovideocameraapp.hpp".

    to: bb::cascades:Application;

    int main (void) {app app (argc, argv);

    New HelloVideoCameraApp (&app);)

    Return app.exec ();

    printfhw();
    printf ("Hello new %d", hwnum);
    Return EXIT_SUCCESS;
    }

    You just add the header and call the function as you would normally call a C in C++ function.

    You will need to provide clarification as to what you are trying to accomplish.  In its current form it looks like you want to run C code in an application of cascades.  You are more that welcome to do so, there is nothing to stop you.

    Waterfalls of projects are default C++ projects.  You do not even need to use QML and can do everything straight c++.

    Cascades IS C++ and C and C++ get along very well, so the answer that was given to us.

    We cannot give exmamples because all you need to do is create a new project of cascades in the IDE and it will generate the default files for you who are C++.  Just add your headers and other whatnot and start coding.

  • Application does not appear under Application permissions in 10 BB

    I will implement a BlackBerry 10 Cascade application. Here, I have responded to permissions in the bar - descriptor.xml.

    run_when_backgrounded
    access_internet

    Then I clean, build, and run the application using QNX Momentics IDE. Then go to the Control Panel -> Security -> permissions of the Application and select "all permissions" in the menu dropdown. But I do not see my app that there are listed. I use the device Dev Alpha for my tests. I used the same device of liberation to build the Configuration.

    What could be the mistake I made?

    No errors except these permissions require the approval of the user. You will never see those listed there. Try it as access_files (or whatever it is) and it should appear.

  • How to call the function cascade BlackBerry

    I begineer in blackberry c ++.

    I do two class is testobject and second in test .i call the onther text function average () and nexttext();

    so please how to call this function.

    // Default empty project template
    #include "TestObect.hpp"
    
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    TestObect::TestObect(bb::cascades::Application *app)
    : QObject(app)
    {
        // create scene document from main.qml asset
        // set parent to created document to ensure it exists for the whole application lifetime
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // set created root object as a scene
        app->setScene(root);
    }
    
    void TestObect::test(){
    
        qDebug()<< "****************Naveen";
    }
    

    I insert also declared in the header file.

    Q_INVOKABLE Sub test();

    then I create another test class.

    /*
     * test.cpp
     *
     *  Created on: Apr 2, 2013
     *      Author: nksharma
     */
    
    #include "test.h"
    
    test::test() {
        // TODO Auto-generated constructor stub
    
    }
    
    void test:: nexttest(){
        qDebug()<<"***********Next test*********"
    
    }
    test::~test() {
        // TODO Auto-generated destructor stub
    }
    

    error in the file namespace,

    here in file herder

    the namespace error

    /*
     * test.h
     *
     *  Created on: Apr 2, 2013
     *      Author: nksharma
     */
    
    #ifndef TEST_H_
    #define TEST_H_
    
    class test {
    public:
        test();
        virtual ~test();
         Q_INVOKABLE void nexttest();
    };
    
    #endif /* TEST_H_ */
    

    You have a space between the colon and the n in:

    void test:: nexttest()
    

    Another thiing, if you are using Q_INVOKABLE, you must declare Q_OBJECT in your front header file public:

     


    If you're still having problems, try to clean up the project with Project > clean...

  • App rejected with application settings management

    Hello

    I am a new developer, and I'm trying to implement a configuration management in my application. I found some information on the forum and other Internet site. When I test it with the Simulator (10.2.1 and 10.3) and my devices (Blackberry Z30 and passport) it works without any problem.

    My question is when I am trying to release my app on BlackBerry World, BlackBerry test team rejected it and told me that they cannot launch my application when they tap the... I asked explanations more because I couldn't reproduce this problem and they sent me a video of the bug (every time they tap the add anything...).

    I still don't understand how they can have this question if the test tool with my devices, everything is ok...

    Can you help me understand what's wrong in my code that could explain this bug?

    Here is my code for layout management:

    main.cpp
    
    #include "applicationui.hpp"
    
    #include 
    
    #include 
    #include 
    
    #include 
    
    using namespace bb::cascades;
    
    int main(int argc, char **argv)
    {
        // this is where the server is started etc
        Application app(argc, argv);
    
        // localization support
        QTranslator translator;
        QString locale_string = QLocale().name();
        QString filename = QString( "PourcentagesFaciles_%1" ).arg( locale_string );
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator( &translator );
        }
        // create the application pane object to init UI etc.
        new ApplicationUI(&app);
        // we complete the transaction started in the app constructor and start the client event loop here
        return Application::exec();
        // when loop is exited the Application deletes the scene which deletes all its children (per qt rules for children)
    }
    
    Applicationui.hpp
    
    #ifndef ApplicationUI_HPP_
    #define ApplicationUI_HPP_
    
    #include 
    
    namespace bb {
        namespace cascades {
            class Application;
        }
    }
    
    class QTranslator;
    
    class ApplicationUI : public QObject
    {
        Q_OBJECT
        public:
        ApplicationUI(bb::cascades::Application *app);
        ~ApplicationUI();
    
        Q_INVOKABLE
        QString getValueFor(const QString &objectName, const QString &defaultValue);
        Q_INVOKABLE
        void saveValueFor(const QString &objectName, const QString &inputValue);
    };
    
    #endif /* ApplicationUI_HPP_ */
    
    applicationui.cpp
    
    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app)
    : QObject(app)
    {
        QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
        qml->setContextProperty("_app", this);
    
        AbstractPane *root = qml->createRootObject();
    
        app->setScene(root);
    }
    
    ApplicationUI::~ApplicationUI()
    {
    
    }
    
    QString ApplicationUI::getValueFor(const QString &objectName, const QString &defaultValue)
    {
        QSettings settings;
    
        if (settings.value(objectName).isNull()) {
            return defaultValue;
        }
    
        return settings.value(objectName).toString();
    }
    
    void ApplicationUI::saveValueFor(const QString &objectName, const QString &inputValue)
    {
        QSettings settings;
    
        settings.setValue(objectName, QVariant(inputValue));
    }
    

    I found a solution to my problem by changing the code.

    I write the code in case someone had the same problem as me.

    main.cpp

    #include "applicationui.hpp"
    #include 
    
    #include 
    
    #include 
    #include 
    #include 
    
    #include 
    
    using ::bb::cascades::Application;
    
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        Application app(argc, argv);
    
        ApplicationUI mainApp;
    
        return Application::exec();
    }
    

    applicationui. HPP

    #ifndef ApplicationUI_HPP_
    #define ApplicationUI_HPP_
    
    #include 
    
    namespace bb
    {
        namespace cascades
        {
            class LocaleHandler;
        }
    }
    
    class QTranslator;
    
    class ApplicationUI : public QObject
    {
        Q_OBJECT
    
            public:
            ApplicationUI();
            ~ApplicationUI();
    
            Q_INVOKABLE QString getValueFor(const QString &objectName, const QString &defaultValue);
            Q_INVOKABLE void saveValueFor(const QString &objectName, const QString &inputValue);
    
            private:
    
            Q_SLOT void onSystemLanguageChanged();
    
            QTranslator* mTranslator;
    
            bb::cascades::LocaleHandler* mLocaleHandler;
    };
    
    #endif /* ApplicationUI_HPP_ */
    

    applicationui.cpp

    #include "applicationui.hpp"
    
    #include 
    #include 
    #include 
    #include 
    #include 
    
    using namespace bb::cascades;
    
    ApplicationUI::ApplicationUI()
    {
        QCoreApplication::setOrganizationName("test babou en carton");
        QCoreApplication::setApplicationName("test babou en carton");
    
        mTranslator = new QTranslator(this);
        mLocaleHandler = new LocaleHandler(this);
        onSystemLanguageChanged();
        bool connectResult = connect(mLocaleHandler, SIGNAL(systemLanguageChanged()), SLOT(onSystemLanguageChanged()));
        Q_UNUSED(connectResult);
    
        QmlDocument *qml = QmlDocument::create("asset:///main.qml");
        qml->setContextProperty("_app", this);
    
        if (!qml->hasErrors()) {
            AbstractPane *appPane = qml->createRootObject();
            if (appPane) {
                Application::instance()->setScene(appPane);
            }
        }
    }
    
    ApplicationUI::~ApplicationUI()
    {
    
    }
    
    QString ApplicationUI::getValueFor(const QString &objectName, const QString &defaultValue)
    {
        QSettings settings;
    
        if (settings.value(objectName).isNull()) {
            return defaultValue;
        }
    
        return settings.value(objectName).toString();
    }
    
    void ApplicationUI::saveValueFor(const QString &objectName, const QString &inputValue)
    {
        QSettings settings;
        settings.setValue(objectName, QVariant(inputValue));
    }
    
    void ApplicationUI::onSystemLanguageChanged()
    {
        QCoreApplication::instance()->removeTranslator(mTranslator);
    
        QString localeString = QLocale().name();
        QString fileName = QString("testBabouEnCarton_%1").arg(localeString);
        if (mTranslator->load(fileName, "app/native/qm")) {
            QCoreApplication::instance()->installTranslator(mTranslator);
        }
        qDebug() << "language " << localeString;
    }
    

Maybe you are looking for