Qt c++ Increasing integer with pushButton to label -
i'm trying make simple "cookie clicker" game , i'm having trouble this. when press button want label print out "you have mined (value) fscoins" label won't update reason. console shows no errors :(
here's code:
mainwindow.cpp
void mainwindow::on_pushbutton_clicked(int num, int numplus) { num = numplus + 1; qstring qstr = qstring::number(numplus); ui->label->settext("you have mined " + qstr + " fscoins"); } any appreciated, i've started working qt yesterday , i'm "sort of" getting hang of it.
num = numplus + 1; what point of line? num local variable never used. did mean pass reference?
Comments
Post a Comment