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. Set delegate for QTreeWidget header
Forum Updated to NodeBB v4.3 + New Features

Set delegate for QTreeWidget header

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

    I need to set delegate for QTreeWidget header or make it working with HTML tags using other ways.
    I set a delegate for QTreeWidget items using
    [code]ui->tree->setItemDelegate(dlgt);[/code]

    and it works.
    But setting a delegate to the header does not work :

    [code]ui->tree->header()->setItemDelegate(dlgt);[/code]

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Maybe switch to model/view to implement this.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        za83
        wrote on last edited by
        #3

        bq. Maybe switch to model/view to implement this.

        What does it mean?

        1 Reply Last reply
        0
        • JeroentjehomeJ Offline
          JeroentjehomeJ Offline
          Jeroentjehome
          wrote on last edited by
          #4

          Hi,
          Use the Model/View method instead of the Widget will give you more options to control the delegates for every cell. The View does what the name says, shows stuff. The model holds the data and the way it is presented by the view.
          Read this: "Model/View doc":http://qt-project.org/doc/qt-4.8/modelview.html

          Greetz, Jeroen

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            za83
            wrote on last edited by
            #5

            I will consider this. But I have a big project As far as I understand in this case I need to make many changes in this project.

            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