1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #include "ddeviceinformation.h"
- #include <QDebug>
- #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(QT_SIMULATOR) || defined(MEEGO_EDITION) || defined(UI_TABLET)
- #define MY_MOBILITY
- #include <QtSystemInfo/QSystemInfo>
- QTM_USE_NAMESPACE
- #endif
- DDeviceInformation::DDeviceInformation(QObject *parent) :
- QObject(parent)
- {
- }
- #if defined(QTM_USE_NAMESPACE)
- QString DDeviceInformation::getStyleName(){
- QSystemInfo sys;
- qDebug()<< sys.version(QSystemInfo::Os);
- if (isTouchable()){
- return ":/dbrowser/touchable.qss";
- }
- else{
- return ":/dbrowser/default.qss" ;
- }
- }
- bool DDeviceInformation::isTouchable(){
- QSystemInfo sys;
- #if defined(UI_TABLET)
- return true;
- #endif
- return sys.hasFeatureSupported(QSystemInfo::HapticsFeature) || sys.version(QSystemInfo::Os).contains("MeeGo");
- }
- #else
- QString DDeviceInformation::getStyleName(){
- return ":/dbrowser/default.qss" ;
- }
- bool DDeviceInformation::isTouchable(){
- return false;
- }
- #endif
|