Cleanup + docs

This commit is contained in:
Luca Beltrame 2013-06-09 18:39:26 +02:00
parent e74c73db3c
commit c363891de3
4 changed files with 54 additions and 12 deletions

View file

@ -23,12 +23,29 @@
#ifndef DANBOORUTABLEMODEL_H
#define DANBOORUTABLEMODEL_H
/**
* @brief This file contains a specific model to represent Danbooru Items
* @file danboorutablemodel.h
*
**/
#include <QAbstractListModel>
#include <QList>
namespace Danbooru {
class DanbooruPost;
/**
* @brief A model to represent DanbooruItems
*
* Since items from a Danbooru service are sent by the service itself,
* there is no need for sorting or table-like structures: everything is
* represented as a flat list.
*
* Items are added through the addPost() slot.
*
*/
class DanbooruTableModel : public QAbstractListModel
{
@ -41,13 +58,18 @@ namespace Danbooru {
int rowCount(const QModelIndex& parent=QModelIndex()) const;
QVariant data(const QModelIndex& index, int role) const;
// bool insertRows(int row, int count=rowCount(),
// const QModelIndex& parent=QModelIndex());
private:
QList<DanbooruPost*> m_posts;
public Q_SLOTS:
/**
* @brief Add a new post to the model
*
* Connect to this slot when you want to add items to the model.
*
* @param post A pointer to a DanbooruPost.
*
*/
void addPost(Danbooru::DanbooruPost* post);
};