Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
11
//![0]
12
// avatarExample.h
13
class
AvatarExample :
public
QObject
14
{
15
Q_OBJECT
16
Q_PROPERTY(QPixmap avatar READ avatar WRITE setAvatar NOTIFY avatarChanged)
17
QML_ELEMENT
18
19
public
:
20
AvatarExample(QObject *parent =
nullptr
)
21
: QObject(parent), m_value(100, 100)
22
{
23
m_value.fill(Qt::blue);
24
}
25
26
~AvatarExample() {}
27
28
QPixmap avatar()
const
{
return
m_value; }
29
void
setAvatar(QPixmap v) { m_value = v; emit avatarChanged(); }
30
31
signals:
32
void
avatarChanged();
33
34
private
:
35
QPixmap m_value;
36
};
37
//![0]
38
39
#
endif
main
int main(int argc, char *argv[])
[ctor_close]
Definition
src_corelib_animation_qpropertyanimation.cpp:100
Expectations
Definition
avatarExample.cpp:10
Expectations::expectFive
void expectFive()
Definition
avatarExample.cpp:78
Expectations::expectThree
void expectThree()
Definition
avatarExample.cpp:41
Expectations::engine
QQmlEngine engine
Definition
avatarExample.cpp:11
Expectations::expectTwo
void expectTwo()
Definition
avatarExample.cpp:26
Expectations::expectFour
void expectFour()
Definition
avatarExample.cpp:57
Expectations::expectOne
void expectOne()
Definition
avatarExample.cpp:13
qtdeclarative
src
qml
doc
snippets
qml
integrating-javascript
scarceresources
avatarExample.h
Generated on
for Qt by
1.14.0