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

KNewStuff

  • knewstuff
  • knewstuff3
  • ui
itemsgridviewdelegate.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2008 Jeremy Whiting <jpwhiting@kde.org>
3 Copyright (C) 2010 Reza Fatahilah Shah <rshah0385@kireihana.com>
4 Copyright (C) 2010 Frederik Gladhorn <gladhorn@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef KNEWSTUFF3_UI_ITEMSGRIDVIEWDELEGATE_H
21#define KNEWSTUFF3_UI_ITEMSGRIDVIEWDELEGATE_H
22
23#include "itemsviewbasedelegate.h"
24class QToolButton;
25namespace KNS3
26{
27 static const int ItemGridHeight = 202;
28 static const int ItemGridWidth = 158;
29
30 static const int FrameThickness = 5;
31 static const int ItemMargin = 2;
32class ItemsGridViewDelegate: public ItemsViewBaseDelegate
33{
34 Q_OBJECT
35public:
36 explicit ItemsGridViewDelegate(QAbstractItemView* itemView, Engine* engine, QObject* parent = 0);
37 ~ItemsGridViewDelegate();
38
39
40 // paint the item at index with all its attributes shown
41 virtual void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
42
43 // get the list of widgets
44 virtual QList<QWidget*> createItemWidgets() const;
45
46 // update the widgets
47 virtual void updateItemWidgets(const QList<QWidget*> widgets,
48 const QStyleOptionViewItem &option,
49 const QPersistentModelIndex &index) const;
50
51 virtual QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
52
53 private:
54 void createOperationBar();
55 void displayOperationBar(const QRect &rect,const QModelIndex & index);
56
57 private:
58 QWidget *m_operationBar;
59 QToolButton *m_detailsButton;
60 QToolButton *m_installButton;
61
62 QModelIndex m_oldIndex;
63 mutable int m_elementYPos;
64};
65}
66
67#endif
KNS3::Engine
KNewStuff engine.
Definition: knewstuff3/core/engine.h:53
KNS3::ItemsGridViewDelegate
Definition: itemsgridviewdelegate.h:33
KNS3::ItemsGridViewDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: itemsgridviewdelegate.cpp:256
KNS3::ItemsGridViewDelegate::createItemWidgets
virtual QList< QWidget * > createItemWidgets() const
Definition: itemsgridviewdelegate.cpp:55
KNS3::ItemsGridViewDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: itemsgridviewdelegate.cpp:197
KNS3::ItemsGridViewDelegate::updateItemWidgets
virtual void updateItemWidgets(const QList< QWidget * > widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const
Definition: itemsgridviewdelegate.cpp:82
KNS3::ItemsGridViewDelegate::~ItemsGridViewDelegate
~ItemsGridViewDelegate()
Definition: itemsgridviewdelegate.cpp:51
KNS3::ItemsViewBaseDelegate
Definition: itemsviewbasedelegate.h:41
KWidgetItemDelegate::itemView
QAbstractItemView * itemView() const
QList
QObject
QToolButton
QWidget
itemsviewbasedelegate.h
KNS3
Definition: atticaprovider.cpp:36
KNS3::ItemGridWidth
static const int ItemGridWidth
Definition: itemsgridviewdelegate.h:28
KNS3::FrameThickness
static const int FrameThickness
Definition: itemsgridviewdelegate.h:30
KNS3::ItemMargin
static const int ItemMargin
Definition: itemsgridviewdelegate.h:31
KNS3::ItemGridHeight
static const int ItemGridHeight
Definition: itemsgridviewdelegate.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