#ifndef SCHECKBOXHEADERVIEW_H#define SCHECKBOXHEADERVIEW_H#include#include#include#include#include
class SCheckBoxHeaderView : publicQHeaderView
{
Q_OBJECTprivate:boolisChecked;intm_checkColIdx;public:
SCheckBoxHeaderView(int checkColumnIndex, Qt::Orientation orientation, QWidget * parent = 0) :
QHeaderView(orientation, parent) {
m_checkColIdx=checkColumnIndex;
isChecked= false;
}
signals:void checkStausChange(bool);protected:void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const{
painter->save();
QHeaderView::paintSection(painter, rect, logicalIndex);
painter->restore();if (logicalIndex ==m_checkColIdx) {
QStyleOptionButton option;int width = 10;for (int i=0; i
width+=sectionSize( i );
option.rect= QRect(3, 5, 21