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. changing height of Qtablewidget Cells
Forum Update on Monday, May 27th 2025

changing height of Qtablewidget Cells

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtablewidgetqsizepolicyqt6.5.0qlayoutsize
5 Posts 2 Posters 907 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.
  • NarutoblazeN Offline
    NarutoblazeN Offline
    Narutoblaze
    wrote on last edited by
    #1

    I want to change the height of cells of the Qtablewidget i have change the height of column successfully but i am unable to do the same for all the cells below or rows you may call.

    changed height of column via :

    Qtablewidget *table = new Qtablewidget;
    horizontalHeader()->setFixedHeight(30);
    

    Tried to do this did not work :

    verticalHeader()->setFixedHeight(30)
    
    M 1 Reply Last reply
    0
    • NarutoblazeN Narutoblaze

      I want to change the height of cells of the Qtablewidget i have change the height of column successfully but i am unable to do the same for all the cells below or rows you may call.

      changed height of column via :

      Qtablewidget *table = new Qtablewidget;
      horizontalHeader()->setFixedHeight(30);
      

      Tried to do this did not work :

      verticalHeader()->setFixedHeight(30)
      
      M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      @Narutoblaze
      Have a try with:
      setMinimumSectionSize() or
      setDefaultSectionSize()

      NarutoblazeN 1 Reply Last reply
      0
      • M mpergand

        @Narutoblaze
        Have a try with:
        setMinimumSectionSize() or
        setDefaultSectionSize()

        NarutoblazeN Offline
        NarutoblazeN Offline
        Narutoblaze
        wrote on last edited by
        #3

        @mpergand this worked partially when set large numbers but not when i wanted to make it extremely thinner.

        worked :

        setDefaultSectionSize(50);
        

        Did not worked :

        setDefaultSectionSize(30);
        

        Did not worked :

        setDefaultSectionSize(10);
        

        setting to small numbers like above did not change the height of the cells so i believe this is not a good solution and is error prone and also does not solve my problems.

        why setting height does not work is it a bug ?

        M 1 Reply Last reply
        0
        • NarutoblazeN Narutoblaze

          @mpergand this worked partially when set large numbers but not when i wanted to make it extremely thinner.

          worked :

          setDefaultSectionSize(50);
          

          Did not worked :

          setDefaultSectionSize(30);
          

          Did not worked :

          setDefaultSectionSize(10);
          

          setting to small numbers like above did not change the height of the cells so i believe this is not a good solution and is error prone and also does not solve my problems.

          why setting height does not work is it a bug ?

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #4

          @Narutoblaze
          add:
          sectionResizeMode(QHeaderView::Fixed);

          NarutoblazeN 1 Reply Last reply
          0
          • M mpergand

            @Narutoblaze
            add:
            sectionResizeMode(QHeaderView::Fixed);

            NarutoblazeN Offline
            NarutoblazeN Offline
            Narutoblaze
            wrote on last edited by
            #5

            @mpergand

            Did not worked :

            setSectionResizeMode(QHeaderView::Fixed);
            setDefaultSectionSize(10);
            
            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