You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
814 B
C++
30 lines
814 B
C++
/* */
|
|
#include "ccheckboxitemdelegate.h"
|
|
|
|
#include <QPainter>
|
|
#include <QTextDocument>
|
|
#include <QAbstractTextDocumentLayout>
|
|
#include <QFont>
|
|
|
|
|
|
void cCheckBoxItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex &index) const
|
|
{
|
|
QStyleOptionViewItem options = option;
|
|
initStyleOption(&options, index);
|
|
|
|
if(index.data(Qt::CheckStateRole) == Qt::Checked)
|
|
options.font.setBold(true);
|
|
QStyledItemDelegate::paint(painter, options, index);
|
|
}
|
|
|
|
QSize cCheckBoxItemDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
|
|
{
|
|
QStyleOptionViewItem options = option;
|
|
initStyleOption(&options, index);
|
|
|
|
//if(index.data(Qt::CheckStateRole) == Qt::Checked)
|
|
options.font.setBold(true);
|
|
|
|
return(QStyledItemDelegate::sizeHint(options, index));
|
|
}
|