Qt World Summit: Submit your Presentation

Game of life grid size change query

  • Hello there,

    I have created the Game Of Life and I have a 50 by 50 grid which I have set, however I need a pushButton to resize the grid to a value I have typed into the LineEdit, how is this done? I think it has something to do with textChanged and then converting the string to an int but I am unsure how to pass these values into this slot and then ultimately to replace my @grid [50][50]@ value.

    This is the general idea - Yes I know this code will not work but you get the idea.
    @void MainWindow::on_pushButton_clicked()
    //ui->label->setText("Hello world");
    ui->lineEdit->update(grid[lineEdit][lineEdit]); //Grid is in a different function altogether of course.

Log in to reply