~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to stage/part/tests/ModelTest.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2007 Trolltech ASA. All rights reserved.
 
4
**
 
5
** This file is part of the Qt Concurrent project on Trolltech Labs.
 
6
**
 
7
** This file may be used under the terms of the GNU General Public
 
8
** License version 2.0 as published by the Free Software Foundation
 
9
** and appearing in the file LICENSE.GPL included in the packaging of
 
10
** this file.  Please review the following information to ensure GNU
 
11
** General Public Licensing requirements will be met:
 
12
** http://www.trolltech.com/products/qt/opensource.html
 
13
**
 
14
** If you are unsure which license is appropriate for your use, please
 
15
** review the following information:
 
16
** http://www.trolltech.com/products/qt/licensing.html or contact the
 
17
** sales department at sales@trolltech.com.
 
18
**
 
19
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
20
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
21
**
 
22
****************************************************************************/
 
23
 
 
24
#ifndef MODELTEST_H
 
25
#define MODELTEST_H
 
26
 
 
27
#include <QObject>
 
28
#include <QAbstractItemModel>
 
29
#include <QStack>
 
30
 
 
31
class ModelTest : public QObject
 
32
{
 
33
    Q_OBJECT
 
34
 
 
35
public:
 
36
    ModelTest(QAbstractItemModel *model, QObject *parent = 0);
 
37
 
 
38
private Q_SLOTS:
 
39
    void nonDestructiveBasicTest();
 
40
    void rowCount();
 
41
    void columnCount();
 
42
    void hasIndex();
 
43
    void index();
 
44
    void parent();
 
45
    void data();
 
46
 
 
47
protected Q_SLOTS:
 
48
    void runAllTests();
 
49
    void layoutAboutToBeChanged();
 
50
    void layoutChanged();
 
51
    void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end);
 
52
    void rowsInserted(const QModelIndex & parent, int start, int end);
 
53
    void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
 
54
    void rowsRemoved(const QModelIndex & parent, int start, int end);
 
55
 
 
56
private:
 
57
    void checkChildren(const QModelIndex &parent, int currentDepth = 0);
 
58
 
 
59
    QAbstractItemModel *model;
 
60
 
 
61
    struct Changing {
 
62
        QModelIndex parent;
 
63
        int oldSize;
 
64
        QVariant last;
 
65
        QVariant next;
 
66
    };
 
67
    QStack<Changing> insert;
 
68
    QStack<Changing> remove;
 
69
 
 
70
    bool fetchingMore;
 
71
 
 
72
    QList<QPersistentModelIndex> changing;
 
73
};
 
74
 
 
75
#endif