#include <Iguana/Studio/interface/AdvListViewItem.h>
Public Member Functions | |
AdvListViewItem (QListViewItem *parent, QListViewItem *after, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null) | |
AdvListViewItem (QListView *parent, QListViewItem *after, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null) | |
AdvListViewItem (QListViewItem *parent, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null) | |
AdvListViewItem (QListView *parent, QString, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null, QString=QString::null) | |
AdvListViewItem (QListViewItem *parent, QListViewItem *after) | |
AdvListViewItem (QListView *parent, QListViewItem *after) | |
Creates the branch item and places it after "after" item. | |
AdvListViewItem (QListViewItem *parent) | |
Creates the branch item with the parent "parent". | |
AdvListViewItem (QListView *parent) | |
Creates the top level item in the list "parent". | |
bool | isBold () |
Returns true if this item is bold faced. | |
bool | isCheckable () |
Returns true if this item can be checked. | |
bool | isChecked () |
Returns true if this item is checked. | |
bool | isItalic () |
Returns true if this item is italic. | |
bool | isMagic () |
Returns true if this item can`t be opened using mouse dblclick on the item`s text. | |
virtual void | paintCell (QPainter *, const QColorGroup &cg, int column, int width, int alignment) |
Reimplemented from QListViewItem. | |
void | setBold (bool is_bold=true) |
Sets the item`s font to be bold faced. | |
void | setCheckable (bool is_checkable=true) |
Sets item to be checkable. | |
void | setChecked (bool is_checked=true) |
Sets item to be checked. | |
void | setItalic (bool is_italic=true) |
Sets the item`s font to be italic. | |
void | setMagic (bool is_magic=true) |
Disables item opening using mouse dblclick. | |
virtual int | width (const QFontMetrics &fm, const QListView *lv, int c) const |
Returns the text width of the item in given column. | |
Private Member Functions | |
void | init () |
Initiates the item. | |
Private Attributes | |
bool | isBold_ |
bool | isCheckable_ |
bool | isChecked_ |
bool | isItalic_ |
bool | isMagic_ |
It is is a multi-column object capable of displaying itself. Its design has the following main goals:
The simplest way to use AdvListViewItem is to construct one with a few constant strings. This creates an item which is a child of parent with two fixed-content strings, and discards the pointer to it:
(void) new AdvListViewItem( parent, "first column", "second column" );
This object will be deleted when parent is deleted, as for QObjects.
The parent is either another AdvListViewItem or AdvListView. If the parent is an AdvListView, this item is a top-level item within that AdvListView. If the parent is another AdvListViewItem, this item becomes a child of the parent item.
If you keep the pointer, you can set or change the texts using setText(), add pixmaps using setPixmap(), change its mode using setSelectable(), setSelected(), setOpen() and setExpandable(), change its height using setHeight(), and do much tree traversal. The set* functions in AdvListView also affect AdvListViewItem, of course.
Other functions derived from QListViewItem are described in QListViewItem documentation.
Definition at line 54 of file AdvListViewItem.h.
AdvListViewItem::AdvListViewItem | ( | QListView * | parent | ) |
Creates the top level item in the list "parent".
Definition at line 14 of file AdvListViewItem.cc.
References init().
AdvListViewItem::AdvListViewItem | ( | QListViewItem * | parent | ) |
AdvListViewItem::AdvListViewItem | ( | QListView * | parent, | |
QListViewItem * | after | |||
) |
Creates the branch item and places it after "after" item.
Constructs an empty list view item which is a child of parent and is after after in the parent's list of children
Definition at line 32 of file AdvListViewItem.cc.
References init().
AdvListViewItem::AdvListViewItem | ( | QListViewItem * | parent, | |
QListViewItem * | after | |||
) |
AdvListViewItem::AdvListViewItem | ( | QListView * | parent, | |
QString | label1, | |||
QString | label2 = QString::null , |
|||
QString | label3 = QString::null , |
|||
QString | label4 = QString::null , |
|||
QString | label5 = QString::null , |
|||
QString | label6 = QString::null , |
|||
QString | label7 = QString::null , |
|||
QString | label8 = QString::null | |||
) |
Creates a new list view item in the QListView parent, parent, with at most 8 constant strings as contents. (void)new QListViewItem( lv, "/", "Root directory" );
Definition at line 53 of file AdvListViewItem.cc.
References init().
00062 :QListViewItem(parent, label1, label2, label3, label4, 00063 label5, label6, label7, label8) 00064 { 00065 init(); 00066 }
AdvListViewItem::AdvListViewItem | ( | QListViewItem * | parent, | |
QString | label1, | |||
QString | label2 = QString::null , |
|||
QString | label3 = QString::null , |
|||
QString | label4 = QString::null , |
|||
QString | label5 = QString::null , |
|||
QString | label6 = QString::null , |
|||
QString | label7 = QString::null , |
|||
QString | label8 = QString::null | |||
) |
Creates a new list view item that's a child of the QListViewItem parent, with at most 8 constant strings as contents. Possible example in a threaded news or e-mail reader:
(void)new QListViewItem( parentMessage, author, subject );
Definition at line 77 of file AdvListViewItem.cc.
References init().
00086 :QListViewItem(parent, label1, label2, label3, label4, 00087 label5, label6, label7, label8) 00088 { 00089 init(); 00090 }
AdvListViewItem::AdvListViewItem | ( | QListView * | parent, | |
QListViewItem * | after, | |||
QString | label1, | |||
QString | label2 = QString::null , |
|||
QString | label3 = QString::null , |
|||
QString | label4 = QString::null , |
|||
QString | label5 = QString::null , |
|||
QString | label6 = QString::null , |
|||
QString | label7 = QString::null , |
|||
QString | label8 = QString::null | |||
) |
Creates a new list view item in the QListView parent, after item after, with at most 8 constant strings as contents.
Note that the order is changed according to QListViewItem::key() unless the list view's sorting is disabled using QListView::setSorting( -1 ).
Definition at line 102 of file AdvListViewItem.cc.
References init().
00111 :QListViewItem(parent, after, label1, label2, label3, label4, 00112 label5, label6, label7, label8) 00113 { 00114 init(); 00115 }
AdvListViewItem::AdvListViewItem | ( | QListViewItem * | parent, | |
QListViewItem * | after, | |||
QString | label1, | |||
QString | label2 = QString::null , |
|||
QString | label3 = QString::null , |
|||
QString | label4 = QString::null , |
|||
QString | label5 = QString::null , |
|||
QString | label6 = QString::null , |
|||
QString | label7 = QString::null , |
|||
QString | label8 = QString::null | |||
) |
Creates a new list view item that's a child of the QListViewItem parent, after item after, with at most 8 constant strings as contents.
Note that the order is changed according to QListViewItem::key() unless the list view's sorting is disabled using QListView::setSorting( -1 ).
Definition at line 129 of file AdvListViewItem.cc.
References init().
00138 :QListViewItem(parent, after, label1, label2, label3, label4, 00139 label5, label6, label7, label8) 00140 { 00141 init(); 00142 }
Initiates the item.
Definition at line 144 of file AdvListViewItem.cc.
References isBold_, isCheckable_, isItalic_, and isMagic_.
Referenced by AdvListViewItem().
00145 { 00146 isBold_ = isItalic_ = isMagic_ = isCheckable_ = false; 00147 }
bool AdvListViewItem::isBold | ( | ) | [inline] |
Returns true if this item is bold faced.
Definition at line 91 of file AdvListViewItem.h.
00091 { return isBold_; }
bool AdvListViewItem::isCheckable | ( | ) | [inline] |
Returns true if this item can be checked.
Definition at line 98 of file AdvListViewItem.h.
Referenced by AdvListView::initItem(), and AdvListView::setChecked().
00098 {return isCheckable_; }
bool AdvListViewItem::isChecked | ( | ) | [inline] |
Returns true if this item is checked.
Definition at line 100 of file AdvListViewItem.h.
Referenced by AdvListView::initItem(), and AdvListView::setChecked().
00100 {return isChecked_; }
bool AdvListViewItem::isItalic | ( | ) | [inline] |
Returns true if this item is italic.
Definition at line 93 of file AdvListViewItem.h.
00093 { return isItalic_; }
bool AdvListViewItem::isMagic | ( | ) | [inline] |
Returns true if this item can`t be opened using mouse dblclick on the item`s text.
Definition at line 96 of file AdvListViewItem.h.
00096 { return isMagic_; }
void AdvListViewItem::paintCell | ( | QPainter * | p, | |
const QColorGroup & | cg, | |||
int | column, | |||
int | width, | |||
int | alignment | |||
) | [virtual] |
Reimplemented from QListViewItem.
Definition at line 149 of file AdvListViewItem.cc.
References isBold_, and isItalic_.
00151 { 00152 QFont old_font( p->font()); 00153 00154 QFont new_font( p->font()); 00155 new_font.setBold(isBold_); 00156 new_font.setItalic(isItalic_); 00157 00158 p->setFont(new_font); 00159 QListViewItem::paintCell(p, cg, column, width, align); 00160 p->setFont(old_font); 00161 }
Sets the item`s font to be bold faced.
Definition at line 103 of file AdvListViewItem.h.
00103 { isBold_ = is_bold; }
Sets item to be checkable.
Definition at line 109 of file AdvListViewItem.h.
00109 { isCheckable_ = is_checkable; }
Sets item to be checked.
Definition at line 174 of file AdvListViewItem.cc.
References isChecked_, list(), and AdvListView::setChecked().
Referenced by AdvListView::setChecked().
00175 { 00176 isChecked_ = is_checked; 00177 AdvListView* list = static_cast<AdvListView*>(listView()); 00178 if (list) 00179 list->setChecked(this, is_checked); 00180 }
Sets the item`s font to be italic.
Definition at line 105 of file AdvListViewItem.h.
00105 { isItalic_ = is_italic; }
Disables item opening using mouse dblclick.
Definition at line 107 of file AdvListViewItem.h.
00107 { isMagic_ = is_magic; }
Returns the text width of the item in given column.
Definition at line 163 of file AdvListViewItem.cc.
References isBold_, isItalic_, and width.
00165 { 00166 QFont new_font(listView()->font()); 00167 new_font.setBold(isBold_); 00168 new_font.setItalic(isItalic_); 00169 QFontMetrics fm_new(new_font); 00170 00171 return QListViewItem::width(fm_new, lv, c); 00172 }
bool AdvListViewItem::isBold_ [private] |
bool AdvListViewItem::isCheckable_ [private] |
bool AdvListViewItem::isChecked_ [private] |
bool AdvListViewItem::isItalic_ [private] |
bool AdvListViewItem::isMagic_ [private] |