Guest User

Untitled

a guest
Jul 17th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. void QueueableDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
  2. {
  3. if (option.state & QStyle::State_Selected)
  4. painter->fillRect(option.rect, option.palette.highlight());
  5. QWidget *widget = new QPushButton("bonjour");
  6. widget->render(painter);
  7. }
  8.  
  9. void QueueableDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
  10. {
  11. if (option.state & QStyle::State_Selected)
  12. painter->fillRect(option.rect, option.palette.highlight());
  13. if (option.state & QStyle::State_Selected)
  14. painter->setPen(option.palette.highlightedText().color());
  15. painter->setFont(QFont("Arial", 10));
  16. painter->drawText(option.rect, Qt::AlignCenter, "Custom drawing");
  17. }
Add Comment
Please, Sign In to add comment