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
chris_chrono
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::smileytongue:icture);
filePicker->setTitle("Select Picture");
filePicker->setMode(FilePickerMode::smileytongue:icker);
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::smileytongue:ickers::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

Please use plain text.
Developer
Zmey
Posts: 1,511
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Failed to build FilePicker

[ Edited ]

FilePicker is defined in bb::cascades::smileytongue:ickers namespace.

Add "using namespace bb::cascades::smileytongue:ickers" to .cpp file.


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
chris_chrono
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::smileytongue:ickers;




Thank you for your help :smileyhappy:
Please use plain text.
Developer
tonygluk
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.

Please use plain text.