diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qendian.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/global/qfeatures.txt | 7 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 469 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 228 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 28 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 53 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 24 | ||||
-rw-r--r-- | src/corelib/global/qt_windows.h | 7 |
8 files changed, 689 insertions, 129 deletions
diff --git a/src/corelib/global/qendian.qdoc b/src/corelib/global/qendian.qdoc index e0ef662..949f7b8 100644 --- a/src/corelib/global/qendian.qdoc +++ b/src/corelib/global/qendian.qdoc @@ -42,7 +42,7 @@ /*! \headerfile <QtEndian> \title Endian Conversion Functions - \ingroup classlists + \ingroup funclists \brief The <QtEndian> header provides functions to convert between little and big endian representations of numbers. */ diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 9408a5b..3a6c050 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1143,13 +1143,6 @@ Requires: UNDOSTACK LISTVIEW Name: QUndoView SeeAlso: ??? -Feature: SCRIPT -Description: Provides support for the QtScript module -Section: Utilities -Requires: TEXTDATE DATESTRING PROPERTIES -Name: QtScript -SeeAlso: ??? - Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 81a5ae5..d7ae78f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -44,6 +44,8 @@ #include "qvector.h" #include "qlist.h" #include "qthreadstorage.h" +#include "qdir.h" +#include "qstringlist.h" #ifndef QT_NO_QOBJECT #include <private/qthread_p.h> @@ -66,10 +68,15 @@ # include <envLib.h> #endif -#ifdef Q_CC_MWERKS +#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX) #include <CoreServices/CoreServices.h> #endif +#if defined(Q_OS_SYMBIAN) +#include <e32def.h> +#include <e32debug.h> +#endif + QT_BEGIN_NAMESPACE @@ -401,13 +408,13 @@ QT_BEGIN_NAMESPACE /*! \headerfile <QtGlobal> \title Global Qt Declarations - \ingroup classlists + \ingroup funclists - \brief The <QtGlobal> header provides basic declarations and - is included by all other Qt headers. + \brief The <QtGlobal> header file includes the fundamental global + declarations. It is included by most other Qt header files. - The declarations include \l {types}, \l functions and - \l macros. + The global declarations include \l{types}, \l{functions} and + \l{macros}. The type definitions are partly convenience definitions for basic types (some of which guarantee certain bit-sizes on all platforms @@ -1053,6 +1060,20 @@ bool qSharedBuild() */ /*! + \fn QSysInfo::SymbianVersion QSysInfo::symbianVersion() + + Returns the version of the Symbian operating system on which the + application is run (Symbian only). +*/ + +/*! + \fn QSysInfo::S60Version QSysInfo::s60Version() + + Returns the version of the S60 SDK system on which the + application is run (S60 only). +*/ + +/*! \enum QSysInfo::Endian \value BigEndian Big-endian byte order (also called Network byte order) @@ -1108,7 +1129,7 @@ bool qSharedBuild() \value WV_NT_based NT-based version of Windows \value WV_CE_based CE-based version of Windows - \sa MacVersion + \sa MacVersion, SymbianVersion */ /*! @@ -1137,7 +1158,39 @@ bool qSharedBuild() \value MV_LEOPARD Apple codename for MV_10_5 \value MV_SNOWLEOPARD Apple codename for MV_10_6 - \sa WinVersion + \sa WinVersion, SymbianVersion +*/ + +/*! + \enum QSysInfo::SymbianVersion + + This enum provides symbolic names for the various versions of the + Symbian operating system. On Symbian, the + QSysInfo::symbianVersion() function gives the version of the + system on which the application is run. + + \value SV_9_2 Symbian OS v9.2 + \value SV_9_3 Symbian OS v9.3 + \value SV_9_4 Symbian OS v9.4 + \value SV_Unknown An unknown and currently unsupported platform + + \sa S60Version, WinVersion, MacVersion +*/ + +/*! + \enum QSysInfo::S60Version + + This enum provides symbolic names for the various versions of the + S60 SDK. On S60, the + QSysInfo::s60Version() function gives the version of the + SDK on which the application is run. + + \value SV_S60_3_1 S60 3rd Edition Feature Pack 1 + \value SV_S60_3_2 S60 3rd Edition Feature Pack 2 + \value SV_S60_5_0 S60 5th Edition + \value SV_S60_Unknown An unknown and currently unsupported platform + + \sa SymbianVersion, WinVersion, MacVersion */ /*! @@ -1704,6 +1757,87 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() #endif +#ifdef Q_OS_SYMBIAN +# ifdef Q_WS_S60 +static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1); + +QSysInfo::S60Version QSysInfo::s60Version() +{ +# ifdef Q_CC_NOKIAX86 + // For emulator builds. Emulators don't support the trick we use to figure + // out which SDK we are running under, so simply hardcode it there. +# if defined(__SERIES60_31__) + return SV_S60_3_1; + +# elif defined(__S60_32__) + return SV_S60_3_2; + +# elif defined(__S60_50__) + return SV_S60_5_0; + +# else + return SV_S60_Unknown; + +# endif + +# else + // For hardware builds. + if (cachedS60Version != -1) + return cachedS60Version; + + QDir dir(QLatin1String("z:\\system\\install")); + QStringList filters; + filters << QLatin1String("Series60v?.*.sis"); + dir.setNameFilters(filters); + + QStringList names = dir.entryList(QDir::NoFilter, QDir::Name | QDir::Reversed | QDir::IgnoreCase); + if (names.size() == 0) + return cachedS60Version = SV_S60_Unknown; + + int major, minor; + major = names[0][9].toAscii() - '0'; + minor = names[0][11].toAscii() - '0'; + if (major == 3) { + if (minor == 1) { + return cachedS60Version = SV_S60_3_1; + } else if (minor == 2) { + return cachedS60Version = SV_S60_3_2; + } + } else if (major == 5) { + if (minor == 0) { + return cachedS60Version = SV_S60_5_0; + } + } + + return cachedS60Version = SV_S60_Unknown; +# endif +} +QSysInfo::SymbianVersion QSysInfo::symbianVersion() +{ + switch (s60Version()) { + case SV_S60_3_1: + return SV_9_2; + case SV_S60_3_2: + return SV_9_3; + case SV_S60_5_0: + return SV_9_4; + default: + return SV_Unknown; + } +} +#else +QSysInfo::S60Version QSysInfo::s60Version() +{ + return SV_S60_None; +} + +QSysInfo::SymbianVersion QSysInfo::symbianVersion() +{ + return SV_Unknown; +} +# endif // ifdef Q_WS_S60 +#endif // ifdef Q_OS_SYMBIAN + /*! \macro void Q_ASSERT(bool test) \relates <QtGlobal> @@ -1769,6 +1903,15 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() */ /*! + T *q_check_ptr(T *pointer) + \relates <QtGlobal> + + Users Q_CHECK_PTR on \a pointer, then returns \a pointer. + + This can be used as an inline version of Q_CHECK_PTR. +*/ + +/*! \macro const char* Q_FUNC_INFO() \relates <QtGlobal> @@ -1796,6 +1939,17 @@ void qt_check_pointer(const char *n, int l) qWarning("In file %s, line %d: Out of memory", n, l); } +#ifndef QT_NO_EXCEPTIONS +/* \internal + Allows you to throw an exception without including <new> + Called internally from Q_CHECK_PTR on certain OS combinations +*/ +void qBadAlloc() +{ + QT_THROW(std::bad_alloc()); +} +#endif + /* The Q_ASSERT macro calls this function when the test fails. */ @@ -1853,7 +2007,7 @@ void *qMemSet(void *dest, int c, size_t n) { return memset(dest, c, n); } static QtMsgHandler handler = 0; // pointer to debug handler -#ifdef Q_CC_MWERKS +#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX) extern bool qt_is_gui_used; static void mac_default_handler(const char *msg) { @@ -1865,7 +2019,7 @@ static void mac_default_handler(const char *msg) fprintf(stderr, msg); } } -#endif // Q_CC_MWERKS +#endif // Q_CC_MWERKS && Q_OS_MACX @@ -1941,8 +2095,8 @@ QString qt_error_string(int errorCode) warnings, critical and fatal error messages. The Qt library (debug mode) contains hundreds of warning messages that are printed when internal errors (usually invalid function arguments) - occur. Qt built in release mode also contains such warnings unless - QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during + occur. Qt built in release mode also contains such warnings unless + QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during compilation. If you implement your own message handler, you get total control of these messages. @@ -1986,12 +2140,23 @@ void qt_message_output(QtMsgType msgType, const char *buf) if (handler) { (*handler)(msgType, buf); } else { -#if defined(Q_CC_MWERKS) +#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX) mac_default_handler(buf); #elif defined(Q_OS_WINCE) QString fstr = QString::fromLatin1(buf); fstr += QLatin1Char('\n'); OutputDebugString(reinterpret_cast<const wchar_t *> (fstr.utf16())); +#elif defined(Q_OS_SYMBIAN) + // RDebug::Print has a cap of 256 characters so break it up + _LIT(format, "[Qt Message] %S"); + const int maxBlockSize = 256 - ((const TDesC &)format).Length(); + const TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf)); + HBufC* hbuffer = q_check_ptr(HBufC::New(qMin(maxBlockSize, ptr.Length()))); + for (int i = 0; i < ptr.Length(); i += hbuffer->Length()) { + hbuffer->Des().Copy(ptr.Mid(i, qMin(maxBlockSize, ptr.Length()-i))); + RDebug::Print(format, hbuffer); + } + delete hbuffer; #else fprintf(stderr, "%s\n", buf); fflush(stderr); @@ -2018,7 +2183,15 @@ void qt_message_output(QtMsgType msgType, const char *buf) _CrtDbgBreak(); #endif -#if (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) +#if defined(Q_OS_SYMBIAN) + __DEBUGGER(); // on the emulator, get the debugger to kick in if there's one around + TBuf<256> tmp; + TPtrC8 ptr(reinterpret_cast<const TUint8*>(buf)); + TInt len = Min(tmp.MaxLength(), ptr.Length()); + tmp.Copy(ptr.Left(len)); + // Panic the current thread. We don't use real panic codes, so 0 has no special meaning. + User::Panic(tmp, 0); +#elif (defined(Q_OS_UNIX) || defined(Q_CC_MINGW)) abort(); // trap; generates core dump #else exit(1); // goodbye cruel world @@ -2026,6 +2199,48 @@ void qt_message_output(QtMsgType msgType, const char *buf) } } +#if !defined(QT_NO_EXCEPTIONS) +/*! + \internal + Uses a local buffer to output the message. Not locale safe + cuts off + everything after character 255, but will work in out of memory situations. +*/ +static void qEmergencyOut(QtMsgType msgType, const char *msg, va_list ap) +{ + char emergency_buf[256] = { '\0' }; + emergency_buf[255] = '\0'; + if (msg) + qvsnprintf(emergency_buf, 255, msg, ap); + qt_message_output(msgType, emergency_buf); +} +#endif + +/*! + \internal +*/ +static void qt_message(QtMsgType msgType, const char *msg, va_list ap) +{ +#if !defined(QT_NO_EXCEPTIONS) + if (std::uncaught_exception()) { + qEmergencyOut(msgType, msg, ap); + return; + } +#endif + QByteArray buf; + if (msg) { + QT_TRY { + buf = QString().vsprintf(msg, ap).toLocal8Bit(); + } QT_CATCH(const std::bad_alloc &) { +#if !defined(QT_NO_EXCEPTIONS) + qEmergencyOut(msgType, msg, ap); + // don't rethrow - we use qWarning and friends in destructors. + return; +#endif + } + } + qt_message_output(msgType, buf.constData()); +} + #undef qDebug /*! \relates <QtGlobal> @@ -2063,14 +2278,10 @@ void qt_message_output(QtMsgType msgType, const char *buf) */ void qDebug(const char *msg, ...) { - QString buf; va_list ap; - va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + va_start(ap, msg); // use variable arg list + qt_message(QtDebugMsg, msg, ap); va_end(ap); - - qt_message_output(QtDebugMsg, buf.toLocal8Bit().constData()); } #undef qWarning @@ -2107,14 +2318,10 @@ void qDebug(const char *msg, ...) */ void qWarning(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtWarningMsg, msg, ap); va_end(ap); - - qt_message_output(QtWarningMsg, buf.toLocal8Bit().constData()); } /*! @@ -2147,15 +2354,12 @@ void qWarning(const char *msg, ...) */ void qCritical(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtCriticalMsg, msg, ap); va_end(ap); - - qt_message_output(QtCriticalMsg, buf.toLocal8Bit().constData()); } + #ifdef QT3_SUPPORT void qSystemWarning(const char *msg, int code) { qCritical("%s (%s)", msg, qt_error_string(code).toLocal8Bit().constData()); } @@ -2163,6 +2367,8 @@ void qSystemWarning(const char *msg, int code) void qErrnoWarning(const char *msg, ...) { + // qt_error_string() will allocate anyway, so we don't have + // to be careful here (like we do in plain qWarning()) QString buf; va_list ap; va_start(ap, msg); @@ -2175,6 +2381,8 @@ void qErrnoWarning(const char *msg, ...) void qErrnoWarning(int code, const char *msg, ...) { + // qt_error_string() will allocate anyway, so we don't have + // to be careful here (like we do in plain qWarning()) QString buf; va_list ap; va_start(ap, msg); @@ -2211,14 +2419,10 @@ void qErrnoWarning(int code, const char *msg, ...) */ void qFatal(const char *msg, ...) { - QString buf; va_list ap; va_start(ap, msg); // use variable arg list - if (msg) - buf.vsprintf(msg, ap); + qt_message(QtFatalMsg, msg, ap); va_end(ap); - - qt_message_output(QtFatalMsg, buf.toLocal8Bit().constData()); } // getenv is declared as deprecated in VS2005. This function @@ -2250,11 +2454,15 @@ bool qputenv(const char *varName, const QByteArray& value) QByteArray buffer(varName); buffer += '='; buffer += value; - return putenv(qstrdup(buffer.constData())) == 0; + char* envVar = qstrdup(buffer.constData()); + int result = putenv(envVar); + if (result != 0) // error. we have to delete the string. + delete[] envVar; + return result == 0; #endif } -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) +#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) # if defined(Q_OS_INTEGRITY) && defined(__GHS_VERSION_NUMBER) && (__GHS_VERSION_NUMBER < 500) // older versions of INTEGRITY used a long instead of a uint for the seed. @@ -2287,7 +2495,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value */ void qsrand(uint seed) { -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) +#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) SeedStorageType *pseed = randTLS()->localData(); if (!pseed) randTLS()->setLocalData(pseed = new SeedStorageType); @@ -2316,7 +2524,7 @@ void qsrand(uint seed) */ int qrand() { -#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) +#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) SeedStorageType *pseed = randTLS()->localData(); if (!pseed) { randTLS()->setLocalData(pseed = new SeedStorageType); @@ -3006,7 +3214,7 @@ bool QInternal::callFunction(InternalFunction func, void **args) Compares the floating point value \a p1 and \a p2 and returns \c true if they are considered equal, otherwise \c false. - Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. + Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. The solution to this is to compare against values greater than or equal to 1.0. \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 @@ -3067,4 +3275,185 @@ bool QInternal::callFunction(InternalFunction func, void **args) \sa Q_DECL_EXPORT */ +#if defined(Q_OS_SYMBIAN) + +#include <typeinfo> + +/*! \macro QT_TRAP_THROWING(function) + \relates <QtGlobal> + \ingroup qts60 + + TRAP leaves from Symbian \a function and throws an appropriate + standard C++ exception instead. + This must be used when calling Symbian OS leaving functions + from inside Qt or standard C++ code, so that the code can respond + correctly to the exception. + + \warning This macro is only available on Symbian. + + Example: + + \code + // A Symbian leaving function is being called within a Qt function. + // Any leave must be converted to an exception + CAknTitlePane* titlePane = S60->titlePane(); + if (titlePane) { + TPtrC captionPtr(qt_QString2TPtrC(caption)); + QT_TRAP_THROWING(titlePane->SetTextL(captionPtr)); + } + \endcode + + \sa QT_TRYCATCH_ERROR(), QT_TRYCATCH_LEAVING() +*/ + +/*! \macro QT_TRYCATCH_ERROR(error, function) + \relates <QtGlobal> + \ingroup qts60 + + Catch standard C++ exceptions from a \a function and convert them to a Symbian OS + \a error code, or \c KErrNone if there is no exception. + This must be used inside Qt or standard C++ code when using exception throwing + code (practically anything) and returning an error code to Symbian OS. + + \warning This macro is only available on Symbian. + + Example: + + \code + // An exception might be thrown in this Symbian TInt error returning function. + // It is caught and translated to an error code + TInt QServerApp::Connect(const QString &serverName) + { + TPtrC name; + TInt err; + QT_TRYCATCH_ERROR(err, name.Set(qt_QString2TPtrC(serverName))); + if (err != KErrNone) + return err; + return iServer.Connect(name); + } + \endcode +} + + \sa QT_TRYCATCH_LEAVING(), QT_TRAP_THROWING() +*/ + +/*! \macro QT_TRYCATCH_LEAVING(function) + \relates <QtGlobal> + \ingroup qts60 + + Catch standard C++ exceptions from \a function and convert them to Symbian OS + leaves. This must be used inside Qt or standard C++ code when using exception + throwing code (practically anything) and returning to Symbian OS from a leaving function. + For example inside a Symbian active object's \c RunL function implemented with Qt code. + + \warning This macro is only available on Symbian. + + Example: + + \code + // This active object signals Qt code + // Exceptions from the Qt code must be converted to Symbian OS leaves for the active scheduler + void QWakeUpActiveObject::RunL() + { + iStatus = KRequestPending; + SetActive(); + QT_TRYCATCH_LEAVING(m_dispatcher->wakeUpWasCalled()); + } + \endcode + + \sa QT_TRAP_THROWING(), QT_TRYCATCH_ERROR() +*/ + +#include <stdexcept> + +class QSymbianLeaveException : public std::exception +{ +public: + inline QSymbianLeaveException(int err) : error(err) {} + inline const char* what() const throw() { return "Symbian leave exception"; } + +public: + int error; +}; + +/*! \relates <QtGlobal> + \ingroup qts60 + + Throws an exception if the \a error parameter is a symbian error code. + This is the exception throwing equivalent of Symbian's User::LeaveIfError. + + \warning This function is only available on Symbian. + + \sa qt_symbian_exception2LeaveL(), qt_symbian_exception2Error() +*/ +void qt_symbian_throwIfError(int error) +{ + if (error >= KErrNone) + return; // do nothing - not an exception + switch (error) { + case KErrNoMemory: + throw std::bad_alloc(); + case KErrArgument: + throw std::invalid_argument("from Symbian error"); + case KErrOverflow: + throw std::overflow_error("from Symbian error"); + case KErrUnderflow: + throw std::underflow_error("from Symbian error"); + default: + throw QSymbianLeaveException(error); + } +} + +/*! \relates <QtGlobal> + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian leave + + \warning This function is only available on Symbian. + + \sa qt_symbian_throwIfError(), qt_symbian_exception2Error() +*/ +void qt_symbian_exception2LeaveL(const std::exception& aThrow) +{ + User::Leave(qt_symbian_exception2Error(aThrow)); +} + +/*! \relates <QtGlobal> + \ingroup qts60 + + Convert a caught standard C++ exception \a aThrow to a Symbian error code + + \warning This function is only available on Symbian. + + \sa qt_symbian_throwIfError(), qt_symbian_exception2LeaveL() +*/ +int qt_symbian_exception2Error(const std::exception& aThrow) +{ + const std::type_info& atype = typeid(aThrow); + int err = KErrGeneral; + + if(atype == typeid (std::bad_alloc)) + err = KErrNoMemory; + else if(atype == typeid(QSymbianLeaveException)) + err = static_cast<const QSymbianLeaveException&>(aThrow).error; + else { + if(atype == typeid(std::invalid_argument)) + err = KErrArgument; + else if(atype == typeid(std::out_of_range)) + // std::out_of_range is of type logic_error which by definition means that it is + // "presumably detectable before the program executes". + // std::out_of_range is used to report an argument is not within the expected range. + // The description of KErrArgument says an argument is out of range. Hence the mapping. + err = KErrArgument; + else if(atype == typeid(std::overflow_error)) + err = KErrOverflow; + else if(atype == typeid(std::underflow_error)) + err = KErrUnderflow; + qWarning("translation from std exception \"%s\" to %d", aThrow.what(), err); + } + + return err; +} +#endif + QT_END_NAMESPACE diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index d85d0db..87f5cb2 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -110,7 +110,7 @@ namespace QT_NAMESPACE {} This expands to a "using QT_NAMESPACE" also in _header files_. It is the only way the feature can be used without too much pain, but if people _really_ do not want it they can add - DEFINES += QT_NO_USING_NAMESPACE to theur .pro files. + DEFINES += QT_NO_USING_NAMESPACE to their .pro files. */ QT_USE_NAMESPACE # endif @@ -144,6 +144,7 @@ namespace QT_NAMESPACE {} The operating system, must be one of: (Q_OS_x) DARWIN - Darwin OS (synonym for Q_OS_MAC) + SYMBIAN - Symbian MSDOS - MS-DOS and Windows OS2 - OS/2 OS2EMX - XFree86 on OS/2 (not PM) @@ -182,6 +183,10 @@ namespace QT_NAMESPACE {} # else # define Q_OS_DARWIN32 # endif +#elif defined(__SYMBIAN32__) || defined(SYMBIAN) +# define Q_OS_SYMBIAN +# define Q_NO_POSIX_SIGNALS +# define QT_NO_GETIFADDRS #elif defined(__CYGWIN__) # define Q_OS_CYGWIN #elif defined(MSDOS) || defined(_MSDOS) @@ -260,6 +265,15 @@ namespace QT_NAMESPACE {} # define Q_OS_WIN #endif +#if defined(Q_OS_WIN32) +# ifndef WINVER +# define WINVER 0x0500 +# endif +# ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0500 +# endif +#endif + #if defined(Q_OS_DARWIN) # define Q_OS_MAC /* Q_OS_MAC is mostly for compatibility, but also more clear */ # define Q_OS_MACX /* Q_OS_MACX is only for compatibility.*/ @@ -348,7 +362,9 @@ namespace QT_NAMESPACE {} HIGHC - MetaWare High C/C++ PGI - Portland Group C++ GHS - Green Hills Optimizing C++ Compilers + GCCE - GCCE (Symbian GCCE builds) RVCT - ARM Realview Compiler Suite + NOKIAX86 - Nokia x86 (Symbian WINSCW builds) Should be sorted most to least authoritative. @@ -369,6 +385,9 @@ namespace QT_NAMESPACE {} #elif defined(__MWERKS__) # define Q_CC_MWERKS +# if defined(__EMU_SYMBIAN_OS__) +# define Q_CC_NOKIAX86 +# endif /* "explicit" recognized since 4.0d1 */ #elif defined(_MSC_VER) @@ -423,7 +442,15 @@ namespace QT_NAMESPACE {} #elif defined(__WATCOMC__) # define Q_CC_WAT -#elif defined(__CC_ARM) +/* Symbian GCCE */ +#elif defined(__GCCE__) +# define Q_CC_GCCE +# define QT_VISIBILITY_AVAILABLE + +/* ARM Realview Compiler Suite + RVCT compiler also defines __EDG__ and __GNUC__ (if --gnu flag is given), + so check for it before that */ +#elif defined(__ARMCC__) || defined(__CC_ARM) # define Q_CC_RVCT #elif defined(__GNUC__) @@ -705,6 +732,10 @@ namespace QT_NAMESPACE {} # endif # define Q_NO_USING_KEYWORD /* ### check "using" status */ +#elif defined(__WINSCW__) && !defined(Q_CC_NOKIAX86) +# define Q_CC_NOKIAX86 + + #else # error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" #endif @@ -752,6 +783,7 @@ namespace QT_NAMESPACE {} QWS - Qt for Embedded Linux WIN32 - Windows X11 - X Window System + S60 - Symbian S60 PM - unsupported WIN16 - unsupported */ @@ -784,6 +816,10 @@ namespace QT_NAMESPACE {} # elif defined(Q_OS_MAC32) # define Q_WS_MAC32 # endif +# elif defined(Q_OS_SYMBIAN) +# if (defined(__SERIES60_31__) || defined(__S60_32__) || defined(__S60_50__)) && !defined(QT_NO_S60) +# define Q_WS_S60 +# endif # elif !defined(Q_WS_QWS) # define Q_WS_X11 # endif @@ -809,7 +845,7 @@ typedef short qint16; /* 16 bit signed */ typedef unsigned short quint16; /* 16 bit unsigned */ typedef int qint32; /* 32 bit signed */ typedef unsigned int quint32; /* 32 bit unsigned */ -#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) +#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) && !defined(Q_CC_MWERKS) # define Q_INT64_C(c) c ## i64 /* signed 64 bit constant */ # define Q_UINT64_C(c) c ## ui64 /* unsigned 64 bit constant */ typedef __int64 qint64; /* 64 bit signed */ @@ -827,7 +863,7 @@ typedef quint64 qulonglong; #ifndef QT_POINTER_SIZE # if defined(Q_OS_WIN64) # define QT_POINTER_SIZE 8 -# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) +# elif defined(Q_OS_WIN32) || defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) # define QT_POINTER_SIZE 4 # endif #endif @@ -876,6 +912,12 @@ QT_END_INCLUDE_NAMESPACE */ #ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */ +/* Symbian OS defines TRUE = 1 and FALSE = 0, +redefine to built-in booleans to make autotests work properly */ +#ifdef Q_OS_SYMBIAN + #undef TRUE + #undef FALSE +#endif # ifndef TRUE # define TRUE true # define FALSE false @@ -1030,7 +1072,7 @@ typedef int QNoImplicitBoolCast; // This logic must match the one in qmetatype.h #if defined(QT_COORD_TYPE) typedef QT_COORD_TYPE qreal; -#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) +#elif defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) typedef float qreal; #else typedef double qreal; @@ -1046,8 +1088,13 @@ inline T qAbs(const T &t) { return t >= 0 ? t : -t; } inline int qRound(qreal d) { return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1); } +#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN) +inline qint64 qRound64(double d) +{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); } +#else inline qint64 qRound64(qreal d) { return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qint64(d-1) + 0.5) + qint64(d-1); } +#endif template <typename T> inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; } @@ -1116,7 +1163,7 @@ class QDataStream; #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) #ifndef Q_DECL_EXPORT -# ifdef Q_OS_WIN +# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) # define Q_DECL_EXPORT __declspec(dllexport) # elif defined(QT_VISIBILITY_AVAILABLE) # define Q_DECL_EXPORT __attribute__((visibility("default"))) @@ -1126,7 +1173,7 @@ class QDataStream; # endif #endif #ifndef Q_DECL_IMPORT -# if defined(Q_OS_WIN) +# if defined(Q_OS_WIN) || defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) # define Q_DECL_IMPORT __declspec(dllimport) # else # define Q_DECL_IMPORT @@ -1134,10 +1181,10 @@ class QDataStream; #endif /* - Create Qt DLL if QT_DLL is defined (Windows only) + Create Qt DLL if QT_DLL is defined (Windows and Symbian only) */ -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) # if defined(QT_NODLL) # undef QT_MAKEDLL # undef QT_DLL @@ -1295,6 +1342,12 @@ class QDataStream; # else # define Q_GUI_EXPORT_INLINE inline # endif +#elif defined(Q_CC_RVCT) +// we force RVCT not to export inlines by passing --visibility_inlines_hidden +// so we need to just inline it, rather than exporting and inlining +// note: this affects the contents of the DEF files (ie. these functions do not appear) +# define Q_CORE_EXPORT_INLINE inline +# define Q_GUI_EXPORT_INLINE inline #else # define Q_CORE_EXPORT_INLINE Q_CORE_EXPORT inline # define Q_GUI_EXPORT_INLINE Q_GUI_EXPORT inline @@ -1305,16 +1358,42 @@ class QDataStream; for Qt's internal unit tests. If you want slower loading times and more symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL. */ -#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_MAKEDLL) +#if defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL) # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT -#elif defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN) && defined(QT_DLL) +#elif defined(QT_BUILD_INTERNAL) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL) # define Q_AUTOTEST_EXPORT Q_DECL_IMPORT -#elif defined(QT_BUILD_INTERNAL) && !defined(Q_OS_WIN) && defined(QT_SHARED) +#elif defined(QT_BUILD_INTERNAL) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED) # define Q_AUTOTEST_EXPORT Q_DECL_EXPORT #else # define Q_AUTOTEST_EXPORT #endif +inline void qt_noop() {} + +/* These wrap try/catch so we can switch off exceptions later. + + Beware - do not use more than one QT_CATCH per QT_TRY, and do not use + the exception instance in the catch block. + If you can't live with those constraints, don't use these macros. + Use the QT_NO_EXCEPTIONS macro to protect your code instead. +*/ + +#ifdef QT_BOOTSTRAPPED +# define QT_NO_EXCEPTIONS +#endif + +#ifdef QT_NO_EXCEPTIONS +# define QT_TRY if (true) +# define QT_CATCH(A) else +# define QT_THROW(A) qt_noop() +# define QT_RETHROW qt_noop() +#else +# define QT_TRY try +# define QT_CATCH(A) catch (A) +# define QT_THROW(A) throw A +# define QT_RETHROW throw +#endif + /* System information */ @@ -1411,6 +1490,23 @@ public: }; static const MacVersion MacintoshVersion; #endif +#ifdef Q_OS_SYMBIAN + enum SymbianVersion { + SV_Unknown = 0x0000, + SV_9_2 = 0x0001, + SV_9_3 = 0x0002, + SV_9_4 = 0x0004 + }; + static SymbianVersion symbianVersion(); + enum S60Version { + SV_S60_None = 0x0000, + SV_S60_Unknown = 0x0001, + SV_S60_3_1 = 0x0002, + SV_S60_3_2 = 0x0004, + SV_S60_5_0 = 0x0008 + }; + static S60Version s60Version(); +#endif }; Q_CORE_EXPORT const char *qVersion(); @@ -1455,7 +1551,7 @@ inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } Avoid "unused parameter" warnings */ -#if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) +#if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT) template <typename T> inline void qUnused(T &x) { (void)x; } # define Q_UNUSED(x) qUnused(x); @@ -1467,6 +1563,15 @@ inline void qUnused(T &x) { (void)x; } Debugging and error handling */ +/* + On Symbian we do not know beforehand whether we are compiling in + release or debug mode, so check the Symbian build define here, + and set the QT_NO_DEBUG define appropriately. +*/ +#if defined(Q_OS_SYMBIAN) && defined(NDEBUG) && !defined(QT_NO_DEBUG) +# define QT_NO_DEBUG +#endif + #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) # define QT_DEBUG #endif @@ -1535,8 +1640,6 @@ inline QNoDebug qDebug(); #endif -inline void qt_noop() {} - Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line); #if !defined(Q_ASSERT) @@ -1563,12 +1666,23 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char * Q_CORE_EXPORT void qt_check_pointer(const char *, int); -#ifndef QT_NO_DEBUG -# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) +#ifndef QT_NO_EXCEPTIONS +Q_CORE_EXPORT void qBadAlloc(); +#endif + +#ifdef QT_NO_EXCEPTIONS +# if defined(QT_NO_DEBUG) +# define Q_CHECK_PTR(p) qt_noop(); +# else +# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) +# endif #else -# define Q_CHECK_PTR(p) +# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0) #endif +template <typename T> +inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } + #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB) # define Q_FUNC_INFO __PRETTY_FUNCTION__ #elif defined(_MSC_VER) @@ -1579,7 +1693,7 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int); # define Q_FUNC_INFO __FUNCSIG__ # endif #else -# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) +# if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) # define Q_FUNC_INFO __FILE__ "(line number unavailable)" # else /* These two macros makes it possible to turn the builtin line expander into a @@ -1588,9 +1702,9 @@ Q_CORE_EXPORT void qt_check_pointer(const char *, int); # define QT_STRINGIFY(x) QT_STRINGIFY2(x) # define Q_FUNC_INFO __FILE__ ":" QT_STRINGIFY(__LINE__) # endif - /* The MIPSpro compiler postpones macro expansion, and therefore macros must be in scope - * when being used. */ -# if !defined(Q_CC_MIPS) + /* The MIPSpro and RVCT compilers postpones macro expansion, + and therefore macros must be in scope when being used. */ +# if !defined(Q_CC_MIPS) && !defined(Q_CC_RVCT) && !defined(Q_CC_NOKIAX86) # undef QT_STRINGIFY2 # undef QT_STRINGIFY # endif @@ -1715,12 +1829,12 @@ public: static TYPE *NAME() \ { \ if (!this_##NAME.pointer && !this_##NAME.destroyed) { \ - TYPE *x = new TYPE; \ + QScopedPointer<TYPE > x(new TYPE); \ INITIALIZER; \ - if (!this_##NAME.pointer.testAndSetOrdered(0, x)) \ - delete x; \ - else \ + if (this_##NAME.pointer.testAndSetOrdered(0, x.data())) { \ static QGlobalStaticDeleter<TYPE > cleanup(this_##NAME); \ + x.take(); \ + } \ } \ return this_##NAME.pointer; \ } @@ -1935,7 +2049,7 @@ inline void qSwap(T &value1, T &value2) template <> inline bool qIsDetached<TYPE>(TYPE &t) { return t.isDetached(); } \ template <> inline void qSwap<TYPE>(TYPE &value1, TYPE &value2) \ { \ - qSwap<TYPE::DataPtr>(value1.data_ptr(), value2.data_ptr()); \ + qSwap(value1.data_ptr(), value2.data_ptr()); \ } /* @@ -2093,7 +2207,7 @@ typedef uint Flags; #endif /* Q_NO_TYPESAFE_FLAGS */ -#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) /* make use of typeof-extension */ template <typename T> class QForeachContainer { @@ -2187,9 +2301,12 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase #endif #endif +template <typename T> static inline T *qGetPtrHelper(T *ptr) { return ptr; } +template <typename Wrapper> static inline typename Wrapper::pointer qGetPtrHelper(const Wrapper &p) { return p.data(); } + #define Q_DECLARE_PRIVATE(Class) \ - inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(d_ptr); } \ - inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(d_ptr); } \ + inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \ + inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \ friend class Class##Private; #define Q_DECLARE_PRIVATE_D(Dptr, Class) \ @@ -2243,14 +2360,9 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); classes contains a private copy constructor and assignment operator to disable copying (the compiler gives an error message). */ - -#if !defined(Q_NO_DECLARED_NOT_DEFINED) || !defined(QT_MAKEDLL) -# define Q_DISABLE_COPY(Class) \ - Class(const Class &); \ - Class &operator=(const Class &); -#else -# define Q_DISABLE_COPY(Class) -#endif +#define Q_DISABLE_COPY(Class) \ + Class(const Class &); \ + Class &operator=(const Class &); class QByteArray; Q_CORE_EXPORT QByteArray qgetenv(const char *varName); @@ -2286,6 +2398,43 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathTranslations(); QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #endif +#if defined(Q_OS_SYMBIAN) +QT_END_NAMESPACE +// forward declare std::exception +#ifdef __cplusplus +namespace std { class exception; } +#endif +QT_BEGIN_NAMESPACE +Q_CORE_EXPORT void qt_symbian_throwIfError(int error); +Q_CORE_EXPORT void qt_symbian_exception2LeaveL(const std::exception& ex); +Q_CORE_EXPORT int qt_symbian_exception2Error(const std::exception& ex); + +#define QT_TRAP_THROWING(_f) \ + { \ + TInt ____error; \ + TRAP(____error, _f); \ + qt_symbian_throwIfError(____error); \ + } + +#define QT_TRYCATCH_ERROR(_err, _f) \ + { \ + _err = KErrNone; \ + try { \ + _f; \ + } catch (const std::exception &____ex) { \ + _err = qt_symbian_exception2Error(____ex); \ + } \ + } + +#define QT_TRYCATCH_LEAVING(_f) \ + { \ + TInt ____err; \ + QT_TRYCATCH_ERROR(____err, _f) \ + User::LeaveIfError(____err); \ + } +#endif + + /* This gives us the possibility to check which modules the user can use. These are purely compile time checks and will generate no code. @@ -2366,6 +2515,9 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); #define QT_LICENSED_MODULE(x) \ enum QtValidLicenseFor##x##Module { Licensed##x = true }; +/* qdoc is really unhappy with the following block of preprocessor checks, + making it difficult to document classes properly after this point. */ + #if (QT_EDITION & QT_MODULE_CORE) QT_LICENSED_MODULE(Core) #endif diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 20e7845..0e654af 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ #include "qdir.h" -#include "qfile.h" +#include "qfile.h" #include "qconfig.h" #include "qsettings.h" #include "qlibraryinfo.h" -#include "qpointer.h" +#include "qscopedpointer.h" #ifdef QT_BUILD_QMAKE QT_BEGIN_NAMESPACE @@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE struct QLibrarySettings { QLibrarySettings(); - ~QLibrarySettings() { delete static_cast<QSettings *>(settings); } - QSettings *settings; + QScopedPointer<QSettings> settings; }; Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings) @@ -79,32 +78,19 @@ public: static void cleanup() { QLibrarySettings *ls = qt_library_settings(); - if (ls) { - delete static_cast<QSettings *>(ls->settings); - ls->settings = 0; - } + if (ls) + ls->settings.reset(0); } static QSettings *configuration() { -#ifdef QT_NO_THREAD - // This recursion guard should be a temporary solution; the recursive - // dependency should be found and removed. - static bool initializing = false; - if (initializing) - return 0; - initializing = true; -#endif QLibrarySettings *ls = qt_library_settings(); -#ifdef QT_NO_THREAD - initializing = false; -#endif - return ls ? static_cast<QSettings *>(qt_library_settings()->settings) : (QSettings*)0; + return ls ? ls->settings.data() : 0; } }; QLibrarySettings::QLibrarySettings() + : settings(QLibraryInfoPrivate::findConfiguration()) { - settings = QLibraryInfoPrivate::findConfiguration(); #ifndef QT_BUILD_QMAKE qAddPostRoutine(QLibraryInfoPrivate::cleanup); #endif diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 3c95f2c..97026ad 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -44,6 +44,10 @@ #include <QtCore/qglobal.h> +#ifdef Q_OS_SYMBIAN +# include <e32def.h> +#endif + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -87,7 +91,8 @@ Qt { Q_FLAGS(MatchFlags) Q_FLAGS(KeyboardModifiers MouseButtons) Q_ENUMS(WindowType WindowState WindowModality WidgetAttribute ApplicationAttribute) - Q_FLAGS(WindowFlags WindowStates) + Q_ENUMS(InputMethodHint) + Q_FLAGS(WindowFlags WindowStates InputMethodHints) Q_ENUMS(ConnectionType) #endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN)) @@ -1404,21 +1409,27 @@ public: ImFont, ImCursorPosition, ImSurroundingText, - ImCurrentSelection + ImCurrentSelection, + ImMaximumTextLength, + ImAnchorPosition }; enum InputMethodHint { ImhNone = 0x0, ImhHiddenText = 0x1, - ImhNumbersOnly = 0x2, - ImhUppercaseOnly = 0x4, - ImhLowercaseOnly = 0x8, - ImhNoAutoUppercase = 0x10, - ImhPreferNumbers = 0x20, - ImhPreferUppercase = 0x40, - ImhPreferLowercase = 0x80, - ImhNoPredictiveText = 0x100, - ImhDialableCharactersOnly = 0x200 + ImhNoAutoUppercase = 0x2, + ImhPreferNumbers = 0x4, + ImhPreferUppercase = 0x8, + ImhPreferLowercase = 0x10, + ImhNoPredictiveText = 0x20, + + ImhDigitsOnly = 0x10000, + ImhFormattedNumbersOnly = 0x20000, + ImhUppercaseOnly = 0x40000, + ImhLowercaseOnly = 0x80000, + ImhDialableCharactersOnly = 0x100000, + + ImhExclusiveInputMask = 0xffff0000 }; Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint) @@ -1435,6 +1446,17 @@ public: RightToLeft }; + enum AnchorPoint { + AnchorLeft = 0, + AnchorHorizontalCenter, + AnchorRight, + AnchorTop, + AnchorVerticalCenter, + AnchorBottom + }; + + + enum DropAction { CopyAction = 0x1, MoveAction = 0x2, @@ -1515,6 +1537,8 @@ public: typedef unsigned long HANDLE; #elif defined(Q_WS_QWS) typedef void * HANDLE; +#elif defined(Q_OS_SYMBIAN) + typedef unsigned long int HANDLE; // equivalent to TUint32 #endif typedef WindowFlags WFlags; @@ -1568,6 +1592,11 @@ public: Uninitialized }; + enum CoordinateSystem { + DeviceCoordinates, + LogicalCoordinates + }; + enum TouchPointState { TouchPointPressed = 0x01, TouchPointMoved = 0x02, @@ -1606,8 +1635,8 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::DropActions) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::ItemFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags) -Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates) Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints) +Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates) typedef bool (*qInternalCallback)(void **); diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index d1c16e5..657e367 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2422,6 +2422,24 @@ */ /*! + \enum Qt::AnchorPoint + + Specifies a side of a layout item that can be anchored. This is used by + QGraphicsAnchorLayout. + + \value AnchorLeft The left side of a layout item. + \value AnchorHorizontalCenter A "virtual" side that is centered between the left and the + right side of a layout item. + \value AnchorRight The right side of a layout item. + \value AnchorTop The top side of a layout item. + \value AnchorVerticalCenter A "virtual" side that is centered between the top and the + bottom side of a layout item. + \value AnchorBottom The bottom side of a layout item. + + \sa QGraphicsAnchorLayout +*/ + +/*! \enum Qt::InputMethodHint \value ImhNone No hints. @@ -2450,11 +2468,11 @@ \value ImMicroFocus The rectangle covering the area of the input cursor in widget coordinates. \value ImFont The currently used font for text input. - \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see ImSurroundingText). - If any text is selected, the position returned will be at the logical end of the - selection, even if the real cursor is located at the logical start. + \value ImCursorPosition The logical position of the cursor within the text surrounding the input area (see \c ImSurroundingText). \value ImSurroundingText The plain text around the input area, for example the current paragraph. \value ImCurrentSelection The currently selected text. + \value ImMaximumTextLength The maximum number of characters that the widget can hold. If there is no limit, QVariant() is returned. + \value ImAnchorPosition The position of the selection anchor. This may be less or greater than \c ImCursorPosition, depending on which side of selection the cursor is. If there is no selection, it returns the same as \c ImCursorPosition. */ /*! diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h index dd722f9..6e3f242 100644 --- a/src/corelib/global/qt_windows.h +++ b/src/corelib/global/qt_windows.h @@ -53,13 +53,6 @@ #endif #endif -#if defined(Q_CC_MINGW) -// mingw's windows.h does not set _WIN32_WINNT, resulting breaking compilation -#ifndef WINVER -#define WINVER 0x500 -#endif -#endif - #include <windows.h> #ifdef _WIN32_WCE |