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
thubalek
Posts: 323
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
Accepted Solution

Compound Button: how to resend signal from one component to another

Hello, I'm quite new in BB10 development. I have a question:

 

I'm trying to make image button with text. My idea was that I'll create custom component consisting of two components:

 

ImageButton

Label

 

Label will be over Image Button and will contain customisable text

 

It basically works but it seems that Label swallows click signal and it is not propagated to the ImageButton. I tried to set 

setFocusPolicy(FocusPolicy::None); to Label but it does not work.

 

My questio is: How to make it properly? Should I capture clicked() signal on Label and resend it to the ImageButton?

 

Thanks

Tom

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Developer
raju504
Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha

Re: Compound Button: how to resend signal from one component to another

Hi!

 

This may help you!

Refer Overlap touch policies in

 

https://developer.blackberry.com/cascades/documentation/dev/touch/touch_propagation.html

 

OR

 

 

Refer Create the source for the Timer class

 

https://developer.blackberry.com/cascades/documentation/dev/signals_slots/signals_slots_create_timer...

 

I think,

 

The signal of one control can be connected to the signal of another control.

 

- Raju

 

 

- Raju
Regular Contributor
mohdfarhanakram
Posts: 73
Registered: ‎12-30-2011
My Device: All devices

Re: Compound Button: how to resend signal from one component to another

Hi ,

 

Please post the source code its too urgent for me.

Thanks

Mohd Farhan
Developer
raju504
Posts: 86
Registered: ‎05-21-2012
My Device: Blackberry 10 Dev Alpha

Re: Compound Button: how to resend signal from one component to another

This can be useful to u!

 

    button1.clicked.connect(button2.clicked);

because any signal can be connected to any slot or signal.....am I right !!!

 

-Regards

 Raju

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

Re: Compound Button: how to resend signal from one component to another

SIgnal should connect only to slot. And slot can emit another signal.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Developer
Zmey
Posts: 1,514
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Compound Button: how to resend signal from one component to another

It's possible to connect a signal directly to another signal. Please see this page for details:

http://doc.qt.digia.com/qt/signalsandslots.html


Andrey Fidrya, @zmeyc on twitter