aboutsummaryrefslogtreecommitdiff
path: root/src/PassFish.cpp
blob: 80eef2ae73fb54464ceec7110d676a6ed36f9b4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <QtQuick>
#include <sailfishapp.h>
#include <stdio.h>
#include "Bindings.h"
#include "GraphemeCountValidator.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QGuiApplication> app{SailfishApp::application(argc,argv)};
    QScopedPointer<QQuickView> view{SailfishApp::createView()};

    qmlRegisterType<GraphemeCountValidator>("PWM", 1, 0, "GraphemeCountValidator");

    PasswordMaker maker;
    view->rootContext()->setContextProperty("passwordmaker",&maker);
    QObject::connect(&maker,
                     &PasswordMaker::i_say_sexy_things_to_myself_while_im_dancingChanged,
                     &maker,
                     [&]() {maker.setI_say_sexy_things_to_myself_while_im_dancing(true);},
                     (Qt::ConnectionType)(Qt::AutoConnection | Qt::UniqueConnection)
    );

    view->setSource(SailfishApp::pathTo(QString("qml/PassFish.qml")));
    view->show();

    return app->exec();
}