Toast not declared in the scope

Hello

I am going through the updated documentation and having problems of implementation of the toast.

void App::showToast() {
    toast = new SystemToast(this);
    toast->setBody("Welcome to the BlackBerry 10 Cascades documentation!" + "You have lots of space, but your text will wrap around in the dialog box.");
    toast->show();
}

Returns an error: "toast not declared in the scope" on this line:

toast = new SystemToast(this);

I've added all these header files to my name .cpp

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

using namespace bb::cascades;
using namespace bb::system;

My .pro includes these:

LIBS   += -lbbdata -lbbsystem

My header app.hpp file looks like this

// List with context menu project template
#ifndef App_HPP_
#define App_HPP_

#include 

namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class App : public QObject
{
    Q_OBJECT
public:
    App(bb::cascades::Application *app);
    virtual ~App() {}
    void showToast();
};

#endif /* App_HPP_ */

Have a blast to find out why its not working. Anyone of you has a working example that connects everything to display a simple toast?

Thank you

I guess you missed the variable declaration.

Declare an SystemToast object in the method itself or in app.hpp like this:

SystemToast *toast;

Kind regards

Nishant Shah

Tags: BlackBerry Developers

Similar Questions

  • SOA 12.1.3 ORABPEL-02118 - variable is not declared in the current scope

    Hello

    I'm trying to run a code example for the conversion of input XML XSD inside BPEL (SOA Suite 12.1.3). )

    1 file xsd

    <? XML version = "1.0" encoding = "windows-1252"? >

    " < xsd: Schema container = ' http://www.w3.org/2001/XMLSchema "xmlns =" " http://www.email.org "

    " targetNamespace = ' http://www.email.org "elementFormDefault ="qualified"> "

    < xsd: element name = "email" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "ovdTriggeredDate" type = "xsd: String" minOccurs = "1" / >

    < xsd: element name = "query" type = "RequestType" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: complexType name = 'RequestType' >

    < xsd: SEQUENCE >

    < xsd: element name = "requestId" type = "xsd: long" minOccurs = "1" / >

    < xsd: element name = "service" type = "xsd: String" minOccurs = "1" / >

    < xsd: element name = "action" type = "xsd: String" minOccurs = "1" / >

    < xsd: element name = "customer" type = "xsd: String" minOccurs = "1" / >

    < xsd: element name = "delivery" type = "xsd: String" minOccurs = "0" / >

    < xsd: element name = "local" type = "xsd: String" minOccurs = "0" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: Schema >

    2 BPEL code

    < variable name = "emailVar" element = "ns3:email" / > / / variable of type XSD

    < variable name = "emailDataVar" type = "xsd: String" / >

    < assign the name 'Assign2' = >

    < copy >

    < from > "& lt;" Email & gt; & lt; ovdTriggeredDate & gt; 16thFeb & lt; / ovdTriggeredDate & gt; & lt; request & gt; & lt; requestId & gt; 1111 & lt; / requestId & gt; & lt; Service & gt; OVDOngoing & lt; / service & gt; & lt; action & gt; Retry & lt; / action & gt; & lt; customer & gt; Batch & lt; / customer & gt; & lt; delivery & gt; Email & lt; / delivery & gt; & lt; local & gt; & lt; countryCode & gt; U.S. & lt; / countryCode & gt; & lt; languageCode & gt; English & lt; / languageCode & gt; & lt; / settings regional & gt; & lt; / request & gt; & lt; / e-mail & gt; "< / from >

    < to > $emailDataVar < /pour >

    < / copy >

    < copy >

    < from > ora: parseEscapedXML (ora: getContentAsString (bpws:getVariableData('$__emailDataVar__'))) < / from >

    < to > $emailVar < /pour >

    < / copy >

    < / assign >

    < / details >

    Get after exception when I run the application.

    < detail >

    XPath expression cannot run.

    An error occurs during the processing of the XPath expression; the term is ora:parseEscapedXML (ora:getContentAsString (bpws:getVariableData('$emailDataVar'))).

    The XPath expression cannot run; the reason was: ORABPEL-02118

    Variant could not be found.

    The variable '$emailDataVar' is not declared in the current scope. All variables must be declared in the scope before accessed. Component DN is "default/Project1!1.0*soa_c1383edb-7f32-4860-8d21-82d312a0e1da/BPELProcess1" and the corresponding Instance Id is 20 042

    There was an internal error. The flow was not generated correctly by the BPEL compiler.

    Contact Oracle Support Services. Please provide definition component of the "default/Project1!1.0*soa_c1383edb-7f32-4860-8d21-82d312a0e1da/BPELProcess1" trail and verification of instance id 20 042 using enterprise console manager.

    . Check the detailed origin described in the text of the exception message and verify that the XPath query is correct.

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

    There is a solution, I found in the forum to add the following in bpel code. (Problem of access to the variables in BPEL - ORABPEL-02118)

    <>configurations

    < property name = "keepGlobalVariables" > true < / property >

    < / configuration >


    But when I add <>configurations in 12.1.3 BPEL, editor-in-Chief is showing 'element configurations is not supported'.


    Appreciate your quick help.

    Thank you

    Cdhar

    Hello

    The problem is "$", you don't need a dollar in this case

    bpws:getVariableData('emailDataVar')

    Please mark this message as useful/correct if it helps.

    Concerning

    Pradeep.

  • error "Ibsta" no was not declared in this scope

    I have a "error: 'Ibsta' was not declared in this scope."

    I try to program with C++ and GPIB test equipments, but so far, I have this problem.

    I'm sorry, but my knowledge of C++ is very limited because I took a module on it for about 4 months in College and now I have to rectify emergency for my project. Any help would be much apprciated, I tried searching the forums, but I still have to find an answer. I think it has something to do with my linker. BTW, I use Code blocks to compile program, so it may be different from other IDEs posted here such as Microsoft Visual C++, Borland, Dev C++.

    The program that I write to you is as follows:

    #include
    #include "ni488.h".
    #include
    #include
    #include "Decl. - 32.h"
    #include

    using namespace std;

    void GpibError (const char * msg); / * Function to Error statement * /.

    Device int = 0; / * Peripheral device descriptor * /.
    int BoardIndex = 0; / * Interface index (GPIB0 = 0, GPIB1 = 1, etc..) * /.

    int main() {}
    int PrimaryAddress = 28; / * Main unit address * /.
    int SecondaryAddress = 0; / * Secondary unit address * /.
    char Buffer [101]; / * Read buffer * /.

    /*****************************************************************************
    * Boot - made only once at the beginning of your application.
    *****************************************************************************/

    Device = ibdev (/ * create a device descriptor pointer * /)
    BoardIndex, / * Board Index (GPIB0 = 0, GPIB1 = 1,...) * /.
    PrimaryAddress, / * address of the primary device * /.
    SecondaryAddress, / * peripheral secondary address * /.
    T10s, / * delay (T10s = 10 seconds) option * /.
    1, / * line EOI assert at the end of writing * /.
    (0); / * Mode of termination EOS * /.
    If (Ibsta() & ERR) {/ * find GPIB error * /}
    GpibError ("ibdev Error");
    }

    ibclr (Device); / * System * /.
    If {(Ibsta() & ERR)
    GpibError ("ibclr Error");
    }

    /*****************************************************************************
    * Body - writing the majority of your GPIB application code here.
    *****************************************************************************/

    ibwrt (device, "* IDN?", 5 "); / * Send the command ID of the query * /.
    If {(Ibsta() & ERR)
    GpibError ("ibwrt Error");
    }

    Bird (device, buffer, 100); / * Read up to 100 bytes of the device * /.
    If {(Ibsta() & ERR)
    GpibError ("Bird error");
    }

    Buffer [Ibcnt ()] = '\0 '; / * Null terminate the string ASCII * /.

    printf ("%s\n", buffer); / * Print the device identification * /.

    /*****************************************************************************
    * UN-initialize - done only once at the end of your application.
    *****************************************************************************/

    ibonl (device, 0); / * Turn off the line * /.
    If {(Ibsta() & ERR)
    GpibError ("ibonl Error");
    }

    }

    /*****************************************************************************
    * Function GPIBERROR
    * This function will warn you that a function of NOR-488 failed by
    * a print error message. The State IBSTA variable will also be
    * printed in hexadecimal with the senses mnemonic of the forest
    * position. The State IBERR variable will be printed in decimal form
    * with the mnemonic significance of the decimal value. The status
    * Variable IBCNT will be printed in decimal form.
    *
    * The NOR-488 IBONL function is called to turn off the equipment and
    * software.
    *
    OUTPUT Comptrollership will end this program.
    *****************************************************************************/
    void GpibError (const char * msg) {}

    printf ("%s\n", msg);

    printf ("Ibsta () = 0 x %x<",>
    If (Ibsta() & ERR) printf ("ERR");
    If (Ibsta() & TIMO) printf ("TIMO");
    If (Ibsta() & END) printf ("END");
    If (Ibsta() & SRQI) printf ("SRQI");
    If (Ibsta() & RQS) printf ("QR");
    If (Ibsta() & CMPL) printf ("CMPL");
    If (Ibsta() & LOK) printf ("LOK");
    If (Ibsta() & REM) printf ("REM");
    If (Ibsta() & CIC) printf ("CIC");
    If (Ibsta() & ATN) printf ("ATN");
    If (Ibsta() & TAC) printf ("TAC");
    If (Ibsta() & MFP) printf ("LAKES");
    If (Ibsta() & CDI) printf ("CDI");
    If (Ibsta() & DCAS) printf ("DCAS");
    printf ("" > \n ");

    printf ("Iberr() = %d", Iberr() ");
    If (Iberr() == EDVR) printf ("EDVR \n");
    If (Iberr() == ECIC) printf ("in ECIC \n");
    If (Iberr() == ENOL) printf ("ENOL \n");
    If (Iberr() == EADR) printf ("EADR

    \n");

    If (Iberr() == HELLO) printf ("the GRAE \n");
    If (Iberr() == ESAC) printf ("ALD \n");
    If (Iberr() == EABO) printf ("EABO \n");
    If (Iberr() == ENEB) printf ("ENEB \n");
    If (Iberr() == PAES) printf ("PAES \n");
    If (Iberr() == ECAP) printf ("ECAP \n");
    If (Iberr() == EFSO) printf ("EFSO \n");
    If (Iberr() == USBE) printf ("USBE \n");
    If (Iberr() == ESTB) printf ("ESTB \n");
    If (Iberr() == ESRQ) printf ("ESRQ \n");
    If (Iberr() == XTAB) printf ("Established\n");
    If (Iberr() == ELCK) printf ("ELCK \n");
    If (Iberr() == MART) printf ("MART \n");
    If (Iberr() == EHDL) printf ("EHDL \n");
    If (Iberr() == EWIP) printf ("EWIP \n");
    If (Iberr() == ERST) printf ("ERST \n");
    If (Iberr() == EPWR) printf ("EPWR \n");

    printf ("Ibcnt () = %u\n", Ibcnt() ");
    printf ("\n");

    / * Call the ibonl to get the device and interface offline * /.
    ibonl (device, 0);

    "exit" (1);
    }

    The program I had is a sample I found the Instrument National software called GPIB Explorer.


  • Error "batteryInfo" has not declared in this scope

    Hi, I have this error in my project, I understand the example of the battery of the sample, but I get the error of generation.

    'MarcossitMobile10::MarcossitMobile10(bb::cascades::Application*)':
    ../src/MarcossitMobile10.cpp:17:42: error: 'batteryInfo' was not declared in this scope
    cc: C:/bbndk/host_10_0_9_404/win32/x86/usr/lib/gcc/arm-unknown-nto-qnx8.0.0eabi/4.6.3/cc1plus caught signal 1
    make[2]: *** [o.le-v7-g/.obj/MarcossitMobile10.o] Error 1
    make[2]: Leaving directory `C:/Users/marcossit/ndk-10.0.9-workspace/MarcossitMobile10/arm'
    make[1]: *** [debug] Error 2
    make[1]: Leaving directory `C:/Users/marcossit/ndk-10.0.9-workspace/MarcossitMobile10/arm'
    make: *** [Device-Debug] Error 2
    
    **** Build Finished ****
    

    I don't understand this part I declare scope

    This is the main.cpp Batterysample

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    
    using namespace bb::cascades;
    using namespace bb::device;
    
    /**
     * This sample application shows some basic
     * usage of the BatteryInfo API, such as charging level and charging state.
     */
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
    
        Application app(argc, argv);
    
        QTranslator translator;
        const QString locale_string = QLocale().name();
        const QString filename = QString("batterysample_%1").arg(locale_string);
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator(&translator);
        }
    
    //! [0]
        // Create the battery info object
        BatteryInfo batteryInfo;
    
        // Load the UI description from main.qml
        QmlDocument *qml = QmlDocument::create("asset:///main.qml");
    
        // Make the BatteryInfo object available to the UI as context property
        qml->setContextProperty("_battery", &batteryInfo);
    //! [0]
    
        // Create the application scene
        AbstractPane *appPage = qml->createRootObject();
        Application::instance()->setScene(appPage);
    
        return Application::exec();
    }
    

    It's my main.cpp

    /*
    * Copyright (c) 2012 Jason I. Carter
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    #include "Flashlight.hpp"
    #include 
    #include 
    #include 
    #include 
    
    #include 
    #include 
    #include 
    #include "MobileMarcossit.hpp"
    #include "RegistrationHandler.hpp"
    #include "InviteToDownload.hpp"
    #include 
    
    using namespace bb::cascades;
    using namespace bb::cascades::advertisement;
    
    Q_DECL_EXPORT 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( "MobileMarcossit_%1" ).arg( locale_string );
        if (translator.load(filename, "app/native/qm")) {
            app.installTranslator( &translator );
        }
        BatteryInfo batteryInfo;
        const char *uri = "bb.cascades.advertisement";
           qmlRegisterType(uri, 1, 0, "Banner");
           qmlRegisterUncreatableType("bb.device", 1, 0, "BatteryChargingState", "");
           qmlRegisterType("Flashlight", 1, 0, "Flashlight");
    
        // Every application is required to have its own unique UUID. You should
        // keep using the same UUID when you release a new version of your application.
        //TODO:  YOU MUST CHANGE THIS UUID!
        // You can generate one here: http://www.guidgenerator.com/
        const QUuid uuid(QLatin1String("c4e27f7c-f9d2-40dc-8630-1d037a0a1309"));
    
        //Setup BBM registration handler
        RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);
    
        //AppName.cpp file which contains your main.qml file
        MobileMarcossit *mobileMarcossit = new MobileMarcossit(registrationHandler->context(), &app);
    
        // Whenever the registration has finished successfully, we continue to the main UI
        // Added finishRegistration() to registrationFinished()
        // This is to emit signal and by pass use of continue button as shown in sample
        QObject::connect(registrationHandler, SIGNAL(registered()), mobileMarcossit, SLOT(show()));
    
        // 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)
    }
    

    It's my MarcossitMobile10.cpp

    // Default empty project template
    #include "MarcossitMobile10.hpp"
    
    #include 
    #include 
    #include 
    #include 
    using namespace bb::cascades;
    
    MarcossitMobile10::MarcossitMobile10(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("_battery", &batteryInfo);
        // create root object for the UI
        AbstractPane *root = qml->createRootObject();
    
        // set created root object as a scene
        app->setScene(root);
    }
    

    and get the error in this line that I declare.

     qml->setContextProperty("_battery", &batteryInfo);
    

    Help...

    Organizing in this way PPH, but already now, run nothing comes in my dev alpha application

    MarcossitMobile10.hpp

    // Default empty project template
    #ifndef MarcossitMobile10_HPP_
    #define MarcossitMobile10_HPP_
    
    #include 
    
    #include 
    namespace bb { namespace cascades { class Application; }}
    
    /*!
     * @brief Application pane object
     *
     *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
     */
    class MarcossitMobile10 : public QObject
    {
        Q_OBJECT
    public:
        bb::device::BatteryInfo* batteryInfo;
        MarcossitMobile10(bb::cascades::Application *app);
        virtual ~MarcossitMobile10() {}
    };
    
    #endif /* MarcossitMobile10_HPP_ */
    

    the qml constructor is bateria.qml

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    import bb.cascades 1.0
    import bb.device 1.0
    
    // Page laying out the visual components
    Page {
        Container {
            layout: DockLayout {}
    
            ImageView {
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
    
                imageSource: "asset:///images/bateria/background.png"
            }
    
            Battery {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Center
            }
    
            Container {
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
    
                bottomPadding: 50
    
                //! [0]
                Label {
                    id: stateLabel
    
                    horizontalAlignment: HorizontalAlignment.Center
    
                    text: {
                        switch (_battery.chargingState) {
                            case BatteryChargingState.Unknown:
                                return qsTr ("Unknown");
                                break;
                            case BatteryChargingState.NotCharging:
                                return qsTr ("Not Charging");
                                break;
                            case BatteryChargingState.Charging:
                                return qsTr ("Charging");
                                break;
                            case BatteryChargingState.Discharging:
                                return qsTr ("Discharging");
                                break;
                            case BatteryChargingState.Full:
                                return qsTr ("Full");
                                break;
                        }
                    }
                    textStyle {
                        color: Color.White
                        fontSize: FontSize.XLarge
                    }
                }
                //! [0]
    
                Label {
                    id: descriptionLabel
    
                    horizontalAlignment: HorizontalAlignment.Center
                    bottomMargin: 100
    
                    text: {
                        switch (_battery.chargingState) {
                            case BatteryChargingState.Unknown:
                                return qsTr ("Something is up with the battery");
                                break;
                            case BatteryChargingState.NotCharging:
                                return qsTr ("Plugged in, just no charge");
                                break;
                            case BatteryChargingState.Charging:
                                return qsTr ("Plugged in");
                                break;
                            case BatteryChargingState.Discharging:
                                return qsTr ("Unplugged and discharging");
                                break;
                            case BatteryChargingState.Full:
                                return qsTr ("Plugged in, full");
                                break;
                        }
                    }
                    textStyle {
                        color: Color.Gray
                        fontSize: FontSize.Large
                    }
                }
            }
        }
    }
    

    and the qml plugin is Battery.qml

    /* Copyright (c) 2012 Research In Motion Limited.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    
    import bb.cascades 1.0
    import bb.device 1.0
    
    Container {
        preferredWidth: 498
        preferredHeight: 318
    
        layout: DockLayout {}
    
        //! [0]
        ImageView {
            id: batteryOutline
    
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
    
            imageSource: _battery.chargingState == BatteryChargingState.Unknown ? "asset:///images/bateria/battery_plugged_error.png" :
                         _battery.chargingState == BatteryChargingState.NotCharging ? "asset:///images/bateria/battery_plugged_bad.png" :
                         _battery.chargingState == BatteryChargingState.Charging ? "asset:///images/bateria/battery_plugged.png" :
                         _battery.chargingState == BatteryChargingState.Discharging ? "asset:///images/bateria/battery.png" :
                         _battery.chargingState == BatteryChargingState.Full ? "asset:///images/bateria/battery_plugged.png" : ""
        }
        //! [0]
    
        //! [1]
        ImageView {
            id: loadingLevel
    
            horizontalAlignment: HorizontalAlignment.Left
            verticalAlignment: VerticalAlignment.Center
    
            translationX: 75
            preferredWidth: _battery.level * 350.0 / 100.0
    
            imageSource: _battery.level <= 10 ? "asset:///images/bateria/fill_red.png" :
                         _battery.level <= 20 ? "asset:///images/bateria/fill_yellow.png" :
                         _battery.level < 100 ? "asset:///images/bateria/fill_grey.png" : "asset:///images/bateria/fill_green.png"
        }
        //! [1]
    
        ImageView {
            id: stateIndicator
    
            horizontalAlignment: HorizontalAlignment.Center
            verticalAlignment: VerticalAlignment.Center
    
            imageSource: _battery.chargingState == BatteryChargingState.Unknown ? "asset:///images/bateria/exclamation.png" :
                         _battery.chargingState == BatteryChargingState.NotCharging ? "asset:///images/bateria/exlamation.png" :
                         _battery.chargingState == BatteryChargingState.Charging ? "asset:///images/bateria/flash.png" :
                         _battery.chargingState == BatteryChargingState.Discharging ? "" :
                         _battery.chargingState == BatteryChargingState.Full ? "" : ""
        }
    }
    

    It will be something else?

    qml->setContextProperty("_battery", &batteryInfo);
    

    for example

    qml->setContextProperty("_bateria", &batteryInfo);
    
    or
    
    qml->setContextProperty("Battery", &batteryInfo);
    
  • error: 'QmlDocument' was not declared in this scope

    I followed along the following:

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

    And added the following code to main.cpp:

    #include 
    #include 
    
    #include "app.hpp"
    
    using ::bb::cascades::Application;
    
    int main(int argc, char **argv)
    {
        Application app(argc, argv);
    
        QmlDocument *qml = QmlDocument::create("main.qml");
        AbstractPane *root = qml->createRootNode();
        Application::setScene(root);
    
        return Application::exec();
    }
    

    When compiling, I get the error:

    error: 'QmlDocument' was not declared in this scope
    

    Your weird namespace.

    using bb::cascades;

    Try this.

    Edit: Also if I were you I wouldn't want to create a new project and select HelloCasades as a model.  That will be running a lot faster than to try to do it from scratch.

  • SqlDataAccess has not declared in this scope

    Learn how to use SQL statements in the Cascades.

    I'm following the example provided in https://developer.blackberry.com/cascades/reference/bb__data__sqldataaccess.html

    I copied the code example in my app.cpp and consisted of two instructions include:

    #include 
    #include 
    

    Here is the code

    // create a data model with sorting keys for firstname and lastname
    GroupDataModel *model =
      new GroupDataModel(QStringList() << "firstname" << "lastname");
    
    // load the sql data from contacts table
    SqlDataAccess sda("contacts.db");
    QVariant list = sda.execute("select * from contact order by firstname");
    
    // add the data to the model
    model->insertList(list.value());
    
    // create a ListView control and add the model to the list
    ListView *listView = new ListView();
    listView->setDataModel(model);
    

    When I compile I get the following:

    ../src/app.cpp:21:5: error: 'SqlDataAccess' was not declared in this scope
    

    What I am doing wrong?

    Thank you!

    SqlDataAccess is located in the bb::data namespace.

    Also, need to add the line:

    LIBS += -lbbdata
    

    in *.pro in your project file. See here:

    https://developer.BlackBerry.com/Cascades/documentation/dev/upgrading/index.html#library

  • another namespace issue? 'CameraSettings' was not declared in this scope

    I have a camera native c ++ application coded and run successfully.

    I want to change the flash mode.  So I add:

    CameraSettings* cameraSettings = new CameraSettings();
     cameraSettings->setFlashMode(CameraFlashMode::Light);
     camera->applySettings(cameraSettings);
    

    I also add:

    #include 
    #include 
    

    When I build, I get the error:

    'CameraSettings' was not declared in this scope.

    Is it a matter of namespace or a:

    LIBS += ?
    

    ... question?

    Something else?

    My current LIBS:

    LIBS += -lcamapi -lscreen
    

    I see what is happening, I mix with QT c functions.

    I need to use the settings as shown in this example:

    http://supportforums.BlackBerry.com/T5/native-development/Flash-always-on-camera/m-p/1911403/HIGHLIG...

    Thanks for your help.

  • setScene not declared in this scope

    Im working on the c ++ here Navigation pane:

    https://developer.BlackBerry.com/Cascades/documentation/UI/navigation/multiple_screens_stack.html

    I get the error:

    setScene has not declared in this scope.

    Any ideas how to fix?

    With the help of beta3.

    Hello

    You must use following syntax to define the method of application setScrene.

    NavigationPane * rootPane = qml-> createRootObject();

    Application::instance()-> setScene (rootPane);

  • 'DAQmxReserveNetworkDevice' was not declared in this scope

    Hey guys. I have a problem with this function. I have already included NIDAQmx.h in my aplication c ++ and the functions of this header works. However, I was checking and "DAQmxReserveNetworkDevice" was not included in the header, identical to DAQmxAddNetworkDevice. How to use these functions in my application c ++ then?

    I got it. I just added the function in the NIDAQmx.h, so now I'm able to use the service. I write in attachments of the header file where everyone needs

  • Mobile applications - target component using the component of reference - JSON is not defined in the scope

    Application based Mobile Apps to integrate angular with AEM and transfer data to angular range of AEM using angular.json.jsp and controller.js.jsp. When I am using this standalone as a component and drag to the page that is based on the angular model. The JSON created in angular.json.jsp is readable in controller.js.jsp with "frameworkType = angular.

    When this component is written in another page, in another page trying to use within the reference element, the angular.json.jsp, controller.js.jsp does not come to the image at all.

    I had a use case to create the JSON structure (to go to angular range) in one place, then all pages using the reference component. Pointers would be useful

    Hi Sandeep,

    The best recommendation I can offer at this point is to create an extension of the component/libs/foundation/components/reference that includes the node of cq: model by specifying frameworkType: angular and supports transmission by proxy of applications angular.json and controller.js to the resource "referenced". I've hacked together an example of component to prove:

    Mobile reference component example · GitHub

    Hope this helps,

    Bruce

  • InvokeManager has not declared in this scope

    Hey guys

    How are you today?, hoping you're all going well

    I have a weird bug that continues to show the material to what I did for me

    I did a class, spicific for invocations to my email, twitter account etc... I took the code from the site blackberry like (copy-past) here and made some changes to of course the actions and targets... I have included all classes in the code that I copied as follows:

    #include 
    #include 
    #include 
    

    but I get these weird errors:

    and it's happening for each class included

    and I've linked with the library system LIBS +=-lbbsystem

    any help with this?

    Thank you very much

    Space of names that you use?

    NICU namespace bb::system;

    or

    BB::System:InvokeManager * invokeManager;

  • Please help: why my variables are not displayed in the subtemplate?

    Hi all

    We use BEEP 11.1.1.6 (build 5.12.110)

    We have several models of rtf and some with templates.

    In this case, I declared a variable var1 in the upper part of the main model.
    I also said variable var2 in the subtemplate.

    In the subtemplate, I added this command:
    var1:<?xdoxslt:get_variable($_XDOCTX, 'var1')?>
    var2:<?xdoxslt:get_variable($_XDOCTX, 'var2')?>
    var2 always displays normally.
    var1 is always null (RC = NaN when I pass it as a parameter to the submodel)
    The value appears correctly the second main folder of XML data.


    Is there something wrong in my code?
    Is there a reason why the variable is NULL in the first record of the main loop?

    Please find attached an example with different variables and params:
    https://FTS.Capgemini.com/pubpwd/66814124735400/XML_Publisher_test.zip link is valid until 2013-05-13 13:00 UTC (access with local public password)
    Username: ijtzggnrz
    Password: uP8YrdRPKc

    I hope my explanation is clear.
    Thanks in advance,
    Olivier

    Look at the response of amri in Obtaining Variable in footer of RTF
    >
    Variables when declared in the body section are not available in the scope of the header/footer.
    So you can't put in the body section and see the same thing in the header/footer.

    I think you want to have the header/footer conditional for some sets of pages. If you can explain your condition here we offer if this is possible.
    >

    and the response of the Vetsrini in the use of variables within a foot of the RTF template
    >
    Footer is in a different context,

    If you will not be able to use the variable declared in the page inside the footer,

    try to create a sample footer variable is assign a value and displays
    you will be able to display that correctly...

  • "XYZ" is not in the scope. You may need to use an alias for "MNO".

    Hello

    I use 3 entities

    Global

    ABC

    XYZ

    All relationships are in one on one, Global contains ABC and ABC contains XYZ.

    XYZ contains a text MNO attribute and I executed the bottom rule in the doc of the rule of the OPM 10.3.1 and 10.4. In 10.4 it works fine where as in 10.3, I get an error "" XYZ" is not in the scope. "You may need to use an alias for"MNO""

    MNO is correct if

    MNO = "MARK".

    I would like to know why I get this error and the solution for it.
    Thanks in advance

    I highly recommend to undertake formal training. Then the OPA is easy to get up and run with, it's like any other powerful tool that once you start digging into the most powerful bits you need to have a better understanding of the underlying concepts to really get the best value.

    You must also make sure that read you the excellent guide of best practices of Jasmine

    http://www.Oracle.com/technetwork/apps-tech/policy-automation/learnmore/policymodelingbestpracticeguide-1371173.PDF

    So assuming that we still use the above very limited model (it's rare to see 1:1 too many relationships in practice) and you need to get this working on 10.3... essentially, what you're going to need to do is navigate the relationships to pass information to the entity levels - I'll use your feature names as on the model, but they write the rules more difficult to understand.

    I suppose that the text of standard relationship containment generated automatically.

    the global attribute value

    1 For(all instances of ABC, ABC has an MNO of "Mark")

    2 otherwise

    ABC has a MNO 'brand '.

    For (all instances of XYZ to ABC, MNO XYZ = "Mark")

    Although personally I would also enter the condition in the second rule to a conclusion so separate.

  • PL/SQL - change the value of a parameter (not declared as NOCOPY)

    Hi all

    In the following simple example, which should be in p_invar, when it is called to dbms_output?
    I'd say "BEFORE", because it is not declared as NOCOPY, but looks like I'm wrong...
    On our HP - UX 11 GR 2 database, p_invar is set to "AFTER" - it is a 'feature' / bug?

    declare
    --
    g_var VARCHAR2 (4000);
    --
    procedure showvar (p_invar in VARCHAR2) is
    Start
    --
    g_var: = "AFTER";
    --
    dbms_output.put_line(p_invar||) e /'|| g_var);
    --
    end showvar;
    --
    Start
    g_var: = "BEFORE";
    showvar (p_invar = > g_var);
    end;
    /

    Oracle® database PL/SQL language reference
    * 11g Release 2 (11.2) *.
    Part number E17126-04
    Chapter 8

    Subprogramme Aliasing parameter with the parameters passed by reference

    When the compiler passes a real parameter by reference, the actual and formal parameters refer to the same memory location. Therefore, if the subroutine changes the value of the formal parameter, change immediately shows in the real setting.

    The compiler always happening IN reference parameters, but the aliasing resulting cause any problems, because the subprogrammes could not assign values to the PARAMETERS.

    PARAMETERS are passed by reference, so when you change the actual variable, you change even as a variable IN.

    Published by: david.sweet on February 17, 2011 10:30

    Published by: david.sweet on February 17, 2011 10:30, typo

  • DSN of ELEMENT not defined in the APPLICATION scope

    DSN of ELEMENT not defined in the APPLICATION scope


    Hi, I'm new to see my problem is as follows:

    I have 2 files:

    application.cfm that is inside
    d:\inetpub\wwwroot\mysite\

    and

    hand. CFC
    (d:\inetpub\wwwroot\mysite\cfc)

    inside of application.cfm I set an application variable:
    < cfset Application.DSN = "mydb" >
    (and connections mydb works if they are tested in coldfusion administrator)

    inside the main.cfc, I use the application variable:

    < cffunction = 'getLogin' access returntype = name "remotely" = "struct" output = "true" >
    < name cfargument = "nickname" type = "string" required = "true" >
    < name cfargument = "password" type = "string" required = "true" >
    < cfset returnedValue = structNew () >
    < name cfquery = "q_getLogin" datasource = "#application. DSN #">"
    SELECT id, nickname
    to allieve
    etc...

    ..
    < cfreturn returnedValue >
    < / cffunction >

    I call the SWC from flash, and I get the DSN of ELEMENT error undefined in APPLICATION scope.
    Someone has an idea of what could be bad?
    Thanks in advance,
    Mitja

    Not sure now why doesn't he call application.cfm, but my solution to CF6 time should include the application.cfm within my CFC... you can add a cfinclude within the item, on the very top, not inside any function... every time that Flash calls the CFC this code will be executed before the function call.
    If this component is also used by CF, then you can wrap which include in a conditional... You can check application.applicationName...
    HTH

Maybe you are looking for