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
mdodd
Posts: 187
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: Three
Accepted Solution

Qt Connect() statements broken in Beta 3

I've just opened up an existing project in Beta 3 and while my code is largely intact, a number of important connect() statements have been broken. For example, I can no longer track the state of loading images e.g.

 

        // Load cascades image
	mTracker = new ImageTracker(mLocalImageUrl);
	connect(mTracker, SIGNAL(stateChanged (bb::cascades::ResourceTracker::State)),
			this, SLOT(onStateChanged(bb::cascades::ResourceTracker::State)));

 puts a red squiggle under both the signal and slot with the errors:

Function "stateChanged (bb::cascades::ResourceTracker::smileyfrustrated:tate)" can not be resolved

- Signal/Slot "trackImage.onStateChanged(bb::cascades::ResourceTracker::smileyfrustrated:tate)" is not defined


I find it strange that the compiler thinks that the this keyword is referring to the function and not the class. Parameters involving QLists of custom classes are also affected, giving the error Signal/Slot Parameter "QList<MyClassName*>" can not be resolved. Is there any documentation on how to resolve these problems?



Did this post help you? If so, please make sure to "like" it!
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Qt Connect() statements broken in Beta 3

Is the IDE showing the errors or is the compiler throwing these errors? Its very possible that the IDE just isnt recognizing them and saying its an erro when it should build just fine

Like all of my posts
Please use plain text.
Contributor
base8
Posts: 26
Registered: ‎06-27-2012
My Device: Playbook
My Carrier: n/a

Re: Qt Connect() statements broken in Beta 3

You might be missing the appropriate include. Check the properties of your project, C/C++ General, Paths and Symbols. I have a bunch of include in there, including:

 

${QNX_TARGET}/usr/include/cpp/c

${QNX_TARGET}/usr/include/qt4/QtCore

 

Or add the correct #includes at the top of your cpp file.

Please use plain text.
Developer
mdodd
Posts: 187
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: Three

Re: Qt Connect() statements broken in Beta 3

[ Edited ]

@kylefowler - I'm getting a red bug symbol next to those lines instead of the usual red X. Strangely enough, the compiler isn't complaining about the ResourceTracker::smileyfrustrated:tate connections. I'm guessing it's the QT error highlighter being overly sensitive - is there any way to turn this off?

 

EDIT: Okay, maybe not. After a clean build I'm getting this:

../src/observers/../datamodel/Image.h:48:53: error: 'bb::cascades::ResourceTracker::State' has not been declared

 My cascades includes for this class are:

#include <bb/cascades/Image>
#include <bb/cascades/ImageTracker>

 

EDIT 2: Disregard that, just found out the enum name has been changed to bb::cascades::ResourceState::Type

 

 

@base8 - I have those includes present already. I also have <bb/cascades/ImageTracker> included at the top of the file, which is a child class of ResourceTracker.



Did this post help you? If so, please make sure to "like" it!
Please use plain text.
BlackBerry Development Advisor (Retired)
gperry
Posts: 138
Registered: ‎05-11-2012
My Device: Developer
My Carrier: Developer

Re: Qt Connect() statements broken in Beta 3

Sorry, trying to get the current status of your issue.

 

Do I understand from your last post that you have resolved the issue? If so can you please

mark the thread as resolved, otherwise it would be helpful to get separate post detailing the

current situation.

 

Thanks

Graham

Please use plain text.
Developer
dkonigs
Posts: 241
Registered: ‎07-25-2008
My Device: Bold 9900

Re: Qt Connect() statements broken in Beta 3

I don't think he's resolved is issue.  It looks more like he had two issues, the one originally mentioned, and another that came up while trying to resolve it.

 

I just ran into the first issue myself, which is that Eclipse is incorrectly complaining about many Qt connect() statements.  However, the actual code compiles and runs just fine.

 

With my code, it seems to be happening with most signals coming from QML-declared elements, and some weird subset of signals coming from C++ defined classes.

 

(For me, this issue is also only happening under Linux.  It doesn't seem to be happening under Windows.)

Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: Qt Connect() statements broken in Beta 3

i got the same issue too.

 

here's the problematic line:

connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onHttpError(QNetworkReply::NetworkError)));

 

and the error marker in QDE:

Multiple markers at this line
- Signal/Slot "onHttpError(QNetworkReply::NetworkError)" is not
defined
- Signal/Slot "QNetworkReply.error(QNetworkReply::NetworkError)" is not
defined

 

the code compiles and run properly though....this issue doesnot seem to occur on MacOSX QDE but only on Windows7 QDE for me. also this project was imported from 10_0_6 so i am guessing this is another messed up config / workspace file when using the same workspace on the new QDE :smileysad:

Please use plain text.
Trusted Contributor
Brennan12325
Posts: 204
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: Qt Connect() statements broken in Beta 3

I have the same issue.

 

QObject::connect(PostsList, SIGNAL(selectionChanged(const QVariantList, bool)),
				this, SLOT(onSelectionChanged(const QVariantList, bool)));

 The bolded, underlined, and colored red text is underlined as an error in the momentics IDE. The error message is:

Signal/Slot "App.onSelectionChanged(const QVariantList, bool)" is not defined

 

The SLOT definition is as follows:

void App::onSelectionChanged(const QVariantList indexPath, bool selected) {...

 

The program compiles and I'd ignore the error, but it appears the onSelectionChanged SLOT is never being called when the selectionChanged signal is fired.

 

This worked in Beta 2.

 

- Brennan

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Please use plain text.
New Contributor
gord888
Posts: 8
Registered: ‎11-26-2010
My Device: Not Specified

Re: Qt Connect() statements broken in Beta 3

Same issue here:

 

 

QObject::connect(uiObject, SIGNAL(clicked()), this, SLOT(OnTimeSet()));

 

I get the QObject.clicked() is undefined. :smileysad:... worked in beta1... haven't tried beta2 though.

Please use plain text.
Developer
dkonigs
Posts: 241
Registered: ‎07-25-2008
My Device: Bold 9900

Re: Qt Connect() statements broken in Beta 3

Okay, I've figured out the issue.  Its not Linux or Windows specific at all, and it happens on both platform.  Basically, Qt-specific syntax checking is broken in this release.  The only difference for me was that this feature was turned on by default in Linux, and off by default in Windows.  (results may vary for others)  I can easily reproduce the issue on either platform, now that I know what's causing it.

 

To make this error go away, you basically need to disable Qt syntax checking in preferences.  Once you do this, close and reopen any error-filled source files, and all the red squigglies will vanish.  I've attached a screenshot showing where this setting is located.

 

ndk-syntax-error-settings.png

Please use plain text.