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

changing height of Qtablewidget Cells

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtablewidgetqsizepolicyqt6.5.0qlayoutsize
5 Posts 2 Posters 901 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.
  • N Offline
    N Offline
    Narutoblaze
    wrote on 14 Jul 2023, 16:15 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 14 Jul 2023, 16:52
    0
    • N Narutoblaze
      14 Jul 2023, 16:15

      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 14 Jul 2023, 16:52 last edited by
      #2

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

      N 1 Reply Last reply 14 Jul 2023, 17:05
      0
      • M mpergand
        14 Jul 2023, 16:52

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

        N Offline
        N Offline
        Narutoblaze
        wrote on 14 Jul 2023, 17:05 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 14 Jul 2023, 18:47
        0
        • N Narutoblaze
          14 Jul 2023, 17:05

          @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 14 Jul 2023, 18:47 last edited by
          #4

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

          N 1 Reply Last reply 15 Jul 2023, 14:42
          0
          • M mpergand
            14 Jul 2023, 18:47

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

            N Offline
            N Offline
            Narutoblaze
            wrote on 15 Jul 2023, 14:42 last edited by
            #5

            @mpergand

            Did not worked :

            setSectionResizeMode(QHeaderView::Fixed);
            setDefaultSectionSize(10);
            
            1 Reply Last reply
            0

            1/5

            14 Jul 2023, 16:15

            • Login

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