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
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

[ Edited ]

Pictures have to be approved before they show.

 

If you're application is greyed out after closing you have a memory or process problem, something is either not being released or is in an infinite/long running loop.

 

 


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

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

I have checked the connection it will return true. I am really not able to understand what is the problem.

What can I do to solve it.

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

Can you post the header file as well.


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

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

Header file

#ifndef RoamAssist_HPP_
#define RoamAssist_HPP_

#include <QObject>
#include "qtsoap/qtsoap.h"
#include <qtsoap/QtSoapHttpTransport>
#include <qtsoap/QtSoapMessage>
#include <bb/cascades/TextField>
#include <bb/cascades/ActivityIndicator>
#include <bb/system/phone/Call>
#include <bb/system/phone/Line>
#include <QtNetwork/QNetworkSession>
#include <QtNetwork/QNetworkConfiguration>
#include <QtNetwork/QNetworkConfigurationManager>

namespace bb
{
    namespace cascades
    {
        class Application;
        class LocaleHandler;
    }
}
using namespace bb::system::phone;


class QTranslator;

/*!
 * @brief Application object
 *
 *
 */

class RoamAssist : public QObject
{
    Q_OBJECT
public:
    RoamAssist(bb::cascades::Application *app);
    RoamAssist();
    virtual ~RoamAssist() { }
    Q_INVOKABLE QString getSMSList();
    Q_INVOKABLE void getInternetDataUsage();
    QString getDeviceInfo(QString name);
    QString getLatLongInfo();
    QString getRoamingStatus();
    Q_INVOKABLE void generateXML();
    Q_INVOKABLE void simCardChangeDictation();
    void getSoapResponse(const QtSoapMessage &response);
    Q_INVOKABLE void checkRegistration(QString phone,QString fname,QString lname);
    Q_INVOKABLE int checkConnection();
    Q_INVOKABLE void openFilePicker();
public:
    int returnResult;
    QString currentWebServiceCalled;
    //QSettings setting("RoamAssist","RoamAssist");
private slots:
    void onSystemLanguageChanged();
    void printOutput();
    void printError();

    private Q_SLOTS:

        void getResponse(const QtSoapMessage &);
        void onCallUpdated(const bb::system::phone::Call &);
        void update();
        void onFileSelected(const QStringList&);
        void onCanceled();
private:

    bb::cascades::ActivityIndicator *activityIndicator;

    QTranslator* m_pTranslator;
    QtSoapHttpTransport http;
    bb::cascades::LocaleHandler* m_pLocaleHandler;


};

#endif /* RoamAssist_HPP_ */

 

main file

#include <bb/cascades/Application>

#include <QLocale>
#include <QTranslator>

#include "RoamAssist.hpp"

#include <bb/cascades/AbstractPane>
#include <bb/cascades/Application>
#include <Qt/qdeclarativedebug.h>
#include <bb/cascades/pickers/FilePicker>
#include <bb/cascades/pickers/FilePickerMode>
#include <bb/cascades/pickers/FilePickerSortFlag>
#include <bb/cascades/pickers/FilePickerSortOrder>
#include <bb/cascades/pickers/FilePickerViewMode>
#include <bb/cascades/pickers/FileType>
#include <bb/cascades/QmlDocument>*/

using namespace bb::cascades;

Q_DECL_EXPORT int main(int argc, char **argv)
{

	    qmlRegisterType<pickers::FilePicker>("bb.cascades.pickers", 1, 0, "FilePicker");
	    qmlRegisterUncreatableType<pickers::FilePickerMode>("bb.cascades.pickers", 1, 0, "FilePickerMode", "");
	    qmlRegisterUncreatableType<pickers::FilePickerSortFlag>("bb.cascades.pickers", 1, 0, "FilePickerSortFlag", "");
	    qmlRegisterUncreatableType<pickers::FilePickerSortOrder>("bb.cascades.pickers", 1, 0, "FilePickerSortOrder", "");
	    qmlRegisterUncreatableType<pickers::FileType>("bb.cascades.pickers", 1, 0, "FileType", "");
	    qmlRegisterUncreatableType<pickers::FilePickerViewMode>("bb.cascades.pickers", 1, 0, "FilePickerViewMode", "");
	//! [0]


    Application app(argc, argv);

    // Create the Application UI object, this is where the main.qml file
    // is loaded and the application scene is set.
    new RoamAssist(&app);
   // new EndUserLicen(&app);
    // Enter the application main event loop.
    return Application::exec();
}

 

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

Unless you are going to use FilePickers in QML files you don't need to do the registration lines.

 

But that won't be the problem.


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.
Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

You said you declared the FilePicker as global but I still haven't seen that,

 

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

 

Please post the code this is in and if it's not in the class you are using then the code that puts it in scope of the class.

 


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

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

void RoamAssist::openFilePicker()
{
	qDebug()<<"in open file picker";
	bb::cascades::pickers::FilePicker *filePicker = new bb::cascades::pickers::FilePicker();

	// Connect the fileSelected() signal with the slot.
			bool connectResult =QObject::connect(filePicker,
				    SIGNAL(fileSelected(const QStringList&)),
				    this,
				    SLOT(onFileSelected(const QStringList&)));
			qDebug()<<"connectResult"<<connectResult;
// Connect the canceled() signal with the slot. QObject::connect(filePicker, SIGNAL(canceled()), this, SLOT(onCanceled())); filePicker->setType(bb::cascades::pickers::FileType::Picture); filePicker->setTitle("Select Picture"); filePicker->setMode(bb::cascades::pickers::FilePickerMode::Picker); filePicker->open(); }

 I also tried to create file picker in function itself but not getting any success.

Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

You shouldn't need private slots and Q_SLOTS so take the Q_SLOTS out.

However as far as I can see with the code I've seen it all looks ok.

 

As suggested in my PM try just quickly try writing a QML version and see if you get the same result, otherwise with what I've seen so far and with no access to your full code I'm stumped.


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.
Developer
BBSJdev
Posts: 6,118
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

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

I doubt this is it either but check you're not inadvertantly destroying the FilePicker object somewhere else in your code.

 

Apart from that i've no idea;

 

Double check

   - permissions

   - library inclusion (LIBS += -lbbcascadespickers)

   - inclusion of headers in your class

 


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

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

Hey,

My problem is solved!!!!  :Clap:

 

I just remove onFileSelect  function from Q_SLOT and place it into private slot:  

Thank you so much guys....Thanks a lot.