Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to get MFC MM_HIMETRIC map mode in QGraphicsView?
IvanM1976 last edited by
I'm trying to map a scene in a QGraphicsView using the same map mode MM_HIMETRIC of MFC.
the himetric map has a unit of 0.01mm and the y is negative from up to down.
How to achieve this?
I'm trying this way:
QGraphicsView* pView = new QGraphicsView();
QGraphicsScene* pScene = new QGraphicsScene(pView);
pScene->setSceneRect(0,0,21000,29700); //A4 dimension in 0,01mm unit
qDebug() << (double)pView->physicalDpiX();
qDebug() << (double)pView->logicalDpiX();
double scaleX = ((double)pView->physicalDpiX())/2540.0;
double scaleY = ((double)pView->physicalDpiY())/2540.0;
this solution works good in a pc using windows 8 with physical DPI of 102 and logical DPI 120, but in another pc (same hardware and screen ) with win7, with physical DPI of 72 and logical DPI 96, the object are smaller than they should appear.
How can I resolve this?
How to get the y negative goin down along the screen?