mirror of
https://github.com/qt/qtmqtt.git
synced 2026-10-25 16:16:26 +00:00
Fix int <-> quint16 conversion issues
This commit is contained in:
parent
8157661d71
commit
a89d471be5
@ -17,9 +17,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(m_client, &QMqttClient::stateChanged, this, &MainWindow::updateLogStateChange);
|
||||
connect(m_client, &QMqttClient::disconnected, this, &MainWindow::brokerDisconnected);
|
||||
connect(ui->lineEditHost, &QLineEdit::textChanged, m_client, &QMqttClient::setHostname);
|
||||
//connect(ui->spinBoxPort, &QSpinBox::valueChanged, m_client, &QMqttClient::setPort);
|
||||
|
||||
connect(ui->spinBoxPort, SIGNAL(valueChanged(int)), m_client, SLOT(setPort(quint16)));
|
||||
connect(ui->spinBoxPort, SIGNAL(valueChanged(int)), this, SLOT(setClientPort(int)));
|
||||
updateLogStateChange();
|
||||
}
|
||||
|
||||
@ -63,3 +61,8 @@ void MainWindow::brokerDisconnected()
|
||||
ui->spinBoxPort->setEnabled(true);
|
||||
ui->buttonConnect->setText(tr("Connect"));
|
||||
}
|
||||
|
||||
void MainWindow::setClientPort(int p)
|
||||
{
|
||||
m_client->setPort(p);
|
||||
}
|
||||
|
||||
@ -23,6 +23,7 @@ private slots:
|
||||
void updateLogStateChange();
|
||||
|
||||
void brokerDisconnected();
|
||||
void setClientPort(int p);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user