1 /****************************************************************************
2 ** $Id: qg_listviewitem.cpp 1385 2003-08-27 23:19:42Z andrew $
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
6 ** This file is part of the qcadlib Library project.
8 ** This file may be distributed and/or modified under the terms of the
9 ** GNU General Public License version 2 as published by the Free Software
10 ** Foundation and appearing in the file LICENSE.GPL included in the
11 ** packaging of this file.
13 ** Licensees holding valid qcadlib Professional Edition licenses may use
14 ** this file in accordance with the qcadlib Commercial License
15 ** Agreement provided with the Software.
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 ** See http://www.ribbonsoft.com for further details.
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
25 **********************************************************************/
27 #include "qg_listviewitem.h"
30 /*#include "xpm/folderclosed.xpm"
31 #include "xpm/folderopen.xpm"*/
34 * Constructor for root items.
36 //QG_ListViewItem::QG_ListViewItem(Q3ListView * par, const QString & label,
37 QG_ListViewItem::QG_ListViewItem(QListWidget * par, const QString & label,
38 bool open, int id): QListWidgetItem(par)
44 // setPixmap(0, QPixmap((open ? folderopen_xpm : folderclosed_xpm)));
45 // setIcon(QIcon((open ? folderopen_xpm : folderclosed_xpm)));
46 setIcon(QIcon((open ? ":/res/folderopen.xpm" : ":/res/folderclosed.xpm")));
52 * Constructor for list view items with a folder icon.
54 QG_ListViewItem::QG_ListViewItem(QG_ListViewItem * par, const QString & label,
55 bool open, int id): QListWidgetItem((QListWidget *)par)
61 // setPixmap(0, QPixmap((open ? folderopen_xpm : folderclosed_xpm)));
62 //redundant: setIcon(QIcon((open ? folderopen_xpm : folderclosed_xpm)));
67 * Opens or closes the item.
69 void QG_ListViewItem::setOpen(bool open)
72 // setPixmap(0, QPixmap(folderopen_xpm));
73 // setIcon(QIcon(folderopen_xpm));
74 setIcon(QIcon(":/res/folderopen.xpm"));
76 // setPixmap(0, QPixmap(folderclosed_xpm));
77 // setIcon(QIcon(folderclosed_xpm));
78 setIcon(QIcon(":/res/folderclosed.xpm"));
80 // Q3ListViewItem::setOpen(open);
82 // QListWidgetItem::setOpen(open);
86 * Called in the beginning.
88 void QG_ListViewItem::setup()
90 // Q3ListViewItem::setup();
92 // QListWidgetItem::setup();
96 * Returns the "path" of this item (like: "Project/Page1/Paragraph1/").
98 QString QG_ListViewItem::getFullPath()
104 s = par->getFullPath();
118 * Returns the text of the given column of this item.
120 QString QG_ListViewItem::text(int column) const
128 QString QG_ListViewItem::getLabel() const
133 void QG_ListViewItem::setId(int id)
138 int QG_ListViewItem::getId()