Hello anyone,

Iám using qt-4.4.1 with Windows XP.
I have subclassed QSqLTableModel into CustomSqlModel for the BackgroundRole for setting different colors in columns and Textalignment.
In the main implentation i use QTableview as model.
Everything works perfect.
I have also subclassed QItemDelegate for setting background color for a column with a certain value. ( see example code below).
Now my question is i want to blink the cells with a QTimer in the subclassed QItemDelegate.
Is this possible and can you give me some example code.
QTimer use Signal and a Slot but the paint constructor is public and not a slot.

Qt Code:
  1. #include "delegate.h"
  2. #include <QPainter>
  3. #include <QTimer>
  4.  
  5. void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
  6. {
  7.  
  8. int val = index.model()->data(index, Qt::DisplayRole).toInt() < 1 ;
  9. if(index.column() == 8 && val )
  10.  
  11. {
  12. painter->fillRect(option.rect, Qt::yellow);
  13.  
  14. }
  15. else
  16.  
  17. QItemDelegate::paint(painter,option,index);
  18. }
To copy to clipboard, switch view to plain text mode 

Thanks in advance.