QQuickImageProvider for ForkAwesome
0.3.4
QQuickImageProvider for ForkAwesome
Toggle main menu visibility
Loading...
Searching...
No Matches
imageprovider.h
Go to the documentation of this file.
1
#ifndef QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER
2
#define QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER
3
4
#include "
./global.h
"
5
6
#include <QColor>
7
#include <QQuickImageProvider>
8
#include <QSize>
9
10
QT_FORWARD_DECLARE_CLASS(QPixmap)
11
QT_FORWARD_DECLARE_CLASS(QSize)
12
13
namespace
QtForkAwesome
{
14
15
class
Renderer;
16
17
class
QT_QUICK_FORK_AWESOME_EXPORT
QuickImageProvider
:
public
QQuickImageProvider {
18
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
19
Q_OBJECT
20
Q_PROPERTY(QColor
defaultColor
READ
defaultColor
WRITE
setDefaultColor
)
21
Q_PROPERTY(QSize
defaultSize
READ
defaultSize
WRITE
setDefaultSize
)
22
#endif
23
24
public
:
25
QuickImageProvider
(
const
Renderer &renderer,
const
QColor &
defaultColor
= QColor(),
const
QSize &
defaultSize
= QSize(64, 64),
26
QQuickImageProvider::ImageType type = QQuickImageProvider::Pixmap);
27
QImage
requestImage
(
const
QString &
id
, QSize *size,
const
QSize &requestedSize)
override
;
28
QPixmap
requestPixmap
(
const
QString &
id
, QSize *size,
const
QSize &requestedSize)
override
;
29
30
QColor
defaultColor
()
const
;
31
QSize
defaultSize
()
const
;
32
33
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
34
public
Q_SLOTS:
35
#else
36
public
:
37
#endif
38
void
setDefaultColor
(
const
QColor &color);
39
void
setDefaultSize
(
const
QSize &size);
40
41
private
:
42
const
Renderer &m_renderer;
43
QColor m_defaultColor;
44
QSize m_defaultSize;
45
};
46
47
inline
QColor
QuickImageProvider::defaultColor
()
const
48
{
49
return
m_defaultColor;
50
}
51
52
inline
QSize
QuickImageProvider::defaultSize
()
const
53
{
54
return
m_defaultSize;
55
}
56
57
inline
void
QuickImageProvider::setDefaultColor
(
const
QColor &color)
58
{
59
m_defaultColor = color;
60
}
61
62
inline
void
QuickImageProvider::setDefaultSize
(
const
QSize &size)
63
{
64
m_defaultSize = size;
65
}
66
67
}
// namespace QtForkAwesome
68
69
#endif
// QT_FORK_AWESOME_QUICK_IMAGE_PROVIDER
QtForkAwesome::QuickImageProvider::setDefaultSize
void setDefaultSize(const QSize &size)
Definition
imageprovider.h:62
QtForkAwesome::QuickImageProvider::defaultColor
QColor defaultColor
Definition
imageprovider.h:20
QtForkAwesome::QuickImageProvider::defaultSize
QSize defaultSize
Definition
imageprovider.h:21
QtForkAwesome::QuickImageProvider::QuickImageProvider
QuickImageProvider(const Renderer &renderer, const QColor &defaultColor=QColor(), const QSize &defaultSize=QSize(64, 64), QQuickImageProvider::ImageType type=QQuickImageProvider::Pixmap)
Definition
imageprovider.cpp:17
QtForkAwesome::QuickImageProvider::requestPixmap
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
Definition
imageprovider.cpp:26
QtForkAwesome::QuickImageProvider::setDefaultColor
void setDefaultColor(const QColor &color)
Definition
imageprovider.h:57
QtForkAwesome::QuickImageProvider::requestImage
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override
Definition
imageprovider.cpp:65
global.h
QT_QUICK_FORK_AWESOME_EXPORT
#define QT_QUICK_FORK_AWESOME_EXPORT
Marks the symbol to be exported by the qtquickforkawesome library.
Definition
global.h:14
QtForkAwesome
Contains classes provided by the QtForkAwesome library.
Definition
imageprovider.h:13
Generated on
for QQuickImageProvider for ForkAwesome by
1.18.0