Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsdialoghelpers.cpp File Reference

(4a705f5f29aa5ffce8db87fe54f7e70c08124d80)

#include <QtCore/qt_windows.h>
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
#include "qwindowswindow.h"
#include "qwindowsintegration.h"
#include "qwindowstheme.h"
#include <QtGui/qguiapplication.h>
#include <QtGui/qcolor.h>
#include <QtCore/qdebug.h>
#include <QtCore/qtimer.h>
#include <QtCore/qdir.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qsharedpointer.h>
#include <QtCore/qobject.h>
#include <QtCore/qthread.h>
#include <QtCore/qsysinfo.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qmutex.h>
#include <QtCore/quuid.h>
#include <QtCore/qtemporaryfile.h>
#include <QtCore/private/qfunctions_win_p.h>
#include <QtCore/private/qsystemerror_p.h>
#include <QtCore/private/qcomobject_p.h>
#include <algorithm>
#include <vector>
#include "qwindowsdialoghelpers.moc"
+ Include dependency graph for qwindowsdialoghelpers.cpp:

Go to the source code of this file.

Classes

class  QWindowsNativeDialogBase
 Base class for Windows native dialogs. More...
 
class  QWindowsDialogThread
 Run a non-modal native dialog in a separate thread. More...
 
class  QWindowsFileDialogSharedData
 Explicitly shared file dialog parameters that are not in QFileDialogOptions. More...
 
class  QWindowsNativeFileDialogEventHandler
 Listens to IFileDialog events and forwards them to QWindowsNativeFileDialogBase. More...
 
class  QWindowsShellItem
 Wrapper for IShellItem. More...
 
class  QWindowsNativeFileDialogBase
 Windows native file dialog wrapper around IFileOpenDialog, IFileSaveDialog. More...
 
struct  FilterSpec
 
class  QWindowsNativeSaveFileDialog
 Windows native file save dialog wrapper around IFileSaveDialog. More...
 
class  QWindowsNativeOpenFileDialog
 Windows native file save dialog wrapper around IFileOpenDialog. More...
 
class  QWindowsFileDialogHelper
 Helper for native Windows file dialogs. More...
 
class  QWindowsXpNativeFileDialog
 Native Windows directory dialog for Windows XP using SHlib-functions. More...
 
class  QWindowsXpFileDialogHelper
 Dialog helper using QWindowsXpNativeFileDialog. More...
 

Namespaces

namespace  QWindowsDialogs
 

Macros

#define QT_NO_URL_CAST_FROM_STRING   1
 

Typedefs

using SharedPointerColor = QSharedPointer<QColor>
 

Functions

static wchar_t * qStringToWCharArray (const QString &s, size_t reserveSize=0)
 
