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 do I freeze the first row in a QTableWidget?
Forum Updated to NodeBB v4.3 + New Features

How do I freeze the first row in a QTableWidget?

Scheduled Pinned Locked Moved Unsolved General and Desktop
tablewidget
4 Posts 3 Posters 714 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.
  • J Offline
    J Offline
    jdent
    wrote on last edited by jdent
    #1

    I want the first row in QTableWidget to always be visible. just like in Excel where you can freeze rows.
    How to do it?
    Also, how to resize a column based on its contents?

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      Frozen Column Example (https://doc.qt.io/qt-6/qtwidgets-itemviews-frozencolumn-example.html). [With this wonderful new forum how do I pick "link Url" which used to be so easy and useful?)

      void QTableView::resizeColumnToContents(int column) (https://doc.qt.io/qt-6/qtableview.html#resizeColumnToContents)

      SGaistS 1 Reply Last reply
      1
      • JonBJ JonB

        Frozen Column Example (https://doc.qt.io/qt-6/qtwidgets-itemviews-frozencolumn-example.html). [With this wonderful new forum how do I pick "link Url" which used to be so easy and useful?)

        void QTableView::resizeColumnToContents(int column) (https://doc.qt.io/qt-6/qtableview.html#resizeColumnToContents)

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @JonB use the answer arrows rather than the quick answer box. You will have the full editor :-)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        JonBJ 1 Reply Last reply
        0
        • SGaistS SGaist

          @JonB use the answer arrows rather than the quick answer box. You will have the full editor :-)

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @SGaist said in How do I freeze the first row in a QTableWidget?:

          use the answer arrows rather than the quick answer box.

          Thanks, I discovered that after the first time I used it... :)

          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