0

QTimer がいつ起動するかに基づいてテキストを表示しようとしています...

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    m_label1 = new QLabel("My Label not working", this);

    QTimer* timerDisplay = new QTimer(this);
    connect(timerDisplay, SIGNAL(Started()), this, SLOT(updateDisplay(this)));
    timerDisplay->start(10);

}


void updateDisplay(MainWindow* m_this)
{
    QString out;
    out = "hello";

    m_this->m_label1->setText("asdf");
}
4

1 に答える 1