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. setItemWidget to QTreeWidget
Forum Updated to NodeBB v4.3 + New Features

setItemWidget to QTreeWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 456 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.
  • N Offline
    N Offline
    n34rt
    wrote on last edited by n34rt
    #1

    How to use the api setItemWidget to set a widget to a specific column of a QTreeWidget header?

    JonBJ 1 Reply Last reply
    0
    • N n34rt

      How to use the api setItemWidget to set a widget to a specific column of a QTreeWidget header?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @n34rt
      Did you try calling setItemWidget() on QHeaderView? If that does not work I presume you must use the methods at https://doc.qt.io/qt-6/qheaderview.html#protected-functions or QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate) to draw one.

      Or, there is an old article Qt Support Weekly #27 – Widgets on a header, and https://stackoverflow.com/questions/27000484/add-custom-widgets-as-qtablewidget-horizontalheader. Several suggestions can be found by Googling qheaderview add widget.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #3

        I think you can't do that.
        Take a look at https://www.qt.io/blog/2012/09/28/qt-support-weekly-27-widgets-on-a-header about writing a custom headerView with widgets.

        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