예제 #1
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QGraphicsScene scene;
    QGraphicsView view(&scene);

    // Add a Widget
    WidgetLoader *loader = new WidgetLoader;
    scene.addWidget(loader);

    //Add a second one and move to right side
    AnalogClock *clock = new AnalogClock;
    clock->move(QPoint(300,0));
    scene.addWidget(clock);

    //Finally the sampleWidget
    SampleWidget *widget = new SampleWidget;
    widget->move(0,300);
    scene.addWidget(widget);


    //Place a qml Widget
    QDeclarativeView *qmlView = new QDeclarativeView;
    qmlView->setSource(QUrl::fromLocalFile("qml/QMLBusTimetable.qml"));
    scene.addWidget(qmlView);
    qmlView->move(300,300);

    view.showMaximized();
    //Fullscreen:
//     view.showFullScreen();

    return a.exec();
}
예제 #2
0
int main(int argc, char *argv[])
{
    Logger logger = Logger::getInstance(LOG4CPLUS_TEXT("applications.AuthenticationApplication"));
    PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));

    WatchdogThread watchdogThread(iviLink::SystemController::AUTHENTICATION_APP);
    watchdogThread.start();

    LOG4CPLUS_INFO(logger, "Authentication main()");

    QApplication app(argc, argv);

    app.setApplicationName("AuthenticationApplication");
    app.setQuitOnLastWindowClosed(true);
    QDeclarativeView  viewer;
    QMLAuthenticationDialog * dialog = new QMLAuthenticationDialog;
    viewer.rootContext()->setContextProperty("QMLAuthenticationDialog", dialog);
    viewer.setSource(QUrl::fromLocalFile("qml/AuthenticationApplication/authentication.qml"));
    viewer.setAttribute(Qt::WA_TranslucentBackground);
    viewer.setAttribute(Qt::WA_NoSystemBackground);
    viewer.setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
    viewer.setStyleSheet("background:transparent;");
    // show the application
    viewer.move(QApplication::desktop()->screen()->rect().center() - viewer.rect().center() );
    viewer.show();
    dialog->init();

    LOG4CPLUS_TRACE(Logger::getInstance(LOG4CPLUS_TEXT("profiler.ComponentIsStarted")), "AuthenticationApplication");

    return app.exec();

}