Windows: Fix inclusion of <windows.h>
- Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
9fa4e51dbb
commit
b44e67e1ca
@ -64,7 +64,6 @@
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define Q_FS_FAT
|
||||
#ifdef QT_LARGEFILE_SUPPORT
|
||||
|
@ -60,10 +60,6 @@
|
||||
#include <private/qobject_p.h>
|
||||
#include <qabstractanimation.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -85,8 +85,11 @@
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
# define QT_NO_SETLOCALE
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
# if defined(Q_OS_WINCE)
|
||||
# define QT_NO_SETLOCALE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -60,6 +60,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define NOMINMAX
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
|
@ -59,10 +59,11 @@
|
||||
#include <QtCore/qabstractfileengine.h>
|
||||
|
||||
// Platform-specific includes
|
||||
#if defined(Q_OS_WIN)
|
||||
#ifndef IO_REPARSE_TAG_SYMLINK
|
||||
#define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
# include <QtCore/qt_windows.h>
|
||||
# ifndef IO_REPARSE_TAG_SYMLINK
|
||||
# define IO_REPARSE_TAG_SYMLINK (0xA000000CL)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -52,8 +52,15 @@
|
||||
#include <qdir.h>
|
||||
#include <qtextstream.h>
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QWindowsFileSystemWatcherEngine::Handle::Handle()
|
||||
: handle(INVALID_HANDLE_VALUE), flags(0u)
|
||||
{
|
||||
}
|
||||
|
||||
QWindowsFileSystemWatcherEngine::~QWindowsFileSystemWatcherEngine()
|
||||
{
|
||||
foreach(QWindowsFileSystemWatcherEngineThread *thread, threads) {
|
||||
|
@ -57,8 +57,6 @@
|
||||
|
||||
#ifndef QT_NO_FILESYSTEMWATCHER
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
#include <QtCore/qdatetime.h>
|
||||
#include <QtCore/qthread.h>
|
||||
#include <QtCore/qfile.h>
|
||||
@ -90,15 +88,10 @@ public:
|
||||
class Handle
|
||||
{
|
||||
public:
|
||||
HANDLE handle;
|
||||
Qt::HANDLE handle;
|
||||
uint flags;
|
||||
|
||||
Handle()
|
||||
: handle(INVALID_HANDLE_VALUE), flags(0u)
|
||||
{ }
|
||||
Handle(const Handle &other)
|
||||
: handle(other.handle), flags(other.flags)
|
||||
{ }
|
||||
Handle();
|
||||
};
|
||||
|
||||
class PathInfo {
|
||||
@ -147,12 +140,12 @@ public:
|
||||
void wakeup();
|
||||
|
||||
QMutex mutex;
|
||||
QVector<HANDLE> handles;
|
||||
QVector<Qt::HANDLE> handles;
|
||||
int msg;
|
||||
|
||||
QHash<QString, QWindowsFileSystemWatcherEngine::Handle> handleForDir;
|
||||
|
||||
QHash<HANDLE, QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> > pathInfoForHandle;
|
||||
QHash<Qt::HANDLE, QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> > pathInfoForHandle;
|
||||
|
||||
Q_SIGNALS:
|
||||
void fileChanged(const QString &path, bool removed);
|
||||
|
@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PROCESS
|
||||
|
||||
#if (!defined(Q_OS_WIN32) && !defined(Q_OS_WINCE)) || defined(qdoc)
|
||||
#if !defined(Q_OS_WIN) || defined(qdoc)
|
||||
typedef qint64 Q_PID;
|
||||
#else
|
||||
QT_END_NAMESPACE
|
||||
|
@ -68,17 +68,17 @@
|
||||
#include "qcoreapplication.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN // for homedirpath reading from registry
|
||||
#include "qt_windows.h"
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_VXWORKS
|
||||
# include <ioLib.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef Q_OS_WIN // for homedirpath reading from registry
|
||||
# include <private/qsystemlibrary_p.h>
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef CSIDL_COMMON_APPDATA
|
||||
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
|
||||
#endif
|
||||
|
@ -64,10 +64,6 @@
|
||||
#endif
|
||||
#include "private/qscopedpointer_p.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "QtCore/qt_windows.h"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
|
||||
|
@ -46,8 +46,8 @@
|
||||
#include "qsettings_p.h"
|
||||
#include "qvector.h"
|
||||
#include "qmap.h"
|
||||
#include "qt_windows.h"
|
||||
#include "qdebug.h"
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -53,8 +53,8 @@
|
||||
|
||||
#include <stdlib.h> // mkdtemp
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#include <private/qfsfileengine_p.h>
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -56,10 +56,10 @@
|
||||
#include <qbytearray.h>
|
||||
#include <qobject.h>
|
||||
#include <qtimer.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
#include <private/qringbuffer_p.h>
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -42,13 +42,13 @@
|
||||
#include "qcoreapplication.h"
|
||||
#include "qcoreapplication_p.h"
|
||||
#include "qstringlist.h"
|
||||
#include "qt_windows.h"
|
||||
#include "qvector.h"
|
||||
#include "qmutex.h"
|
||||
#include "qfileinfo.h"
|
||||
#include "qcorecmdlineargs_p.h"
|
||||
#include <private/qthread_p.h>
|
||||
#include <ctype.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -58,13 +58,11 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
#include "QtCore/qvector.h"
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
# include "qt_windows.h"
|
||||
#endif
|
||||
# include "QtCore/qvector.h"
|
||||
# include <qt_windows.h>
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
|
||||
// template implementation of the parsing algorithm
|
||||
@ -132,7 +130,6 @@ static QVector<Char*> qWinCmdLine(Char *cmdParam, int length, int &argc)
|
||||
return argv;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
static inline QStringList qWinCmdArgs(QString cmdLine) // not const-ref: this might be modified
|
||||
{
|
||||
QStringList args;
|
||||
@ -153,7 +150,7 @@ static inline QStringList qCmdLineArgs(int argc, char *argv[])
|
||||
QString cmdLine = QString::fromWCharArray(GetCommandLine());
|
||||
return qWinCmdArgs(cmdLine);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else // !Q_OS_WIN
|
||||
|
||||
static inline QStringList qCmdLineArgs(int argc, char *argv[])
|
||||
|
@ -45,6 +45,9 @@
|
||||
#include <qdir.h>
|
||||
#include <qcryptographichash.h>
|
||||
#include <qdebug.h>
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -69,10 +69,8 @@ namespace QSharedMemoryPrivate
|
||||
#include "qsystemsemaphore.h"
|
||||
#include "private/qobject_p.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#else
|
||||
#include <sys/sem.h>
|
||||
#ifndef Q_OS_WIN
|
||||
# include <sys/sem.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -131,7 +129,7 @@ public:
|
||||
static QString makePlatformSafeKey(const QString &key,
|
||||
const QString &prefix = QLatin1String("qipc_sharedmemory_"));
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE handle();
|
||||
Qt::HANDLE handle();
|
||||
#else
|
||||
key_t handle();
|
||||
#endif
|
||||
@ -156,7 +154,7 @@ public:
|
||||
|
||||
private:
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE hand;
|
||||
Qt::HANDLE hand;
|
||||
#else
|
||||
key_t unix_key;
|
||||
#endif
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "qsharedmemory_p.h"
|
||||
#include "qsystemsemaphore.h"
|
||||
#include <qdebug.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
||||
# endif
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
||||
Qt::HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
||||
void setErrorString(const QString &function);
|
||||
#else
|
||||
key_t handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
|
||||
@ -89,8 +89,8 @@ public:
|
||||
QString fileName;
|
||||
int initialValue;
|
||||
#ifdef Q_OS_WIN
|
||||
HANDLE semaphore;
|
||||
HANDLE semaphoreLock;
|
||||
Qt::HANDLE semaphore;
|
||||
Qt::HANDLE semaphoreLock;
|
||||
#else
|
||||
int semaphore;
|
||||
bool createdFile;
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "qsystemsemaphore_p.h"
|
||||
#include "qcoreapplication.h"
|
||||
#include <qdebug.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -53,14 +53,14 @@
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include "QtCore/qt_windows.h"
|
||||
#endif
|
||||
#include "QtCore/qlibrary.h"
|
||||
#include "QtCore/qpointer.h"
|
||||
#include "QtCore/qstringlist.h"
|
||||
#include "QtCore/qplugin.h"
|
||||
#include "QtCore/qsharedpointer.h"
|
||||
#ifdef Q_OS_WIN
|
||||
# include "QtCore/qt_windows.h"
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_LIBRARY
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
#pragma message("QT_NO_LIBRARY is not supported on Windows")
|
||||
#endif
|
||||
|
||||
#include "qt_windows.h"
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -44,8 +44,8 @@
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#include <QtCore/qstring.h>
|
||||
# include <QtCore/qstring.h>
|
||||
# include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -118,8 +118,8 @@ public:
|
||||
bool wakeup;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
#elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
HANDLE event;
|
||||
#elif defined(Q_OS_WIN)
|
||||
Qt::HANDLE event;
|
||||
#endif
|
||||
};
|
||||
#endif //Q_OS_LINUX
|
||||
|
@ -39,11 +39,10 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <qt_windows.h>
|
||||
|
||||
#include "qmutex.h"
|
||||
#include <qatomic.h>
|
||||
#include "qmutex_p.h"
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -52,24 +52,6 @@
|
||||
#include "qthread_p.h"
|
||||
#include "private/qcoreapplication_p.h"
|
||||
|
||||
/*
|
||||
#ifdef Q_OS_WIN32
|
||||
# include "qt_windows.h"
|
||||
#else
|
||||
# include <unistd.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sys/utsname.h>
|
||||
# include <sys/socket.h>
|
||||
*/
|
||||
/*
|
||||
# elif defined(Q_OS_HPUX)
|
||||
# include <sys/pstat.h>
|
||||
# elif defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_MAC)
|
||||
# include <sys/sysctl.h>
|
||||
# endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*
|
||||
|
@ -167,16 +167,13 @@ public:
|
||||
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
HANDLE handle;
|
||||
unsigned int id;
|
||||
int waiters;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
static unsigned int __stdcall start(void *);
|
||||
static void finish(void *, bool lockAnyway=true);
|
||||
#endif // Q_OS_WIN32
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
Qt::HANDLE handle;
|
||||
unsigned int id;
|
||||
int waiters;
|
||||
bool terminationEnabled, terminatePending;
|
||||
# endif
|
||||
QThreadData *data;
|
||||
|
@ -45,13 +45,13 @@
|
||||
#include "qreadwritelock.h"
|
||||
#include "qlist.h"
|
||||
#include "qalgorithms.h"
|
||||
#include "qt_windows.h"
|
||||
|
||||
#ifndef QT_NO_THREAD
|
||||
|
||||
#define Q_MUTEX_T void*
|
||||
#include <private/qmutex_p.h>
|
||||
#include <private/qreadwritelock_p.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -48,16 +48,16 @@
|
||||
#include "qdatetime.h"
|
||||
#include "qregexp.h"
|
||||
#include "qdebug.h"
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
#ifndef Q_OS_WIN
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#if defined(Q_OS_WINCE)
|
||||
#include "qfunctions_wince.h"
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
# ifdef Q_OS_WINCE
|
||||
# include "qfunctions_wince.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//#define QDATETIMEPARSER_DEBUG
|
||||
|
@ -40,7 +40,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qelapsedtimer.h"
|
||||
#include <windows.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void);
|
||||
static PtrGetTickCount64 ptrGetTickCount64 = 0;
|
||||
|
@ -67,12 +67,12 @@ QT_END_NAMESPACE
|
||||
#include "qstringlist.h"
|
||||
#include "qvariant.h"
|
||||
#include "qstringbuilder.h"
|
||||
#if defined(Q_OS_WIN)
|
||||
# include "qt_windows.h"
|
||||
# include <time.h>
|
||||
#endif
|
||||
#include "private/qnumeric_p.h"
|
||||
#include "private/qsystemlibrary_p.h"
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -50,8 +50,8 @@
|
||||
|
||||
#include "qdebug.h"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# include "qt_windows.h"
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
# include <time.h>
|
||||
#endif
|
||||
|
||||
|
@ -43,15 +43,14 @@
|
||||
#include <QByteArray>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN64) && !defined(Q_CC_GNU)
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX) && defined(__arm__)
|
||||
#if defined(Q_OS_WIN)
|
||||
# if defined(Q_OS_WINCE)
|
||||
# include <qt_windows.h>
|
||||
# endif
|
||||
# if defined(Q_OS_WIN64) && !defined(Q_CC_GNU)
|
||||
# include <intrin.h>
|
||||
# endif
|
||||
#elif defined(Q_OS_LINUX) && defined(__arm__)
|
||||
#include "private/qcore_unix_p.h"
|
||||
|
||||
// the kernel header definitions for HWCAP_*
|
||||
|
@ -71,9 +71,6 @@ QT_BEGIN_HEADER
|
||||
# include <emmintrin.h>
|
||||
# undef posix_memalign
|
||||
#else
|
||||
# ifdef Q_CC_MINGW
|
||||
# include <windows.h>
|
||||
# endif
|
||||
# include <emmintrin.h>
|
||||
#endif
|
||||
|
||||
|
@ -64,24 +64,26 @@
|
||||
|
||||
#include <private/qfunctions_p.h>
|
||||
|
||||
#if defined(Q_OS_WINCE)
|
||||
#include <windows.h>
|
||||
#include <winnls.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef truncate
|
||||
#undef truncate
|
||||
#endif
|
||||
|
||||
#include "qchar.cpp"
|
||||
#include "qstringmatcher.cpp"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
# ifdef Q_OS_WINCE
|
||||
# include <winnls.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef truncate
|
||||
# undef truncate
|
||||
#endif
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
#define LLONG_MAX qint64_C(9223372036854775807)
|
||||
#endif
|
||||
@ -4710,12 +4712,6 @@ int QString::localeAwareCompare(const QString &other) const
|
||||
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
|
||||
QT_END_NAMESPACE
|
||||
#include "qt_windows.h"
|
||||
QT_BEGIN_NAMESPACE
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\since 4.5
|
||||
|
@ -44,8 +44,8 @@
|
||||
#include "qpixmap_raster_p.h"
|
||||
|
||||
#include <qglobal.h>
|
||||
#include <qt_windows.h>
|
||||
#include <QScopedArrayPointer>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -71,17 +71,17 @@
|
||||
// #include "qbezier_p.h"
|
||||
#include "qoutlinemapper_p.h"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# include <qt_windows.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qvarlengtharray.h>
|
||||
# include <private/qfontengine_p.h>
|
||||
# include <qt_windows.h>
|
||||
#ifdef Q_OS_WIN64
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WIN64)
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
|
||||
|
@ -552,11 +552,6 @@ public:
|
||||
struct ApplicationFont {
|
||||
QString fileName;
|
||||
QByteArray data;
|
||||
#if defined(Q_OS_WIN)
|
||||
HANDLE handle;
|
||||
bool memoryFont;
|
||||
QVector<FONTSIGNATURE> signatures;
|
||||
#endif
|
||||
QStringList families;
|
||||
};
|
||||
QVector<ApplicationFont> applicationFonts;
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <private/qmutexpool_p.h>
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <qt_windows.h>
|
||||
#include <windns.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -47,11 +47,11 @@
|
||||
#include <qstringlist.h>
|
||||
#include <qregexp.h>
|
||||
#include <qurl.h>
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <qt_windows.h>
|
||||
#include <wininet.h>
|
||||
#include <private/qsystemlibrary_p.h>
|
||||
|
||||
/*
|
||||
* Information on the WinHTTP DLL:
|
||||
|
@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
|
||||
typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
|
||||
typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
|
||||
#elif defined(Q_OS_WIN)
|
||||
#include <windows.h>
|
||||
#include <QtCore/qt_windows.h>
|
||||
#include <wincrypt.h>
|
||||
#ifndef HCRYPTPROV_LEGACY
|
||||
#define HCRYPTPROV_LEGACY HCRYPTPROV
|
||||
|
@ -55,12 +55,11 @@
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include "qt_windows.h"
|
||||
|
||||
#include <QtGui/qpaintengine.h>
|
||||
#include <QtPrintSupport/QPrintEngine>
|
||||
#include <QtPrintSupport/QPrinter>
|
||||
#include <private/qpaintengine_alpha_p.h>
|
||||
#include <QtCore/qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -45,6 +45,7 @@
|
||||
|
||||
#ifndef QT_NO_FILEDIALOG
|
||||
#include "qfiledialog_p.h"
|
||||
#include "qplatformdialoghelper_qpa.h"
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qaction.h>
|
||||
@ -67,11 +68,12 @@
|
||||
#if defined(Q_OS_WINCE)
|
||||
extern bool qt_priv_ptr_valid;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(Q_OS_UNIX)
|
||||
#include <pwd.h>
|
||||
#elif defined(Q_OS_WIN)
|
||||
# include <QtCore/qt_windows.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "qplatformdialoghelper_qpa.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -1386,6 +1388,25 @@ QLineEdit *QFileDialogPrivate::lineEdit() const {
|
||||
return (QLineEdit*)qFileDialogUi->fileNameEdit;
|
||||
}
|
||||
|
||||
int QFileDialogPrivate::maxNameLength(const QString &path)
|
||||
{
|
||||
#if defined(Q_OS_UNIX)
|
||||
return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
|
||||
#elif defined(Q_OS_WINCE)
|
||||
Q_UNUSED(path);
|
||||
return MAX_PATH;
|
||||
#elif defined(Q_OS_WIN)
|
||||
DWORD maxLength;
|
||||
const QString drive = path.left(3);
|
||||
if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
|
||||
return -1;
|
||||
return maxLength;
|
||||
#else
|
||||
Q_UNUSED(path);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
Sets the view root index to be the file system model index
|
||||
*/
|
||||
|
@ -143,25 +143,7 @@ public:
|
||||
|
||||
QLineEdit *lineEdit() const;
|
||||
|
||||
int maxNameLength(const QString &path) {
|
||||
#if defined(Q_OS_UNIX)
|
||||
return ::pathconf(QFile::encodeName(path).data(), _PC_NAME_MAX);
|
||||
#elif defined(Q_OS_WIN)
|
||||
#ifndef Q_OS_WINCE
|
||||
DWORD maxLength;
|
||||
QString drive = path.left(3);
|
||||
if (::GetVolumeInformation(reinterpret_cast<const wchar_t *>(drive.utf16()), NULL, 0, NULL, &maxLength, NULL, NULL, 0) == FALSE)
|
||||
return -1;
|
||||
return maxLength;
|
||||
#else
|
||||
Q_UNUSED(path);
|
||||
return MAX_PATH;
|
||||
#endif //Q_OS_WINCE
|
||||
#else
|
||||
Q_UNUSED(path);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
static int maxNameLength(const QString &path);
|
||||
|
||||
QString basename(const QString &path) const
|
||||
{
|
||||
|
@ -49,10 +49,8 @@
|
||||
#include <qapplication.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
#ifdef Q_OS_WIN32
|
||||
#include <QtCore/QVarLengthArray>
|
||||
# include <QtCore/QVarLengthArray>
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -56,12 +56,12 @@
|
||||
#ifndef QT_NO_WIZARD
|
||||
#ifndef QT_NO_STYLE_WINDOWSVISTA
|
||||
|
||||
#include <qt_windows.h>
|
||||
#include <qobject.h>
|
||||
#include <qwidget.h>
|
||||
#include <qabstractbutton.h>
|
||||
#include <QtWidgets/private/qwidget_p.h>
|
||||
#include <QtWidgets/private/qstylehelper_p.h>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -46,6 +46,9 @@
|
||||
#include <qapplication.h>
|
||||
#include <qdir.h>
|
||||
#include <qpixmapcache.h>
|
||||
#include <private/qfunctions_p.h>
|
||||
#include <private/qguiplatformplugin_p.h>
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# define _WIN32_IE 0x0500
|
||||
# include <qt_windows.h>
|
||||
@ -56,9 +59,6 @@
|
||||
# include <private/qt_cocoa_helpers_mac_p.h>
|
||||
#endif
|
||||
|
||||
#include <private/qfunctions_p.h>
|
||||
#include <private/qguiplatformplugin_p.h>
|
||||
|
||||
#if defined(Q_WS_X11) && !defined(Q_NO_STYLE_GTK)
|
||||
# include <private/qgtkstyle_p.h>
|
||||
# include <private/qt_x11_p.h>
|
||||
|
@ -64,6 +64,10 @@
|
||||
#include "qdesktopwidget_qpa_p.h"
|
||||
#include "qwidgetwindow_qpa_p.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <QtCore/qt_windows.h> // for qt_win_display_dc()
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static QString appName;
|
||||
@ -398,6 +402,7 @@ void qt_init(QApplicationPrivate *priv, int type)
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// #fixme: Remove.
|
||||
static HDC displayDC = 0; // display device context
|
||||
|
||||
Q_WIDGETS_EXPORT HDC qt_win_display_dc() // get display DC
|
||||
|
@ -60,9 +60,6 @@
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
# include "qaccessible.h"
|
||||
#endif
|
||||
#if defined(Q_WS_WIN)
|
||||
# include "qt_windows.h"
|
||||
#endif
|
||||
#ifdef Q_WS_MAC
|
||||
# include "qt_mac_p.h"
|
||||
# include "qt_cocoa_helpers_mac_p.h"
|
||||
|
@ -64,9 +64,9 @@
|
||||
#include <private/qt_mac_p.h>
|
||||
#include <private/qt_cocoa_helpers_mac_p.h>
|
||||
#endif
|
||||
#ifdef Q_WS_WIN
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qlibrary.h>
|
||||
# include <windows.h>
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -52,12 +52,6 @@
|
||||
#include "qdebug.h"
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#if defined(Q_WS_X11)
|
||||
#include <private/qt_x11_p.h>
|
||||
#elif defined (Q_OS_WIN)
|
||||
# include <QtCore/qt_windows.h>
|
||||
# include "private/qapplication_p.h"
|
||||
#endif
|
||||
#ifdef Q_WS_MAC
|
||||
#include <private/qt_mac_p.h>
|
||||
#endif
|
||||
@ -65,6 +59,11 @@
|
||||
#include <private/qwidget_p.h>
|
||||
#include <QtWidgets/qabstractscrollarea.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <QtCore/qt_windows.h>
|
||||
# include "private/qapplication_p.h"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if defined (Q_OS_WIN)
|
||||
|
@ -48,9 +48,6 @@
|
||||
#include "qcursor.h"
|
||||
#include "qsizegrip.h"
|
||||
#include "qevent.h"
|
||||
#if defined(Q_WS_WIN)
|
||||
#include "qt_windows.h"
|
||||
#endif
|
||||
#include "qdebug.h"
|
||||
#include "private/qlayoutengine_p.h"
|
||||
|
||||
|
@ -48,6 +48,9 @@
|
||||
#include <qhash.h>
|
||||
#include <qbytearray.h>
|
||||
#include <qdatastream.h>
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
class tst_QHostAddress : public QObject
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user