File indexing completed on 2024-04-28 15:29:05

0001 /*
0002     This file is part of KNewStuff2.
0003     SPDX-FileCopyrightText: 2008 Jeremy Whiting <jpwhiting@kde.org>
0004     SPDX-FileCopyrightText: 2010 Reza Fatahilah Shah <rshah0385@kireihana.com>
0005     SPDX-FileCopyrightText: 2010 Frederik Gladhorn <gladhorn@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.1-or-later
0008 */
0009 
0010 #ifndef KNEWSTUFF3_ITEMSVIEWDELEGATE_P_H
0011 #define KNEWSTUFF3_ITEMSVIEWDELEGATE_P_H
0012 
0013 #include "itemsviewbasedelegate_p.h"
0014 
0015 namespace KNS3
0016 {
0017 class ItemsViewDelegate : public ItemsViewBaseDelegate
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit ItemsViewDelegate(QAbstractItemView *itemView, KNSCore::Engine *engine, QObject *parent = nullptr);
0022     ~ItemsViewDelegate() override;
0023 
0024     // paint the item at index with all its attributes shown
0025     void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0026 
0027     // get the list of widgets
0028     QList<QWidget *> createItemWidgets(const QModelIndex &index) const override;
0029 
0030     // update the widgets
0031     void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const override;
0032 
0033     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0034 };
0035 }
0036 
0037 #endif