summaryrefslogtreecommitdiff
path: root/libopie/ocheckitem.cpp
Unidiff
Diffstat (limited to 'libopie/ocheckitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ocheckitem.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/libopie/ocheckitem.cpp b/libopie/ocheckitem.cpp
index d6ddc79..082d7a2 100644
--- a/libopie/ocheckitem.cpp
+++ b/libopie/ocheckitem.cpp
@@ -14,32 +14,63 @@
14 14
15#include "ocheckitem.h" 15#include "ocheckitem.h"
16 16
17/**
18 * Constructs an CheckItem with a QTable as parent
19 * and a sort key for.
20 * The sort key will be used by QTable to sort the table later
21 * @param t The parent QTable where the check item belongs
22 * @param key A sort key
23 */
17OCheckItem::OCheckItem( QTable *t, const QString &key ) 24OCheckItem::OCheckItem( QTable *t, const QString &key )
18 : QTableItem( t, Never, "" ), m_checked( FALSE ), m_sortKey( key ) 25 : QTableItem( t, Never, "" ), m_checked( FALSE ), m_sortKey( key )
19{ 26{
20} 27}
21 28
29/**
30 * reimplemted for internal reasons
31 * @return Returns the sort key of the Item
32 * @see QTableItem
33 */
22QString OCheckItem::key() const 34QString OCheckItem::key() const
23{ 35{
24 return m_sortKey; 36 return m_sortKey;
25} 37}
26 38
39/**
40 * This method can check or uncheck the item. It will
41 * call QTable to update the cell.
42 *
43 * @param b Whether to check or uncheck the item
44 */
27void OCheckItem::setChecked( bool b ) 45void OCheckItem::setChecked( bool b )
28{ 46{
29 m_checked = b; 47 m_checked = b;
30 table()->updateCell( row(), col() ); 48 table()->updateCell( row(), col() );
31} 49}
32 50
51/**
52 * This will toggle the item. If it is checked it'll get
53 * unchecked by this method or vice versa.
54 */
33void OCheckItem::toggle() 55void OCheckItem::toggle()
34{ 56{
35 m_checked = !m_checked; 57 m_checked = !m_checked;
36} 58}
37 59
60/**
61 * This will return the state of the item.
62 *
63 * @return Returns true if the item is checked
64 */
38bool OCheckItem::isChecked() const 65bool OCheckItem::isChecked() const
39{ 66{
40 return m_checked; 67 return m_checked;
41} 68}
42 69
70/**
71 * @internal
72 * This paints the item
73 */
43void OCheckItem::paint( QPainter *p, const QColorGroup &cg, const QRect &cr, 74void OCheckItem::paint( QPainter *p, const QColorGroup &cg, const QRect &cr,
44 bool ) 75 bool )
45{ 76{