Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
avatarExample.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef AVATAREXAMPLE_P_H
5#define AVATAREXAMPLE_P_H
6
7#include <QObject>
8#include <QPixmap>
9#include <qqml.h>
10
12// avatarExample.h
13class AvatarExample : public QObject
14{
18
19public:
21 : QObject(parent), m_value(100, 100)
22 {
23 m_value.fill(Qt::blue);
24 }
25
27
28 QPixmap avatar() const { return m_value; }
29 void setAvatar(QPixmap v) { m_value = v; emit avatarChanged(); }
30
33
34private:
35 QPixmap m_value;
36};
38
39#endif
void avatarChanged()
AvatarExample(QObject *parent=nullptr)
void setAvatar(QPixmap v)
QPixmap avatar() const
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
Definition qpixmap.cpp:850
@ blue
Definition qnamespace.h:37
GLsizei const GLfloat * v
[13]
#define QML_ELEMENT
#define Q_PROPERTY(...)
#define Q_OBJECT
#define signals
#define emit