-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNamePopup.qml
48 lines (43 loc) · 1.19 KB
/
NamePopup.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
import QtQuick 2.0
import QtQuick.Dialogs 1.3
Dialog {
visible: false
height: 100
title: "Change player name"
//modal: true
//anchors.centerIn: parent
standardButtons: Dialog.Close | Dialog.Apply
Rectangle{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
border.color: "black"
width: parent.width
height: 40
TextInput{
id: playerNameInput
anchors.verticalCenter: parent.verticalCenter
text: "";
width: parent.width
font.family: "Helvetica"
font.pointSize: 20
font.bold: true
//color: black
onAccepted: {
cppSocket.setPlayerName(playerNameInput.text);
messageRect.setPlayerName(playerNameInput.text);
}
}
}
Component.onCompleted: {
playerNameInput.text = cppSocket.getPlayerName();
}
onApply: {
cppSocket.setPlayerName(playerNameInput.text);
messageRect.setPlayerName(playerNameInput.text);
this.close();
}
onRejected: {
this.close();
}
}