Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Do I have to write my own TableView headerDelegate from scratch?
Qt 6.12 LTS is out! See what's new in the release blog

Do I have to write my own TableView headerDelegate from scratch?

Scheduled Pinned Locked Moved QML and Qt Quick
tableviewdelegate
2 Posts 2 Posters 1.1k Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Using Qt 5.5, I've got a TableView where I need to tweak the header slightly - I want to set the font's point size and make it underlined.

    As far as I can tell, I can't just say "take the default headerDelegate and modify the font", my only option for doing this is to create my own headerDelegate and re-create the entire headerDelegate from scratch.

    1. Why isn't there a TableViewHeaderDelegate widget that I can "inherit" and just modify the font? Or is there, and I just don't know where to look?

    2. Is there an example somewhere showing how to get the UI for sorting to work?

    Thanks,
    Chris

    p3c0P 1 Reply Last reply
    0
    • ? A Former User

      Using Qt 5.5, I've got a TableView where I need to tweak the header slightly - I want to set the font's point size and make it underlined.

      As far as I can tell, I can't just say "take the default headerDelegate and modify the font", my only option for doing this is to create my own headerDelegate and re-create the entire headerDelegate from scratch.

      1. Why isn't there a TableViewHeaderDelegate widget that I can "inherit" and just modify the font? Or is there, and I just don't know where to look?

      2. Is there an example somewhere showing how to get the UI for sorting to work?

      Thanks,
      Chris

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @betty_crokker

      Why isn't there a TableViewHeaderDelegate widget that I can "inherit" and just modify the font? Or is there, and I just don't know where to look?

      There is no such way to do so. No such functionality provided yet.

      Is there an example somewhere showing how to get the UI for sorting to work?

      You can use the method described here. Basically it is a QML wrapper around QSortFilterProxyModel and works with ListModel.

      157

      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
      • Unsolved