ddeviceinformation.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "ddeviceinformation.h"
  2. #include <QDebug>
  3. #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(QT_SIMULATOR) || defined(MEEGO_EDITION) || defined(UI_TABLET)
  4. #define MY_MOBILITY
  5. #include <QtSystemInfo/QSystemInfo>
  6. QTM_USE_NAMESPACE
  7. #endif
  8. DDeviceInformation::DDeviceInformation(QObject *parent) :
  9. QObject(parent)
  10. {
  11. }
  12. #if defined(QTM_USE_NAMESPACE)
  13. QString DDeviceInformation::getStyleName(){
  14. QSystemInfo sys;
  15. qDebug()<< sys.version(QSystemInfo::Os);
  16. if (isTouchable()){
  17. return ":/dbrowser/touchable.qss";
  18. }
  19. else{
  20. return ":/dbrowser/default.qss" ;
  21. }
  22. }
  23. bool DDeviceInformation::isTouchable(){
  24. QSystemInfo sys;
  25. #if defined(UI_TABLET)
  26. return true;
  27. #endif
  28. return sys.hasFeatureSupported(QSystemInfo::HapticsFeature) || sys.version(QSystemInfo::Os).contains("MeeGo");
  29. }
  30. #else
  31. QString DDeviceInformation::getStyleName(){
  32. return ":/dbrowser/default.qss" ;
  33. }
  34. bool DDeviceInformation::isTouchable(){
  35. return false;
  36. }
  37. #endif