added QTDeviceToLogical for QWidgets

This commit is contained in:
Paolo Cignoni 2014-04-28 13:30:27 +00:00
parent 8825048e46
commit 115bb8a701
1 changed files with 11 additions and 0 deletions

View File

@ -26,6 +26,17 @@ inline ValueType QTLogicalToDevice( QPainter *qp, const ValueType &value)
#endif
}
template < class ValueType>
inline ValueType QTDeviceToLogical( QWidget *qw, const ValueType &value)
{
#if QT_VERSION >= 0x050000
return value/qw->devicePixelRatio() ;
#else
Q_UNUSED(qw);
return value;
#endif
}
template < class ValueType>
inline ValueType QTDeviceToLogical( QPainter *qp, const ValueType &value)
{