blob: 45c8ff2898f05c6db13cd50d95241aaec1d300da [file] [log] [blame]
Sébastien Blin1f915762020-08-03 13:27:42 -04001
2/*
3 * Copyright (C) 2020 by Savoir-faire Linux
4 * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19import QtQuick 2.14
20import QtQuick.Controls 2.14
21import QtQuick.Layouts 1.14
22import net.jami.Models 1.0
23
24Dialog {
25 id: userQrImageDialog
26
27 property int currentAccountIndex: 0
28
29
30 /*
31 * When dialog is opened, trigger mainViewWindow overlay which is defined in overlay.model.
32 * (model : true is necessary)
33 */
34 modal: true
35
36
37 /*
38 * Content height + margin.
39 */
40 contentHeight: userQrImage.height + 30
41
42 Image {
43 id: userQrImage
44
45 anchors.centerIn: parent
46
47 width: 250
48 height: 250
49
50 fillMode: Image.PreserveAspectFit
51 source: "image://qrImage/account_" + currentAccountIndex
52 sourceSize.width: 260
53 sourceSize.height: 260
54 mipmap: true
55 }
56
57 background: Rectangle {
58 border.width: 0
59 radius: 10
60 }
61}