Item Class Reference

Used in view modes edit dialog. Is there to reuse some code for the QListView. More...

Inheritance diagram for Item:

Inheritance graph
[legend]
Collaboration diagram for Item:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void edit ()
virtual void add ()

Public Member Functions

 Item (QListView *listView, ShowModesDlg *_dlg)
 Item (QListViewItem *item, ShowModesDlg *_dlg)
 ~Item ()
void moveToEnd ()
virtual QString name ()=0
virtual bool deletable ()=0
void popup (const QPoint &pos)
virtual void setAttributes (QDomElement elem)=0
void createDom (QDomElement elem)

Protected Attributes

QPopupMenumenu
ShowModesDlgshowModesDlg

Detailed Description

Used in view modes edit dialog. Is there to reuse some code for the QListView.

Definition at line 36 of file showmodesdlg.cpp.


Constructor & Destructor Documentation

Item::Item ( QListView listView,
ShowModesDlg _dlg 
) [inline]

Definition at line 39 of file showmodesdlg.cpp.

References moveToEnd().

00039                                                      : QListViewItem( listView ), showModesDlg(_dlg)
00040     { moveToEnd(); }

Item::Item ( QListViewItem item,
ShowModesDlg _dlg 
) [inline]

Definition at line 41 of file showmodesdlg.cpp.

References moveToEnd().

00041                                                      : QListViewItem( item ), showModesDlg(_dlg)
00042     { moveToEnd(); }

Item::~Item (  )  [inline]

Definition at line 43 of file showmodesdlg.cpp.

References menu.

00044     {
00045         if ( menu )
00046         {
00047             delete menu;
00048             menu = NULL;
00049         }
00050     }


Member Function Documentation

void Item::moveToEnd (  )  [inline]

Definition at line 51 of file showmodesdlg.cpp.

References QListViewItem::moveItem(), and QListViewItem::nextSibling().

Referenced by Item().

00051                      {
00052      QListViewItem *lastChild = this;
00053         if ( lastChild ) {
00054             while ( lastChild->nextSibling() )
00055                 lastChild = lastChild->nextSibling();
00056         }
00057     
00058     
00059     moveItem( lastChild ); 
00060     }

virtual QString Item::name (  )  [pure virtual]

Implemented in FeatureItem, LayerItem, ModeItem, and RootItem.

Referenced by createDom().

virtual bool Item::deletable (  )  [pure virtual]

Implemented in FeatureItem, LayerItem, ModeItem, and RootItem.

Referenced by ShowModesDlg::remove().

void Item::popup ( const QPoint pos  )  [inline]

Definition at line 64 of file showmodesdlg.cpp.

References menu, and QPopupMenu::popup().

Referenced by ShowModesDlg::contextMenu().

00065     {
00066         if ( menu )
00067         {
00068             menu->popup( pos );
00069         }
00070         return;
00071     }

virtual void Item::setAttributes ( QDomElement  elem  )  [pure virtual]

Implemented in FeatureItem, LayerItem, ModeItem, and RootItem.

Referenced by createDom().

void Item::createDom ( QDomElement  elem  )  [inline]

Definition at line 73 of file showmodesdlg.cpp.

References createDom(), QDomDocument::createElement(), QListViewItem::firstChild(), name(), QListViewItem::nextSibling(), and setAttributes().

Referenced by ShowModesDlg::accept(), and createDom().

00074     {
00075 
00076         setAttributes( elem );
00077         QListViewItem *child = firstChild();
00078         while ( child )
00079         {
00080             QDomDocument doc = elem.ownerDocument();
00081 
00082             Item * it = dynamic_cast<Item *> ( child );
00083 
00084 
00085             Q_ASSERT( it );
00086             if ( it )
00087             {
00088 
00089                 QDomElement childElem = doc.createElement( it->name() );
00090                 elem.appendChild( childElem );
00091 
00092                 it->createDom( childElem );
00093             }
00094             child = child->nextSibling();
00095         }
00096     }

virtual void Item::edit (  )  [inline, virtual, slot]

Reimplemented in LayerItem, and ModeItem.

Definition at line 99 of file showmodesdlg.cpp.

Referenced by ShowModesDlg::clicked(), and ShowModesDlg::edit().

00100     {
00101         return;
00102     }

virtual void Item::add (  )  [inline, virtual, slot]

Reimplemented in LayerItem, ModeItem, and RootItem.

Definition at line 104 of file showmodesdlg.cpp.

Referenced by ShowModesDlg::add().

00105     {
00106         return;
00107     }


Member Data Documentation

QPopupMenu* Item::menu [protected]

Definition at line 109 of file showmodesdlg.cpp.

Referenced by LayerItem::LayerItem(), ModeItem::ModeItem(), popup(), RootItem::RootItem(), and ~Item().

ShowModesDlg* Item::showModesDlg [protected]

Definition at line 110 of file showmodesdlg.cpp.

Referenced by ModeItem::add(), RootItem::add(), LayerItem::edit(), ModeItem::edit(), RootItem::parseDom(), ModeItem::parseDom(), and LayerItem::parseDom().


The documentation for this class was generated from the following file:
Generated on Fri Jul 17 20:19:49 2009 for ngsview by  doxygen 1.5.1