Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Game of life grid size change query

    General and Desktop
    1
    1
    696
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aaronjlaw last edited by

      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");
      if(textChanged(inputNumber))
      {
      ui->lineEdit->update(grid[lineEdit][lineEdit]); //Grid is in a different function altogether of course.
      }
      @

      1 Reply Last reply Reply Quote 0
      • First post
        Last post