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 set height of all rows(QTableView)
Forum Updated to NodeBB v4.3 + New Features

How set height of all rows(QTableView)

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 11.7k 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    Hi.I was searching google for function of QTableView and QStandardItemModel, but can't find one. Seems like exist func only for single setRowHeight, no for all rows in model.

    JonBJ 1 Reply Last reply
    0
    • EngelardE Engelard

      Hi.I was searching google for function of QTableView and QStandardItemModel, but can't find one. Seems like exist func only for single setRowHeight, no for all rows in model.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Engelard
      What do you mean? setRowHeight() is the row height for each row to be displayed. How could you have a height for all rows when there could be any number of them, and what would you use it for anyway?

      EngelardE 1 Reply Last reply
      0
      • M Offline
        M Offline
        mpergand
        wrote on last edited by
        #3

        For the vertical header, call setDefaultSectionSize()

        QHeaderView* header=tableView->verticalHeader();
        header->setDefaultSectionSize(20); // 20 px height
        header->sectionResizeMode(QHeaderView::Fixed);
        
        1 Reply Last reply
        4
        • JonBJ JonB

          @Engelard
          What do you mean? setRowHeight() is the row height for each row to be displayed. How could you have a height for all rows when there could be any number of them, and what would you use it for anyway?

          EngelardE Offline
          EngelardE Offline
          Engelard
          wrote on last edited by
          #4

          @JonB said in How set height of all rows(QTableView):

          setRowHeight() is the row height for each row to be displayed.

          No, it's only for particular, not for each.

          @mpergand said in How set height of all rows(QTableView):

          header->setDefaultSectionSize(20); // 20 px height

          This.

          1 Reply Last reply
          1
          • M mpergand referenced this topic on

          • Login

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