void QWindowsDialogs::eatMouseMove ()
 After closing a windows dialog with a double click (i.e.
 
HWND QWindowsDialogs::getHWND (IFileDialog *fileDialog)
 
static IShellLibrary * sHLoadLibraryFromItem (IShellItem *libraryItem, DWORD mode)
 
QDebug operator<< (QDebug d, const QWindowsShellItem &i)
 
QDebug operator<< (QDebug d, IShellItem *i)
 
static QList< FilterSpecfilterSpecs (const QStringList &filters, bool hideFilterDetails, int *totalStringLength)
 
static IFileDialog2 * getFileDialog2 (IFileDialog *fileDialog)
 
static bool isHexRange (const QString &s, int start, int end)
 
static bool isClsid (const QString &s)
 
static int indexOfNameFilter (const QStringList &filters, const QString &needle)
 
static QString suffixFromFilter (const QString &filter)
 
static void cleanupTemporaryItemCopies ()
 
static bool validFileNameCharacter (QChar c)
 
QString tempFilePattern (QString name)
 
static QString createTemporaryItemCopy (QWindowsShellItem &qItem, QString *errorMessage)
 
static QUrl itemToDialogUrl (QWindowsShellItem &qItem, QString *errorMessage)
 
static int QT_WIN_CALLBACK xpFileDialogGetExistingDirCallbackProc (HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
 
bool QWindowsDialogs::useHelper (QPlatformTheme::DialogType type)
 
QPlatformDialogHelperQWindowsDialogs::createHelper (QPlatformTheme::DialogType type)
 

Macro Definition Documentation

◆ QT_NO_URL_CAST_FROM_STRING

#define QT_NO_URL_CAST_FROM_STRING   1

Definition at line 4 of file qwindowsdialoghelpers.cpp.

Typedef Documentation

◆ SharedPointerColor

Function Documentation

◆ cleanupTemporaryItemCopies()

static void cleanupTemporaryItemCopies ( )
static

Definition at line 1338 of file qwindowsdialoghelpers.cpp.

References file, and QFile::remove().

Referenced by createTemporaryItemCopy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTemporaryItemCopy()

static QString createTemporaryItemCopy ( QWindowsShellItem & qItem,
QString * errorMessage )
static

Definition at line 1373 of file qwindowsdialoghelpers.cpp.

References cleanupTemporaryItemCopies(), errorMessage(), qAddPostRoutine(), and tempFilePattern().

Referenced by itemToDialogUrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterSpecs()

static QList< FilterSpec > filterSpecs ( const QStringList & filters,
bool hideFilterDetails,
int * totalStringLength )
static

Definition at line 961 of file qwindowsdialoghelpers.cpp.

References FilterSpec::filter, filters, QString::mid(), Q_ASSERT, QStringLiteral, and QString::trimmed().

Referenced by QWindowsNativeFileDialogBase::setNameFilters().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileDialog2()

static IFileDialog2 * getFileDialog2 ( IFileDialog * fileDialog)
inlinestatic

Definition at line 1061 of file qwindowsdialoghelpers.cpp.

Referenced by QWindowsNativeFileDialogBase::setLabelText().

+ Here is the caller graph for this function:

◆ indexOfNameFilter()

static int indexOfNameFilter ( const QStringList & filters,
const QString & needle )
static

Definition at line 1130 of file qwindowsdialoghelpers.cpp.

References filters, and i.

Referenced by QWindowsNativeFileDialogBase::selectNameFilter().

+ Here is the caller graph for this function:

◆ isClsid()

static bool isClsid ( const QString & s)
inlinestatic

Definition at line 1103 of file qwindowsdialoghelpers.cpp.

References isHexRange().

Referenced by QWindowsNativeFileDialogBase::selectFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isHexRange()

static bool isHexRange ( const QString & s,
int start,
int end )
static

Definition at line 1091 of file qwindowsdialoghelpers.cpp.

References ch.

Referenced by isClsid().

+ Here is the caller graph for this function:

◆ itemToDialogUrl()

static QUrl itemToDialogUrl ( QWindowsShellItem & qItem,
QString * errorMessage )
static

Definition at line 1396 of file qwindowsdialoghelpers.cpp.

References createTemporaryItemCopy(), errorMessage(), QUrl::fromLocalFile(), QUrl::isLocalFile(), QUrl::isValid(), QUrl::scheme(), QString::startsWith(), url, and QUrl::url().

Referenced by QWindowsNativeOpenFileDialog::dialogResult().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator<<() [1/2]

QDebug operator<< ( QDebug d,
const QWindowsShellItem & i )

Definition at line 690 of file qwindowsdialoghelpers.cpp.

References d, and i.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug d,
IShellItem * i )

Definition at line 701 of file qwindowsdialoghelpers.cpp.

References d, QWindowsShellItem::format(), and i.

+ Here is the call graph for this function:

◆ qStringToWCharArray()

static wchar_t * qStringToWCharArray ( const QString & s,
size_t reserveSize = 0 )
static

Definition at line 47 of file qwindowsdialoghelpers.cpp.

◆ sHLoadLibraryFromItem()

static IShellLibrary * sHLoadLibraryFromItem ( IShellItem * libraryItem,
DWORD mode )
static

Definition at line 638 of file qwindowsdialoghelpers.cpp.

References IID.

◆ suffixFromFilter()

static QString suffixFromFilter ( const QString & filter)
inlinestatic

Definition at line 1255 of file qwindowsdialoghelpers.cpp.

Referenced by QWindowsNativeSaveFileDialog::setNameFilters().

+ Here is the caller graph for this function:

◆ tempFilePattern()

QString tempFilePattern ( QString name)

Definition at line 1352 of file qwindowsdialoghelpers.cpp.

References i, qMax(), QDir::tempPath(), and validFileNameCharacter().

+ Here is the call graph for this function:

◆ validFileNameCharacter()

static bool validFileNameCharacter ( QChar c)
static

Definition at line 1347 of file qwindowsdialoghelpers.cpp.

Referenced by tempFilePattern().

+ Here is the caller graph for this function:

◆ xpFileDialogGetExistingDirCallbackProc()

static int QT_WIN_CALLBACK xpFileDialogGetExistingDirCallbackProc ( HWND hwnd,
UINT uMsg,
LPARAM lParam,
LPARAM lpData )
static

Definition at line 1690 of file qwindowsdialoghelpers.cpp.

References dialog.