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. How to lock the headviewer width of the qtablewidget

How to lock the headviewer width of the qtablewidget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 236 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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote on last edited by
    #1

    I want to lock the first column of the tablewidget ,so that nobody could resize the width of the first column in the tablewidget,But other columns width could be resized by the users .So how to solve this problem?Is there any way that I could lock some columns width sets?
    Heres the code I used dosent work.

         .....
        case eCompTableItemDate:{
            setColumnWidth(colId,240);
        }
            break;
        case eCompTableItemSize:{
            setColumnWidth(colId,150);
        }
    
    
    JonBJ 1 Reply Last reply
    0
    • nicker playerN nicker player

      I want to lock the first column of the tablewidget ,so that nobody could resize the width of the first column in the tablewidget,But other columns width could be resized by the users .So how to solve this problem?Is there any way that I could lock some columns width sets?
      Heres the code I used dosent work.

           .....
          case eCompTableItemDate:{
              setColumnWidth(colId,240);
          }
              break;
          case eCompTableItemSize:{
              setColumnWidth(colId,150);
          }
      
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @nicker-player
      I would guess tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed)?

      nicker playerN 1 Reply Last reply
      0
      • JonBJ JonB

        @nicker-player
        I would guess tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Fixed)?

        nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote on last edited by
        #3

        @JonB
        yeah,bingo.

        1 Reply Last reply
        0
        • SGaistS SGaist 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