Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    2
    2
    48
    Loading More Posts
    • 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
      davecotter last edited by

      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 Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        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 has to stay free or it will die.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post