本文整理汇总了C++中QtQuick2ApplicationViewer::setMaximumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QtQuick2ApplicationViewer::setMaximumSize方法的具体用法?C++ QtQuick2ApplicationViewer::setMaximumSize怎么用?C++ QtQuick2ApplicationViewer::setMaximumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtQuick2ApplicationViewer
的用法示例。
在下文中一共展示了QtQuick2ApplicationViewer::setMaximumSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
qmlRegisterType<PieSlice>("Charts", 1, 0, "PieSlice");
Configuration m_configuration;
SerialLink m_serialLink;
MavLinkManager m_mavlink_manager;
LinkManager m_gLinkManager;
QtQuick2ApplicationViewer viewer;
QtQuick2ApplicationViewer splashscreen;
QString customPath = "Sqlite/OfflineStorage";
QDir dir;
if(dir.mkpath(QString(customPath))){
// qDebug() << "Default path >> "+viewer.engine()->offlineStoragePath();
viewer.engine()->setOfflineStoragePath(QString(customPath));
// qDebug() << "New path >> "+viewer.engine()->offlineStoragePath();
}
// using as normal
// viewer.setMainQmlFile(QStringLiteral("qml/gStabiSC/main.qml"));
// using qml files form resources file, uncomment this to compile all qml file to .exe
splashscreen.setSource(QUrl("qrc:/qml/gStabiSC/GSplashScreen.qml"));
splashscreen.setFlags(Qt::FramelessWindowHint);
splashscreen.setMinimumSize(QSize(1000,500));
splashscreen.show();
viewer.setSource(QUrl("qrc:/qml/gStabiSC/GMain.qml"));
viewer.setTitle(QString("%1 %2").arg(APPLICATION_NAME).arg(APPLICATION_VERSION));
viewer.setMinimumSize(QSize(APPLICATION_WIDTH,APPLICATION_HEIGHT));
viewer.setMaximumSize(QSize(APPLICATION_WIDTH,APPLICATION_HEIGHT));
// viewer.addImportPath("qrc:/qml/gStabiSC");
// viewer.addImportPath("qrc:/qml/gStabiSC/Components");
// viewer.addImportPath("qrc:/qml/gStabiSC/GDashboard");
// viewer.addImportPath("qrc:/javascript/storage.js");
viewer.rootContext()->setContextProperty("_configuration",&m_configuration);
viewer.rootContext()->setContextProperty("_serialLink", &m_serialLink);
viewer.rootContext()->setContextProperty("_mavlink_manager", &m_mavlink_manager);
m_gLinkManager.connectLink(&m_serialLink,&m_mavlink_manager);
QTimer::singleShot(3000, &splashscreen, SLOT(close()));
QTimer::singleShot(3000, &viewer, SLOT(show()));
return app.exec();
}