• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kfile
kdevicelistmodel.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2006 Michael Larouche <michael.larouche@kdemail.net>
3 2007 Kevin Ottens <ervin@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library 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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18
19*/
20#ifndef KDEVICELISTMODEL_H
21#define KDEVICELISTMODEL_H
22
23#include <kio/kio_export.h>
24
25#include <QtCore/QAbstractItemModel>
26
27#include <solid/device.h>
28#include <solid/predicate.h>
29
39class KIO_EXPORT KDeviceListModel : public QAbstractItemModel
40{
41 Q_OBJECT
42public:
43 explicit KDeviceListModel(QObject *parent=0);
44 explicit KDeviceListModel(const QString &predicate, QObject *parent=0);
45 explicit KDeviceListModel(const Solid::Predicate &predicate,
46 QObject *parent=0);
47 ~KDeviceListModel();
48
58 QVariant data(const QModelIndex &index, int role) const;
59
71 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
72
76 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
77
78 QModelIndex rootIndex() const;
79
83 QModelIndex parent(const QModelIndex &child) const;
84
88 int rowCount(const QModelIndex &parent = QModelIndex()) const;
89
93 int columnCount(const QModelIndex &parent = QModelIndex()) const;
94
95 Solid::Device deviceForIndex( const QModelIndex& index ) const;
96
97
98Q_SIGNALS:
99 void modelInitialized();
100
101private:
102 Q_PRIVATE_SLOT(d, void _k_initDeviceList())
103 Q_PRIVATE_SLOT(d, void _k_deviceAdded(const QString &))
104 Q_PRIVATE_SLOT(d, void _k_deviceRemoved(const QString &))
105
106 class Private;
107 Private * const d;
108};
109
110#endif
KDeviceListModel::rootIndex
QModelIndex rootIndex() const
Definition kdevicelistmodel.cpp:143
KDeviceListModel::parent
QModelIndex parent(const QModelIndex &child) const
Get the parent QModelIndex for the given model child.
Definition kdevicelistmodel.cpp:148
KDeviceListModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Get the number of rows for a model index.
Definition kdevicelistmodel.cpp:162
KDeviceListModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Get the header data for a given section, orientation and role.
Definition kdevicelistmodel.cpp:110
KDeviceListModel::KDeviceListModel
KDeviceListModel(QObject *parent=0)
Definition kdevicelistmodel.cpp:58
KDeviceListModel::deviceForIndex
Solid::Device deviceForIndex(const QModelIndex &index) const
Definition kdevicelistmodel.cpp:179
KDeviceListModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const
Get the number of columns for a model index.
Definition kdevicelistmodel.cpp:172
KDeviceListModel::modelInitialized
void modelInitialized()
KDeviceListModel::data
QVariant data(const QModelIndex &index, int role) const
Get a visible data based on Qt role for the given index.
Definition kdevicelistmodel.cpp:90
KDeviceListModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Get the children model index for the given row and column.
Definition kdevicelistmodel.cpp:122
QAbstractItemModel
QObject
kio_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal