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. Derived QTreeWidgetItem class painting
Forum Updated to NodeBB v4.3 + New Features

Derived QTreeWidgetItem class painting

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.9k 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.
  • S Offline
    S Offline
    swarsi
    wrote on last edited by
    #1

    i have derived my own class subclassing from QTreeWidgetItem and i want to be able to draw some of these items in a QTreeWidget with colored boxes surrounding the items. for instance, i want to be be able to draw a red outline around some of the items to give feedback on critical items. is this possible?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Sure. However, you should probably look into using a delegate instead. One way would be to subclass [[doc:QStyledItemDelegate]] and reimplement its paint() method.

      1 Reply Last reply
      0

      • Login

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