Add two signals to propagate the URLs when the buttons are clicked

This commit is contained in:
Luca Beltrame 2013-06-09 22:00:41 +02:00
parent ad89dd5db9
commit 9373508bc3
2 changed files with 77 additions and 2 deletions

View file

@ -31,22 +31,27 @@
#include <QStyledItemDelegate>
#include <KUrl>
class QListView;
class QPainter;
class KPushButton;
namespace Danbooru {
/**
* @brief Specific delegate for Danbooru items.
*
*/
class DanbooruPost;
class DanbooruPostDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
DanbooruPostDelegate(QListView* itemView);
@ -57,7 +62,6 @@ namespace Danbooru {
QModelIndex hoveredIndex() const;
private:
QListView* m_itemView;
@ -70,6 +74,32 @@ namespace Danbooru {
static const int MARGIN;
Q_SIGNALS:
/**
* @brief Emitted when the view button is clicked.
*
* @param postUrl the URL to the full picture.
*
*/
void postViewRequested(KUrl postUrl);
/**
* @brief Emitted when the download button is clicked.
*
* @param postUrl the URL to the full picture.
*
*/
void postDownloadRequested(KUrl postUrl);
private Q_SLOTS:
void viewButtonClicked();
void downloadButtonClicked();
};
} // namespace Danbooru