| 1 |
#ifndef LIST_H |
| 2 |
#define LIST_H |
| 3 |
|
| 4 |
#include <QWidget> |
| 5 |
#include <QVBoxLayout> |
| 6 |
#include <DListView> |
| 7 |
#include <DStandardItem> |
| 8 |
#include <DLabel> |
| 9 |
#include <DSpinner> |
| 10 |
|
| 11 |
DWIDGET_USE_NAMESPACE |
| 12 |
|
| 13 |
class List : public QWidget |
| 14 |
{ |
| 15 |
Q_OBJECT |
| 16 |
public: |
| 17 |
List(QString title); |
| 18 |
void addItem(QString name, QIcon icon, QVariant data = QVariant()); |
| 19 |
void addHeaderWidget(QWidget *widget); |
| 20 |
void setEmptyText(QString text); |
| 21 |
void editItemText(QString package, QString text); |
| 22 |
void clear(); |
| 23 |
void load(); |
| 24 |
void unload(); |
| 25 |
DListView *listView; |
| 26 |
private: |
| 27 |
QHBoxLayout *headerLayout; |
| 28 |
QStandardItemModel *model; |
| 29 |
DSpinner *loading; |
| 30 |
DLabel *emptyLabel; |
| 31 |
QVBoxLayout *layout; |
| 32 |
signals: |
| 33 |
void currentItemChanged(QVariant data); |
| 34 |
}; |
| 35 |
|
| 36 |
#endif // LIST_H |