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:
painter->save();
painter->setFont(smallerBoldFont);
if (!isSelected && !isActive)
painter
->setPen
(QPen(option.
palette.
brush(QPalette::Mid),
0));
QString authorString
= pStreamItem
->author
();
QSizeF authorStringSize
(QFontMetrics(painter
->font
()).
size( Qt
::TextSingleLine, authorString
) );
textLoc.setX(textLoc.x() + publishedStringSize.width() + PADDING);
QRectF authorTextBox
( textLoc , authorStringSize
);
painter->drawText(authorTextBox, Qt::AlignLeft | Qt::AlignTop, authorString);
painter->restore();
painter->save();
painter->setFont(smallerBoldFont);
if (!isSelected && !isActive)
painter->setPen(QPen(option.palette.brush(QPalette::Mid), 0));
QString authorString = pStreamItem->author();
QSizeF authorStringSize(QFontMetrics(painter->font()).size( Qt::TextSingleLine, authorString ) );
textLoc.setX(textLoc.x() + publishedStringSize.width() + PADDING);
QRectF authorTextBox( textLoc , authorStringSize);
painter->drawText(authorTextBox, Qt::AlignLeft | Qt::AlignTop, authorString);
painter->restore();
To copy to clipboard, switch view to plain text mode
Bookmarks