[KLF Application]
[KLF Tools]
[KLF Backend]
[KLF Home]
KLatexFormula Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
modeltest.h
Go to the documentation of this file.
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
#ifdef KLF_DEBUG_USE_MODELTEST // for doxygen to skip these files
28
29
#include <QtCore/QObject>
30
#include <QtCore/QAbstractItemModel>
31
#include <QtCore/QStack>
32
33
class
ModelTest :
public
QObject
34
{
35
Q_OBJECT
36
37
public
:
38
ModelTest(
QAbstractItemModel
*model,
QObject
*parent = 0);
39
40
private
Q_SLOTS:
41
void
nonDestructiveBasicTest();
42
void
rowCount();
43
void
columnCount();
44
void
hasIndex();
45
void
index();
46
void
parent
();
47
void
data();
48
49
protected
Q_SLOTS:
50
void
runAllTests();
51
void
layoutAboutToBeChanged();
52
void
layoutChanged();
53
void
rowsAboutToBeInserted(
const
QModelIndex
&parent,
int
start,
int
end);
54
void
rowsInserted(
const
QModelIndex
& parent,
int
start,
int
end);
55
void
rowsAboutToBeRemoved(
const
QModelIndex
&parent,
int
start,
int
end);
56
void
rowsRemoved(
const
QModelIndex
& parent,
int
start,
int
end);
57
58
private
:
59
void
checkChildren(
const
QModelIndex
&parent,
int
currentDepth = 0);
60
61
QAbstractItemModel
*model;
62
63
struct
Changing
64
{
65
QModelIndex
parent;
66
int
oldSize;
67
QVariant
last;
68
QVariant
next;
69
};
70
QStack<Changing>
insert;
71
QStack<Changing>
remove
;
72
73
bool
fetchingMore;
74
75
QList<QPersistentModelIndex>
changing;
76
};
77
78
#endif
79
80
#endif
QModelIndex
QObject
QList
QAbstractItemModel
QObject::parent
parent()
QStack
QVariant
Generated by
doxygen
1.8.6