File indexing completed on 2024-05-12 15:59:58
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2019 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KISSTORAGECHOOSERWIDGET_H 0008 #define KISSTORAGECHOOSERWIDGET_H 0009 0010 #include <QWidget> 0011 #include <QAbstractItemDelegate> 0012 #include <KisPopupButton.h> 0013 0014 #include "kritaresourcewidgets_export.h" 0015 0016 class KRITARESOURCEWIDGETS_EXPORT KisStorageChooserDelegate : public QAbstractItemDelegate 0017 { 0018 Q_OBJECT 0019 public: 0020 explicit KisStorageChooserDelegate(QObject *parent = 0); 0021 ~KisStorageChooserDelegate() override {} 0022 0023 void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override; 0024 0025 QSize sizeHint ( const QStyleOptionViewItem &, const QModelIndex & ) const override; 0026 0027 }; 0028 0029 0030 class KRITARESOURCEWIDGETS_EXPORT KisStorageChooserWidget : public KisPopupButton 0031 { 0032 Q_OBJECT 0033 public: 0034 KisStorageChooserWidget(const QString &resourceType, QWidget *parent = 0); 0035 0036 ~KisStorageChooserWidget(); 0037 0038 private Q_SLOTS: 0039 void activated(const QModelIndex &index); 0040 0041 private: 0042 QString m_resourceType; 0043 0044 }; 0045 0046 0047 #endif // KISSTORAGECHOOSERWIDGET_H