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
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon
Accepted Solution

Issue with file picker after selecting file in bb10 cascades

Hi,

I am using file picker in my application. I tried to use it in both way like in cpp as well as in qml file. But my problem is after selcting a file it will not return me anything any my application is goes into dead mode. I have give all permissions to application. filePicker cascade application is works fine but not in my applicaion.

 

I am using blackberry 10 cascade development. Please help me to resolve this issue. :smileysad:

Please use plain text.
Developer
BBSJdev
Posts: 6,085
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Issue with file picker after selecting file in bb10 cascades

[ Edited ]

Is 'Dead mode' a techincal term I've missed? :smileywink:

 

With what you have written no help can be given as we will just be posting the same code as the example.

Please post the code you have so far.

 

Do you get any log errors or warnings?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon

Re: Issue with file picker after selecting file in bb10 cascades

//global declaration of object

 

bb::cascades::smileytongue:ickers::FilePicker *filePicker = new bb::cascades::smileytongue:ickers::FilePicker();

 

//signal and slots

 

QObject::connect(filePicker,SIGNAL(fileSelected(const QStringList&)),this,SLOT(onFileSelected(const QStringList&)));

 

QObject::connect(filePicker,SIGNAL(canceled()),this,SLOT(onCanceled()));

 

here is my code:

 

filePicker->setType(bb::cascades::smileytongue:ickers::FileType::smileytongue:icture);
filePicker->setTitle("Select Picture");
filePicker->setMode(bb::cascades::smileytongue:ickers::FilePickerMode::smileytongue:icker);
filePicker->open();

 

Through this code I am able to open file picker and select a file but after file selection nothing will happened. Not able to emit fileSelected event. 

Application dead mode menns when I close the thumbnel mode of application and again try to reopen the application icon is in disable mode. Not able to click and delete the application. Need to restart the phone to process.

 

Please use plain text.
Developer
BBSJdev
Posts: 6,085
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Issue with file picker after selecting file in bb10 cascades

Please use the code button to attach code, the clipboard with a c in it, this way it is more readable and avoids unwanted smileys.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon

Re: Issue with file picker after selecting file in bb10 cascades

//global declaration of object
 
bb::cascades::smileytongue:ickers::FilePicker *filePicker = new bb::cascades::smileytongue:ickers::FilePicker();
 
//signal and slots
 
QObject::connect(filePicker,SIGNAL(fileSelected(const QStringList&)),this,SLOT(onFileSelected(const QStringList&)));
 
QObject::connect(filePicker,SIGNAL(canceled()),this,SLOT(onCanceled()));
 
here is actual function to open file picker:
 
filePicker->setType(bb::cascades::smileytongue:ickers::FileType::smileytongue:icture);
filePicker->setTitle("Select Picture");
filePicker->setMode(bb::cascades::smileytongue:ickers::FilePickerMode::smileytongue:icker);
filePicker->open();

 

I have also LIBS += -lbbcascadespickers to .pro file.

Please use plain text.
Developer
BBSJdev
Posts: 6,085
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Issue with file picker after selecting file in bb10 cascades

Can you check the connection has worked either with a Console output or Q_ASSERT?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
BBSJdev
Posts: 6,085
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Issue with file picker after selecting file in bb10 cascades

[ Edited ]

You should do some kind of check on your connections any way as standard practice.

 

If it's connected correctly then post your onFileSelected code.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon

Re: Issue with file picker after selecting file in bb10 cascades

Hey,

I am not able to understand how exactly I check the connection.  

After opening file picker I am getting following text on console:

toTypedescList() returned  ("Picture") 
defaultFileNames  "" 
ViewMode  0 
SourceRestriction  0 
The dataMap  QMap(("AllowOverwrite", QVariant(bool, false) ) ( "ImageCrop" ,  QVariant(bool, false) ) ( "Mode" ,  QVariant(QString, "Picker") ) ( "SortBy" ,  QVariant(QString, "Default") ) ( "SortOrder" ,  QVariant(QString, "Default") ) ( "SourceRestriction" ,  QVariant(QString, "None") ) ( "Title" ,  QVariant(QString, "Select Picture") ) ( "Type" ,  QVariant(QString, "Picture") ) ( "ViewMode" ,  QVariant(QString, "Default") ) )  
The request string  "AllowOverwrite:b:false
ImageCrop:b:false
Mode::Picker
SortBy::Default
SortOrder::Default
SourceRestriction::None
Title::Select Picture
Type::Picture
ViewMode::Default
" 

 

and then nothing will happened. In fileSelected function I have just print name of the selected file as 

void RoamAssist::onFileSelected(const QStringList &fileName)
{
	qDebug()<<"In file select"<<fileName[0];
}

 

but this function is not called.

 

 

 

Please use plain text.
Developer
BBSJdev
Posts: 6,085
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Issue with file picker after selecting file in bb10 cascades

connectResult = QObject::connect(filePicker, 
    SIGNAL(fileSelected(const QStringList&)), 
    this, 
    SLOT(onFileSelected(const QStringList&)));
     
Q_ASSERT(connectResult);   // <- This is only available in Debug builds.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
sonalb123
Posts: 63
Registered: ‎08-05-2013
My Device: Blackberry-10 webworks
My Carrier: zcon

Re: Issue with file picker after selecting file in bb10 cascades

Screen Shot

 

See the last icon. Application icon is not clickable after opening file picker.

Please use plain text.