1
0
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:
Maurice Kalinowski 2017-01-19 15:37:30 +01:00
parent 8157661d71
commit a89d471be5
2 changed files with 7 additions and 3 deletions

View File

@ -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);
}

View File

@ -23,6 +23,7 @@ private slots:
void updateLogStateChange();
void brokerDisconnected();
void setClientPort(int p);
private:
Ui::MainWindow *ui;