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 set font size of header and set row's height for QTableview
Forum Updated to NodeBB v4.3 + New Features

How to set font size of header and set row's height for QTableview

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.0k 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.
  • H Offline
    H Offline
    highlandcoffee
    wrote on last edited by
    #1

    Hi,

    I tried to set font size of header and set row's height for QTableview but they didn't work. This is what I tried to do:

    @QTableView#tblView::item
    {
    height: 44px;
    }

    QTableView#tblView QHeaderView::section:horizontal
    {
    font-size: 12px;
    }@

    Please give me some advices for it. Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sripooja
      wrote on last edited by
      #2

      Hi,

      QtableView is having setRowHeight(int row,int height) method just try and check it.

      $ripooj@

      1 Reply Last reply
      0
      • H Offline
        H Offline
        highlandcoffee
        wrote on last edited by
        #3

        Hi sripooja,

        Thank you. It works. :)

        I'm still stuck on setting font size of header.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sripooja
          wrote on last edited by
          #4

          U r Welcome..

          QHeaderView is having setFont(QFont *) method Check it Once.

          $ripooj@

          1 Reply Last reply
          0
          • H Offline
            H Offline
            highlandcoffee
            wrote on last edited by
            #5

            Hi,

            I tried but it doesn't work. This is what I tried:

            @ui->tblView->horizontalHeader()->setFont(QFont("Tahoma", 20));@

            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