Results 1 to 7 of 7

Thread: QTreeWidget - itemAt(QMousePos): error if there is a header

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTreeWidget - itemAt(QMousePos): error if there is a header

    Why are you trying to get a global position? You don't need a global position but position in the viewport's coordinate space.

    This should work:
    Qt Code:
    1. QPoint pos = ui->treeWidget->viewport()->mapFromParent(event->pos());
    To copy to clipboard, switch view to plain text mode 

    or something like that, depending on what is the receiver of the event.
    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.


  2. #2
    Join Date
    Apr 2010
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeWidget - itemAt(QMousePos): error if there is a header

    Thank you, that's it It tooks me few hours of my life

Similar Threads

  1. Help with QTreeWidget header
    By jwieland in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2009, 13:36
  2. How to Add a Button in QTreeWidget Header?
    By ioannis in forum Qt Programming
    Replies: 1
    Last Post: 1st October 2008, 10:52
  3. QTreeWidget itemAt
    By maartenS in forum Newbie
    Replies: 4
    Last Post: 17th September 2008, 19:19
  4. Replies: 6
    Last Post: 15th September 2007, 22:14
  5. Two-row header for QTreeWidget
    By wetzel in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2006, 12:26

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
  •  
Qt is a trademark of The Qt Company.