summaryrefslogtreecommitdiff
path: root/libopie/ocheckitem.cpp
authorzecke <zecke>2003-04-13 16:57:28 (UTC)
committer zecke <zecke>2003-04-13 16:57:28 (UTC)
commit0b311079ff19798866291034663757103c6ba935 (patch) (unidiff)
tree70ddccf3a3147475050fa06cc2d807a71ab1d5ee /libopie/ocheckitem.cpp
parent1537ccb435ca725c793db6e94e0b9e83484b57e7 (diff)
downloadopie-0b311079ff19798866291034663757103c6ba935.zip
opie-0b311079ff19798866291034663757103c6ba935.tar.gz
opie-0b311079ff19798866291034663757103c6ba935.tar.bz2
Jumbo API documentation update
and some API fixed ColorDialog is now OColorDialog!!! keep the namespace tidy! ColorPopupMenu is now OColorPopupMenu!!! keep the namespace tidy ColorDialog TT couldn't break bc we can so make it const QColor& OTimePicker add some convience methods more I might have forgot
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
@@ -11,38 +11,69 @@
11**********************************************************************/ 11**********************************************************************/
12 12
13#include <qpainter.h> 13#include <qpainter.h>
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{
46 p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) ); 77 p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Base ) );
47 78
48 int marg = ( cr.width() - BoxSize ) / 2; 79 int marg = ( cr.width() - BoxSize ) / 2;