Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    77** This file is part of the documentation of the Qt Toolkit.
    88**
    9 ** $QT_BEGIN_LICENSE:LGPL$
     9** $QT_BEGIN_LICENSE:L$
    1010** Commercial Usage
    1111** Licensees holding valid Qt Commercial licenses may use this file in
    1212** accordance with the Qt Commercial License Agreement provided with the
    13 ** Software or, alternatively, in accordance with the terms contained in
    14 ** a written agreement between you and Nokia.
    15 **
    16 ** GNU Lesser General Public License Usage
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
    18 ** General Public License version 2.1 as published by the Free Software
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
    20 ** packaging of this file.  Please review the following information to
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    23 **
    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.
    27 **
    28 ** GNU General Public License Usage
    29 ** Alternatively, this file may be used under the terms of the GNU
    30 ** General Public License version 3.0 as published by the Free Software
    31 ** Foundation and appearing in the file LICENSE.GPL included in the
    32 ** packaging of this file.  Please review the following information to
    33 ** ensure the GNU General Public License version 3.0 requirements will be
    34 ** met: http://www.gnu.org/copyleft/gpl.html.
     13** Software or, alternatively, in accordance with the terms contained in a
     14** written agreement between you and Nokia.
     15**
     16** GNU Free Documentation License
     17** Alternatively, this file may be used under the terms of the GNU Free
     18** Documentation License version 1.3 as published by the Free Software
     19** Foundation and appearing in the file included in the packaging of this
     20** file.
    3521**
    3622** If you have questions regarding the use of this file, please contact
     
    4935    \image completer-example.png
    5036
    51     This example uses a custom item model, \c DirModel, and a QCompleter object.
     37    This example uses a custom item model, \c Model, and a QCompleter object.
    5238    QCompleter is a class that provides completions based on an item model. The
    5339    type of model, the completion mode, and the case sensitivity can be
     
    6248    \quotefile examples/tools/completer/completer.qrc
    6349
    64     \section1 DirModel Class Definition
    65 
    66     The \c DirModel class is a subclass of QDirModel, which provides a data
     50    \section1 Model Class Definition
     51
     52    The \c Model, which provides a data
    6753    model for the local filesystem.
    6854
    69     \snippet examples/tools/completer/dirmodel.h 0
     55    \snippet examples/tools/completer/model.h 0
    7056
    7157    This class only has a constructor and a \c data() function as it is only
    7258    created to enable \c data() to return the entire file path for the
    73     display role, unlike \l{QDirModel}'s \c data() function that only returns
     59    display role, unlike \l{QModel}'s \c data() function that only returns
    7460    the folder and not the drive label. This is further explained in
    75     \c DirModel's implementation.
    76 
    77     \section1 DirModel Class Implementation
    78 
    79     The constructor for the \c DirModel class is used to pass \a parent to
    80     QDirModel.
    81 
    82     \snippet examples/tools/completer/dirmodel.cpp 0
     61    \c Model's implementation.
     62
     63    \section1 Model Class Implementation
     64
     65    The constructor for the \c Model class is used to pass \a parent to
     66    QModel.
     67
     68    \snippet examples/tools/completer/model.cpp 0
    8369
    8470    As mentioned earlier, the \c data() function is reimplemented in order to
    8571    get it to return the entire file parth for the display role. For example,
    86     with a QDirModel, you will see "Program Files" in the view. However, with
    87     \c DirModel, you will see "C:\\Program Files".
    88 
    89     \snippet examples/tools/completer/dirmodel.cpp 1
     72    with a QModel, you will see "Program Files" in the view. However, with
     73    \c Model, you will see "C:\\Program Files".
     74
     75    \snippet examples/tools/completer/model.cpp 1
    9076
    9177    The screenshots below illustrate this difference:
     
    121107
    122108    We set up three QComboBox objects, \c modelComb, \c modeCombo and
    123     \c caseCombo. By default, the \c modelCombo is set to QDirModel,
     109    \c caseCombo. By default, the \c modelCombo is set to QModel,
    124110    the \c modeCombo is set to "Filtered Popup" and the \c caseCombo is set
    125111    to "Case Insensitive".
     
    203189
    204190    A \c switch statement is used to change the item model based on the index
    205     of \c modelCombo. If \c case is 0, we use an unsorted QDirModel, providing
     191    of \c modelCombo. If \c case is 0, we use an unsorted QModel, providing
    206192    us with a file path excluding the drive label.
    207193
Note: See TracChangeset for help on using the changeset viewer.