Cleanup + docs
This commit is contained in:
parent
e74c73db3c
commit
c363891de3
4 changed files with 54 additions and 12 deletions
|
|
@ -20,9 +20,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// Own
|
||||
|
||||
#include "danboorutablemodel.h"
|
||||
#include "libdanbooru/danboorupost.h"
|
||||
|
||||
// Qt
|
||||
|
||||
#include <QDebug>
|
||||
#include <QPixmap>
|
||||
|
||||
|
|
@ -47,7 +51,7 @@ namespace Danbooru {
|
|||
void DanbooruTableModel::addPost(Danbooru::DanbooruPost* post)
|
||||
{
|
||||
|
||||
beginInsertRows(QModelIndex(), m_posts.length(), m_posts.length()+1);
|
||||
beginInsertRows(QModelIndex(), m_posts.length(), m_posts.length() + 1);
|
||||
m_posts.append(post);
|
||||
endInsertRows();
|
||||
}
|
||||
|
|
@ -70,8 +74,12 @@ namespace Danbooru {
|
|||
|
||||
if (role == Qt::DisplayRole) {
|
||||
|
||||
DanbooruPost* post = m_posts.at(index.row());
|
||||
return post->fileUrl().fileName();
|
||||
Danbooru::DanbooruPost* post = m_posts.at(index.row());
|
||||
|
||||
QVariant variant;
|
||||
variant.setValue(post);
|
||||
|
||||
return variant;
|
||||
}
|
||||
|
||||
if (role == Qt::DecorationRole) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue