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
dtater
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha

ImageView does not name a type

Hello all.  Given the error and the very basic state of this applicaiton that i am trying to create, i am going to assume that this error is rather triviall; i jsut can't seem to peg it down.

 

 

Here is my app.hpp

 

#include <QObject>

#include <camera/camera_api.h>
#include <bb/cascades/ImageView>


namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class AppName : public QObject
{
	Q_OBJECT
public:
	AppName(bb::cascades::Application *app);
	virtual ~AppName() {}

	// coil_Base image
	ImageView *mImageCoilBase;

	// coil_On overlay image
	ImageView *mImageCoilOn;

private:

	bool setupCamera();
	camera_handle_t cameraHandle;

	


};


#endif 

 

 

And yet, i get a compile error on the ImageView objects called mImageCoilBase and mImageCoilOn.

 

 

Thoughts?

- - - - - - - - - -
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: ImageView does not name a type

add

 

using namespace bb::cascades

 

Like all of my posts
Please use plain text.
Developer
dtater
Posts: 158
Registered: ‎01-11-2010
My Device: 9700 | 9900 | PlayBook | Dev Alpha

Re: ImageView does not name a type

Where exactly?  That particular line is already in my CPP file.

- - - - - - - - - -
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900

Re: ImageView does not name a type

You need it in the declaration where you reference ImageView. Put it right below you're other namespace statement in the .h file. You should definitely read up on C++ namespaces, they are incredibly important and you will run into this many more times if you dont know how they work or what they mean.

Like all of my posts
Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: ImageView does not name a type

Kyle is correct. Basically, "ImageView" by itself is not a thing. "bb::cascades::ImageView" is, however. You can refer to it like that, or add "using namespsace bb::cascades" before the class declartion, which will make the compiler try and append that to any classes it doesn't recognize on their own.

 

Most of our sample apps do this, if you want to see it in action.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.