]>
cloud.milkyroute.net Git - dolphin.git/blob - src/kitemviews/kstandarditem.cpp
1 /***************************************************************************
2 * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "kstandarditem.h"
24 KStandardItem::KStandardItem(KStandardItem
* parent
) :
32 KStandardItem::KStandardItem(const QString
& text
, KStandardItem
* parent
) :
41 KStandardItem::KStandardItem(const QIcon
& icon
, const QString
& text
, KStandardItem
* parent
) :
51 KStandardItem::KStandardItem(const KStandardItem
& item
) :
52 m_parent(item
.m_parent
),
53 m_children(item
.m_children
),
54 m_model(item
.m_model
),
59 KStandardItem::~KStandardItem()
63 void KStandardItem::setText(const QString
& text
)
65 m_data
.insert("text", text
);
68 QString
KStandardItem::text() const
70 return m_data
["text"].toString();
73 void KStandardItem::setIcon(const QIcon
& icon
)
75 m_data
.insert("iconName", icon
.name());
78 QIcon
KStandardItem::icon() const
80 return QIcon(m_data
["iconName"].toString());
83 void KStandardItem::setGroup(const QString
& group
)
85 m_data
.insert("group", group
);
88 QString
KStandardItem::group() const
90 return m_data
["group"].toString();
93 void KStandardItem::setDataValue(const QByteArray
& role
, const QVariant
& value
)
95 m_data
.insert(role
, value
);
98 QVariant
KStandardItem::dataValue(const QByteArray
& role
) const
103 void KStandardItem::setParent(KStandardItem
* parent
)
105 // TODO: not implemented yet
109 KStandardItem
* KStandardItem::parent() const
114 void KStandardItem::setData(const QHash
<QByteArray
, QVariant
>& values
)
119 QHash
<QByteArray
, QVariant
> KStandardItem::data() const
124 QList
<KStandardItem
*> KStandardItem::children() const