09-26-2012 10:27 AM
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:
tate)" can not be resolved
- Signal/Slot "trackImage.onStateChanged(bb::cascades::ResourceT
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?
Solved! Go to Solution.
09-26-2012 01:41 PM
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
09-26-2012 02:04 PM
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.
09-27-2012 04:42 AM - edited 09-27-2012 05:11 AM
@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:
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.
09-27-2012 10:47 AM
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
09-29-2012 12:53 PM
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.)
09-29-2012 02:31 PM
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 ![]()
09-30-2012 06:04 AM
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
10-02-2012 09:37 PM
Same issue here:
QObject::connect(uiObject, SIGNAL(clicked()), this, SLOT(OnTimeSet()));
I get the QObject.clicked() is undefined.
... worked in beta1... haven't tried beta2 though.
10-05-2012 01:16 AM
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.