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
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha

Re: why my actions are there two times?

[ Edited ]

I have re-created a project using cascade c++ project, then copy codes and assets from old to new project.

Then I compared the bar file and .pro file to add the libs as needed. 

But I faced the same problem.

I can't find what's the difference between my old and new project.

Hope someone can figure it out.

 

PS: new workspace... good idea, becuase I still use the workspace that created from beta2.

I will try it tomorrow and let everyone know.

Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha

Re: why my actions are there two times?

After I created a new workspace and copy my assets, src, .pro. It still can not work. 

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

Re: why my actions are there two times?

Solved!

 

I changed the sequence of calls from:

loginRoot = loginQml->createRootObject<AbstractPane>();

loginQml->setContextProperty("bpm", manager);

  

to:

loginQml->setContextProperty("bpm", manager); 

loginRoot = loginQml->createRootObject<AbstractPane>();

 

The method setContextProperty must be called before method createRootObject!!! Only in this case there are no duplicates.

 

 

--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Contributor
Posts: 10
Registered: ‎10-13-2011
My Device: 9900

Re: why my actions are there two times?

God Bless You! Perfect! Thank you very much
Developer
Posts: 849
Registered: ‎03-03-2011
My Device: Z10

Re: why my actions are there two times?

Reverse engineering :-) It was tough.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook

Re: why my actions are there two times?

[ Edited ]

 

Did you post this as a bug?  I have another app where the action items work and the createRootObject is after contextProperty.  However, If the sequence is what matter's  how are you supposed to reverse the order it in this context?

 

        // The application NavigationPane is created from QML.
    	m_navPane = qml->createRootObject<NavigationPane>();
        if (m_navPane) {

        	m_pOpenGLThread = new OpenGLThread();

        	m_pGoodCitizen = new GoodCitizen();

        	//m_pGoodCitizen->moveToThread(m_pOpenGLThread);
        	m_pOpenGLThread->addView(m_pGoodCitizen);

            qml->setContextProperty("_navPane", m_navPane);
            qml->setContextProperty("_goodCitizen", m_pGoodCitizen);
            qml->setContextProperty("_openGLThread", m_pOpenGLThread);

..

 

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook

Re: why my actions are there two times?


soaman wrote:

Solved!

 

I changed the sequence of calls from:

loginRoot = loginQml->createRootObject<AbstractPane>();

loginQml->setContextProperty("bpm", manager);

  

to:

loginQml->setContextProperty("bpm", manager); 

loginRoot = loginQml->createRootObject<AbstractPane>();

 

The method setContextProperty must be called before method createRootObject!!! Only in this case there are no duplicates.

 

 


this fixed the issue with the actions. but now my buttons are not working anymore o.O

Plase "+Like" my post if it was helpful.
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook

Re: why my actions are there two times?

Here is my solution, my error came because i had a old workspace.

 

  1. create and use a whole new workspace
  2. create a new project and then import your qml files

this solved the problem for me

Plase "+Like" my post if it was helpful.
Developer
Posts: 160
Registered: ‎01-27-2012
My Device: Playbook

Re: why my actions are there two times?

I've submitted this as a bug:

 

https://www.blackberry.com/jira/browse/BBTEN-343

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha

Re: why my actions are there two times?

Do you mean?

 

1. create a new workspace

2. create a new project

3. import src, qml

4. follow the codes as you post

 

loginQml->setContextProperty("bpm"manager); 

loginRoot = loginQml->createRootObject<AbstractPane>();