• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KNewStuff

itemsviewdelegate.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KNewStuff2.
00003     Copyright (C) 2008 Jeremy Whiting <jeremy@scitools.com>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 #ifndef KNEWSTUFF2_UI_ITEMSVIEWDELEGATE_H
00020 #define KNEWSTUFF2_UI_ITEMSVIEWDELEGATE_H
00021 
00022 #include <kwidgetitemdelegate.h>
00023 
00024 #include <QtCore/QMap>
00025 #include <QtCore/QModelIndex>
00026 #include <QtCore/QObject>
00027 #include <QtGui/QImage>
00028 #include <QtGui/QLabel>
00029 #include <QtGui/QToolButton>
00030 
00031 #include <knewstuff2/core/entry.h>
00032 #include <knewstuff2/ui/downloaddialog.h>
00033 
00034 #include <kicon.h>
00035 #include <kmenu.h>
00036 
00037 namespace KNS
00038 {
00039 class ItemsViewDelegate: public KWidgetItemDelegate
00040 {
00041     Q_OBJECT
00042 public:
00043     explicit ItemsViewDelegate(QAbstractItemView *itemView, QObject * parent = 0);
00044     ~ItemsViewDelegate();
00045 
00046     // paint the item at index with all its attributes shown
00047     virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
00048 
00049     // get the list of widgets
00050     virtual QList<QWidget*> createItemWidgets() const;
00051 
00052     // update the widgets
00053     virtual void updateItemWidgets(const QList<QWidget*> widgets,
00054                                    const QStyleOptionViewItem &option,
00055                                    const QPersistentModelIndex &index) const;
00056 
00057     virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
00058 
00059 signals:
00060 
00061     void performAction(DownloadDialog::EntryAction action, KNS::Entry * entry);
00062 
00063     //protected:
00064     //virtual bool eventFilter(QObject *watched, QEvent *event);
00065 
00066 private slots:
00067 
00068     void slotActionTriggered(QAction *action);
00069     void slotInstallClicked();
00070     void slotLinkClicked(const QString & url);
00071 
00072 private:
00073     KMenu * InstallMenu(const QToolButton* button, Entry::Status status) const;
00074 
00075     QList<KIcon> m_statusicons;
00076     QImage m_frameImage;
00077 };
00078 }
00079 
00080 #endif

KNewStuff

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal