Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class Widget
  2. {
  3. public:
  4. Widget(int id) : id_(id) {
  5. timer_.connect(PseudoTimer::started(), [this] () {
  6. std::cout << "Widget id=" << this->id() << " : "
  7. << "started slot" << std::endl;
  8. });
  9.  
  10. timer_.connect(PseudoTimer::expierd(), [this] (int n) {
  11. std::cout << "Widget id=" << this->id() << " : "
  12. << "expierd slot n=" << n << std::endl;
  13. });
  14. }
  15. void clicked() {
  16. timer_.start();
  17. }
  18. int id() const {
  19. return id_;
  20. }
  21. private:
  22. int id_;
  23. PseudoTimer timer_;
  24. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement