Listing 3: Defines slots

01:  void HelloWorld::intCount()
02:  {
03:      if (++myCount >= MAX_COUNT) {
04:          myCount = MAX_COUNT;
05:          emit maxCountReached();
06:          QString labelText("Max count reached! ");
07:          labelText += QString::number(myCount);
08:          countLabel->setText(labelText);
09:      } else {
10:          countLabel->setText(QString::number(myCount));
11:      }
12:  }
13:  
14:  void HelloWorld::disableCountButton()
15:  {
16:      countButton->setDisabled(true);
17:  }
18:  
19:  void HelloWorld::resetCount()
20:  {
21:       myCount = 0;
22:       countButton->setEnabled(true);
23:       countLabel->setText(QString::number(myCount));
24:  }
— End of Listing —