Advertisement
Guest User

viewmodel.h

a guest
Mar 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. #ifndef VIEWMODEL_H
  2. #define VIEWMODEL_H
  3.  
  4. #include <QStringList>
  5. #include <QObject>
  6. #include <QDate>
  7. #include "hotel.h"
  8. class ViewModel : public QObject
  9. {
  10.     Q_OBJECT
  11.     Q_PROPERTY(QStringList startDate READ startDate WRITE setStartDate NOTIFY startDateChanged)
  12.     Q_PROPERTY(QString test READ test WRITE setTest NOTIFY testChanged)
  13.     Q_PROPERTY(QList<QObject*> hotels READ hotels WRITE setHotels NOTIFY hotelsChanged)
  14. public:
  15.     void setStartDate(const QStringList &list);
  16.     void setTest(const QString& test);
  17.     void setHotels(const QObjectList& h);
  18.     QStringList startDate() const;
  19.     QString test() const;
  20.     QList<QObject*> hotels() const;
  21.     ViewModel(QObject *parent = 0);
  22.  
  23. private:
  24.     QStringList _starDateList;
  25.     QString _test;
  26.     QList<QObject*> _hotels;
  27. signals:
  28.     void startDateChanged();
  29.     void testChanged();
  30.     void hotelsChanged();
  31. };
  32.  
  33. #endif // VIEWMODEL_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement