How to increase QTableWidgetItem SIZE



  • 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 :)



  • 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



  • 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,



  • @mostefa

    This worked
    thanks .



  • @Swapnil_Shelke

    Happy to see that it helped you,

    You are welcome =)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.