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
New Developer
Posts: 18
Registered: ‎12-26-2012
My Device: Z10
My Carrier: Tawasolit

Sending data between 2 QML / cpp??

I want to ask simple Question in bb10 cascade ...

First this is my logic to send data between 2 activities like android  => every Activity has it own XML => just when I make intent and send data the other activity it show automatically in other XML

 

lets try to make this bb10 cascade

first I made 2 classes(.cpp) with 2 headers(.hpp)   and 2 QML for them 

 

frist.cpp  => frist.qml

Second.cpp=> second.qml

 

there is button in frist.qml call "show list"

when i click it  ==>it call function in frist.cpp (access database and get list of Qvariant and i print it in consol . i sure this function work well)  then i want to send this list to second.qml to show it 

 

i did that i made a nativgationpane form frist.qml to second.qml 

 

The Question here : How to send the list to show it 

 

Please Support me with a simple example like send string between 2 qmls

Developer
Posts: 16,846
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Sending data between 2 QML / cpp??

read this:
https://developer.blackberry.com/cascades/documentation/dev/signals_slots/
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 18
Registered: ‎12-26-2012
My Device: Z10
My Carrier: Tawasolit

Re: Sending data between 2 QML / cpp??

please simon i read a few about signals and solts and it seem it deal in 1 (cpp/ qml) not between 2 qml 

i asked 1 developer QT and said u should make keyword =>"connection"

i would be greatful if u provide me with simple example sending string between 2 qml using Cpp 

 

hint : i am not like or agree with write logic code in Qml . i love to make it like Android design in xml and logic in java

 

thanks 

Hesham Magdy

Developer
Posts: 16,846
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Sending data between 2 QML / cpp??

signals and slots can be used to communicate between all components, Qt(c++) and/or QML.

If you have both qml pages in one navigationPane you could use that to connect them, for example by using a property.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Sending data between 2 QML / cpp??

I don't really follow the first part of your post but to pass simple strings between two QML files you can use this sample: http://bbcascadescode.tumblr.com/post/40740528163/stack-of-screens-passing-information-around

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan