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. Trying for force display of QTableWidget horizontal header
Forum Updated to NodeBB v4.3 + New Features

Trying for force display of QTableWidget horizontal header

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 215 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.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #1

    Qt 6.5 I'm trying to get QTableWidget to display the column headers even if there's no data to display.

    I tried to follow the advice given by VRonin in this post:

    https://forum.qt.io/post/470163

    but found two problems:

    • ensurePolished() didn't seem to be a valid thing to call from that code.

    • The column headers were still not displayed

    What's the current advice to get this to work please?

    Thanks
    David

    PerdrixP 1 Reply Last reply
    0
    • PerdrixP Perdrix

      Qt 6.5 I'm trying to get QTableWidget to display the column headers even if there's no data to display.

      I tried to follow the advice given by VRonin in this post:

      https://forum.qt.io/post/470163

      but found two problems:

      • ensurePolished() didn't seem to be a valid thing to call from that code.

      • The column headers were still not displayed

      What's the current advice to get this to work please?

      Thanks
      David

      PerdrixP Offline
      PerdrixP Offline
      Perdrix
      wrote on last edited by Perdrix
      #2

      @Perdrix I got it to display the column headers by simply calling

      imageList->setColumnCount(count);

      with the correct number of columns

      1 Reply Last reply
      0
      • PerdrixP Perdrix has marked this topic as solved on

      • Login

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