本文整理汇总了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();
}
示例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();
}