Provide the filename as tooltip
This commit is contained in:
parent
834bdfd82d
commit
ec6735c44e
1 changed files with 10 additions and 3 deletions
|
@ -72,9 +72,13 @@ namespace Danbooru {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == Qt::DisplayRole) {
|
DanbooruPost* post = m_posts.at(index.row());
|
||||||
|
|
||||||
Danbooru::DanbooruPost* post = m_posts.at(index.row());
|
if (!post) {
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (role == Qt::DisplayRole) {
|
||||||
|
|
||||||
QVariant variant;
|
QVariant variant;
|
||||||
variant.setValue(post);
|
variant.setValue(post);
|
||||||
|
@ -83,11 +87,14 @@ namespace Danbooru {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (role == Qt::DecorationRole) {
|
if (role == Qt::DecorationRole) {
|
||||||
DanbooruPost* post = m_posts.at(index.row());
|
|
||||||
const QPixmap* pixmap = post->pixmap();
|
const QPixmap* pixmap = post->pixmap();
|
||||||
return *pixmap;
|
return *pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (role == Qt::ToolTipRole) {
|
||||||
|
return post->fileUrl().fileName();
|
||||||
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue