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. QStyledItemDelegate item drawing over other items...

QStyledItemDelegate item drawing over other items...

Scheduled Pinned Locked Moved Solved General and Desktop
qstyleditemdele
3 Posts 2 Posters 710 Views 1 Watching
  • 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
    Dariusz
    wrote on last edited by
    #1

    Hey

    I've subclassed a QStyledItemDelegate and paint function to do some drawing. I've re-styled my QCheckbox icon but I noticed that if the hierarchy tree goes very deep the checkbox eventually lies over other column and still draws. How can I check if given draw area is visible or being occluded by another column due to offsets?

    TIA

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show your painting code ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Can you show your painting code ?

        D Offline
        D Offline
        Dariusz
        wrote on last edited by
        #3

        @sgaist

        Hey, sorry for slow reply. You got me thinking about the issue! I initially was taking const QStyleOptionViewItem &option - option.rect - and creating my checkbox from it. But I never checked if that rect had any width/height in itself... I did a check now, and if the width of the rect is less than the width of my checkbox then I don't paint it! :D I should probably also check the position... but meh. So far works nice! :D

        1 Reply Last reply
        1

        • Login

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