-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
50 lines (41 loc) · 1.13 KB
/
main.qml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import QtQuick 2.9
import QtQuick.Window 2.2
import "qml"
Window {
id: window
visible: true
width: 1440
height: 900
flags: Qt.WindowFullscreenButtonHint
title: qsTr("MultiMedia Processing")
MouseArea{
anchors.fill: parent
onClicked: presentation.nextSlideState()
}
Presentation{
id: presentation
focus: true
anchors.centerIn: parent
Keys.onLeftPressed: presentation.previousSlide()
Keys.onRightPressed: presentation.nextSlideState()
Keys.onUpPressed: presentation.previousSlide()
Keys.onDownPressed: presentation.nextSlideState()
Keys.onEscapePressed: window.showNormal()
}
onWidthChanged: {
resizePresentation()
}
onHeightChanged: {
resizePresentation()
}
function resizePresentation() {
var winWidth = window.width
var winHeight = window.height
var ratioHeight = winWidth / 1440.0 * 900
if (winHeight >= ratioHeight) {
presentation.scale = ratioHeight / 900.0
}else {
presentation.scale = winHeight / 900.0
}
}
}