I have QListVIew and delegate to paint the list view. I paint some text int the center of cell. so I do it:
void Delegate::paint(QPainter *painter, const QStyledOptionViewItem &option, const QModelIndex &index )
{
.
.
.
QRect textRect(option.rect.center(),QSize(option.rect.width(),option.rect.height());
paiter->drawText(textRect,text,QTextOption());
but it starts to paint from the center. how can I center this output? thank you