KNewStuff
knewstuff2/ui/itemsviewdelegate.cpp
Go to the documentation of this file.
65 QAction * action_install = installMenu->addAction(m_statusicons[Entry::Installed], i18n("Install"));
66 QAction * action_uninstall = installMenu->addAction(m_statusicons[Entry::Deleted], i18n("Uninstall"));
100 const QSortFilterProxyModel * model = qobject_cast<const QSortFilterProxyModel*>(index.model());
124 infoLabel->resize(QSize(option.rect.width() - kPreviewWidth - (margin * 6) - size.width(), option.fontMetrics.height() * 7));
127 infoLabel->resize(QSize(option.rect.width() - (margin * 4) - size.width(), option.fontMetrics.height() * 7));
130 QString text = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
131 "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">p, li { white-space: pre-wrap; margin:0 0 0 0;}\n"
135 QString summary = "<p>" + option.fontMetrics.elidedText(index.data(ItemsModel::kSummary).toString(),
145 text += "<p><i>" + authorName + "</i> <a href=\"mailto:" + email + "\">" + email + "</a></p>\n";
150 text += downloads == 0 ? i18n("<p>No Downloads</p>") : i18n("<p>Downloads: %1</p>\n", downloads);
222 ratingLabel->move(right - button->width() - margin, option.rect.height() / 2 + button->height()/2);
229 void ItemsViewDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
244 const QSortFilterProxyModel * model = qobject_cast<const QSortFilterProxyModel*>(index.model());
281 QSize ItemsViewDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
289 size.setHeight(qMax(option.fontMetrics.height() * 7, kPreviewHeight)); // up to 6 lines of text, and two margins
300 const QSortFilterProxyModel * model = qobject_cast<const QSortFilterProxyModel*>(index.model());
311 const QSortFilterProxyModel * model = qobject_cast<const QSortFilterProxyModel*>(index.model());
322 const QSortFilterProxyModel * model = qobject_cast<const QSortFilterProxyModel*>(index.model());
QString i18n(const char *text)
QPersistentModelIndex focusedIndex() const
Definition: knewstuff2/ui/itemsmodel.h:33
the number of downloads for the entry
Definition: knewstuff2/ui/itemsmodel.h:74
the e-mail address of the author
Definition: knewstuff2/ui/itemsmodel.h:48
ItemsViewDelegate(QAbstractItemView *itemView, QObject *parent=0)
Definition: knewstuff2/ui/itemsviewdelegate.cpp:38
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
void setBlockedEventTypes(QWidget *widget, QList< QEvent::Type > types) const
Definition: knewstuff2/core/entry.h:295
bool hasPreviewImages() const
Definition: knewstuff2/ui/itemsmodel.cpp:178
virtual void updateItemWidgets(const QList< QWidget * > widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:96
virtual QList< QWidget * > createItemWidgets() const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:75
Definition: knewstuff2/core/entry.h:293
~ItemsViewDelegate()
Definition: knewstuff2/ui/itemsviewdelegate.cpp:57
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:229
void performAction(DownloadDialog::EntryAction action, KNS::Entry *entry)
the name of the author of the entry
Definition: knewstuff2/ui/itemsmodel.h:46
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:281
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.