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: 34
Registered: ‎11-25-2009
My Device: Not Specified

Qt linking issue? Anyone else having this problem?

Just trying to play around a bit with Qt, and I can get all sorts of things working until I add a class.  Then things go south, and I seem to be getting this all the time :

 

undefined reference to `QWidget::x11Event(_XEvent*)'

 

Not quite sure why this would be.  I remove the class files from the project and everything is fine again, as soon as I add them, I'm all done.  This is on a Linux box, latest SDK, and a fresh Qt install from Git. 

 

Thank you,

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Qt linking issue? Anyone else having this problem?

"from Git" isn't a complete description, unfortunately. Which Git? BlackBerry's, or the official Qt 4.8 branch?

If you're mixing compilers (g++ and qcc), I could imagine that error coming up. Probably other ways too... I'm no expert.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Developer
Posts: 34
Registered: ‎11-25-2009
My Device: Not Specified

Re: Qt linking issue? Anyone else having this problem?

Blackberry's latest. I am not mixing compilers, though I did notice something. Looking through the forums it looks like you need to remove the QT strapped from the build, that got me a bit further, but then I had more issues.

I appears as though the qt preprocessor moc is not being run on the header files. I did try to have it run moc individually on the headers and that didn't seem to work well. Still playing with it.

Seems like anytime you have a class that uses the slot functionality, which then needs Q_OBJECT fails.
Developer
Posts: 188
Registered: ‎01-27-2012
My Device: playbook
My Carrier: ...

Re: Qt linking issue? Anyone else having this problem?

Do you have an example of your code?

It sounds like a missing #include or perhaps a prototype in your header is missing?

I am also no expert, however I have had no issues whatsoever with the QtSDK where I have had to "remove the Qt strapped from the build", (I dont even know what that means). Nor have I ever had to worry about, or do anything with the moc files, on any platform.

2 of my released pb apps are Qt widget based apps that utilize signals and slots.

What was your process for building the bbQt port?

Cheers,

Jon

 

New Developer
Posts: 34
Registered: ‎11-25-2009
My Device: Not Specified

Re: Qt linking issue? Anyone else having this problem?

I will paste the code tomorrow, but I am using the BB ide, not the qtsdk. I like having an inline debugger. Smiley Happy
Developer
Posts: 188
Registered: ‎01-27-2012
My Device: playbook
My Carrier: ...

Re: Qt linking issue? Anyone else having this problem?

[ Edited ]

Got it! Cant help you there, I have not experimented with Momentics.

Can you get an active debug connection to the pb with momentics?

If so it should be easy enough from the QtSDK as well... Hmmm...

Cheers,

Jon

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Qt linking issue? Anyone else having this problem?

I think you're right about it being the MOC. From what I've read so far (limited) the signals/slots stuff and Q_OBJECT are all things the meta-object compiler provides, so without it none of that would work.

If the x11Event thing is a slot, then it would fit.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Developer
Posts: 34
Registered: ‎11-25-2009
My Device: Not Specified

Re: Qt linking issue? Anyone else having this problem?

Yea, looks like I'm going to have to dump Momentics to get a decent Qt app to compile correctly.

Thank you for your reply, and time,
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Qt linking issue? Anyone else having this problem?

For now anyway.

You know they are working on a plugin that will let that all work right from Momentics, right? Just more of what we're waiting for in the form of Cascades...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
New Developer
Posts: 34
Registered: ‎11-25-2009
My Device: Not Specified

Re: Qt linking issue? Anyone else having this problem?

I thought the plugin was for QtCreator for QNX? I checked out their preview downloads and didn't see any difference between the pre 2.5 version and the preview. Other than it shows QNX as being a plugin.

And I don't know about waiting too much, Cascades was supposed to be "in the fall of 2011", and well they blew that one. Haha... I'm just trying to work with what they have given us at this point.