checkbox and itemdelegate in a tableview

后端 未结 6 1000
攒了一身酷
攒了一身酷 2020-12-31 22:32

I\'m doing an implementation of a CheckBox that inherits from QitemDelegate, to put it into a QTableView.

the problem is that I get when inserted flush left and I ne

6条回答
  •  萌比男神i
    2020-12-31 22:56

    Without too much fussing instead of directly setting rect:

    BtnStyle.rect = option.rect;
    

    Construct a new QRect and move x coordinate to the right as much as you like:

    QRect r = option.rect;
    QRect r1(r.x() + 34, r.y(), r.width(), r.height());
    BtnStyle.rect = r1;
    

提交回复
热议问题