Thanks for all , i know i did wrong with the QLabel but
im trying to make text that is selectable , it doesn't have to be Label , i before that used to drow simple text but didn't found any way to make it selectable
like this:
Qt Code:
  1. painter->save();
  2. painter->setFont(smallerBoldFont);
  3. if (!isSelected && !isActive)
  4. painter->setPen(QPen(option.palette.brush(QPalette::Mid), 0));
  5. QString authorString = pStreamItem->author();
  6. QSizeF authorStringSize(QFontMetrics(painter->font()).size( Qt::TextSingleLine, authorString ) );
  7. textLoc.setX(textLoc.x() + publishedStringSize.width() + PADDING);
  8. QRectF authorTextBox( textLoc , authorStringSize);
  9. painter->drawText(authorTextBox, Qt::AlignLeft | Qt::AlignTop, authorString);
  10. painter->restore();
To copy to clipboard, switch view to plain text mode