Results 1 to 7 of 7

Thread: Problems customizing tooltips in QListView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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 Re: Problems customizing tooltips in QListView

    Quote Originally Posted by wysota View Post
    Did you try using QListView::columnWidth(int) to fetch the column width and QListView::itemAt() to determine which item is under cursor?
    Qt Code:
    1. view->header()->sectionSize( colIndex )
    To copy to clipboard, switch view to plain text mode 

    is a similar way to find the size of the column.
    The problem is that other than the size of the column I need to know the width needed by the item to be drawn in such column.

    The width needed by the cell in the first column of an item is determined by:
    • The Text size (known)

    • The Pixmap size (known)

    • The size of the decorator of the QCheckListItem (unknown)

    • The size of the box of the QCheckListItem (unknown)

    • The indentation of the QChecklist item (if the item is child of other items the first column is indented) (unknown)


    I do not know how to compute the size of the unknown elements

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

    Default Re: Problems customizing tooltips in QListView

    Quote Originally Posted by kalos80 View Post
    I do not know how to compute the size of the unknown elements
    The elements are drawn according to the style. You can query the active style for the size. It's possible that you can query for the complete size you need. Just take a look at what QStyle offers.

Similar Threads

  1. Problems customizing QSlider
    By Antrax in forum Qt Programming
    Replies: 13
    Last Post: 20th December 2011, 07:00

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.