• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff2
  • ui
knewstuff2/ui/itemsviewdelegate.h
Go to the documentation of this file.
1/*
2 This file is part of KNewStuff2.
3 Copyright (C) 2008 Jeremy Whiting <jpwhiting@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef KNEWSTUFF2_UI_ITEMSVIEWDELEGATE_H
20#define KNEWSTUFF2_UI_ITEMSVIEWDELEGATE_H
21
22#include <kwidgetitemdelegate.h>
23
24#include <QtCore/QMap>
25#include <QtCore/QModelIndex>
26#include <QtCore/QObject>
27#include <QtGui/QImage>
28#include <QtGui/QLabel>
29#include <QtGui/QToolButton>
30
31#include <knewstuff2/core/entry.h>
32#include <knewstuff2/ui/downloaddialog.h>
33
34#include <kicon.h>
35#include <kmenu.h>
36
37namespace KNS
38{
39class ItemsViewDelegate: public KWidgetItemDelegate
40{
41 Q_OBJECT
42public:
43 explicit ItemsViewDelegate(QAbstractItemView *itemView, QObject * parent = 0);
44 ~ItemsViewDelegate();
45
46 // paint the item at index with all its attributes shown
47 virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
48
49 // get the list of widgets
50 virtual QList<QWidget*> createItemWidgets() const;
51
52 // update the widgets
53 virtual void updateItemWidgets(const QList<QWidget*> widgets,
54 const QStyleOptionViewItem &option,
55 const QPersistentModelIndex &index) const;
56
57 virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
58
59signals:
60
61 void performAction(DownloadDialog::EntryAction action, KNS::Entry * entry);
62
63 //protected:
64 //virtual bool eventFilter(QObject *watched, QEvent *event);
65
66private slots:
67
68 void slotActionTriggered(QAction *action);
69 void slotInstallClicked();
70 void slotLinkClicked(const QString & url);
71
72private:
73 KMenu * InstallMenu(const QToolButton* button, Entry::Status status) const;
74
75 QList<KIcon> m_statusicons;
76 QImage m_frameImage;
77};
78}
79
80#endif
KMenu
KNS::DownloadDialog::EntryAction
EntryAction
Definition: knewstuff2/ui/downloaddialog.h:76
KNS::Entry
KNewStuff data entry container.
Definition: knewstuff2/core/entry.h:47
KNS::Entry::Status
Status
Status of the entry.
Definition: knewstuff2/core/entry.h:290
KNS::ItemsViewDelegate
Definition: knewstuff2/ui/itemsviewdelegate.h:40
KNS::ItemsViewDelegate::performAction
void performAction(DownloadDialog::EntryAction action, KNS::Entry *entry)
KNS::ItemsViewDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:281
KNS::ItemsViewDelegate::createItemWidgets
virtual QList< QWidget * > createItemWidgets() const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:75
KNS::ItemsViewDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:229
KNS::ItemsViewDelegate::updateItemWidgets
virtual void updateItemWidgets(const QList< QWidget * > widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
Definition: knewstuff2/ui/itemsviewdelegate.cpp:96
KNS::ItemsViewDelegate::~ItemsViewDelegate
~ItemsViewDelegate()
Definition: knewstuff2/ui/itemsviewdelegate.cpp:57
KWidgetItemDelegate
KWidgetItemDelegate::itemView
QAbstractItemView * itemView() const
QAction
QList
QObject
QToolButton
kicon.h
kmenu.h
entry.h
downloaddialog.h
kwidgetitemdelegate.h
KNS
Definition: knewstuff2/core/author.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal