~ubuntu-branches/ubuntu/precise/grantlee/precise

« back to all changes in this revision

Viewing changes to examples/books/bookwrapper.h

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2010-06-11 23:41:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100611234145-oas7rhdrbwy8j55c
Tags: upstream-0.1.1
ImportĀ upstreamĀ versionĀ 0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  This file is part of the Grantlee template system.
 
3
 
 
4
  Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
 
5
 
 
6
  This library is free software; you can redistribute it and/or
 
7
  modify it under the terms of the GNU Lesser General Public
 
8
  License version 3 only, as published by the Free Software Foundation.
 
9
 
 
10
  This library is distributed in the hope that it will be useful,
 
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
  Lesser General Public License version 3 for more details.
 
14
 
 
15
  You should have received a copy of the GNU Lesser General Public
 
16
  License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
17
 
 
18
*/
 
19
 
 
20
#ifndef BOOK_WRAPPER_H
 
21
#define BOOK_WRAPPER_H
 
22
 
 
23
#include <QObject>
 
24
 
 
25
class BookWrapper : public QObject
 
26
{
 
27
  Q_OBJECT
 
28
  Q_PROPERTY(QString author READ author)
 
29
  Q_PROPERTY(QString title READ title)
 
30
  Q_PROPERTY(QString genre READ genre)
 
31
  Q_PROPERTY(int rating READ rating)
 
32
public:
 
33
  BookWrapper(QString author, QString title, QString genre, int rating, QObject *parent = 0)
 
34
      : QObject(parent), m_author(author), m_title(title), m_genre(genre), m_rating(rating)
 
35
  {}
 
36
 
 
37
  QString author() { return m_author; }
 
38
  QString title() { return m_title; }
 
39
  QString genre() { return m_genre; }
 
40
  int rating() { return m_rating; }
 
41
 
 
42
private:
 
43
  QString m_title;
 
44
  QString m_author;
 
45
  QString m_genre;
 
46
  int m_rating;
 
47
};
 
48
 
 
49
#endif
 
50