File indexing completed on 2024-04-14 03:47:49

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org>
0004 // SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
0005 // SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
0006 // SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
0007 // SPDX-FileCopyrightText: 2011-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0008 // SPDX-FileCopyrightText: 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
0009 //
0010 
0011 #ifndef MAPVIEWITEMDELEGATE_H
0012 #define MAPVIEWITEMDELEGATE_H
0013 
0014 #include <QStyledItemDelegate>
0015 
0016 class QListView;
0017 
0018 namespace Marble
0019 {
0020 
0021 /**
0022  * @brief The MapViewItemDelegate class is a delegate class for both the MapViewWidget's listView
0023  * and MapChangeEditDialog's listView.
0024  */
0025 class MapViewItemDelegate : public QStyledItemDelegate
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     explicit MapViewItemDelegate( QListView* view );
0031     void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
0032     QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const override;
0033 
0034 private:
0035     static QString text( const QModelIndex &index );
0036     QListView* m_view;
0037     QIcon m_bookmarkIcon;
0038 };
0039 
0040 } //Namespace: Marble
0041 
0042 #endif // MAPVIEWITEMDELEGATE_H