2008-08-20 18:54:35 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Marco Martin <notmart@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLASMA_TREEVIEW_H
|
|
|
|
#define PLASMA_TREEVIEW_H
|
|
|
|
|
|
|
|
#include <QtGui/QGraphicsProxyWidget>
|
|
|
|
|
2008-08-20 20:14:20 +02:00
|
|
|
#include <plasma/plasma_export.h>
|
|
|
|
|
2008-08-20 18:54:35 +02:00
|
|
|
class QTreeView;
|
|
|
|
class QAbstractItemModel;
|
|
|
|
|
2008-08-20 20:14:20 +02:00
|
|
|
namespace Plasma
|
|
|
|
{
|
2008-08-20 18:54:35 +02:00
|
|
|
|
|
|
|
class TreeViewPrivate;
|
|
|
|
|
2008-08-25 19:47:48 +02:00
|
|
|
/**
|
|
|
|
* @class TreeView plasma/widgets/treeview.h <Plasma/Widgets/TreeView>
|
|
|
|
*
|
|
|
|
* @short Provides a plasma-themed QTreeView.
|
|
|
|
*/
|
2008-08-20 20:14:20 +02:00
|
|
|
class PLASMA_EXPORT TreeView : public QGraphicsProxyWidget
|
2008-08-20 18:54:35 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2008-10-12 03:31:54 +02:00
|
|
|
Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel)
|
|
|
|
Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
|
2008-08-20 18:54:35 +02:00
|
|
|
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
|
2008-10-12 03:31:54 +02:00
|
|
|
Q_PROPERTY(QTreeView *nativeWidget READ nativeWidget)
|
2008-08-20 18:54:35 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TreeView(QGraphicsWidget *parent = 0);
|
|
|
|
~TreeView();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a model for this weather view
|
|
|
|
*
|
|
|
|
* @arg model the model to display
|
|
|
|
*/
|
|
|
|
void setModel(QAbstractItemModel *model);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the model shown by this view
|
|
|
|
*/
|
|
|
|
QAbstractItemModel *model();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the stylesheet used to control the visual display of this TreeView
|
|
|
|
*
|
|
|
|
* @arg stylesheet a CSS string
|
|
|
|
*/
|
|
|
|
void setStyleSheet(const QString &stylesheet);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the stylesheet currently used with this widget
|
|
|
|
*/
|
|
|
|
QString styleSheet();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the native widget wrapped by this TreeView
|
|
|
|
*/
|
2008-10-12 03:31:54 +02:00
|
|
|
QTreeView *nativeWidget() const;
|
2008-08-20 18:54:35 +02:00
|
|
|
|
|
|
|
private:
|
2008-10-12 03:31:54 +02:00
|
|
|
TreeViewPrivate *const d;
|
2008-08-20 18:54:35 +02:00
|
|
|
};
|
|
|
|
|
2008-08-21 08:24:40 +02:00
|
|
|
}
|
2008-08-20 18:54:35 +02:00
|
|
|
#endif // multiple inclusion guard
|