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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
noahhuang
Posts: 100
Registered: ‎10-01-2012
My Carrier: Roger

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.

Please use plain text.
Developer
noahhuang
Posts: 100
Registered: ‎10-01-2012
My Carrier: Roger

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. 

Please use plain text.
Developer
soaman
Posts: 610
Registered: ‎03-03-2011
My Carrier: Mobitel

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.

 

 

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

Follow our developer blog on Slovenia BlackBerry Developer Group!
Please use plain text.
New Contributor
jenicek
Posts: 9
Registered: ‎10-13-2011
My Carrier: T-mobile

Re: why my actions are there two times?

God Bless You! Perfect! Thank you very much
Please use plain text.
Developer
soaman
Posts: 610
Registered: ‎03-03-2011
My Carrier: Mobitel

Re: why my actions are there two times?

Reverse engineering :-) It was tough.
--------------------------------------------------------

Follow our developer blog on Slovenia BlackBerry Developer Group!
Please use plain text.
Developer
Dredvard
Posts: 154
Registered: ‎01-27-2012
My Carrier: Rogers

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"
Please use plain text.
Developer
smartek
Posts: 274
Registered: ‎05-31-2012
My Carrier: o2

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.
Please use plain text.
Developer
smartek
Posts: 274
Registered: ‎05-31-2012
My Carrier: o2

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.
Please use plain text.
Developer
Dredvard
Posts: 154
Registered: ‎01-27-2012
My Carrier: Rogers

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"
Please use plain text.
Developer
noahhuang
Posts: 100
Registered: ‎10-01-2012
My Carrier: Roger

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>();

Please use plain text.