Creating a constructor

Hi, this is my first time posting here and my first time in Aboriginal Cascades.

Im trying to do multi class constructors in c ++ and im getting an error:

#include 
#include 
#ifndef INFORMATION_H_
#define INFORMATION_H_
using namespace bb::cascades;
class Information {
public:
    Information();
    Information(string name,string details,string image);
    ~Information();
    Label* name;
    Label* details;
    Image* image;
};

#endif /* INFORMATION_H_ */

but im getting a problem, it says this: should ')' before 'name'

hope someone knows how to fix this problem...

Hello

Welcome to the forums.

string is class std C++, but I do not see that the correspondent understands. It is probably best to use QString of Qt, which is also used in other classes of Cascades:

Information(const QString &name, ...etc)

In addition, using "using namespace" should not be in the header files, this will lead to the pollution of the namespace. It is better to use full names in the headers: bb::cascades:Label * name etc.

Instead of using includes, classes can be declared before:

namespace bb { namespace cascades { class Label; } }

This will make the compilation faster.

That you plan to use classes of waterfalls (labels and Images), it is better inherit QObject class own addition includes and macros in the class declaration and define the class as their parents.

Tags: BlackBerry Developers

Similar Questions

  • How to create the constructor function for a pl/sql table?

    I created a PL/SQL type as table below:

    create or replace type typ_tbl_des_text is table of the typ_tof_des_text

    OK so far, but I would like to have a constructor function which would be subject to validations and raise_application_error when a validation condition is not met.

    How to do this?

    The typ_tof_des_text that I created with a constructor function, so that the record-level validation are performed in the constructor. And I think the postings between several records shall be made in a constructor for typ_tbl_des_tex, but cannot figure out how to create such a constructor.

    BEDE wrote:

    So, if I have understood correctly, to a plsql table type, I can't have a member procedure. Or can I? I mean, just as for a type of failure I can have one or more constructors and possibly several procedures of Member.

    For the standard tables in PL/SQL, you will need to create your own API (using procedures and functions) to handle beyond the basics provided by the language. No constructors and methods as it is no o - o.

    After thinking a little deeper, I reformulate what I said earlier and actually wants to have a member procedure called add_item, who would be first to check if an item with a key value exists and, if so, it would be up-to-date and so not only extend the plsql table.

    Two options.

    As we already mentioned, an associative array can be considered - note however that this structure of table has name-value pairs.

    Another method is to use a TWG (global temporary table). You define the structure of the once initial table. When a session uses the structure of the table, private copying is instantiated for this session. When the session ends, this copy is destroyed. The table is a temporary structure for this session only.

    It can include indexes and so on – which means you can use the constraints of primary keys, unique indexes, secondary indexes and so on.

    TWG scales are much better than collections or arrays that require a PGA (expensive private server) memory. In addition, SQL can be used natively against a GTT - unlike the arrays and collections.

  • You can create a "constructor" for video clips?

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

    What I do:

    var this_array [counter] = new monster; Monster is a clip

    init_monster(); things of the game like .name, .x, there, etc.

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

    What I want to do:

    var this_array [counter] = new monster();

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

    When I add a 'monster' I then called a function to "initialize" all his stats.

    Is it possible in the creation of the object, as with a builder, where he automatilly the fact on 1 line?

    I teach myself and I'm kinda stuck on this part.  If I have to create a 'monster' class to do what I want to say just.

    Simple examples or links to simple examples would be great. Thanks in advance.

    There is no real difference between these two lines except that the second one is the right way to write it.

    var this_array [counter] = new monster;

    var this_array [counter] = new monster();

    In both cases, you will need to take additional steps to specify different properties for the object.  You can write a class file that does this, or you can let Flash create the file (by assigning a team of class in the library) without the ability to set specific to specific values propertiies.

  • Recover phone calls log position of the telephone Journal

    Hello

    I'm trying to retrieve the position of the PhoneCallLog, based on the name/number highlighted in the PhoneLog.

    If you click the green phone icon, you will see the whole phoneLog.  If you scroll down to the third entry and click on the trackball, BB will give you a list of possibilities with the entry of specified PhoneLog (for example calling NameInTheList, SMS NameInTheList, copy 5556666, set of ring tones, full Menu).

    If you move to the next (or previous entry in the PhoneLog), and if you click again on the track-ball, will list Exchange, based on the name of the person

    (for example calling AnotherNameInTheList, AnotherNameInTheList, copy 8889900 SMS, ringtones Set complete men)...

    I want to retrieve the name, but it's easy once found the position in the PhoneLog.

    Which is actually possible?

    Thank you in advance,

    Hrvoje Kevic

    Tehning d.o.o..

    Croatia

    Hi, Mark!

    I have already created the application that adds a MenuItem the phone log (it is added to the startup of the BB device).  So, when the phone device starts - up, I add the item menu, and when, in the log of phone calls and by clicking on one of the items in the log of phone calls, I get the menu item I want.

    However, I am not able get the name of the participant.

    Here is the code I use to do this:

    public Object execute (object context) {}
    If (context instanceof PhoneCallLog) {}
    _PhLog = (PhoneCallLog) context;
    PAP UiApplication = UiApplication.getUiApplication ();
    theApp.pushScreen (new TTelephoneCallScreen());
    theApp.requestForeground ();
    }
    Returns a null value.
    }

    Is this piece of code written in the right direction?

    Here instead of PhoneCallLog use something else?

    Or is that what you wanted to know what phone call log has been selected?

    When the comparison with the link you send me (which I've used in development - it seems that I was on a good path), I'm guessing that the essential line is

    _PhLog = (PhoneCallLog) context;

    I said like,

    Private Shared PhoneCallLog _PhLog

    If all this is correct, then it seems to me that the only thing I have to do is to create a constructor in the class that implements the screen.  Am I right, or...?

    Thank you for your help,

    Sincerely,

    Hrvoje

  • Declaring constant in an associative array

    Hi all
    is it possible to declare constants on associative array without using a constructor function of a package? Just curious...
    Best regards

    Val

    Valerie Debonair wrote:

    In this case, Init_My_AA is the constructor for the My_AA associative array type. I was wondering if we can achieve the same thing without create such constructor.

    It is not a constructor. A constructor is called when the object/variable is created.

    The function is simply just that - a function that returns a scalar (not) of a specific data type. Its output is assigned as the value of a constant.

    And no - I don't think there is another way to initialize a constant of this type of data.

    Consider the following data types and initialization of a value of that type:

    create or replace type TNumbers is table of number;
    /
    
    declare
            type TNumArray is table of number;
            type TNumAss is table of number index by pls_integer;
    
            numList TNumbers := TNumbers(1,2,3,4,5,6,7);
            numArray TNumArray := TNumArray(1,2,3,4,5,6,7);
            numAss TNumAss := TNumAss( ???? );      --// what are the parameters for the type?
    begin
            DBMS_OUTPUT.put_line( numList.Count );
            DBMS_OUTPUT.put_line( numArray.Count );
            DBMS_OUTPUT.put_line( numAss.Count );
    end;
    /
    

    The collection both normal table allows you to easily make reference to this definition of data type and initialize it (not scalar) value of this type.

    PL/SQL lacks syntax (that I know of) to do the same thing with a type of associative array data more complex. And for this reason, you must use a user-defined function to create each element of the array via an individual code or transfer statement.

  • Unauthorized attributes!

    Hello!

    I'm having a problem when I enter a user using the JNDI, I wonder if anyone in the group help me!

    Well, after having suffered much (lol), I found a tutorial on how to enter data in OpenLDAP as I wanted, which was to create a class that extends the DirContext.

    Doing this and then be able to add a user using the standard ldap attributes, I created a constructor with the fields I wanted to insert. Instantiate all cute, but when I get home, he said that the field cannot be included:

    LDAP: error code 65 - attribute 'name' unauthorized

    I went to the ldap attribute and saw that it was this:

    Used for the user object class

    It has something to do? I need to do something to say that I am in this class inherits from the user?

    It is interesting that if I enter this same object with only the attribute 'fax' it works!

    Published by: Hor on 28/10/2010 12:32

    Well, after having suffered much (lol), I found a tutorial on how to enter data in OpenLDAP as I wanted, which was to create a class that extends the DirContext.

    You'll have to explain it to me because I do not understand. If you want an LDAP object with arbitrary attributes, just add extensibleObject the objectClass attribute. Extending DirContext is a dead end, I see. You must add an object factory and all that, and you lose the ability to create your own object subcontexts too.

    Do that and then be able to add a user using the standard ldap attributes

    Just create a set of attributes including objectClass = {top, person, organizationalPerson inetOrgPerson} and you're done. Then simply use the attributes defined for inetOrgPerson. If you want more, add extensibleObject as above.

  • Help with this & quot; for & quot; loop...!

    Hello. I recorded an ArrayCollection collection on the desktop. When I read it in the application I get the problem that the ArrayCollection collection is now a collection of objects, not a collection of type 'Player' which is the class that represents each item in the collection ArrayCollection. Each player class has three properties of type string associated with it.

    I created a function to "grab" the elements of the ArrayCollection collection. It takes the ArrayCollection collection that has been saved on the desktop as the first argument and the 'player' class as the second argument and must return a typed ArrayCollection collection.

    Try to understand why he continues to launch a mistake... and if I need a second loop inside the first passing variables of objects of the element to the temp object.

    Thank you!

    private void typeCollection (object: collection, clazz: Class): ArrayCollection collection

    {
    var arr:ArrayCollection = new ArrayCollection();
    for each {(var point: objet de collection)}

    var temp: Object = new clazz()
    Temp = item;
    arr.addItem (temp);
    }
    Return arr; return the collection of table
    }

    Hello.

    The error I get is below...

    ArgumentError: Error #1063: inconsistency of Argument on Player() County. 3 EXPECTED, got 0. hand / typeCollection [C:\Documents and Settings\Utilisateur\Mes Documents\Flex Builder 3\main\src\main.mxml:108])

    108 is the line var temp: Object = new clazz();

    When you ask what clazz in... Clazz represents the second argument of the typeCollection function and the argument that is passed is the player class, which is a class in an external actionscript file.

    In fact I just to work. The problem was... I created the constructor function of the class player to accept three arguments (id, first name, family name)... and so new clazz() should have 3 arguments... I just changed the code below and it seems to work...

    If there is a better way happy to hear!

    Thanks for responding.

    private void typeCollection (object: collection, claz: Class): ArrayCollection collection

    {
    var arr:ArrayCollection = new ArrayCollection();

    var a: String;
    var b:String;
    var c:String;

    for each {(var point: objet de collection)}

    var temp: Object = new claz (a, b, c)
    Temp = item;
    arr.addItem (temp);
    }

  • Failed to create the reference to the FXMLLoader controller: "no constructor appropriate."

    Greetings,

    I'm in my first two days, experimenting with JavaFX.

    I am trying to create a reference to my controller class to in my routine of starting application. All the posts I've seen on this call to the code as follows:
     FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MyFXML.fxml")); 
    But in my NetBeans IDE editor this code reports the error "no suitable constructor found for FXMLLoader (java.net.URL)."

    The documentation for the FXMLLoader class undeniably a constructor FXMLLoader (java.net.URL). However, when I access the NetBeans source code, this constructor does not show: the only options are FXMLLoader() and FXMLLoader (Charset arg0).

    I use NetBeans 7.1.2 ee version. I was using JavaFX 2.0, then downloaded the SDK 2.2 JavaFX (beta) to see if it would make a difference - she didn't.

    Any ideas would be very appreciated.

    Hello

    My guess would be that NetBeans resumes still jars of JavaFX 2.0 instead of JavaFX 2.2

    I would say that play with the properties of your project: examine the library dependencies and the platform.
    If you use a Default_JavaFX_Platform then check where it picks up JavaFX (click on 'manage the platform' and look in the JavaFX tab).
    Sometimes, NetBeans is confused and will resume the 2.2 SDK with the 2.0 runtime - check if really all paths!

    Hopes this helps,

    -daniel

    Published by: daniel June 13, 2012 06:18

  • TypeError: Error #1007: tried to create an instance in a no constructor

    Hello guys,.

    Im stuck with actionscript error, I really need help here the error I got: -.

    TypeError: Error #1007: tried to create an instance in a no constructor.

    to Away3dScene / initObjects)

    in Away3dScene / init)

    at flash.display::DisplayObjectContainer/addChild()

    at Away3dProject()

    So to use Away3d, but don't really know what's wrong because everything seems to be OK, I'm using adobe flash cs5.5, flash player 10.

    hand. As code:

    package

    {

    import flash.display.Sprite;

    import flash.display.StageScaleMode;

    import flash.display.StageAlign;

    Import net.hires.utils.Stats;

    SerializableAttribute public class Away3dProject extends Sprite

    {

    public void Away3dProject()

    {

    stage.scaleMode = StageScaleMode.NO_SCALE;

    internship. Align = StageAlign.TOP_LEFT;

    var scene: Away3dScene = new Away3dScene();

    addChild (scene);

    stats: var = new Statistics Stats();

    addChild (stats);

    }

    }

    }

    and Away3dscene.as here:

    package

    {

    Import away3d.cameras.Camera3D;

    Import away3d.containers.Scene3D;

    Import away3d.containers.View3D;

    Import away3d.core.base.Object3D;

    Import away3d.core.clip.RectangleClipping;

    Import away3d.core.math.Number3D;

    Import away3d.materials.WireColorMaterial;

    Import away3d.overlays.LensFlare;

    Import away3d.primitives.Plane;

    import flash.display.BlendMode;

    import flash.display.Sprite;

    import flash.events.Event;

    SerializableAttribute public class Away3dScene extends Sprite

    {

    [Embed (source = "assets/library.swf", symbol = "Halo")]

    private var Halo: Class;

    [Embed (source = "assets/library.swf", symbol = "Flare1")]

    private var Flare1: Class;

    [Embed (source = "assets/library.swf", symbol = "Flare2")]

    private var Flare2: Class;

    [Embed (source = "assets/library.swf", symbol = "Flare3")]

    private var Flare3: Class;

    private var _scene:Scene3D;

    private var _camera:Camera3D;

    private var _view:View3D;

    private var _flare:LensFlare;

    public void Away3dScene()

    {

    this.addEventListener (Event.ADDED_TO_STAGE, init);

    }

    private void init(evt:Event):void

    {

    initScene();

    initObjects();

    this.addEventListener (Event.ENTER_FRAME, render);

    }

    private function initObjects (): void

    {

    / * floor: plan of var = new Plane();

    Floor.Width = floor.height = 100000;

    floor.segmentsW = floor.segmentsH = 12;

    Floor.y = - 3500;

    Floor.Material = new WireColorMaterial (0 x 333333);

    _Scene.addChild (Floor); * /

    var flareSourceDummy:Object3D = new Object3D();

    flareSourceDummy.x = 1000;

    flareSourceDummy.y = 500;

    flareSourceDummy.z = 3000;

    _Scene.addChild (flareSourceDummy);

    _flare = new LensFlare (flareSourceDummy, _camera);

    _flare.setBurnClip (_View);

    _flare.setHaloAsset (new Halo());

    _flare.addFlareAsset (new Flare1());

    _flare.addFlareAsset (new Flare3());

    _flare.addFlareAsset (new Flare1());

    _flare.addFlareAsset (new Flare2());

    _flare.useRotation = false;

    _flare.useAlpha = false;

    _flare.useScaling = false;

    _flare.useBurning = false;

    _flare. BlendMode = BlendMode.SCREEN;

    _flare.burnMethod = LensFlare.BURN_METHOD_COLOR_TRANSFORM;

    _View.addOverlay (_flare);

    }

    private function hoverCamera (): void

    {

    var mX:Number = this.mouseX > 0? this.mouseX: 0;

    var my: number = this.mouseY > 0? this.mouseY: 0;

    var tarX:Number = 3 *(mX-stage.stageWidth/2);

    tarY var: number = - 2 *(mY-stage.stageHeight/2);

    var dX:Number = _camera.x - tarX;

    var dY:Number = _camera.y - silent;

    _camera.x = dX * 0.25;

    _camera.y-= dY * 0.25;

    _camera. LookAt (new Number3D (0, 0, 0));

    }

    private function initScene (): void

    {

    _Scene = new Scene3D();

    _camera = new Camera3D({z:-1500});)

    _View = new View3D ({scene: _scene, camera: _camera});

    _View.x = stage.stageWidth/2;

    _View.y = stage.stageHeight/2;

    _View.clipping = new RectangleClipping ({minX:-stage.stageWidth / 2, minY:-stage.stageHeight / 2, maxX:stage.stageWidth / 2, maxY:stage.stageHeight/2});})

    _View.opaqueBackground = 0;

    addChild (_view);

    }

    private void render(evt:Event):void

    {

    hoverCamera();

    _View. Render();

    }

    }

    }

    Please guys, any idea will be useful for me.

    Best,

    The line that causes the problem will always be the one for the first time in the error message... Away3dScene.as:65.   What line 65 is in the Away3dScene class file, this is where the problem occurs.

  • How to create graphics with the constructor syntax

    How you can use the XXXBuilder class to generate graphs? I have this code:
    NumberAxis xa = NumberAxisBuilder.create().lowerBound(0.0).upperBound(10.0).build();
    NumberAxis ya = NumberAxisBuilder.create().lowerBound(-10.0).upperBound(10.0).build();
    ScatterChart<Number, Number> chart = ScatterChartBuilder.create().XAxis(xa).YAxis(ya).build();
    But I get:
    error: the reference to create is ambiguous, the method create() in RegionBuilder and < X, Y > method create() in ScatterChartBuilder match
    ScatterChart < number >, table = ScatterChartBuilder.create (). XAxis (xa). YAxis (ya) infrastructure ();
    ^
    where X, Y are variables of type:
    X extends the object declared in the < X, Y > method create()
    It extends the object declared in the < X, Y > method create()

    How can I resolve the ambiguity?

    Pete
    (it's 1.7.0_06 JDK, JavaFX 2.2.0 - b21)

    Probably a bug in the ChartBuilders or the JDK.

    ScatterChartBuilder.create().build(); // does not work either.
    

    javac is unable to determine if the create() method of SceneChartBuilder or the create() method of RegionBuilder must be applied.
    The AxisBuilders arising also from RegionBuilder work because they do not identify their own obscure create with generic type information method.

    How can I resolve the ambiguity?

    New ScatterChart ;-)

  • It is possbile to create a form of constructor to change a flashmenu?

    Hello

    As you can see, I don't have too much idea about flash.

    My question is about the "forms builder" for flash. I think that a builder is a shape where people/customers fill it and then there will be a new page in my site according to its information.

    Example: When you want to sell something on ebay, you can choose different options: name, category, price, pictures, etc. Then, after that on ebay, there will be displays this element.

    I would do the same thing, however, I would like to change a menu flash and htm with the option of my form.

    I hope you can understand this problem with my explanation. I don't know if I'm using the correct terms.

    Thank you.

    DT

    Yes, it's doable.

    It is not difficult for a developer to intermediate level, but it will be difficult for a novice developer.

    for a simple form that displays only one of the three items based on the input data, I don't think that there is nothing to get.  It's too simple to have a tutorial.  you just need to apply a logic based on entry points and use certain methods goto or getURL () /navigateToURL () functions.

  • Create an executable by mathscript or from the Windows command window

    Hello

    I have a lot of screws that must be built into executables. So, I think to write a script to save time.

    Windows MathScript looks a lot like the command window in MATLAB, so I wonder if there is a way to create executable files using mathscript?

    Or is it possible to build from the windows command window?

    Thanks for your reply and have a nice day.

    Kind regards

    Yan

    You can use the tools in the palette of constructor calls write a LabVIEW program to automate the construction of applications.

    (Somehow I don't understand not what you want. Building is usually negligible compared to write the program or the configuration of the build).

  • Problems with creating an exe file

    Hello

    I'm trying to convert a vi to an executable. When I run the constructor it comes up with an error:

    Visit ni.com/ask support request page to learn more about the resolution of this problem. Use the following as a reference:

    Error 8 has occurred to create a folder to create a directory Recursive.vi-> AB_Destination.lvclass:Create_Destination.vi-> AB_Build.lvclass:Create_Destinations.vi-> AB_Application.lvclass:Create_Destinations.vi-> AB_Build.lvclass:Build.vi-> AB_Application.lvclass:Build.vi-> AB_EXE.lvclass:Build.vi-> AB_Engine_Build.vi-> AB_Build_Invoke.vi-> AB_Build_Invoke.vi.ProxyCaller

    Possible reasons:

    LabVIEW: File permission error. You do not have the correct permissions for the file.

    C:\Users\builds

    I can't understand the permissions that he speaks. I even changed my program a public folder.

    Thank you

    In the build settings, you said to save the generation to a public folder?

  • Private data LVOOP Parent returned when the child instance created from constant

    I created a parent class and child class.  For each of these classes, I created a member who is a builder, whose purpose is to initialize constants for each class and return the instance of the class VI.  I also have an accessor Member VI for each class that returns private data of the class (in this case, a single string for each class).

    Private class data Parent 'String' is set to "text Parent" as default.

    Private data of the class of the child 'Child String' are set to 'Child text' as a default.

    The Parent class constructor works very well.  For testing purposes, I'll be back the text of unbundling of directly the manufacturer VI, as a return of the VI accessor. The Parent constructor starts from a class constant.

    However, in the case the constructor of class as a child, if I start from a class constant, unbundling directly private data (using a feature of unbundling by name and choosing "Child String" as the element), I get the private parent data!

    If I use the Member of the class of the child VI to retrieve the text, I get the private data of the child.

    If I change the constructor from a class of control instead of a constant class, I get the private data of the child.

    This occurs only until the child class has existed as a control flag. that is, if I ungroup private data, after the class is returned by any Member VI, I get the private good child data.  Then, of course, something changes once the class 'data' has been a control at a given time.

    I'm using Labview 8.6.1, Windows XP

    I have attached a small project that demonstrates the problem that I encounter, without actually doing initialization, just read.

    Is this expected behavior?  Why does it matter if I start with a constant of class instead of a control of the class?  When you slide the block diagram in the project window, you will always have a constant.

    Although I was able to reproduce your problem in LabVIEW 8.6.1, it seems to work fine in 2009.  I could not find a CAR ID, but at this point I can only assume that the behavior was not intended but it is set in 2009.

    Let me know if you need me to find more details.

  • Any sample of "creating a GroupDataModel as QML and C++.

    Hello

    Of this sample:

    https://developer.BlackBerry.com/Cascades/documentation/UI/lists/groupdatamodel.html

    // This is the C++ code that populates the data model. You could include this code
    // in the constructor for your app, in an initialization function, or another
    // location in your app.
    
    // Create the GroupDataModel by locating the corresponding QML component
    GroupDataModel *pModel = root->findChild("groupDataModel");
    
    // Insert the data as instances of the Employee class
    pModel->insert(new Employee("Barichak", "Westlee", 12596375));
    pModel->insert(new Employee("Lambier", "Jamie", 53621479));
    pModel->insert(new Employee("Chepesky", "Mike", 65523696));
    pModel->insert(new Employee("Marshall", "Denise", 77553269));
    pModel->insert(new Employee("Taylor", "Matthew", 51236712));
    pModel->insert(new Employee("Tiegs", "Mark", 13112965));
    pModel->insert(new Employee("Tetzel", "Karla", 99214732));
    pModel->insert(new Employee("Dundas", "Ian", 64329841));
    pModel->insert(new Employee("Cacciacarro", "Marco", 54575213));
    

    How can I get Employee of row object in my slot triggered?

    void onTriggered(QVariantList indexPath)
    {
        GroupDataModel *pModel = root->findChild("groupDataModel");
        pModel->data(indexPath);    //......?????????
    
        Employee e
    }
    

    Nicolas

    I found the solution... it's quiet easy.

    void onTriggered(QVariantList indexPath)
    {
        GroupDataModel *pModel = root->findChild("groupDataModel");
    
        QVariant item = pModel->data(indexPath);
    
        Employee *e = (Employee *) item.value();
    }
    

    Nicolas

Maybe you are looking for