Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/doc/src/examples/qxmlstreambookmarks.qdoc

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the documentation of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5252    \section1 XbelWriter Class Definition
    5353
    54     The \c XbelWriter class is a subclass of QXmlStreamReader, which provides
    55     an XML parser with a streaming API. \c XbelWriter also contains a private
    56     instance of QTreeWidget in order to display the bookmarks according to
    57     hierarchies.
     54    The \c XbelWriter class contains a private instance of QXmlStreamWriter,
     55    which provides an XML writer with a streaming API. \c XbelWriter also
     56    has a reference to the QTreeWidget instance where the bookmark hierarchy
     57    is stored.
    5858
    5959    \snippet examples/xml/streambookmarks/xbelwriter.h 0
     
    7676    \snippet examples/xml/streambookmarks/xbelwriter.cpp 1
    7777
    78     The \c writeItem() function accepts a QTreeWidget object and writes it
     78    The \c writeItem() function accepts a QTreeWidgetItem object and writes it
    7979    to the stream, depending on its \c tagName, which can either be a "folder",
    8080    "bookmark", or "separator".
     
    8484    \section1 XbelReader Class Definition
    8585
    86     The \c XbelReader class is a subclass of QXmlStreamReader, the pendent
    87     class for QXmlStreamWriter. \c XbelReader contains a private instance
    88     of QTreeWidget to group bookmarks according to their hierarchies.
     86    The \c XbelReader contains a private instance of QXmlStreamReader, the
     87    companion class to QXmlStreamWriter. \c XbelReader also contains a
     88    reference to the QTreeWidget that is used to group the bookmarks according
     89    to their hierarchy.
    8990
    9091    \snippet examples/xml/streambookmarks/xbelreader.h 0
     
    103104
    104105    The \c read() function accepts a QIODevice and sets it using
    105     \l{QXmlStreamReader::setDevice()}{setDevice()}. The actual process
    106     of reading only takes place if the file is a valid XBEL 1.0 file.
    107     Note that the XML input needs to be well-formed to be accepted by
    108     QXmlStreamReader. Otherwise, the \l{QXmlStreamReader::raiseError()}
    109     {raiseError()} function is used to display an error message.
     106    \l{QXmlStreamReader::}{setDevice()}. The actual process of reading only
     107    takes place if the file is a valid XBEL 1.0 file. Note that the XML input
     108    needs to be well-formed to be accepted by QXmlStreamReader. Otherwise, the
     109    \l{QXmlStreamReader::}{raiseError()} function is used to display an error
     110    message. Since the XBEL reader is only concerned with reading XML elements,
     111    it makes extensive use of the \l{QXmlStreamReader::}{readNextStartElement()}
     112    convenience function.
    110113
    111114    \snippet examples/xml/streambookmarks/xbelreader.cpp 1
    112115
    113     The \c readUnknownElement() function reads an unknown element. The
    114     Q_ASSERT() macro is used to provide a pre-condition for the function.
     116    The \c errorString() function is used if an error occurred, in order to
     117    obtain a description of the error complete with line and column number
     118    information.
    115119
    116120    \snippet examples/xml/streambookmarks/xbelreader.cpp 2
     
    119123    the appropriate function to read it, depending on whether if its a
    120124    "folder", "bookmark" or "separator". Otherwise, it calls
    121     \c readUnknownElement().
     125    \l{QXmlStreamReader::}{skipCurrentElement()}. The Q_ASSERT() macro is used
     126    to provide a pre-condition for the function.
    122127
    123128    \snippet examples/xml/streambookmarks/xbelreader.cpp 3
     
    128133
    129134    The \c readSeparator() function creates a separator and sets its flags.
    130     The text is set to 30 "0xB7", the HEX equivalent for period, and then
    131     read using \c readElementText().
     135    The text is set to 30 "0xB7", the HEX equivalent for period. The element
     136    is then skipped using \l{QXmlStreamReader::}{skipCurrentElement()}.
    132137
    133138    \snippet examples/xml/streambookmarks/xbelreader.cpp 5
Note: See TracChangeset for help on using the changeset viewer.