blob: e91e54e3c8a003af5d588a1e938ad4998b1fdfac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick
import QtMultimedia
//! [complete snippet]
Text {
text: "Click Me!";
font.pointSize: 24;
width: 150; height: 50;
//! [play sound on click]
SoundEffect {
id: playSound
source: "soundeffect.wav"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playSound.play() }
}
//! [play sound on click]
}
//! [complete snippet]
|