本文整理汇总了C++中QtQuick2ApplicationViewer::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ QtQuick2ApplicationViewer::setColor方法的具体用法?C++ QtQuick2ApplicationViewer::setColor怎么用?C++ QtQuick2ApplicationViewer::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtQuick2ApplicationViewer
的用法示例。
在下文中一共展示了QtQuick2ApplicationViewer::setColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
//Создание структуры объектов
//CanDevice* canDevice = SocketCanDevice::instance();
CanDevice* canDevice = EmulationCanDevice::instance();
canDevice->registerCanUnit(CanUnitCapno1::instance());
canDevice->registerCanUnit(CanUnitCapno2::instance());
canDevice->registerCanUnit(CanUnitPower::instance());
canDevice->registerCanUnit(CanUnitSPO::instance());
canDevice->registerCanUnit(CanUnitKIVL::instance());
canDevice->registerCanUnit(CanUnitMix::instance());
RegimeManager::instance();
CanManager::instance();
EventManager::instance();
GraphicManager::instance();
OptionsManager::instance();
VentModeManager::instance();
TranslationManager::instance();
QObject::connect(canDevice,SIGNAL(canDeviceModeChanged(CanDevice::canDeviceModes)),
RegimeManager::instance(), SLOT(slotCanDeviceMode(CanDevice::canDeviceModes)));
//Регистрация перечислений для QML
qmlRegisterUncreatableType<CanUnitMix>("CppImport", 1, 0, "CanUnitMix", "NOT MAY CREATE");
qmlRegisterUncreatableType<CanUnitKIVL>("CppImport", 1, 0, "CanUnitKIVL", "NOT MAY CREATE");
qmlRegisterUncreatableType<MeasureParameter>("CppImport", 1, 0, "MeasureParameter", "NOT MAY CREATE");
qmlRegisterUncreatableType<TunningParameter>("CppImport", 1, 0, "TunningParameter", "NOT MAY CREATE");
qmlRegisterUncreatableType<AssociatedParameter>("CppImport", 1, 0, "AssociatedParameter", "NOT MAY CREATE");
qmlRegisterUncreatableType<EventIDs>("CppImport", 1, 0, "EventIDs", "NOT MAY CREATE");
qmlRegisterUncreatableType<EventTypes>("CppImport", 1, 0, "EventTypes", "NOT MAY CREATE");
qmlRegisterUncreatableType<CanUnitPower>("CppImport", 1, 0, "CanUnitPower", "NOT MAY CREATE");
qmlRegisterUncreatableType<CanUnit>("CppImport", 1, 0, "CanUnit", "NOT MAY CREATE");
qmlRegisterUncreatableType<RegimeManager>("CppImport", 1, 0, "RegimeManager", "NOT MAY CREATE");
qmlRegisterUncreatableType<VentModeManager>("CppImport", 1, 0, "VentModeManager", "NOT MAY CREATE");
//Создание представления и контекста QML
QtQuick2ApplicationViewer viewer;
QQmlContext* ctx = viewer.rootContext();
//регистрация объектов для QML
ctx->setContextProperty("keySim", new KeyboardSimulator());
ctx->setContextProperty("tm", TranslationManager::instance());
ctx->setContextProperty("regimeManager", RegimeManager::instance());
ctx->setContextProperty("canUnitMix", CanUnitMix::instance());
ctx->setContextProperty("canUnitKIVL", CanUnitKIVL::instance());
ctx->setContextProperty("canUnitPower", CanUnitPower::instance());
ctx->setContextProperty("eventManager", EventManager::instance());
ctx->setContextProperty("ventModeManager",VentModeManager::instance());
ctx->setContextProperty("graphicManager", GraphicManager::instance());
ctx->setContextProperty("canManager", CanManager::instance());
CanUnitKIVL::instance()->bindContext(ctx);
CanUnitCapno1::instance()->bindContext(ctx);
VentModeManager::instance()->bindContext(ctx);
GraphicManager::instance()->bindContext(ctx);
OptionsManager::instance()->bindContext(ctx);
viewer.setMainQmlFile(QStringLiteral("qml/BaseIVL2/main.qml"));
viewer.setWidth(1024);
viewer.setHeight(768);
viewer.setColor(QColor::fromRgb(0,0,0,0)/*Qt::transparent*/);
viewer.showExpanded();
canDevice->startInit();
return app.exec();
}