summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestelement.cpp
blob: 55341d40a360d39dff87422f33c54903fb7ec414 (plain)
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
#include "qtestelement.h"

QT_BEGIN_NAMESPACE

QTestElement::QTestElement(int type)
    :QTestCoreElement<QTestElement>(type),
    listOfChildren(0),
    parent(0)
{
}

QTestElement::~QTestElement()
{
    delete listOfChildren;
}

bool QTestElement::addLogElement(QTestElement *element)
{
    if(!element)
        return false;

    if(element->elementType() != QTest::LET_Undefined){
        element->addToList(&listOfChildren);
        element->setParent(this);
        return true;
    }

    return false;
}

QTestElement *QTestElement::childElements() const
{
    return listOfChildren;
}

const QTestElement *QTestElement::parentElement() const
{
    return parent;
}

void QTestElement::setParent(const QTestElement *p)
{
    parent = p;
}

QT_END_NAMESPACE