Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to get MFC MM_HIMETRIC map mode in QGraphicsView?
Forum Updated to NodeBB v4.3 + New Features

how to get MFC MM_HIMETRIC map mode in QGraphicsView?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 451 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IvanM1976
    wrote on last edited by
    #1

    Hello,

    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
    pView->setScene(pScene);
    qDebug() << (double)pView->physicalDpiX();
    qDebug() << (double)pView->logicalDpiX();
    double scaleX = ((double)pView->physicalDpiX())/2540.0;
    double scaleY = ((double)pView->physicalDpiY())/2540.0;
    pView->scale(scaleX,scaleY);

    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?

    thank you

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved