I did that :
mListView->viewport()->setAttribute(Qt::WA_Hover, true);
mListView->viewport()->setMouseTracking(true);
void ZeChatServer_delegate
::paint(QPainter *painter,
{
if (option.
state == QStyle::State_MouseOver) {
std::cout << "Tac tac\n";
}
}
mListView->viewport()->setAttribute(Qt::WA_Hover, true);
mListView->viewport()->setMouseTracking(true);
void ZeChatServer_delegate::paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QItemDelegate::paint(painter, option, index);
if (option.state == QStyle::State_MouseOver)
{
std::cout << "Tac tac\n";
}
}
To copy to clipboard, switch view to plain text mode
Not working so far.
Edit :
Solved :
if (option.
state & QStyle::State_MouseOver)
if (option.state & QStyle::State_MouseOver)
To copy to clipboard, switch view to plain text mode
Bookmarks