New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lipstick] Use QOrientationSensor to get updates about current device or... #90
Conversation
@@ -39,11 +40,16 @@ | |||
QObject::connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(clearUpdateRequest())); | |||
connect(m_displayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(reactOnDisplayStateChanges(MeeGo::QmDisplayState::DisplayState))); | |||
|
|||
m_orientationSensor = new QOrientationSensor(this); | |||
QObject::connect(m_orientationSensor,SIGNAL(readingChanged()),this,SLOT(orientationSensorChanged())); | |||
m_orientationSensor->start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to call m_orientationSensor->connectToBackend(); before the call to start().
I know, its a bad legacy API design, and unfortunately, we are stuck with it.
You might also look into setting a rate. Some sensor devices only fire off with a change, others do polling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok no problem, but it worked without the call to connectToBackend.
Any idea what rate would be good?
@Vesuri, what do you think about doing orientation handling in C++? |
@rburchell I don't see why it shouldn't be done on the C++ side. Otherwise all QML implementations have to add it separately. |
@@ -39,6 +40,7 @@ BuildRequires: pkgconfig(contextkit-statefs) >= 0.2.7 | |||
BuildRequires: qt5-qttools-linguist | |||
BuildRequires: qt5-qtwayland-wayland_egl-devel >= 5.1.0+git7 | |||
BuildRequires: doxygen | |||
Requires: qt5-qtsensors-plugin-sensorfw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it should be qt5-qtdeclarative-import-sensors.
...-sensorfw will be the one going into patterns, so not needed here (I'm pressing hard those responsible ;) bear with me rrrrrr :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rburchell pointed out he doesn't need the QML module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, does he need the declarative sensors? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xo correction :D he doesn't (as per #90 (comment) )
So yes, final view:
-BuildRequires: pkgconfig(Qt5Qml)
...
-Requires: qt5-qtsensors-plugin-sensorfw
Many thanks @faenil for pointing this out
… orientation Call connect to backend Fix style Fixed problems pointed out by @Vesuri removed unneeded packages from spec file
LVGTM :) |
[lipstick] Use QOrientationSensor to get updates about current device or...
...ientation