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 increase QTableWidgetItem SIZE
QtWS25 Last Chance

How to increase QTableWidgetItem SIZE

Scheduled Pinned Locked Moved Solved General and Desktop
qtablewidgetqt 5.7qtablewidgetite
5 Posts 3 Posters 4.3k 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.
  • S Offline
    S Offline
    Swapnil_Shelke
    wrote on last edited by
    #1

    I have these check boxes in my QTableWidget for selection but the check-boxes are small and not accessible properly with touch.
    I add the check-boxes the following way

    QTableWidgetItem *pItem = new QTableWidgetItem();
    pItem->setCheckState(Qt::Unchecked);

    Is there any way i can increase the check-box size.
    thanks in advance :)

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      There is no direct way to do this as qtablewidgetitems are not widget. Either you create your own checkbox and set the style sheet and use setcellwidget. Or you write your own table view and write ur own delegate with checkbox

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      8
      • M Offline
        M Offline
        mostefa
        wrote on last edited by mostefa
        #3

        Hi @Swapnil_Shelke

        Yes you can play with stylesheet to increase checkBox Size

        you can do something like this for example:

        yourTableWidget->setStyleSheet("QAbstractItemView::indicator { width: 40px;height:40px;/*size of checkbox change here */} QTableWidget::item{width: 200px;height: 100px;} "/*size of item */);

        The result will be then, something like this ;

        alt text

        instead of

        alt text

        alt text

        This can help you to solve your problem , but i really doubt that it is the best solution,

        S 1 Reply Last reply
        2
        • M mostefa

          Hi @Swapnil_Shelke

          Yes you can play with stylesheet to increase checkBox Size

          you can do something like this for example:

          yourTableWidget->setStyleSheet("QAbstractItemView::indicator { width: 40px;height:40px;/*size of checkbox change here */} QTableWidget::item{width: 200px;height: 100px;} "/*size of item */);

          The result will be then, something like this ;

          alt text

          instead of

          alt text

          alt text

          This can help you to solve your problem , but i really doubt that it is the best solution,

          S Offline
          S Offline
          Swapnil_Shelke
          wrote on last edited by
          #4

          @mostefa

          This worked
          thanks .

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mostefa
            wrote on last edited by
            #5

            @Swapnil_Shelke

            Happy to see that it helped you,

            You are welcome =)

            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