00001 /********************************************************************** 00002 ** Copyright (C) 2002 Stefan Eilers (se, eilers.stefan@epost.de) 00003 ** 00004 ** This file may be distributed and/or modified under the terms of the 00005 ** GNU Library General Public License version 2 as published by the 00006 ** Free Software Foundation and appearing in the file LICENSE.GPL 00007 ** included in the packaging of this file. 00008 ** 00009 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00010 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00011 **********************************************************************/ 00012 #include <qtable.h> 00013 00014 #ifndef CHECKITEM_H__ 00015 #define CHECKITEM_H__ 00016 00029 class OCheckItem : public QTableItem 00030 { 00031 public: 00033 enum Size { BoxSize = 10 }; 00034 OCheckItem( QTable *t, const QString &sortkey ); 00035 00036 virtual void setChecked( bool b ); 00037 virtual void toggle(); 00038 bool isChecked() const; 00043 void setKey( const QString &key ) { m_sortKey = key; } 00044 virtual QString key() const; 00045 00050 void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected ); 00051 00052 //static const int BoxSize = 10; 00053 00054 private: 00055 class OCheckItemPrivate; 00056 OCheckItemPrivate *d; 00057 bool m_checked: 1; 00058 QString m_sortKey; 00059 00060 }; 00061 00062 #endif
1.4.2