Thank you very much!
void MainWindow::on_startTransmissionButton_clicked()
{
m_timerID = startTimer( 2000 );
}
void MainWindow::on_stopTransmissionButton_clicked()
{
killTimer( m_timerID );
}
void MainWindow::on_startTransmissionButton_clicked()
{
m_timerID = startTimer( 2000 );
}
void MainWindow::on_stopTransmissionButton_clicked()
{
killTimer( m_timerID );
}
To copy to clipboard, switch view to plain text mode
Added after 7 minutes:
It is better:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
// ...
ui->stopTransmissionButton->setEnabled( false );
}
// ...
void MainWindow::on_startTransmissionButton_clicked()
{
m_timerID = startTimer( 2000 );
ui->startTransmissionButton->setEnabled( false );
ui->stopTransmissionButton->setEnabled( true );
}
void MainWindow::on_stopTransmissionButton_clicked()
{
killTimer( m_timerID );
ui->startTransmissionButton->setEnabled( true );
ui->stopTransmissionButton->setEnabled( false );
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
// ...
ui->stopTransmissionButton->setEnabled( false );
}
// ...
void MainWindow::on_startTransmissionButton_clicked()
{
m_timerID = startTimer( 2000 );
ui->startTransmissionButton->setEnabled( false );
ui->stopTransmissionButton->setEnabled( true );
}
void MainWindow::on_stopTransmissionButton_clicked()
{
killTimer( m_timerID );
ui->startTransmissionButton->setEnabled( true );
ui->stopTransmissionButton->setEnabled( false );
}
To copy to clipboard, switch view to plain text mode
Bookmarks