[SailfishDevel] QML C++ Integration not working in Sailfish

J-P Nurmi jpnurmi at gmail.com
Tue Feb 25 15:31:55 UTC 2014


On Tue, 2014-02-25 at 06:06 -0800, antonio.cano.gomez at ovi.com wrote:
> Hi,
> 
> 
> I am trying to do a simple Sailfish aplication that uses a c++
> library.  I try to connect my qml code with the C++ code.
> 
> 
> First I create QObject extended library:
> 
> 
> 
> #ifndef BLOOMFILTERS_H
> #define BLOOMFILTERS_H
> 
> 
> #include <QObject>
> #include "svn/bloom-read-only/bloom_filter.hpp"
> 
> class Bloomfilters : public QObject
> {
>     Q_OBJECT
> 
> 
> public:
>     Q_INVOKABLE  void generateFilterInvokable2() const ;
>     Q_INVOKABLE  void generateFilterInvokable(const QString &cadenaK,
> const QString &cadenaM) const ;
> 
> 
>     explicit Bloomfilters(QObject *parent = 0);
> 
>     void generateFilter() ;
> 
>     Q_INVOKABLE void insertElement(const QString &cadena) ;
> 
>     Q_INVOKABLE bool checkElement(const QString &cadena) ;
> 
> 
> 
> 
> signals:
> 
> 
> public slots:
> 
> private:
>     bloom_parameters _parameters ;
>     bloom_filter _filter;
>     bool _filter_charged;
>     QString _k;
> };
> 
> #endif // BLOOMFILTERS_H
> 
> 
> 
> 
> 
> 
> An I try to connect this with my sailfish application with the code:
> 
> 
>         QGuiApplication *app = SailfishApp::application(argc, argv);
>         QQuickView *view = SailfishApp::createView();
>         Bloomfilters  * bloomfilters = new Bloomfilters();
>         view->rootContext()->setContextProperty("Bloomfilters",
> bloomfilters);
>         view->setSource(SailfishApp::pathTo("qml/bloomfilter.qml"));
>         view->showFullScreen();
>         return app->exec();
> 
> 
> 
> But this is not working.
> 
> 
> Someone have any idea about what am I doing wrong?
> 

Hi,

What does "this is not working" mean? In what way is it not working?

-- 
J-P Nurmi




More information about the Devel mailing list