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

Posts: 257
Registered: ‎01-08-2013
My Device: Z10 LE
My Carrier: SiMobil

Application crashes on emiting signal

I have two classes. ApplicationUI and ImageUpload. I want to emit a signal in ImageUpload and catch it in ApplicationUI, but it keeps crashing. I'm quite new to singals and slots (well, QT all together)



class ApplicationUI: public QObject
public slots:
    void updateList();



class ImageUpload : public QObject
    void uploadFinished();


inside ApplicationUI I have this to connect signal in ImageUpload and slot in ApplicationUI

ImageUpload *myUpload = new ImageUpload("...");
connect(myUpload, SIGNAL(uploadFinished()), this, SLOT(updateList()));

 and in ImageUpload.cpp I call this:

emit uploadFinished()

But instead doing what it's supposed to do, I get this error:

Process 2117816572 (imgupload) terminated SIGSEGV code=1 fltno=11 ip=0bbd7842(/base/usr/lib/qt4/lib/libQtSql.so.4.8.6@_ZN10QSqlResult19detachFromResultSetEv+0x15) mapaddr=00019842. ref=00000000 bdslot=1


Any ideas what I'm doing wrong? Any other way to connect these classes?

Posts: 237
Registered: ‎05-21-2012
My Device: BlackBerry RED Z10
My Carrier: WiFi

Re: Application crashes on emiting signal

The error looks like a pointer issue, what's in this by the way?

Posts: 257
Registered: ‎01-08-2013
My Device: Z10 LE
My Carrier: SiMobil

Re: Application crashes on emiting signal

[ Edited ]

It's image URI (QString). I just removed it because it doesn't matter. It all works well until I connect it (if I either remove emit or connect it still works)

Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Application crashes on emiting signal

[ Edited ]

at first you should verify if your connect is OK


you should always check connect(....) !


here's from cascades documentation:


// If any Q_ASSERT statement(s) indicate that the slot
// failed to connect to the signal, make sure you know exactly
// why this has happened. This is not normal, and will cause your
// app to stop working
bool connectResult;
// Since the variable is not used in the app, this is
// added to avoid a compiler warning
connectResult = QObject::connect(smokeDetector,
// This is only available in Debug builds


 if connect fails verify that the signal and slot are declared and implemented well


ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Posts: 257
Registered: ‎01-08-2013
My Device: Z10 LE
My Carrier: SiMobil

Re: Application crashes on emiting signal

[ Edited ]

Opps, it wasn't signals (and yes, I'll use Q_ASSERT from now on, very helpful thing). It was the code inside a slot that crashed it. It just took me so long to figure out these signals I didn't think it was something else.