summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-16 15:17:30 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-16 15:43:40 +0200
commit56c1d5548289321a1c13689ffcc2d4dc752ee697 (patch)
tree299f5bc2aec162111eaa83c39f2e6629cca775b8
parent7c6af64d5516d3fe91da59eeaf1c6db1747d8bbc (diff)
Viewer example: Further UI polish
Wire the host line edit to the find button and enable the clear button. Change-Id: I533e0e336f5b65c3ce03efebacf4eec4765705fc Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
-rw-r--r--examples/opcua/opcuaviewer/mainwindow.cpp2
-rw-r--r--examples/opcua/opcuaviewer/mainwindow.ui3
2 files changed, 5 insertions, 0 deletions
diff --git a/examples/opcua/opcuaviewer/mainwindow.cpp b/examples/opcua/opcuaviewer/mainwindow.cpp
index 488dda1..810577d 100644
--- a/examples/opcua/opcuaviewer/mainwindow.cpp
+++ b/examples/opcua/opcuaviewer/mainwindow.cpp
@@ -139,6 +139,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
}
connect(ui->findServersButton, &QPushButton::clicked, this, &MainWindow::findServers);
+ connect(ui->host, &QLineEdit::returnPressed, this->ui->findServersButton,
+ [this]() { this->ui->findServersButton->animateClick(); });
connect(ui->getEndpointsButton, &QPushButton::clicked, this, &MainWindow::getEndpoints);
connect(ui->connectButton, &QPushButton::clicked, this, &MainWindow::connectToServer);
oldMessageHandler = qInstallMessageHandler(&messageHandler);
diff --git a/examples/opcua/opcuaviewer/mainwindow.ui b/examples/opcua/opcuaviewer/mainwindow.ui
index 6fe0420..429a4e4 100644
--- a/examples/opcua/opcuaviewer/mainwindow.ui
+++ b/examples/opcua/opcuaviewer/mainwindow.ui
@@ -71,6 +71,9 @@
<property name="text">
<string>opc.tcp://localhost:48010</string>
</property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item row="0" column="1">