2024-11-09 15:05:14 +08:00
|
|
|
#include "libraryitem.h"
|
|
|
|
|
|
|
|
LibraryItem::LibraryItem(int id, const QString &name, const QString &uuid)
|
|
|
|
: QStandardItem(QIcon::fromTheme(QIcon::ThemeIcon::FolderOpen), name)
|
|
|
|
{
|
|
|
|
setData(id, IdRole);
|
|
|
|
setData(uuid, UuidRole);
|
|
|
|
}
|
2024-11-10 17:10:45 +08:00
|
|
|
|
|
|
|
QHash<int, QByteArray> LibraryItem::roleNames()
|
|
|
|
{
|
|
|
|
return {
|
|
|
|
{Qt::DisplayRole, "display"},
|
|
|
|
{LibraryItem::IdRole, "libraryId"},
|
|
|
|
{LibraryItem::UuidRole, "uuid"},
|
|
|
|
};
|
|
|
|
}
|