summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-10 03:01:54 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-11-10 03:01:54 +0100
commitbd073101acc9d30e0067c9c75d5cdab7511deedf (patch)
tree61a405e830a6a687a41138285c8759197b409c3f
parent083d7257e5adea10aa2b5db5d8083b4cae20f041 (diff)
parent4a8f8f99c82482a679c6e1b0ee5bc377899f68d0 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
-rw-r--r--examples/mqtt/subscriptions/mainwindow.cpp8
-rw-r--r--examples/mqtt/subscriptions/mainwindow.ui44
2 files changed, 42 insertions, 10 deletions
diff --git a/examples/mqtt/subscriptions/mainwindow.cpp b/examples/mqtt/subscriptions/mainwindow.cpp
index e8fea99..e75483f 100644
--- a/examples/mqtt/subscriptions/mainwindow.cpp
+++ b/examples/mqtt/subscriptions/mainwindow.cpp
@@ -89,6 +89,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->lineEditHost, &QLineEdit::textChanged, m_client, &QMqttClient::setHostname);
connect(ui->spinBoxPort, QOverload<int>::of(&QSpinBox::valueChanged), this, &MainWindow::setClientPort);
+ connect(ui->lineEditUser, &QLineEdit::textChanged, m_client, &QMqttClient::setUsername);
+ connect(ui->lineEditPassword, &QLineEdit::textChanged, m_client, &QMqttClient::setPassword);
updateLogStateChange();
}
@@ -103,11 +105,15 @@ void MainWindow::on_buttonConnect_clicked()
if (m_client->state() == QMqttClient::Disconnected) {
ui->lineEditHost->setEnabled(false);
ui->spinBoxPort->setEnabled(false);
+ ui->lineEditUser->setEnabled(false);
+ ui->lineEditPassword->setEnabled(false);
ui->buttonConnect->setText(tr("Disconnect"));
m_client->connectToHost();
} else {
ui->lineEditHost->setEnabled(true);
ui->spinBoxPort->setEnabled(true);
+ ui->lineEditUser->setEnabled(true);
+ ui->lineEditPassword->setEnabled(true);
ui->buttonConnect->setText(tr("Connect"));
m_client->disconnectFromHost();
}
@@ -131,6 +137,8 @@ void MainWindow::brokerDisconnected()
{
ui->lineEditHost->setEnabled(true);
ui->spinBoxPort->setEnabled(true);
+ ui->lineEditUser->setEnabled(true);
+ ui->lineEditPassword->setEnabled(true);
ui->buttonConnect->setText(tr("Connect"));
}
diff --git a/examples/mqtt/subscriptions/mainwindow.ui b/examples/mqtt/subscriptions/mainwindow.ui
index 044ac64..0b627aa 100644
--- a/examples/mqtt/subscriptions/mainwindow.ui
+++ b/examples/mqtt/subscriptions/mainwindow.ui
@@ -23,17 +23,31 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="lineEditHost">
<property name="text">
- <string>Host:</string>
+ <string/>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="lineEditHost">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_8">
<property name="text">
- <string/>
+ <string>Username:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QPushButton" name="buttonPing">
+ <property name="text">
+ <string>Ping</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Host:</string>
</property>
</widget>
</item>
@@ -61,10 +75,20 @@
</property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QPushButton" name="buttonPing">
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_9">
<property name="text">
- <string>Ping</string>
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="lineEditUser"/>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="lineEditPassword">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
@@ -227,7 +251,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
- <height>21</height>
+ <height>20</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">