File indexing completed on 2024-05-12 16:02:09
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2011 Thorsten Zachmann <zachmann@kde.org> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KOMARKERITEMDELEGATE_H 0008 #define KOMARKERITEMDELEGATE_H 0009 0010 // Calligra 0011 #include <KoFlake.h> 0012 // Qt 0013 #include <QAbstractItemDelegate> 0014 0015 class KoMarker; 0016 0017 class KoMarkerItemDelegate : public QAbstractItemDelegate 0018 { 0019 public: 0020 explicit KoMarkerItemDelegate(KoFlake::MarkerPosition position, QObject *parent = 0); 0021 ~KoMarkerItemDelegate() override; 0022 0023 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 0024 QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex &index) const override; 0025 0026 static void drawMarkerPreview(QPainter *painter, const QRect &rect, const QPen &pen, KoMarker *marker, KoFlake::MarkerPosition position); 0027 private: 0028 KoFlake::MarkerPosition m_position; 0029 }; 0030 0031 #endif /* KOMARKERITEMDELEGATE_H */