libyui-qt
|
#include <QY2DiskUsageList.h>
Public Member Functions | |
virtual FSize | usedSize () const =0 |
virtual FSize | totalSize () const =0 |
virtual FSize | freeSize () const |
virtual int | usedPercent () const |
virtual QString | name () const =0 |
virtual QString | deviceName () const |
virtual void | updateStatus () |
virtual void | updateData () |
void | setText (int column, const QString &text) |
void | setText (int column, const FSize &size) |
virtual bool | operator< (const QTreeWidgetItem &other) const |
int | nameCol () const |
int | percentageBarCol () const |
int | freeSizeCol () const |
int | totalSizeCol () const |
void | paintPercentageBar (QPainter *painter, QStyleOptionViewItem option, const QColor &fillColor) |
![]() | |
QY2ListViewItem (QY2ListView *parentListView, const QString &text=QString()) | |
QY2ListViewItem (QTreeWidgetItem *parentItem, const QString &text=QString()) | |
virtual | ~QY2ListViewItem () |
virtual void | updateStatus () |
virtual void | updateData () |
virtual bool | operator< (const QTreeWidgetItem &other) const |
bool | sortByInsertionSequence () const |
int | serial () const |
bool | compare (const QString &text1, const QString &text2) const |
virtual QString | smartSortKey (int column) const |
virtual QString | toolTip (int column) |
Protected Member Functions | |
QY2DiskUsageListItem (QY2DiskUsageList *parent) | |
virtual | ~QY2DiskUsageListItem () |
void | init (bool allFields) |
Protected Attributes | |
QY2DiskUsageList * | _diskUsageList |
![]() | |
int | _serial |
QColor | _textColor |
QColor | _backgroundColor |
Abstract base class for one partition ( mount point ) to display in a QY2DiskUsageList.
This class contains pure virtuals, so it cannot be used directly.
|
protected |
Constructor.
Call updateData() after the constructor for the initial display update. Unfortunately, this cannot be done automatically in the constructor since it uses virtual methods that are not available yet at this point.
|
protectedvirtual |
Destructor.
|
inlinevirtual |
The device name of this partition.
Derived classes may choose to reimplement this method. This default implementation returns an empty std::string.
|
virtual |
The current free size of this partition.
Derived classes can choose reimpmenent this if it is less expensive than calculating this value each time from usedSize() and totalSize() which is the default implementation.
|
protected |
( Re- ) initialize fields - all displayed fields ( if 'allFields' is 'true' ) or only the varying fields ( used, free, percentage ).
|
pure virtual |
The name to display for this partition. It makes most sense to use the mount point here ( but this is not a requirement ). This is what will be displayed in the "Name" column.
Derived classes need to implement this method.
|
virtual |
Comparison function used for sorting the list. Reimplemented from QTreeWidgetItem.
Comparison function used for sorting the list. Reimplemented from QTreeWidgetItem
Reimplemented from QY2ListViewItem.
void QY2DiskUsageListItem::paintPercentageBar | ( | QPainter * | painter, |
QStyleOptionViewItem | option, | ||
const QColor & | fillColor | ||
) |
Paint a percentage bar into a QListViewItem cell. 'width' is the width of the entire cell. 'indent' is the number of pixels to indent the bar.
Stolen from KDirStat::KDirTreeView with the author's permission.
Stolen from KDirStat::KDirTreeView with the author's permission.
void QY2DiskUsageListItem::setText | ( | int | column, |
const FSize & | size | ||
) |
Set a column text via FSize.
|
inline |
Re-declare ordinary setText() method so the compiler doesn't get confused which one to use.
|
pure virtual |
The total size of this partition.
Derived classes need to implement this method.
|
virtual |
Update this item's data completely. Triggered by QY2ListView::updateAllItemData().
Reimplemented from QY2ListViewItem.
Reimplemented from QY2ListViewItem.
|
virtual |
Update this item's status ( here: the numeric fields ). Triggered by QY2ListView::updateAllItemStates().
Reimplemented from QY2ListViewItem.
Reimplemented from QY2ListViewItem.
|
virtual |
The currently used percentage ( 0..100 ) of this partition.
Derived classes can choose reimpmenent this if it is less expensive than calculating this value each time from usedSize() and totalSize() which is the default implementation.
|
pure virtual |
The currently used size of this partition.
Derived classes need to implement this method.