View Single Post
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#11
Originally Posted by tdesws View Post
erm.. how do I do that?
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) );
}
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 

The Following User Says Thank You to krk969 For This Useful Post: