28 #ifndef QY2DiskUsageList_h
29 #define QY2DiskUsageList_h
31 #include <QY2ListView.h>
32 #include <yui/FSize.h>
64 int nameCol()
const {
return _nameCol; }
65 int percentageBarCol()
const {
return _percentageBarCol; }
66 int usedSizeCol()
const {
return _usedSizeCol; }
67 int freeSizeCol()
const {
return _freeSizeCol; }
68 int totalSizeCol()
const {
return _totalSizeCol; }
69 int deviceNameCol()
const {
return _deviceNameCol; }
72 virtual void drawRow ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index )
const;
75 QTreeWidgetItem * itemFromIndex (
const QModelIndex & index )
const
76 {
return QY2ListView::itemFromIndex(index); }
81 int _percentageBarCol;
158 virtual QString
name()
const = 0;
189 void setText(
int column,
const QString & text )
190 { QTreeWidgetItem::setText( column, text ); }
195 void setText(
int column,
const FSize & size );
201 virtual bool operator< (
const QTreeWidgetItem & other )
const;
205 int nameCol()
const {
return _diskUsageList->nameCol(); }
206 int percentageBarCol()
const {
return _diskUsageList->percentageBarCol(); }
207 int usedSizeCol()
const {
return _diskUsageList->usedSizeCol(); }
208 int freeSizeCol()
const {
return _diskUsageList->freeSizeCol(); }
209 int totalSizeCol()
const {
return _diskUsageList->totalSizeCol(); }
210 int deviceNameCol()
const {
return _diskUsageList->deviceNameCol(); }
219 void init(
bool allFields );
230 QStyleOptionViewItem option,
231 const QColor & fillColor);
246 #endif // ifndef QY2DiskUsageList_h
QY2DiskUsageList(QWidget *parent, bool addStdColumns=true)
Constructor.
virtual int usedPercent() const
The currently used percentage ( 0..100 ) of this partition.
virtual QString deviceName() const
The device name of this partition.
virtual void updateStatus()
Update this item's status ( here: the numeric fields ).
QY2DiskUsageListItem(QY2DiskUsageList *parent)
Constructor.
virtual QString name() const =0
The name to display for this partition.
virtual FSize totalSize() const =0
The total size of this partition.
virtual void updateData()
Update this item's data completely.
virtual FSize freeSize() const
The current free size of this partition.
Abstract base class for one partition ( mount point ) to display in a QY2DiskUsageList.
virtual bool operator<(const QTreeWidgetItem &other) const
Comparison function used for sorting the list.
void init(bool allFields)
( Re- ) initialize fields - all displayed fields ( if 'allFields' is 'true' ) or only the varying fie...
Generic scrollable list of disk usage for any number of partitions.
virtual FSize usedSize() const =0
The currently used size of this partition.
void setText(int column, const QString &text)
Re-declare ordinary setText() method so the compiler doesn't get confused which one to use...
virtual ~QY2DiskUsageListItem()
Destructor.
void paintPercentageBar(QPainter *painter, QStyleOptionViewItem option, const QColor &fillColor)
Paint a percentage bar into a QListViewItem cell.
Enhanced QTreeWidgetItem.
virtual ~QY2DiskUsageList()
Destructor.