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
Contributor
Posts: 10
Registered: ‎01-21-2013
My Device: bb10 alpha
My Carrier: tsel
Accepted Solution

Failed to build FilePicker

Hi, i'm following the example from :

https://developer.blackberry.com/cascades/reference/bb__cascades__pickers__filepicker.html

 

FilePicker* filePicker = new FilePicker();
filePicker->setType(FileType:Smiley Tongueicture);
filePicker->setTitle("Select Picture");
filePicker->setMode(FilePickerMode:Smiley Tongueicker);
filePicker->open();
 
// Connect the fileSelected() signal with the slot.
QObject::connect(filePicker,
    SIGNAL(fileSelected(const QStringList&)),
    this,
    SLOT(onFileSelected(const QStringList&)));
 
 
i also include this at the top of the code:
 

#include <bb/cascades/pickers/FilePicker>
#include <bb/cascades/pickers/FileType>
#include <bb/cascades/pickers/FilePickerMode>

 

 

and also add this to the project.pro:

 

LIBS += -lbbcascadespickers

 

 

but when i try to build the project, it show errors:

 

../src/custom/EditableFrameContainer.cpp:105:2: error: 'FilePicker' was not declared in this scope
../src/custom/EditableFrameContainer.cpp:105:2: note: suggested alternative:
C:/Job/Software/bbndk/target_10_0_9_1673/qnx6/usr/include/bb/cascades/pickers/FilePicker.hpp:143:34: note: 'bb::cascades:Smiley Tongueickers::FilePicker'
../src/custom/EditableFrameContainer.cpp:105:14: error: 'filePicker' was not declared in this scope
../src/custom/EditableFrameContainer.cpp:105:31: error: expected type-specifier before 'FilePicker'
../src/custom/EditableFrameContainer.cpp:105:31: error: expected ';' before 'FilePicker'
../src/custom/EditableFrameContainer.cpp:106:22: error: 'FileType' has not been declared
../src/custom/EditableFrameContainer.cpp:108:22: error: 'FilePickerMode' has not been declared

 

 

is there any missing steps that i have to do, to make this project run correctly?

 

 

 

Regards,

Christian

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Failed to build FilePicker

[ Edited ]

FilePicker is defined in bb::cascades:Smiley Tongueickers namespace.

Add "using namespace bb::cascades:Smiley Tongueickers" to .cpp file.


Andrey Fidrya, @zmeyc on twitter
Highlighted
Contributor
Posts: 10
Registered: ‎01-21-2013
My Device: bb10 alpha
My Carrier: tsel

Re: Failed to build FilePicker

Thank you for the quick reply, yes it seems that it need to be added to the cpp:

using namespace bb::cascades:Smiley Tongueickers;




Thank you for your help Smiley Happy
Developer
Posts: 30
Registered: ‎11-06-2012
My Device: BB 10 Dev Alpha
My Carrier: MegaFon

Re: Failed to build FilePicker

chris_chrono, please mark post that helped you (not your own "thank-you" post) as an accepted solution. Liking helpful posts is also appreciated.