当前位置: 首页>>代码示例>>C++>>正文


C++ QDeclarativeView::move方法代码示例

本文整理汇总了C++中QDeclarativeView::move方法的典型用法代码示例。如果您正苦于以下问题:C++ QDeclarativeView::move方法的具体用法?C++ QDeclarativeView::move怎么用?C++ QDeclarativeView::move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QDeclarativeView的用法示例。


在下文中一共展示了QDeclarativeView::move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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();
}
开发者ID:pknierim,项目名称:WidgetCollection,代码行数:33,代码来源:main.cpp

示例2: main

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();

}
开发者ID:,项目名称:,代码行数:32,代码来源:


注:本文中的QDeclarativeView::move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。