Red de conocimiento informático - Conocimiento informático - Modifiqué un pequeño programa creado con el temporizador QT para agregar y detener automáticamente el temporizador en milisegundos, pero ¿por qué no se puede detener el tiempo de milisegundos?

Modifiqué un pequeño programa creado con el temporizador QT para agregar y detener automáticamente el temporizador en milisegundos, pero ¿por qué no se puede detener el tiempo de milisegundos?

#include "mainwindow.h"

#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *padre):

QMainWindow(padre), .

ui(new Ui::MainWindow)

{

ui->setupUi(this);

this->m_timerid = 0;

this->connect(ui->.pushButton,SIGNAL(clicked()),this,SLOT(on_Start_b_clicked());

this->connect(ui ->pushButton_2,SEÑAL(se hizo clic()),este,RANURA(on_Stop_b_clicked());

}

Ventana principal::~Ventana principal()

{

eliminar ui;

}

void MainWindow::on_Start _b_clicked()

// Este es un botón que definí. Se realizarán las siguientes operaciones al presionar

{

m_timerid = this->startTimer(1000);

}

void MainWindow: :.timerEvent(QTimerEvent *evento)

{

QString s=ui->Msegundo->text();

ui->Msegundo->setText (QString::number(s .toInt()+1));

}

void MainWindow::on_Stop_b_clicked()//botón de parada

{

if (m_timerid != 0)

{

this->killTimer(this->m_timerid);

m_timerid = 0 ;

}

}

}