File indexing completed on 2024-05-05 03:57:09
0001 /* 0002 KPeople - Duplicates 0003 SPDX-FileCopyrightText: 2013 Franck Arrecot <franck.arrecot@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #ifndef MERGEDELEGATE_H 0009 #define MERGEDELEGATE_H 0010 0011 #include <kpeople/widgets/kpeoplewidgets_export.h> 0012 0013 #include <KExtendableItemDelegate> 0014 #include <QItemSelection> 0015 0016 class QAbstractItemView; 0017 class QItemSelection; 0018 0019 class KPEOPLEWIDGETS_EXPORT MergeDelegate : public KExtendableItemDelegate 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 explicit MergeDelegate(QAbstractItemView *parent); 0025 ~MergeDelegate() override; 0026 0027 static QSize pictureSize(); 0028 0029 public Q_SLOTS: 0030 void onClickContactParent(const QModelIndex &parent); 0031 void onSelectedContactsChanged(const QItemSelection &now, const QItemSelection &old); 0032 0033 private: 0034 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0035 0036 private: 0037 KPEOPLEWIDGETS_NO_EXPORT QWidget *buildMultipleLineLabel(const QModelIndex &idx); 0038 0039 static QSize s_arrowSize; 0040 static QSize s_decorationSize; 0041 }; 0042 0043 #endif // MERGEDELEGATE_H