Welcome!

Welcome to the official BlackBerry Support Community Forums.

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

inside custom component

Native Development

Reply
Developer
soaman
Posts: 849
Registered: ‎03-03-2011
My Device: Z10

Re: why my actions are there two times?

Or archive project into ZIP and then import project in a new workspace?
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Developer
noahhuang
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha

Re: why my actions are there two times?

Thanks. It can work; So summarize the answer is
1. new workspace
2. new project,
3. import the old project as a zip file
4. modify the code as you post.
Developer
StevenKader
Posts: 644
Registered: ‎02-03-2010
My Device: Z10 LE

Re: why my actions are there two times?

I also had this problem and narrowed it down to it happening when I added this line to the source code :

 

 qml->setContextProperty("cppObject", this);

 

There seems to be a bug in the action item display.  If you see this problem you can try commenting out the context setting to see if it shows properly.


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Contributor
jenicek
Posts: 10
Registered: ‎10-13-2011
My Device: 9900

Re: why my actions are there two times?

Anobody tried with new SDK Beta 4? Has been fixed?

Developer
StevenKader
Posts: 644
Registered: ‎02-03-2010
My Device: Z10 LE

Re: why my actions are there two times?

I did..not fixed yet.

Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
StevenKader
Posts: 644
Registered: ‎02-03-2010
My Device: Z10 LE

Re: why my actions are there two times?

Got this back and plan to try later....

  QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
 
    // GOOD position
    qml->setContextProperty("cs",this);
 
    // create root object for the UI
    AbstractPane *root = qml->createRootObject<AbstractPane>();
 
    // BAD position
    qml->setContextProperty("cs",this);
 
    // set created root object as a scene
    app->setScene(root);
}

Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
Developer
StevenKader
Posts: 644
Registered: ‎02-03-2010
My Device: Z10 LE

Re: why my actions are there two times?

I can confirm that my problem is solved.  I needed to put the  "  qml->setContextProperty("cs",this);"  

before " app->setScene(root);"

 

 


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing
New Developer
float
Posts: 5
Registered: ‎02-18-2013
My Device: Z10

Re: why my actions are there two times?

[ Edited ]

FYI, this is still not solved in 10.0.10.261

 

Had this problem and lucky enough to found this thread. Just setContextProperty() before createRootObject() will do, there is no need to switch workspace etc.

 

/floAt

Developer
Dredvard
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook

Re: why my actions are there two times?

Can you update this stating what you did?

 

https://www.blackberry.com/jira/browse/BBTEN-343?page=com.atlassian.jira.plugin.system.issuetabpanel...

 

I haven't tried it yet in 10.0.10 so I haven't responded.

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
StevenKader
Posts: 644
Registered: ‎02-03-2010
My Device: Z10 LE

Re: why my actions are there two times?


Steven Kader at JaredCo
   Follow me on Twitter    |     Mipixi.com :  Web App for Photo Sharing