Results 1 to 5 of 5

Thread: How to map Viewport coordinates to content coordinates in QTableView

  1. #1
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to map Viewport coordinates to content coordinates in QTableView

    Hi all,

    I did not find a way to map viewport coordinates to content coordinates in QTableView.

    In Qt 3 I was using viewportToContents() function, but I did not find a similar function in Qt4.

    I would be really glad you if someone could suggest me what to use.

    Thanks in advance,
    Calogero

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to map Viewport coordinates to content coordinates in QTableView

    Hi,

    Maybe you can try to catch mouse move event inside your widget?

  3. #3
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to map Viewport coordinates to content coordinates in QTableView

    Hi zgulser,

    Thanks for your reply.

    I'm already doing that, but the coordinates I'm getting are viewport coordinates. I'd like to know a way to translate those coordinates into content coordinates.

  4. #4
    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: How to map Viewport coordinates to content coordinates in QTableView

    The coordinates of the widget representing the viewport can be mapped to the coordinates in the content space by adding (or substracting, based on the mapping direction) values of respective scroll bars.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    kalos80 (18th March 2010)

  6. #5
    Join Date
    Mar 2006
    Posts
    56
    Thanks
    7
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to map Viewport coordinates to content coordinates in QTableView

    wysota,
    thank you very much for you hint.

    It is really helpfull!

Similar Threads

  1. Replies: 2
    Last Post: 15th June 2021, 17:00
  2. Coordinates Related
    By jsmith in forum Qt Programming
    Replies: 0
    Last Post: 18th August 2009, 16:37
  3. Transforming coordinates
    By Benjamin in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2009, 15:18
  4. Viewport and scene coordinates
    By aurelius in forum Newbie
    Replies: 2
    Last Post: 31st October 2008, 00:47
  5. QScrollArea relative viewport coordinates
    By kalanikta in forum Qt Programming
    Replies: 1
    Last Post: 21st April 2006, 11:30

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.