#include <Iguana/Studio/interface/IgQtTreeRep.h>
Public Member Functions | |
void | bold (bool value) |
bool | bold (void) const |
virtual IgRepContext * | context (void) const |
IgQtTreeRep (IgQtTreeBrowser *in, QString name, bool traverse, bool visible, bool opened) | |
IgQtTreeRep (IgQtTreeBrowser *in, IgQtTreeRep *before, QString name, bool traverse, bool visible, bool opened) | |
IgQtTreeRep (IgQtTreeRep *parent, QString name, bool traverse, bool visible, bool opened) | |
IgQtTreeRep (IgQtTreeRep *parent, IgQtTreeRep *before, QString name, bool traverse, bool visible, bool opened) | |
void | italic (bool value) |
bool | italic (void) const |
void | magic (bool value) |
bool | magic (void) const |
virtual IgModel * | model (void) const |
void | setCheck (int column, bool value, bool known) |
virtual void | setOpen (bool opened) |
~IgQtTreeRep (void) | |
Static Public Member Functions | |
static IgQtTreeRep * | create (IgQtTreeBrowser *in, IgQtTreeRep *parent, IgQtTreeRep *before, QString name, bool traverse, bool visible, bool opened) |
Static Public Attributes | |
static const int | CASCADE_FIELD = 3 |
static const int | TRAVERSE_FIELD = 2 |
static const int | VISIBLE_FIELD = 1 |
Protected Member Functions | |
QColorGroup | columnColor (int column, const QColorGroup &cg) const |
virtual void | context (IgRepContext *context) |
void | init (bool traverse, bool visible, bool opened) |
virtual void | paintCell (QPainter *painter, const QColorGroup &cg, int column, int width, int align) |
void | repaintChildren (QListViewItem *item) |
bool | traversed (void) const |
virtual int | width (const QFontMetrics &, const QListView *lv, int c) const |
Private Member Functions | |
void | flag (unsigned n, bool value) |
bool | flag (unsigned n) const |
IgQtTreeRep (const IgQtTreeRep &) | |
IgQtTreeRep & | operator= (const IgQtTreeRep &) |
Private Attributes | |
IgRepContext * | m_context |
unsigned | m_flags |
Static Private Attributes | |
static const unsigned int | AUTO_OPEN = 128 |
static const unsigned int | BOLD = 2 |
static const unsigned int | CHECKABLE = 1 |
static const unsigned int | EXPANDED = 16 |
static const unsigned int | ITALIC = 4 |
static const unsigned int | MAGIC = 8 |
static const unsigned int | TRAVERSE = 32 |
static const unsigned int | VISIBLE = 64 |
Definition at line 22 of file IgQtTreeRep.h.
IgQtTreeRep::IgQtTreeRep | ( | IgQtTreeRep * | parent, | |
IgQtTreeRep * | before, | |||
QString | name, | |||
bool | traverse, | |||
bool | visible, | |||
bool | opened | |||
) |
IgQtTreeRep::IgQtTreeRep | ( | IgQtTreeRep * | parent, | |
QString | name, | |||
bool | traverse, | |||
bool | visible, | |||
bool | opened | |||
) |
IgQtTreeRep::IgQtTreeRep | ( | IgQtTreeBrowser * | in, | |
IgQtTreeRep * | before, | |||
QString | name, | |||
bool | traverse, | |||
bool | visible, | |||
bool | opened | |||
) |
IgQtTreeRep::IgQtTreeRep | ( | IgQtTreeBrowser * | in, | |
QString | name, | |||
bool | traverse, | |||
bool | visible, | |||
bool | opened | |||
) |
IgQtTreeRep::~IgQtTreeRep | ( | void | ) |
Definition at line 88 of file IgQtTreeRep.cc.
References ASSERT, IgRepContext::erase(), m_context, and IgRepContext::rep().
00089 { 00090 // The destruction may come upon me in two ways: the object is 00091 // going away and the context is deleting me, or someone else 00092 // killed me (e.g. Qt). In the former case the caller will have 00093 // done the right thing of getting rid of references to me. 00094 // However if my context *was* deleted, I must not delete it 00095 // again; if so, it has already set its rep to null, which we use 00096 // as a clue. 00097 00098 ASSERT (m_context); 00099 if (m_context->rep ()) 00100 { 00101 ASSERT (m_context->rep () == this); 00102 m_context->erase (false); 00103 delete m_context; 00104 } 00105 }
IgQtTreeRep::IgQtTreeRep | ( | const IgQtTreeRep & | ) | [private] |
QColorGroup IgQtTreeRep::columnColor | ( | int | column, | |
const QColorGroup & | cg | |||
) | const [protected] |
Definition at line 194 of file IgQtTreeRep.cc.
References traversed().
Referenced by paintCell().
00195 { 00196 QColorGroup cgnew (cg); 00197 if (column == 0 && !traversed ()) 00198 cgnew.setColor (QColorGroup::Text, cg.mid ()); 00199 return cgnew; 00200 }
void IgQtTreeRep::context | ( | IgRepContext * | context | ) | [protected, virtual] |
Implements IgRep.
Definition at line 108 of file IgQtTreeRep.cc.
References ASSERT, AUTO_OPEN, flag(), m_context, and setOpen().
00109 { 00110 ASSERT (! m_context); 00111 ASSERT (context); 00112 m_context = context; 00113 00114 // OK, it is now safe to open up this one 00115 if (flag (AUTO_OPEN)) 00116 setOpen (true); 00117 }
IgRepContext * IgQtTreeRep::context | ( | void | ) | const [virtual] |
Implements IgRep.
Definition at line 121 of file IgQtTreeRep.cc.
References m_context.
Referenced by MMM_DEFUN_FUNC().
00122 { return m_context; }
IgQtTreeRep * IgQtTreeRep::create | ( | IgQtTreeBrowser * | in, | |
IgQtTreeRep * | parent, | |||
IgQtTreeRep * | before, | |||
QString | name, | |||
bool | traverse, | |||
bool | visible, | |||
bool | opened | |||
) | [static] |
Definition at line 30 of file IgQtTreeRep.cc.
References IgQtTreeRep().
Referenced by MMM_DEFUN_FUNC().
00035 { 00036 if (parent && before) 00037 return new IgQtTreeRep (parent, before, name, traverse, visible, opened); 00038 else if (parent) 00039 return new IgQtTreeRep (parent, name, traverse, visible, opened); 00040 else if (before) 00041 return new IgQtTreeRep (in, before, name, traverse, visible, opened); 00042 else 00043 return new IgQtTreeRep (in, name, traverse, visible, opened); 00044 }
bool IgQtTreeRep::flag | ( | unsigned | n | ) | const [inline, private] |
Definition at line 100 of file IgQtTreeRep.h.
References m_flags.
Referenced by bold(), context(), init(), italic(), magic(), setCheck(), setOpen(), and traversed().
Definition at line 76 of file IgQtTreeRep.cc.
References AUTO_OPEN, bold(), flag(), dbtoconf::parent, setCheck(), TRAVERSE_FIELD, and VISIBLE_FIELD.
Referenced by IgQtTreeRep().
00077 { 00078 bold (! parent ()); 00079 00080 00081 setCheck (TRAVERSE_FIELD, traverse, false); 00082 setCheck (VISIBLE_FIELD, visible, false); 00083 setExpandable (true); 00084 // Delay until we get a context 00085 flag (AUTO_OPEN, opened); 00086 }
Definition at line 116 of file IgQtTreeRep.h.
References flag(), and ITALIC.
Referenced by paintCell(), and width().
Definition at line 124 of file IgQtTreeRep.h.
Referenced by IgQtTreeBrowser::contentsMouseDoubleClickEvent().
Implements IgRep.
Definition at line 125 of file IgQtTreeRep.cc.
Referenced by MMM_DEFUN_FUNC().
00126 { return static_cast<IgQtTreeBrowser *> (listView ()); }
IgQtTreeRep& IgQtTreeRep::operator= | ( | const IgQtTreeRep & | ) | [private] |
void IgQtTreeRep::paintCell | ( | QPainter * | painter, | |
const QColorGroup & | cg, | |||
int | column, | |||
int | width, | |||
int | align | |||
) | [protected, virtual] |
Definition at line 147 of file IgQtTreeRep.cc.
References bold(), columnColor(), and italic().
00149 { 00150 QFont fold (painter->font ()); 00151 QFont fnew (painter->font ()); 00152 00153 fnew.setBold (bold ()); 00154 fnew.setItalic (italic ()); 00155 00156 painter->setFont (fnew); 00157 QListViewItem::paintCell (painter, columnColor (column, cg), 00158 column, width, align); 00159 painter->setFont (fold); 00160 }
void IgQtTreeRep::repaintChildren | ( | QListViewItem * | item | ) | [protected] |
Definition at line 186 of file IgQtTreeRep.cc.
Referenced by setCheck().
00187 { 00188 item->repaint (); 00189 for (item = item->firstChild (); item; item = item->nextSibling ()) 00190 repaintChildren (item); 00191 }
Definition at line 203 of file IgQtTreeRep.cc.
References ASSERT, flag(), repaintChildren(), TRAVERSE, TRAVERSE_FIELD, VISIBLE, and VISIBLE_FIELD.
Referenced by init().
00204 { 00205 QListViewItem *item; 00206 switch (column) 00207 { 00208 case TRAVERSE_FIELD: 00209 flag (TRAVERSE, value); 00210 00211 // Update children to reflect visibility status 00212 for (item = firstChild (); item; item = item->nextSibling ()) 00213 repaintChildren (item); 00214 break; 00215 00216 case VISIBLE_FIELD: 00217 flag (VISIBLE, value); 00218 break; 00219 00220 default: 00221 ASSERT (false); 00222 } 00223 }
Definition at line 129 of file IgQtTreeRep.cc.
References CASCADE_FIELD, IgBrowserMethods::commit(), IgBrowserMethods::expand(), EXPANDED, flag(), m_context, and IgRepContext::object().
Referenced by context(), and MMM_DEFUN_FUNC().
00130 { 00131 if (opened && ! flag (EXPANDED)) 00132 { 00133 QApplication::setOverrideCursor (Qt::waitCursor); 00134 IgBrowserMethods::expand (m_context->object (), this); 00135 QApplication::restoreOverrideCursor (); 00136 setExpandable (childCount ()); 00137 } 00138 00139 if (opened != flag (EXPANDED)) 00140 flag (EXPANDED, opened); 00141 00142 QListViewItem::setOpen (opened); 00143 IgBrowserMethods::commit (this, m_context->object (), CASCADE_FIELD); 00144 }
Definition at line 174 of file IgQtTreeRep.cc.
References flag(), p, dbtoconf::parent, and TRAVERSE.
Referenced by columnColor().
00175 { 00176 IgQtTreeRep *p = static_cast<IgQtTreeRep *> (parent ()); 00177 for (; p; p = static_cast<IgQtTreeRep *> (p->parent ())) 00178 if (! p->flag (TRAVERSE)) 00179 return false; 00180 00181 return true; 00182 }
const unsigned int IgQtTreeRep::AUTO_OPEN = 128 [static, private] |
const unsigned int IgQtTreeRep::BOLD = 2 [static, private] |
const int IgQtTreeRep::CASCADE_FIELD = 3 [static] |
const unsigned int IgQtTreeRep::CHECKABLE = 1 [static, private] |
Definition at line 79 of file IgQtTreeRep.h.
const unsigned int IgQtTreeRep::EXPANDED = 16 [static, private] |
const unsigned int IgQtTreeRep::ITALIC = 4 [static, private] |
IgRepContext* IgQtTreeRep::m_context [private] |
Definition at line 88 of file IgQtTreeRep.h.
Referenced by context(), setOpen(), and ~IgQtTreeRep().
unsigned IgQtTreeRep::m_flags [private] |
const unsigned int IgQtTreeRep::MAGIC = 8 [static, private] |
const unsigned int IgQtTreeRep::TRAVERSE = 32 [static, private] |
const int IgQtTreeRep::TRAVERSE_FIELD = 2 [static] |
Definition at line 26 of file IgQtTreeRep.h.
Referenced by init(), MMM_DEFUN_FUNC(), and setCheck().
const unsigned int IgQtTreeRep::VISIBLE = 64 [static, private] |
const int IgQtTreeRep::VISIBLE_FIELD = 1 [static] |
Definition at line 25 of file IgQtTreeRep.h.
Referenced by init(), MMM_DEFUN_FUNC(), and setCheck().