Ignore:
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/src/gui/dialogs/qfiledialog.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    229229    \value ReadOnly Indicates that the model is readonly.
    230230
    231     \value HideNameFilterDetails Indicates if the is hidden or not.
     231    \value HideNameFilterDetails Indicates if the file name filter details are
     232    hidden or not.
    232233
    233234    \value DontUseSheet In previous versions of Qt, the static
     
    302303#include <qshortcut.h>
    303304#ifdef Q_WS_MAC
    304 #include <private/qunicodetables_p.h>
    305305#include <qmacstyle_mac.h>
    306306#endif
     
    723723            // updates the state correctly, but skips showing the non-native version:
    724724            setAttribute(Qt::WA_DontShowOnScreen);
     725#ifndef QT_NO_FSCOMPLETER
     726            //So the completer don't try to complete and therefore to show a popup
     727            d->completer->setModel(0);
     728#endif
    725729        } else {
    726730            d->nativeDialogInUse = false;
    727731            setAttribute(Qt::WA_DontShowOnScreen, false);
     732#ifndef QT_NO_FSCOMPLETER
     733            if (d->proxyModel != 0)
     734                d->completer->setModel(d->proxyModel);
     735            else
     736                d->completer->setModel(d->model);
     737#endif
    728738        }
    729739    }
     
    16071617#endif
    16081618
     1619/*
     1620    For Symbian file dialogs
     1621*/
     1622#if defined(Q_WS_S60)
     1623extern QString qtSymbianGetOpenFileName(const QString &caption,
     1624                                        const QString &dir,
     1625                                        const QString &filter);
     1626
     1627extern QStringList qtSymbianGetOpenFileNames(const QString &caption,
     1628                                             const QString &dir,
     1629                                             const QString &filter);
     1630
     1631extern QString qtSymbianGetSaveFileName(const QString &caption,
     1632                                        const QString &dir);
     1633
     1634extern QString qtSymbianGetExistingDirectory(const QString &caption,
     1635                                             const QString &dir);
     1636#endif
     1637
    16091638/*!
    16101639    This is a convenience static function that returns an existing file
     
    16351664    then a default caption will be used.
    16361665
    1637     On Windows and Mac OS X, this static function will use the native file
    1638     dialog and not a QFileDialog.
     1666    On Windows, Mac OS X and Symbian^3, this static function will use the
     1667    native file dialog and not a QFileDialog.
    16391668
    16401669    On Windows the dialog will spin a blocking modal event loop that will not
     
    16471676    \a options includes DontResolveSymlinks, the file dialog will treat
    16481677    symlinks as regular directories.
     1678
     1679    On Symbian^3 the parameter \a selectedFilter has no meaning and the
     1680    \a options parameter is only used to define if the native file dialog is
     1681    used.
    16491682
    16501683    \warning Do not delete \a parent during the execution of the dialog. If you
     
    16631696    if (qt_filedialog_open_filename_hook && !(options & DontUseNativeDialog))
    16641697        return qt_filedialog_open_filename_hook(parent, caption, dir, filter, selectedFilter, options);
     1698#if defined(Q_WS_S60)
     1699    if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog))
     1700        return qtSymbianGetOpenFileName(caption, dir, filter);
     1701#endif
    16651702    QFileDialogArgs args;
    16661703    args.parent = parent;
     
    17131750    then a default caption will be used.
    17141751
    1715     On Windows and Mac OS X, this static function will use the native file
    1716     dialog and not a QFileDialog.
     1752    On Windows, Mac OS X and Symbian^3, this static function will use the
     1753    native file dialog and not a QFileDialog.
    17171754
    17181755    On Windows the dialog will spin a blocking modal event loop that will not
     
    17321769    \snippet doc/src/snippets/code/src_gui_dialogs_qfiledialog.cpp 10
    17331770
     1771    On Symbian^3 the parameter \a selectedFilter has no meaning and the
     1772    \a options parameter is only used to define if the native file dialog is
     1773    used. On Symbian^3, this function can only return a single filename.
     1774
    17341775    \warning Do not delete \a parent during the execution of the dialog. If you
    17351776    want to do this, you should create the dialog yourself using one of the
     
    17471788    if (qt_filedialog_open_filenames_hook && !(options & DontUseNativeDialog))
    17481789        return qt_filedialog_open_filenames_hook(parent, caption, dir, filter, selectedFilter, options);
     1790#if defined(Q_WS_S60)
     1791    if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog))
     1792        return qtSymbianGetOpenFileNames(caption, dir, filter);
     1793#endif
    17491794    QFileDialogArgs args;
    17501795    args.parent = parent;
     
    18041849    a default caption will be used.
    18051850
    1806     On Windows and Mac OS X, this static function will use the native file
    1807     dialog and not a QFileDialog.
     1851    On Windows, Mac OS X and Symbian^3, this static function will use the
     1852    native file dialog and not a QFileDialog.
    18081853
    18091854    On Windows the dialog will spin a blocking modal event loop that will not
     
    18171862    \a options includes DontResolveSymlinks the file dialog will treat symlinks
    18181863    as regular directories.
     1864
     1865    On Symbian^3 the parameters \a filter and \a selectedFilter have no
     1866    meaning. The \a options parameter is only used to define if the native file
     1867    dialog is used.
    18191868
    18201869    \warning Do not delete \a parent during the execution of the dialog. If you
     
    18331882    if (qt_filedialog_save_filename_hook && !(options & DontUseNativeDialog))
    18341883        return qt_filedialog_save_filename_hook(parent, caption, dir, filter, selectedFilter, options);
     1884#if defined(Q_WS_S60)
     1885    if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog))
     1886        return qtSymbianGetSaveFileName(caption, dir);
     1887#endif
    18351888    QFileDialogArgs args;
    18361889    args.parent = parent;
     
    18811934    be set.
    18821935
    1883     On Windows and Mac OS X, this static function will use the native file
    1884     dialog and not a QFileDialog. On Windows CE, if the device has no native
    1885     file dialog, a QFileDialog will be used.
     1936    On Windows, Mac OS X and Symbian^3, this static function will use the
     1937    native file dialog and not a QFileDialog. On Windows CE, if the device has
     1938    no native file dialog, a QFileDialog will be used.
    18861939
    18871940    On Unix/X11, the normal behavior of the file dialog is to resolve and
     
    18951948    dialog just below the parent's title bar.
    18961949
     1950    On Symbian^3 the \a options parameter is only used to define if the native
     1951    file dialog is used.
     1952
    18971953    \warning Do not delete \a parent during the execution of the dialog. If you
    18981954    want to do this, you should create the dialog yourself using one of the
     
    19081964    if (qt_filedialog_existing_directory_hook && !(options & DontUseNativeDialog))
    19091965        return qt_filedialog_existing_directory_hook(parent, caption, dir, options);
     1966#if defined(Q_WS_S60)
     1967    if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 && !(options & DontUseNativeDialog))
     1968        return qtSymbianGetExistingDirectory(caption, dir);
     1969#endif
    19101970    QFileDialogArgs args;
    19111971    args.parent = parent;
Note: See TracChangeset for help on using the changeset viewer.