Provide the filename as tooltip

This commit is contained in:
Luca Beltrame 2013-07-23 07:31:28 +02:00
parent 834bdfd82d
commit ec6735c44e

View file

@ -72,9 +72,13 @@ namespace Danbooru {
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;
variant.setValue(post);
@ -83,11 +87,14 @@ namespace Danbooru {
}
if (role == Qt::DecorationRole) {
DanbooruPost* post = m_posts.at(index.row());
const QPixmap* pixmap = post->pixmap();
return *pixmap;
}
if (role == Qt::ToolTipRole) {
return post->fileUrl().fileName();
}
return QVariant();
}