KNewStuff
knewstuff3/ui/itemsviewdelegate.cpp
Go to the documentation of this file.
42 ItemsViewDelegate::ItemsViewDelegate(QAbstractItemView *itemView, Engine* engine, QObject * parent)
69 connect(installButton, SIGNAL(triggered(QAction*)), this, SLOT(slotInstallActionTriggered(QAction*)));
182 installButton->move(right - installButton->width() - margin, option.rect.height()/2 - installButton->height()*1.5);
184 detailsButton->move(right - installButton->width() - margin, option.rect.height()/2 - installButton->height()/2);
193 infoLabel->resize(QSize(option.rect.width() - PreviewWidth - (margin * 6) - m_buttonSize.width(), option.fontMetrics.height() * 7));
197 infoLabel->resize(QSize(option.rect.width() - (margin * 4) - m_buttonSize.width(), option.fontMetrics.height() * 7));
200 QString text = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
201 "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; margin:0 0 0 0;}\n"
219 text += "<p>" + i18nc("Show the author of this item in a list", "By <i>%1</i>", " <a href=\"" + authorPage + "\">" + authorName + "</a>") + "</p>\n";
221 text += "<p>" + i18nc("Show the author of this item in a list", "By <i>%1</i>", authorName) + " <a href=\"mailto:" + email + "\">" + email + "</a></p>\n";
223 text += "<p>" + i18nc("Show the author of this item in a list", "By <i>%1</i>", authorName) + "</p>\n";
260 // assume all entries come with rating 0..100 but most are in the range 20 - 80, so 20 is 0 stars, 80 is 5 stars
263 rating->move(right - installButton->width() - margin, option.rect.height()/2 + installButton->height()/2);
272 void ItemsViewDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
318 QSize ItemsViewDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
326 size.setHeight(qMax(option.fontMetrics.height() * 7, PreviewHeight)); // up to 6 lines of text, and two margins
virtual void updateItemWidgets(const QList< QWidget * > widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
Definition: knewstuff3/ui/itemsviewdelegate.cpp:87
Definition: knewstuff3/entry.h:63
QString i18n(const char *text)
int downloadLinkCount() const
Definition: entryinternal.cpp:397
void setRating(int rating)
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff3/ui/itemsviewdelegate.cpp:318
QString i18np(const char *sing, const char *plur, const A1 &a1)
virtual QList< QWidget * > createItemWidgets() const
Definition: knewstuff3/ui/itemsviewdelegate.cpp:51
bool hasPreviewImages() const
Definition: knewstuff3/ui/itemsmodel.cpp:142
void setHalfStepsEnabled(bool enabled)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void setMaxRating(int max)
void setBlockedEventTypes(QWidget *widget, QList< QEvent::Type > types) const
QString distributionType
Definition: entryinternal.h:82
QString i18nc(const char *ctxt, const char *text)
QString replaceBBCode(const QString &unformattedText)
function to remove bb code formatting that opendesktop sends
Definition: entryinternal.cpp:586
Definition: knewstuff3/entry.h:61
QImage previewImage(PreviewType type=PreviewSmall1) const
This will not be loaded automatically, instead use Engine to load the actual images.
Definition: entryinternal.cpp:274
QString i18ncp(const char *ctxt, const char *sing, const char *plur, const A1 &a1)
void slotInstallActionTriggered(QAction *action)
Definition: itemsviewbasedelegate.cpp:87
~ItemsViewDelegate()
Definition: knewstuff3/ui/itemsviewdelegate.cpp:47
CopyJob * link(const KUrl &src, const KUrl &destDir, JobFlags flags=DefaultFlags)
Definition: knewstuff3/ui/itemsmodel.h:33
Definition: knewstuff3/entry.h:60
int rating() const
Retrieve the rating for the object, which has been determined by its users and thus might change over...
Definition: entryinternal.cpp:284
Definition: knewstuff3/entry.h:64
int downloadCount() const
Retrieve the download count for the object, which has been determined by its hosting sites and thus m...
Definition: entryinternal.cpp:294
void slotDetailsClicked()
Definition: itemsviewbasedelegate.cpp:98
Definition: knewstuff3/entry.h:65
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
QString summary() const
Retrieve a short description about the object.
Definition: entryinternal.cpp:194
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff3/ui/itemsviewdelegate.cpp:272
QList< DownloadLinkInformation > downloadLinkInformationList() const
Definition: entryinternal.cpp:402
void slotInstallClicked()
Definition: itemsviewbasedelegate.cpp:69
ItemsViewDelegate(QAbstractItemView *itemView, Engine *engine, QObject *parent=0)
Definition: knewstuff3/ui/itemsviewdelegate.cpp:42
QString email() const
Retrieve the author's email address.
Definition: knewstuff3/core/author.cpp:40
Definition: knewstuff3/entry.h:62
QStringList list(const QString &fileClass)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.