void MDeclarativeScreenPrivate::_q_updateOrientationAngle() { if (orientationLocked) return; #ifdef HAVE_CONTEXTSUBSCRIBER MDeclarativeScreen::Orientation newOrientation = MDeclarativeScreen::Portrait; QString edge = topEdgeProperty.value().toString(); bool open = keyboardOpenProperty.value().toBool(); if (open) { newOrientation = MDeclarativeScreen::Landscape; } else if (edge == "top") { newOrientation = MDeclarativeScreen::Landscape; } else if (edge == "left") { newOrientation = MDeclarativeScreen::Portrait; } else if (edge == "right") { newOrientation = MDeclarativeScreen::PortraitInverted; } else if (edge == "bottom") { newOrientation = MDeclarativeScreen::LandscapeInverted; } if (open != keyboardOpen) { keyboardOpen = open; emit q->keyboardOpenChanged(); } if (newOrientation != orientation) { orientation = newOrientation; _q_setOrientationHelper(); emit q->orientationChanged(); } #endif }
void BatteryTest::valueChanged() { ContextProperty *prop = qobject_cast<ContextProperty*>(sender()); if(!prop) return; qDebug()<<"new value: "<<prop->value().toBool(); }
BatteryTest::BatteryTest(QObject *parent) : QObject(parent) { ContextProperty *property = new ContextProperty("Battery.OnBattery",this); property->subscribe(); property->waitForSubscription(); connect(property,SIGNAL(valueChanged()),this,SLOT(valueChanged())); qDebug()<<"initial value: "<<property->value().toBool(); }
void MDeclarativeScreenPrivate::_q_isCoveredChanged() { #ifdef HAVE_CONTEXTSUBSCRIBER bool covered = isCoveredProperty.value().toBool(); if (isCovered != covered) { qDebug() << "MDeclarativeScreenPrivate" << "Covered:" << covered; isCovered = covered; emit q->coveredChanged(); } #endif }