diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-09-16 15:17:30 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-09-16 15:43:40 +0200 |
commit | 56c1d5548289321a1c13689ffcc2d4dc752ee697 (patch) | |
tree | 299f5bc2aec162111eaa83c39f2e6629cca775b8 | |
parent | 7c6af64d5516d3fe91da59eeaf1c6db1747d8bbc (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.cpp | 2 | ||||
-rw-r--r-- | examples/opcua/opcuaviewer/mainwindow.ui | 3 |
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"> |