File: exampleclass.h

package info (click to toggle)
libsigc%2B%2B-3.0 3.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,352 kB
  • sloc: cpp: 6,829; xml: 347; makefile: 197; python: 148; sh: 73
file content (36 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef EXAMPLECLASS_H
#define EXAMPLECLASS_H

#include <QObject>
#include <QTimer>
#include <QDebug>

#include <sigc++/sigc++.h>

class ExampleClass : public QObject
{
  Q_OBJECT
public:
  explicit ExampleClass(QObject* parent = nullptr);

  /* Instead of using the keyword 'signals', use the 'Q_SIGNALS' macro */
Q_SIGNALS:
  void example_signal();

  /* Instead of using the keyword 'slots', use the 'Q_SLOTS' macro */
public Q_SLOTS:
  void timer_slot();

  /**
   * This slot is called using libsigc++, however since it is defined under Q_SLOTS
   * it could also be used with the Qt signals/slots
   */
  void example_slot();

private:
  sigc::slot<void()> m_sigc_slot;
  sigc::signal<void()> m_sigc_signal;
  QTimer m_timer;
};

#endif // EXAMPLECLASS_H