added QTDeviceToLogical for QWidgets
This commit is contained in:
parent
8825048e46
commit
115bb8a701
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue