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. QAbstractItemView::visualRect() vs: rect text is drawn?

QAbstractItemView::visualRect() vs: rect text is drawn?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 138 Views
  • 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    the visualRect is the ENTIRE area enclosed by the cell in the table, right?
    but the text is clipped a bit inset from that, right?
    by clipped i mean the text is shrunk / elided to fit in this slightly smaller than visualRect area, right?
    how do i get that smaller area so if i'm drawing custom text or i want to hand some text up to _inherited, i know how big it is allowed to be?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      When you draw custom text you have to calc it by your own. It's heavily style dependent and therefore no public api possible. For qcommonstyle look at the sources: https://code.woboq.org/qt5/qtbase/src/widgets/styles/qcommonstyle.cpp.html#_ZNK19QCommonStylePrivate12viewItemSizeEPK20QStyleOptionViewItemi

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2

      • Login

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