aboutsummaryrefslogtreecommitdiffstats
path: root/examples/webchannel/chatclient-qml/qmlchatclient.qml
diff options
context:
space:
mode:
authorBalazs Egedi <egedib@inf.u-szeged.hu>2021-08-18 16:40:52 +0200
committerBalazs Egedi <egedib@inf.u-szeged.hu>2021-09-09 09:20:06 +0000
commitd42770a9fda2e00617e6f4c2452156b9b9cafd03 (patch)
tree6c017874548933e86f16d257e7f700a259ab70c7 /examples/webchannel/chatclient-qml/qmlchatclient.qml
parenta79d015bec5b5a55c5975f1fdcca8f3b7e0b0b28 (diff)
Fix QML files in tests and examples
- Removed the import versions - Changed the implicitly defined properties in Connections - Ported qmls to Qt6 - Dialog icon support is incomplete, so no icon in Dialog for now Pick-to: 6.2 Pick-to: 6.2.0 Change-Id: I2dab3a0e715d447004aa408476bcfd638599b012 Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Diffstat (limited to 'examples/webchannel/chatclient-qml/qmlchatclient.qml')
-rw-r--r--examples/webchannel/chatclient-qml/qmlchatclient.qml31
1 files changed, 19 insertions, 12 deletions
diff --git a/examples/webchannel/chatclient-qml/qmlchatclient.qml b/examples/webchannel/chatclient-qml/qmlchatclient.qml
index e10b118..d62118c 100644
--- a/examples/webchannel/chatclient-qml/qmlchatclient.qml
+++ b/examples/webchannel/chatclient-qml/qmlchatclient.qml
@@ -49,12 +49,12 @@
**
****************************************************************************/
-import QtQuick 2.2
-import QtQuick.Dialogs 1.2
-import QtQuick.Controls 2.0
-import QtQuick.Window 2.0
-import QtQuick.Layouts 1.1
-import Qt.WebSockets 1.0
+import QtQuick
+import QtQuick.Dialogs
+import QtQuick.Controls
+import QtQuick.Window
+import QtQuick.Layouts
+import QtWebSockets
import "qwebchannel.js" as WebChannel
ApplicationWindow {
@@ -77,7 +77,7 @@ ApplicationWindow {
sendTextMessage(arg);
}
- onTextMessageReceived: {
+ onTextMessageReceived: function(message) {
onmessage({data: message});
}
@@ -135,7 +135,7 @@ ApplicationWindow {
Connections {
target: mainUi.message
- onEditingFinished: {
+ function onEditingFinished() {
if (mainUi.message.text.length) {
//call the sendMessage method to send the message
root.channel.objects.chatserver.sendMessage(loginName,
@@ -163,7 +163,7 @@ ApplicationWindow {
Connections {
target: loginUi.loginButton
- onClicked: {
+ function onClicked() {
//call the login method
root.channel.objects.chatserver.login(loginName, function(arg) {
//check the return value for success
@@ -179,13 +179,20 @@ ApplicationWindow {
}
}
- MessageDialog {
+ Dialog {
id: errorDialog
+ property alias text: message.text
- icon: StandardIcon.Critical
- standardButtons: StandardButton.Close
+ anchors.centerIn: parent
+ // FIXME: icon!
+ //icon: StandardIcon.Critical
+ standardButtons: Dialog.Close
title: "Chat client"
+ Text {
+ id: message
+ }
+
onAccepted: {
Qt.quit();
}