Results 1 to 7 of 7

Thread: what's the equivalent with DPtoLP in windows

  1. #1
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1

    Default what's the equivalent with DPtoLP in windows

    I has used QPainter::setWindow to map my logic cooridnate system to meet with the view cooridnate, then at the slot of mousePress event, how can I map back the device cooridnate to logic cooridnate. I know in windows programing, the function LPtoDP do this. Is there an equivalent in Qt or any other method?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what's the equivalent with DPtoLP in windows

    There is a family of "mapTo" and "mapFrom" methods in various classes. The painter always operates on "logic" coordinates. The widget should operate on "physical" ones.

  3. #3
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1

    Default Re: what's the equivalent with DPtoLP in windows

    Quote Originally Posted by wysota
    There is a family of "mapTo" and "mapFrom" methods in various classes. The painter always operates on "logic" coordinates. The widget should operate on "physical" ones.
    Thank you. But I need a little more help. How can I get the display_id which is needed by QScreen constructor?

  4. #4
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: what's the equivalent with DPtoLP in windows

    Try leave it in 0
    a life without programming is like an empty bottle

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what's the equivalent with DPtoLP in windows

    Quote Originally Posted by cocalele
    Thank you. But I need a little more help. How can I get the display_id which is needed by QScreen constructor?
    What do you need a QScreen object for?

  6. #6
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1

    Default Re: what's the equivalent with DPtoLP in windows

    Quote Originally Posted by wysota
    What do you need a QScreen object for?
    I want to use the member of QScreen mapFromDevice.

    It seems QScreen is part of Qtopia, I even can't find the head file QScreen in my Qt installation directory

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: what's the equivalent with DPtoLP in windows

    How about QWidget's:

    Qt Code:
    1. QPoint mapFrom ( QWidget * parent, const QPoint & pos ) const
    2. QPoint mapFromGlobal ( const QPoint & pos ) const
    3. QPoint mapFromParent ( const QPoint & pos ) const
    4. QPoint mapTo ( QWidget * parent, const QPoint & pos ) const
    5. QPoint mapToGlobal ( const QPoint & pos ) const
    6. QPoint mapToParent ( const QPoint & pos ) const
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Qt Jambi, deploying app on Mac & Windows fails
    By ChrisColon in forum Installation and Deployment
    Replies: 2
    Last Post: 16th February 2009, 22:05
  2. Replies: 5
    Last Post: 15th January 2009, 09:03
  3. Windows not appearing in XP.
    By beardybloke in forum Qt Programming
    Replies: 7
    Last Post: 24th October 2007, 17:32
  4. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.