Valderman

counter.cpp

Apr 1st, 2022 (edited)
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include "Counter.h"
  2.  
  3. Counter::Counter() : QObject()
  4.                    , m_nValue(0)
  5. {
  6. }
  7.  
  8. void Counter::slotInc()
  9. {
  10.     emit counterChanged(++m_nValue);
  11.  
  12.     if (m_nValue == 5)
  13.     {
  14.         emit goodbye();
  15.     }
  16. }
  17.  
Add Comment
Please, Sign In to add comment