-
Notifications
You must be signed in to change notification settings - Fork 1
/
Qt4DataFormatterTest.cpp
54 lines (43 loc) · 1.21 KB
/
Qt4DataFormatterTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Qt4DataFormatterTest.cpp
* Qt4DataFormatter
*
* Created by James Kyle on 5/12/10.
* Copyright 2010 KSpace MRI. All rights reserved.
*
*/
#include <QtCore/QString>
#include <QtCore/QModelIndex>
#include <QtCore/QVariant>
#include <QtCore/QAbstractItemModel>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include <QtCore/QList>
#include <QtXml/QDomElement>
#include <QtXml/QDomNode>
#include <QtXml/QDomDocument>
void testReference(QString& test)
{
test = "foobar";
};
int main() {
// xml stuff
QDomElement *ele = new QDomElement;
ele->setTagName(QString("testTag"));
QString st("This is a string");
QString *p_st = new QString("This is a string pointer");
testReference(st);
QModelIndex index;
QModelIndex *p_index = new QModelIndex;
QVariant variant;
variant.setValue(QString("A very interesting variant"));
QVariant *p_variant = new QVariant;
p_variant->setValue(QString("A very interesting variant pointer"));
QFile file("/tmp/foo.txt");
QFile *p_file = new QFile("/tmp/pfoo.txt");
QDomDocument dom;
dom.setContent(QString("<root><child>some text</child></root>"));
QDomNode root = dom.firstChild();
qDebug() << root.toElement().tagName();
return 0;
}