View Single Post
Posts: 23 | Thanked: 0 times | Joined on Dec 2009
#13
Originally Posted by krk969 View Post
mainwindow.h
Code:
class MainWindow
{
........

private: 
 	static int  _clickCounter;
};
mainwindow.cpp
in the first line of the file just after all the #includes define this variable,
Code:
int MainWindow::_clickCounter = 0;
and modfiy your slot with something like this
Code:
void MainWindow::on_Button_clicked()
{
       ui->label->setText(QString("this is text %1").arg(QString::number(++_clickCounter) );
}
I've made it to work, but i meant that later it wont be just +1 it will be something like: Hello changes to Mouse and then word mouse changes to some other word or sentence