wolfmanjm / qtrotate
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
2cbddc9
qtrotate /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
README | ||
| |
example.cpp | ||
| |
example.desktop | ||
| |
example.h | ||
| |
examplebase.ui | ||
| |
help/ | ||
| |
index.html | ||
| |
main.cpp | ||
| |
pics/ | ||
| |
qbuild.pro | ||
| |
rotate | ||
| |
rotate.cpp | ||
| |
rotate.h |
README
ported to qtextended by Jim Morris morris@wolfman.com http://blog.wolfman.com A simple self contained routine that will enable a QTE app to rotate the screen depending on orientation To use... #include "rotate.h" // create an instance of RotateHelper RotateHelper *rh= new RotateHelper(); // then start it off.. rh->start(); // the default sample rate is 500ms // to stop it... rh->stop(); // to restore to upright... rh->restore(); // to see if the current orientation is landscape... rh->isLandscape(); // to get a signal when the screen orientation changes... connect(rotate, SIGNAL(rotated(bool)), this, SLOT(rotated(bool))); // Then the slot rotated(bool landscape) will be called with true if the new orientation is landscape The only files you need to put in your project are rotate.h and rotate.cpp You can always get the current rotation in degrees using Qte... QValueSpaceItem vsiRot("/UI/Rotation/Current"); int rotation_in_degrees= vsiRot.value().toUInt();

