~ps-jenkins/dee-qt/latestsnapshot-3.3+14.04.20140116-0ubuntu1

« back to all changes in this revision

Viewing changes to test.h

  • Committer: Michał Sawicz
  • Date: 2013-01-31 19:01:52 UTC
  • mfrom: (65.1.21 qt4-and-qt5)
  • Revision ID: michal.sawicz@canonical.com-20130131190152-pnlsxjnv92rymaux
build for both qt4 and qt5

rename the libs to libdee-qt{4,5}-3
rename QML bindings to qml{1,2}-dee-3
bump version number
rename the QML module to Dee
version the QML module accordingly
split the QML module out into subdir
split the tests into subdir

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2011 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Florian Boucault <florian.boucault@canonical.com>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; version 3.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 */
19
 
 
20
 
#ifndef TEST_H
21
 
#define TEST_H
22
 
 
23
 
#include <QtCore/QCoreApplication>
24
 
#include <QtCore/QDebug>
25
 
 
26
 
#include "deelistmodel.h"
27
 
 
28
 
class TestApplication : public QCoreApplication
29
 
{
30
 
    Q_OBJECT
31
 
 
32
 
public:
33
 
    TestApplication(int& argc, char** argv) : QCoreApplication(argc, argv) {}
34
 
 
35
 
public Q_SLOTS:
36
 
    void onSynchronizedChanged(bool synchronized) {
37
 
        DeeListModel* model = (DeeListModel*)sender();
38
 
        qDebug() << "Number of columns:" << model->roleNames().size();
39
 
        qDebug() << "Number of rows:" << model->rowCount();
40
 
 
41
 
        for(int i = 0; i < model->rowCount(); ++i) {
42
 
            qDebug() << model->data(model->index(i));
43
 
        }
44
 
    }
45
 
 
46
 
    void onRowsInserted() {
47
 
        DeeListModel* model = (DeeListModel*)sender();
48
 
        qDebug() << "Rows added, current number:" << model->rowCount();
49
 
    }
50
 
};
51
 
 
52
 
#endif // TEST_H