digiKam
Loading...
Searching...
No Matches
versionsdelegate.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2010-07-15
7 * Description : Item delegate for image versions list view
8 *
9 * SPDX-FileCopyrightText: 2010-2011 by Martin Klapetek <martin dot klapetek at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QStyledItemDelegate>
20
21// Local includes
22
23#include "digikam_export.h"
24#include "itemdelegateoverlay.h"
25
26namespace Digikam
27{
28
29class VersionsDelegate : public QStyledItemDelegate,
31{
32 Q_OBJECT
33 Q_PROPERTY(int animationState READ animationState
36
37public:
38
39 explicit VersionsDelegate(QObject* const parent);
40 ~VersionsDelegate() override;
41
42 QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
43 void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
44
45 void beginPainting();
46 void finishPainting();
47
48 int animationState() const;
50
51 void setThumbnailSize(int size) const;
52 int thumbnailSize() const;
53
54Q_SIGNALS:
55
57 void visualChange(); // for ItemDelegateOverlayContainer
58
60 void requestNotification(const QModelIndex& index, const QString& message);
62
63protected Q_SLOTS:
64
65 void overlayDestroyed(QObject* o) override
66 {
68 }
69
70protected:
71
72 void initStyleOption(QStyleOptionViewItem* option, const QModelIndex& index) const override;
73
75 QAbstractItemDelegate* asDelegate() override
76 {
77 return this;
78 }
79
80private:
81
82 VersionsDelegate(); // Disable default constructor.
83
84private:
85
86 class Private;
87 Private* const d = nullptr;
88};
89
90} // namespace Digikam
Definition itemdelegateoverlay.h:323
virtual void overlayDestroyed(QObject *o)
Declare as slot in the derived class calling this method.
Definition itemdelegateoverlay.cpp:733
Definition versionsdelegate.h:31
void requestNotification(const QModelIndex &index, const QString &message)
NOTE: for ItemDelegateOverlayContainer, unimplemented:
void overlayDestroyed(QObject *o) override
Definition versionsdelegate.h:65
void setAnimationState(int animationState)
Definition versionsdelegate.cpp:105
void setThumbnailSize(int size) const
Definition versionsdelegate.cpp:116
void beginPainting()
Definition versionsdelegate.cpp:126
int thumbnailSize() const
Definition versionsdelegate.cpp:121
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition versionsdelegate.cpp:146
~VersionsDelegate() override
Definition versionsdelegate.cpp:94
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition versionsdelegate.cpp:184
QAbstractItemDelegate * asDelegate() override
Returns the delegate, typically, the derived class.
Definition versionsdelegate.h:75
void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override
Definition versionsdelegate.cpp:217
int animationState
Definition versionsdelegate.h:35
void finishPainting()
Definition versionsdelegate.cpp:131
Definition datefolderview.cpp:34