KTextAddons

emoticonitemdelegate.h
1/*
2 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8#include "textemoticonswidgets_private_export.h"
9#include <QStyledItemDelegate>
10#include <TextEmoticonsCore/RunningAnimatedImage>
11#include <vector>
12namespace TextEmoticonsWidgets
13{
14class TEXTEMOTICONSWIDGETS_TESTS_EXPORT EmoticonItemDelegate : public QStyledItemDelegate
15{
16 Q_OBJECT
17public:
18 explicit EmoticonItemDelegate(QObject *parent = nullptr);
19 ~EmoticonItemDelegate() override;
20
21 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
22
23private:
24 [[nodiscard]] TEXTEMOTICONSWIDGETS_NO_EXPORT std::vector<TextEmoticonsCore::RunningAnimatedImage>::iterator
25 findRunningAnimatedImage(const QModelIndex &index) const;
26 TEXTEMOTICONSWIDGETS_NO_EXPORT void removeRunningAnimatedImage(const QModelIndex &index) const;
27 mutable std::vector<TextEmoticonsCore::RunningAnimatedImage> mRunningAnimatedImages; // not a hash or map, since QPersistentModelIndex changes value
28};
29}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.