Hobrasoft httpd server
Embedded HTTP server for Qt and C++
item.h
Go to the documentation of this file.
1 
5 #ifndef _Item_H_
6 #define _Item_H_
7 
8 #include <QObject>
9 #include <QString>
10 #include <QTimer>
11 #include <QVariantMap>
12 
13 namespace Example {
14 
20 class Item : public QObject {
21  Q_OBJECT
22  public:
26  Item(const QString& id, const QString& text, int interval, QObject *parent);
27 
28  const QString& id() const;
29 
30  const QString& text() const;
31 
32  QVariantMap webStatus() const;
33 
34  signals:
38  void statusChanged(const Item *);
39 
40  private slots:
44  void updateStatus();
45 
46  private:
47  #ifndef DOXYGEN_SHOULD_SKIP_THIS
48  QString m_id;
49  QString m_text;
50  int m_counter;
51 
52  QTimer *m_timer;
53  #endif
54 };
55 
56 }
57 
58 #endif
void statusChanged(const Item *)
Signal is invoked when the status of the item changed.
Namespace for Example.
Definition: application.h:11
Item(const QString &id, const QString &text, int interval, QObject *parent)
Constructor creates item from given parameters.
Definition: item.cpp:13
QVariantMap webStatus() const
Returns webStatus of the item.
Definition: item.cpp:42
const QString & text() const
Returns text of the item.
Definition: item.cpp:37
void updateStatus()
Slot is called periodicaly to increment inner value of the example item.
Definition: item.cpp:26
One data item in the example.
Definition: item.h:20
const QString & id() const
Returns id of the item.
Definition: item.cpp:32