Pregunta

I've being trying to implement a native File picker on BlackBerry 10 today, I linked it against the required Library -lbbcascadespickers Included <bb/cascades/pickers/FilePicker> that links to the FilePicker.hpp class and all seems fine, but when I try to create a new File picker it says "error: 'FilePicker' was not declared in this scope"

Code is as follows:

    FilePicker* filePicker = new FilePicker();
filePicker->setType(FileType::Picture);
filePicker->setTitle("Select Picture");
filePicker->setMode(FilePickerMode::Picker);
filePicker->open();

// Connect the fileSelected() signal with the slot.
QObject::connect(filePicker,
    SIGNAL(fileSelected(const QStringList&)),
    this,
    SLOT(onFileSelected(const QStringList&)));

// Connect the canceled() signal with the slot.
QObject::connect(filePicker,
    SIGNAL(canceled()),
    this,
    SLOT(onCanceled()));

I'm brand new to BlackBerry development so don't really know what to do, I've cleaned the project and built it many times but it won't play. I was going by the example on BlackBerry's website:

https://developer.blackberry.com/native/reference/cascades/bb_cascades_pickers__filepicker.html

I wanted to open it from QML (I'm using Qt Quick and not BB components)

If anyone can help it will be deeply appreciated

¿Fue útil?

Solución

The compiler can't find FilePicker. So either use a using to tell the compiler where to look:

using namespace bb::cascades::pickers;

or fully qualify the name of the class:

bb::cascades::pickers::FilePicker* filePicker = new FilePicker();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top