BuildLogViewer/DomItem.h
author John Kern <johnk@symbian.org>
Thu, 26 Aug 2010 14:34:34 -0700
changeset 40 edc0144719a1
parent 0 bbe0af256f1b
permissions -rwxr-xr-x
removed invariant from data() and rowCount(). Performance should be ok now.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     1
/****************************************************************************
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     2
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     3
 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     4
 ** Contact: Nokia Corporation (qt-info@nokia.com)
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     5
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     6
 ** This file is part of the examples of the Qt Toolkit.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     7
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     8
 ** $QT_BEGIN_LICENSE:LGPL$
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
     9
 ** Commercial Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    10
 ** Licensees holding valid Qt Commercial licenses may use this file in
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    11
 ** accordance with the Qt Commercial License Agreement provided with the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    12
 ** Software or, alternatively, in accordance with the terms contained in
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    13
 ** a written agreement between you and Nokia.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    14
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    15
 ** GNU Lesser General Public License Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    16
 ** Alternatively, this file may be used under the terms of the GNU Lesser
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    17
 ** General Public License version 2.1 as published by the Free Software
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    18
 ** Foundation and appearing in the file LICENSE.LGPL included in the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    19
 ** packaging of this file.  Please review the following information to
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    20
 ** ensure the GNU Lesser General Public License version 2.1 requirements
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    21
 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    22
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    23
 ** In addition, as a special exception, Nokia gives you certain
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    24
 ** additional rights. These rights are described in the Nokia Qt LGPL
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    25
 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    26
 ** package.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    27
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    28
 ** GNU General Public License Usage
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    29
 ** Alternatively, this file may be used under the terms of the GNU
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    30
 ** General Public License version 3.0 as published by the Free Software
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    31
 ** Foundation and appearing in the file LICENSE.GPL included in the
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    32
 ** packaging of this file.  Please review the following information to
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    33
 ** ensure the GNU General Public License version 3.0 requirements will be
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    34
 ** met: http://www.gnu.org/copyleft/gpl.html.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    35
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    36
 ** If you are unsure which license is appropriate for your use, please
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    37
 ** contact the sales department at http://www.qtsoftware.com/contact.
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    38
 ** $QT_END_LICENSE$
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    39
 **
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    40
 ****************************************************************************/
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    41
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    42
 #ifndef DOMITEM_H
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    43
 #define DOMITEM_H
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    44
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    45
 #include <QDomNode>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    46
 #include <QHash>
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    47
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    48
 class DomItem
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    49
 {
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    50
 public:
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    51
     DomItem(QDomNode &node, int row, DomItem *parent = 0);
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    52
     ~DomItem();
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    53
     DomItem *child(int i);
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    54
     DomItem *parent();
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    55
     QDomNode node() const;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    56
     int row();
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    57
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    58
 private:
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    59
     QDomNode domNode;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    60
     QHash<int,DomItem*> childItems;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    61
     DomItem *parentItem;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    62
     int rowNumber;
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    63
 };
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    64
bbe0af256f1b here is a demo which reads and displays xml.
John Kern <johnk@symbian.org>
parents:
diff changeset
    65
#endif