summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in64
-rw-r--r--src/corelib/Qt5CoreMacros.cmake2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp30
-rw-r--r--src/corelib/codecs/qtextcodec.h5
-rw-r--r--src/corelib/global/global.pri3
-rw-r--r--src/corelib/global/qcompilerdetection.h77
-rw-r--r--src/corelib/global/qglobal.cpp20
-rw-r--r--src/corelib/global/qglobal.h150
-rw-r--r--src/corelib/global/qlibraryinfo.cpp67
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc3
-rw-r--r--src/corelib/global/qsysinfo.h154
-rw-r--r--src/corelib/io/io.pri2
-rw-r--r--src/corelib/io/qabstractfileengine.cpp6
-rw-r--r--src/corelib/io/qabstractfileengine.h247
-rw-r--r--src/corelib/io/qabstractfileengine_p.h191
-rw-r--r--src/corelib/io/qdir.cpp4
-rw-r--r--src/corelib/io/qdiriterator.cpp4
-rw-r--r--src/corelib/io/qfile.cpp85
-rw-r--r--src/corelib/io/qfile.h6
-rw-r--r--src/corelib/io/qfile_p.h2
-rw-r--r--src/corelib/io/qfileinfo_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp5
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp2
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h2
-rw-r--r--src/corelib/io/qfsfileengine.cpp1
-rw-r--r--src/corelib/io/qfsfileengine.h122
-rw-r--r--src/corelib/io/qfsfileengine_iterator_p.h2
-rw-r--r--src/corelib/io/qfsfileengine_p.h65
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp2
-rw-r--r--src/corelib/io/qresource_iterator_p.h2
-rw-r--r--src/corelib/io/qresource_p.h2
-rw-r--r--src/corelib/io/qsettings_p.h2
-rw-r--r--src/corelib/io/qtextstream.cpp4
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp6
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp6
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp5
-rw-r--r--src/corelib/kernel/qeventloop.cpp41
-rw-r--r--src/corelib/kernel/qeventloop.h1
-rw-r--r--src/corelib/kernel/qmetatype.cpp20
-rw-r--r--src/corelib/kernel/qmetatype.h75
-rw-r--r--src/corelib/kernel/qmetatype_p.h47
-rw-r--r--src/corelib/kernel/qmetatypeswitcher_p.h31
-rw-r--r--src/corelib/kernel/qobject.cpp6
-rw-r--r--src/corelib/kernel/qobject_impl.h1
-rw-r--r--src/corelib/kernel/qvariant.cpp102
-rw-r--r--src/corelib/kernel/qvariant.h22
-rw-r--r--src/corelib/kernel/qvariant_p.h11
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h1
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp1
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp42
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h24
-rw-r--r--src/corelib/thread/qmutex.cpp6
-rw-r--r--src/corelib/thread/qmutex_p.h6
-rw-r--r--src/corelib/thread/qthread.cpp9
-rw-r--r--src/corelib/thread/qthread.h2
-rw-r--r--src/corelib/thread/qthread_p.h17
-rw-r--r--src/corelib/thread/qthread_win.cpp31
-rw-r--r--src/corelib/tools/qchar.cpp63
-rw-r--r--src/corelib/tools/qchar.h13
-rw-r--r--src/corelib/tools/qcryptographichash.cpp106
-rw-r--r--src/corelib/tools/qcryptographichash.h6
-rw-r--r--src/corelib/tools/qeasingcurve.cpp29
-rw-r--r--src/corelib/tools/qeasingcurve.h12
-rw-r--r--src/corelib/tools/qelapsedtimer_win.cpp4
-rw-r--r--src/corelib/tools/qhash.cpp2
-rw-r--r--src/corelib/tools/qline.h142
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/corelib/tools/qlocale.cpp2
-rw-r--r--src/corelib/tools/qlocale.qdoc4
-rw-r--r--src/corelib/tools/qlocale_p.h4
-rw-r--r--src/corelib/tools/qlocale_win.cpp2
-rw-r--r--src/corelib/tools/qmargins.h37
-rw-r--r--src/corelib/tools/qpoint.h134
-rw-r--r--src/corelib/tools/qrect.h242
-rw-r--r--src/corelib/tools/qregexp.cpp2
-rw-r--r--src/corelib/tools/qsize.h139
-rw-r--r--src/corelib/tools/qstring.cpp232
-rw-r--r--src/corelib/tools/qstring.h13
-rw-r--r--src/corelib/tools/qstringbuilder.cpp29
-rw-r--r--src/corelib/tools/qstringbuilder.h44
-rw-r--r--src/corelib/tools/qunicodetables.cpp392
-rw-r--r--src/corelib/xml/qxmlutils.cpp2
85 files changed, 1573 insertions, 1937 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 440d5e92bb..67598f4f70 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -1,18 +1,62 @@
get_filename_component(_qt5_corelib_install_prefix ${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR} ABSOLUTE)
-# Required by default:
-set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/qmake$$CMAKE_BIN_SUFFIX\")
-set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/moc$$CMAKE_BIN_SUFFIX\")
-set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/rcc$$CMAKE_BIN_SUFFIX\")
+!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+!!ELSE
+set(QT_QMAKE_EXECUTABLE \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+set(QT_MOC_EXECUTABLE \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+set(QT_RCC_EXECUTABLE \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+!!ENDIF
+!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/default\")
+!!ELSE
+list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/default\")
+!!ENDIF
-if (NOT \"$${CMAKE_ADD_FPIE_FLAGS}\" STREQUAL \"\")
- set(Qt5Core_COMPILE_FLAGS "-fPIE")
-endif()
+!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
+set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "-fPIE")
+!!ENDIF
+
+!!IF !isEmpty(QT_NAMESPACE)
+list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
+list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
+!!ENDIF
+
+!!IF !isEmpty(QT_LIBINFIX)
+set(QT_LIBINFIX \"$${QT_LIBINFIX}\")
+!!ENDIF
-if (NOT \"$$QT_NAMESPACE\" STREQUAL \"\")
- list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
- list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
+set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
+
+if (NOT _Qt5WinMain_target)
+ set(_Qt5WinMain_target 1)
+ add_library(Qt5::WinMain STATIC IMPORTED)
endif()
+
+!!IF !isEmpty(debug_type)
+set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+set_target_properties(Qt5::WinMain PROPERTIES
+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ IMPORTED_LOCATION_DEBUG "${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
+!!ELSE
+ IMPORTED_LOCATION_DEBUG "$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
+!!ENDIF
+)
+!!ENDIF
+
+!!IF !isEmpty(release_type)
+set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+set_target_properties(Qt5::WinMain PROPERTIES
+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
+!!ELSE
+ IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
+!!ENDIF
+)
+!!ENDIF
+!!ENDIF
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index abfe49ec84..4a10fad9eb 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -83,7 +83,7 @@ macro(QT5_GET_MOC_FLAGS _moc_flags)
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
endforeach()
- if(Q_WS_WIN)
+ if(WIN32)
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
endif()
endmacro()
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 82e5c9a1c3..68866b9000 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1495,35 +1495,7 @@ QString QTextDecoder::toUnicode(const QByteArray &ba)
files to be loaded. For details of internationalization, see
\l{Internationalization with Qt}.
- \sa codecForTr(), setCodecForCStrings()
-*/
-
-
-/*!
- \fn QTextCodec* QTextCodec::codecForCStrings()
-
- Returns the codec used by QString to convert to and from \c{const
- char *} and QByteArrays. If this function returns 0 (the default),
- QString assumes Latin-1.
-
- \sa setCodecForCStrings()
-*/
-
-/*!
- \fn void QTextCodec::setCodecForCStrings(QTextCodec *codec)
- \nonreentrant
-
- Sets the codec used by QString to convert to and from \c{const
- char *} and QByteArrays. If the \a codec is 0 (the default),
- QString assumes Latin-1.
-
- \warning Some codecs do not preserve the characters in the ASCII
- range (0x00 to 0x7F). For example, the Japanese Shift-JIS
- encoding maps the backslash character (0x5A) to the Yen
- character. To avoid undesirable side-effects, we recommend
- avoiding such codecs with setCodecsForCString().
-
- \sa codecForCStrings(), setCodecForTr()
+ \sa codecForTr()
*/
/*!
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 9e46863964..ad37005e92 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -75,9 +75,6 @@ public:
static QTextCodec* codecForTr();
static void setCodecForTr(QTextCodec *c);
- static QTextCodec* codecForCStrings();
- static void setCodecForCStrings(QTextCodec *c);
-
static QTextCodec *codecForHtml(const QByteArray &ba);
static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec);
@@ -139,8 +136,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; }
inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
-inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; }
-inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; }
class Q_CORE_EXPORT QTextEncoder {
Q_DISABLE_COPY(QTextEncoder)
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index ddba51950a..49128374e0 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -10,7 +10,8 @@ HEADERS += \
global/qnumeric_p.h \
global/qnumeric.h \
global/qlogging.h \
- global/qtypeinfo.h
+ global/qtypeinfo.h \
+ global/qsysinfo.h
SOURCES += \
global/qglobal.cpp \
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 5ab79092d2..b3787261be 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -76,14 +76,13 @@
# define Q_CC_SYM
/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
# if defined(__SC__) && __SC__ < 0x750
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
#elif defined(_MSC_VER)
# define Q_CC_MSVC
# define Q_CC_MSVC_NET
-# define Q_CANNOT_DELETE_CONSTANT
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_NO_TEMPLATE_FRIENDS
# define Q_ALIGNOF(type) __alignof(type)
@@ -114,8 +113,7 @@
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
# if __BORLANDC__ < 0x502
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
@@ -140,45 +138,19 @@
# define Q_CC_MINGW
# endif
# if defined(__INTEL_COMPILER)
-/* Intel C++ also masquerades as GCC 3.2.0 */
+/* Intel C++ also masquerades as GCC */
# define Q_CC_INTEL
# endif
# if defined(__clang__)
-/* Clang also masquerades as GCC 4.2.1 */
+/* Clang also masquerades as GCC */
# define Q_CC_CLANG
# endif
-# ifdef __APPLE__
-# define Q_NO_DEPRECATED_CONSTRUCTORS
-# endif
-# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
-# define Q_FULL_TEMPLATE_INSTANTIATION
-# endif
-/* GCC 2.95 knows "using" but does not support it correctly */
-# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
-# define Q_NO_USING_KEYWORD
-# endif
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-# define Q_ALIGNOF(type) __alignof__(type)
-# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
-# endif
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
-# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
-# endif
-/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
-# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
-# define Q_WRONG_SB_CTYPE_MACROS
-# endif
-/* GCC <= 3.3 cannot handle template friends */
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
-# define Q_NO_TEMPLATE_FRIENDS
-# endif
-/* Apple's GCC 3.1 chokes on our streaming qDebug() */
-# if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
-# define Q_BROKEN_DEBUG_STREAM
-# endif
-# if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
+# define Q_ALIGNOF(type) __alignof__(type)
+# define Q_TYPEOF(expr) __typeof__(expr)
+# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
+# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
+# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
+# if !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((__packed__))
# define Q_NO_PACKED_REFERENCE
# ifndef __ARM_EABI__
@@ -251,12 +223,7 @@
# define Q_CC_XLC
# define Q_FULL_TEMPLATE_INSTANTIATION
# if __xlC__ < 0x400
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
-# define Q_NO_USING_KEYWORD
-# define Q_OUTOFLINE_TEMPLATE inline
-# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_CANNOT_DELETE_CONSTANT
+# error "Compiler not supported"
# elif __xlC__ >= 0x0600
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
@@ -280,7 +247,7 @@
- observed on Compaq C++ V6.3-002.
In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
# if !defined(_BOOL_EXISTS)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
# define Q_NO_USING_KEYWORD
@@ -288,7 +255,6 @@
DEC C++ V5.5-004. */
# if __DECCXX_VER < 60060000
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_CANNOT_DELETE_CONSTANT
# endif
/* avoid undefined symbol problems with out-of-line template members */
# define Q_OUTOFLINE_TEMPLATE inline
@@ -315,7 +281,7 @@
__BOOL_DEFINED
Defined in Microsoft C++ mode when bool is a keyword. */
# if !defined(_BOOL) && !defined(__BOOL_DEFINED)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* The Comeau compiler is based on EDG and does define __EDG__ */
@@ -341,9 +307,8 @@
# elif defined(__DCC__)
# define Q_CC_DIAB
-# undef Q_NO_BOOL_TYPE
# if !defined(__bool)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
@@ -407,7 +372,7 @@
# define Q_NO_TEMPLATE_FRIENDS
# endif
# if !defined(_BOOL)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
# define Q_NO_USING_KEYWORD
@@ -415,9 +380,7 @@
# define Q_C_CALLBACKS
/* 4.2 compiler or older */
# else
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
-# define Q_NO_USING_KEYWORD
+# error "Compiler not supported"
# endif
/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
@@ -426,7 +389,7 @@
# define Q_CC_EDG
# define Q_CC_CDS
# if !defined(_BOOL)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
@@ -449,11 +412,7 @@
# define Q_DECL_IMPORT Q_DECL_EXPORT
# endif
# else
-# define Q_CC_HP
-# define Q_NO_BOOL_TYPE
-# define Q_FULL_TEMPLATE_INSTANTIATION
-# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD /* ### check "using" status */
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index eea4397dcd..6257376b62 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -819,15 +819,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn int qMacVersion()
- \relates <QtGlobal>
-
- Use QSysInfo::MacintoshVersion instead.
-
- \sa QSysInfo
-*/
-
-/*!
\macro QT_VERSION_CHECK
\relates <QtGlobal>
@@ -949,6 +940,13 @@ bool qSharedBuild()
*/
/*!
+ \fn QSysInfo::MacVersion QSysInfo::macVersion()
+
+ Returns the version of Mac OS X on which the application is run (Mac OS X
+ Only).
+*/
+
+/*!
\enum QSysInfo::Endian
\value BigEndian Big-endian byte order (also called Network byte order)
@@ -1630,7 +1628,7 @@ Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
#if defined(Q_OS_MAC)
-static QSysInfo::MacVersion macVersion()
+QSysInfo::MacVersion QSysInfo::macVersion()
{
#ifndef QT_NO_CORESERVICES
SInt32 gestalt_version;
@@ -1640,7 +1638,7 @@ static QSysInfo::MacVersion macVersion()
#endif
return QSysInfo::MV_Unknown;
}
-const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion();
+const QSysInfo::MacVersion QSysInfo::MacintoshVersion = QSysInfo::macVersion();
#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE)
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index d4d2ffdabb..5fbc8cdd19 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -191,7 +191,7 @@ namespace QT_NAMESPACE {}
#endif
#ifndef Q_REQUIRED_RESULT
-# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+# if defined(Q_CC_GNU)
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define Q_REQUIRED_RESULT
@@ -275,11 +275,6 @@ typedef unsigned int uint;
typedef unsigned long ulong;
QT_END_INCLUDE_NAMESPACE
-#if defined(Q_NO_BOOL_TYPE)
-#error "Compiler doesn't support the bool type"
-#endif
-
-
/*
Constant bool values
*/
@@ -315,9 +310,7 @@ QT_END_INCLUDE_NAMESPACE
/*
Warnings and errors when using deprecated methods
*/
-#if defined(Q_MOC_RUN)
-# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
-#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
+#if defined(Q_CC_GNU) || defined(Q_CC_RVCT)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(Q_CC_MSVC)
# define Q_DECL_DEPRECATED __declspec(deprecated)
@@ -331,15 +324,6 @@ QT_END_INCLUDE_NAMESPACE
#ifndef Q_DECL_VARIABLE_DEPRECATED
# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
#endif
-#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
-# if defined(Q_MOC_RUN)
-# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
-# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
-# define Q_DECL_CONSTRUCTOR_DEPRECATED
-# else
-# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
-# endif
-#endif
#if defined(QT_NO_DEPRECATED)
# undef QT_DEPRECATED
@@ -394,24 +378,13 @@ QT_END_INCLUDE_NAMESPACE
#ifdef QT_ASCII_CAST_WARNINGS
# define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
-# if defined(Q_CC_GNU) && __GNUC__ < 4
- /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR
-# else
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
-# endif
#else
# define QT_ASCII_CAST_WARN
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR
#endif
#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
# if defined(Q_CC_GNU)
-#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
# define QT_FASTCALL __attribute__((regparm(3)))
-#else
-# define QT_FASTCALL
-#endif
# elif defined(Q_CC_MSVC)
# define QT_FASTCALL __fastcall
# else
@@ -512,17 +485,12 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
class QDataStream;
-#if !defined(QT_NO_COP)
-# define QT_NO_COP
-#endif
-
#if defined(Q_OS_VXWORKS)
# define QT_NO_CRASHHANDLER // no popen
# define QT_NO_PROCESS // no exec*, no fork
# define QT_NO_LPR
# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
-# define QT_NO_QWS_MULTIPROCESS // no processes
#endif
# include <QtCore/qfeatures.h>
@@ -844,113 +812,9 @@ inline void qt_noop(void) {}
# define QT_RETHROW throw
#endif
-/*
- System information
-*/
-
-class QString;
-class Q_CORE_EXPORT QSysInfo {
-public:
- enum Sizes {
- WordSize = (sizeof(void *)<<3)
- };
-
-#if defined(QT_BUILD_QMAKE)
- enum Endian {
- BigEndian,
- LittleEndian
- };
- /* needed to bootstrap qmake */
- static const int ByteOrder;
-#elif defined(Q_BYTE_ORDER)
- enum Endian {
- BigEndian,
- LittleEndian
-
-# ifdef qdoc
- , ByteOrder = <platform-dependent>
-# elif Q_BYTE_ORDER == Q_BIG_ENDIAN
- , ByteOrder = BigEndian
-# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
- , ByteOrder = LittleEndian
-# else
-# error "Undefined byte order"
-# endif
- };
-#else
-# error "Qt not configured correctly, please run configure"
-#endif
-#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
- enum WinVersion {
- WV_32s = 0x0001,
- WV_95 = 0x0002,
- WV_98 = 0x0003,
- WV_Me = 0x0004,
- WV_DOS_based= 0x000f,
-
- /* codenames */
- WV_NT = 0x0010,
- WV_2000 = 0x0020,
- WV_XP = 0x0030,
- WV_2003 = 0x0040,
- WV_VISTA = 0x0080,
- WV_WINDOWS7 = 0x0090,
- WV_NT_based = 0x00f0,
-
- /* version numbers */
- WV_4_0 = WV_NT,
- WV_5_0 = WV_2000,
- WV_5_1 = WV_XP,
- WV_5_2 = WV_2003,
- WV_6_0 = WV_VISTA,
- WV_6_1 = WV_WINDOWS7,
-
- WV_CE = 0x0100,
- WV_CENET = 0x0200,
- WV_CE_5 = 0x0300,
- WV_CE_6 = 0x0400,
- WV_CE_based = 0x0f00
- };
- static const WinVersion WindowsVersion;
- static WinVersion windowsVersion();
-
-#endif
-#ifdef Q_OS_MAC
- enum MacVersion {
- MV_Unknown = 0x0000,
-
- /* version */
- MV_9 = 0x0001,
- MV_10_0 = 0x0002,
- MV_10_1 = 0x0003,
- MV_10_2 = 0x0004,
- MV_10_3 = 0x0005,
- MV_10_4 = 0x0006,
- MV_10_5 = 0x0007,
- MV_10_6 = 0x0008,
- MV_10_7 = 0x0009,
-
- /* codenames */
- MV_CHEETAH = MV_10_0,
- MV_PUMA = MV_10_1,
- MV_JAGUAR = MV_10_2,
- MV_PANTHER = MV_10_3,
- MV_TIGER = MV_10_4,
- MV_LEOPARD = MV_10_5,
- MV_SNOWLEOPARD = MV_10_6,
- MV_LION = MV_10_7
- };
- static const MacVersion MacintoshVersion;
-#endif
-};
-
Q_CORE_EXPORT const char *qVersion();
Q_CORE_EXPORT bool qSharedBuild();
-#if defined(Q_OS_MAC)
-inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
-#endif
-
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
#endif
@@ -1357,12 +1221,15 @@ class QFlags
int i;
public:
typedef Enum enum_type;
- Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {}
+ // compiler-generated copy/move ctor/assignment operators are fine!
+#ifdef qdoc
+ inline QFlags(const QFlags &other);
+ inline QFlags &operator=(const QFlags &other);
+#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {}
inline QFlags(QFlag f) : i(f) {}
- inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
inline QFlags &operator&=(int mask) { i &= mask; return *this; }
inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
@@ -1583,8 +1450,6 @@ Q_CORE_EXPORT int qrand();
#ifdef Q_OS_QNX
// QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
// shared fonts and QSystemSemaphore + QSharedMemory are not available
-# define QT_NO_QWS_MULTIPROCESS
-# define QT_NO_QWS_SHARE_FONTS
# define QT_NO_SYSTEMSEMAPHORE
# define QT_NO_SHAREDMEMORY
#endif
@@ -1612,6 +1477,7 @@ QT_END_HEADER
// qDebug and friends
#include <QtCore/qlogging.h>
+#include <QtCore/qsysinfo.h>
#include <QtCore/qtypeinfo.h>
#endif /* __cplusplus */
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 61c750acaf..c871675334 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -348,71 +348,8 @@ QLibraryInfo::location(LibraryLocation loc)
QSettings *config = QLibraryInfoPrivate::configuration();
config->beginGroup(QLatin1String("Paths"));
- QString subKey;
- {
- /*
- find the child group whose version number is closest
- to the library version. for example and we have the
- following groups:
-
- Paths
- Paths/4.0
- Paths/4.1.2
- Paths/4.2.5
- Paths/5
-
- if QT_VERSION is 4.0.1, then we use 'Paths/4.0'
- if QT_VERSION is 4.1.5, then we use 'Paths/4.1.2'
- if QT_VERSION is 4.6.3, then we use 'Paths/4.2.5'
- if QT_VERSION is 6.0.2, then we use 'Paths/5'
-
- note: any of the trailing version numbers may be
- omitted (in which case, they default to zero),
- i.e. 4 == 4.0.0, 4.1 == 4.1.0, and so on
- */
- enum {
- QT_MAJOR = ((QT_VERSION >> 16) & 0xFF),
- QT_MINOR = ((QT_VERSION >> 8) & 0xFF),
- QT_PATCH = (QT_VERSION & 0xFF)
- };
- int maj = 0, min = 0, pat = 0;
- QStringList children = config->childGroups();
- for(int child = 0; child < children.size(); ++child) {
- QString cver = children.at(child);
- QStringList cver_list = cver.split(QLatin1Char('.'));
- if(cver_list.size() > 0 && cver_list.size() < 4) {
- bool ok;
- int cmaj = -1, cmin = -1, cpat = -1;
- cmaj = cver_list[0].toInt(&ok);
- if(!ok || cmaj < 0)
- continue;
- if(cver_list.size() >= 2) {
- cmin = cver_list[1].toInt(&ok);
- if(!ok)
- continue;
- if(cmin < 0)
- cmin = -1;
- }
- if(cver_list.size() >= 3) {
- cpat = cver_list[2].toInt(&ok);
- if(!ok)
- continue;
- if(cpat < 0)
- cpat = -1;
- }
- if((cmaj >= maj && cmaj <= QT_MAJOR) &&
- (cmin == -1 || (cmin >= min && cmin <= QT_MINOR)) &&
- (cpat == -1 || (cpat >= pat && cpat <= QT_PATCH)) &&
- config->contains(cver + QLatin1Char('/') + key)) {
- subKey = cver + QLatin1Char('/');
- maj = cmaj;
- min = cmin;
- pat = cpat;
- }
- }
- }
- }
- ret = config->value(subKey + key, defaultValue).toString();
+ ret = config->value(key, defaultValue).toString();
+
// expand environment variables in the form $(ENVVAR)
int rep;
QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 2087d763de..4ea62c77a6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -293,6 +293,7 @@ public:
WindowStaysOnTopHint = 0x00040000,
WindowTransparentForInput = 0x00080000,
WindowOverridesSystemGestures = 0x00100000,
+ WindowDoesNotAcceptFocus = 0x00200000,
CustomizeWindowHint = 0x02000000,
WindowStaysOnBottomHint = 0x04000000,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index d50960f68b..895feb7f53 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2112,6 +2112,9 @@
implements its own set of gestures and that system level gestures, like for
instance three-finger desktop switching, should be disabled.
+ \value WindowDoesNotAcceptFocus Informs the window system that this window should
+ not receive the input focus.
+
\value WindowType_Mask A mask for extracting the window type
part of the window flags.
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
new file mode 100644
index 0000000000..e6e207ec3d
--- /dev/null
+++ b/src/corelib/global/qsysinfo.h
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSYSINFO_H
+#define QSYSINFO_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+/*
+ System information
+*/
+
+class QString;
+class Q_CORE_EXPORT QSysInfo {
+public:
+ enum Sizes {
+ WordSize = (sizeof(void *)<<3)
+ };
+
+#if defined(QT_BUILD_QMAKE)
+ enum Endian {
+ BigEndian,
+ LittleEndian
+ };
+ /* needed to bootstrap qmake */
+ static const int ByteOrder;
+#elif defined(Q_BYTE_ORDER)
+ enum Endian {
+ BigEndian,
+ LittleEndian
+
+# ifdef qdoc
+ , ByteOrder = <platform-dependent>
+# elif Q_BYTE_ORDER == Q_BIG_ENDIAN
+ , ByteOrder = BigEndian
+# elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ , ByteOrder = LittleEndian
+# else
+# error "Undefined byte order"
+# endif
+ };
+#else
+# error "Qt not configured correctly, please run configure"
+#endif
+#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
+ enum WinVersion {
+ WV_32s = 0x0001,
+ WV_95 = 0x0002,
+ WV_98 = 0x0003,
+ WV_Me = 0x0004,
+ WV_DOS_based= 0x000f,
+
+ /* codenames */
+ WV_NT = 0x0010,
+ WV_2000 = 0x0020,
+ WV_XP = 0x0030,
+ WV_2003 = 0x0040,
+ WV_VISTA = 0x0080,
+ WV_WINDOWS7 = 0x0090,
+ WV_NT_based = 0x00f0,
+
+ /* version numbers */
+ WV_4_0 = WV_NT,
+ WV_5_0 = WV_2000,
+ WV_5_1 = WV_XP,
+ WV_5_2 = WV_2003,
+ WV_6_0 = WV_VISTA,
+ WV_6_1 = WV_WINDOWS7,
+
+ WV_CE = 0x0100,
+ WV_CENET = 0x0200,
+ WV_CE_5 = 0x0300,
+ WV_CE_6 = 0x0400,
+ WV_CE_based = 0x0f00
+ };
+ static const WinVersion WindowsVersion;
+ static WinVersion windowsVersion();
+
+#endif
+#ifdef Q_OS_MAC
+ enum MacVersion {
+ MV_Unknown = 0x0000,
+
+ /* version */
+ MV_9 = 0x0001,
+ MV_10_0 = 0x0002,
+ MV_10_1 = 0x0003,
+ MV_10_2 = 0x0004,
+ MV_10_3 = 0x0005,
+ MV_10_4 = 0x0006,
+ MV_10_5 = 0x0007,
+ MV_10_6 = 0x0008,
+ MV_10_7 = 0x0009,
+
+ /* codenames */
+ MV_CHEETAH = MV_10_0,
+ MV_PUMA = MV_10_1,
+ MV_JAGUAR = MV_10_2,
+ MV_PANTHER = MV_10_3,
+ MV_TIGER = MV_10_4,
+ MV_LEOPARD = MV_10_5,
+ MV_SNOWLEOPARD = MV_10_6,
+ MV_LION = MV_10_7
+ };
+ static const MacVersion MacintoshVersion;
+ static MacVersion macVersion();
+#endif
+};
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QSYSINFO_H
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 2df862e360..29599295ad 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -1,7 +1,6 @@
# Qt core io module
HEADERS += \
- io/qabstractfileengine.h \
io/qabstractfileengine_p.h \
io/qbuffer.h \
io/qdatastream.h \
@@ -30,7 +29,6 @@ HEADERS += \
io/qtldurl_p.h \
io/qsettings.h \
io/qsettings_p.h \
- io/qfsfileengine.h \
io/qfsfileengine_p.h \
io/qfsfileengine_iterator_p.h \
io/qfilesystemwatcher.h \
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index fb18809e48..021698115c 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qabstractfileengine.h"
#include "private/qabstractfileengine_p.h"
+#include "private/qfsfileengine_p.h"
#ifdef QT_BUILD_CORE_LIB
#include "private/qresource_p.h"
#endif
@@ -48,7 +48,6 @@
#include "qreadwritelock.h"
#include "qvariant.h"
// built-in handlers
-#include "qfsfileengine.h"
#include "qdiriterator.h"
#include "qstringbuilder.h"
@@ -61,6 +60,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QAbstractFileEngineHandler
\reentrant
+ \internal
\brief The QAbstractFileEngineHandler class provides a way to register
custom file engines with your application.
@@ -220,6 +220,7 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
/*!
\class QAbstractFileEngine
\reentrant
+ \internal
\brief The QAbstractFileEngine class provides an abstraction for accessing
the filesystem.
@@ -804,6 +805,7 @@ bool QAbstractFileEngine::unmap(uchar *address)
\class QAbstractFileEngineIterator
\brief The QAbstractFileEngineIterator class provides an iterator
interface for custom file engines.
+ \internal
If all you want is to iterate over entries in a directory, see
QDirIterator instead. This class is only for custom file engine authors.
diff --git a/src/corelib/io/qabstractfileengine.h b/src/corelib/io/qabstractfileengine.h
deleted file mode 100644
index 6ea5a2b94e..0000000000
--- a/src/corelib/io/qabstractfileengine.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QABSTRACTFILEENGINE_H
-#define QABSTRACTFILEENGINE_H
-
-#include <QtCore/qdir.h>
-
-#ifdef open
-#error qabstractfileengine.h must be included before any header file that defines open
-#endif
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-
-class QFileExtension;
-class QFileExtensionResult;
-class QVariant;
-class QAbstractFileEngineIterator;
-class QAbstractFileEnginePrivate;
-
-class Q_CORE_EXPORT QAbstractFileEngine
-{
-public:
- enum FileFlag {
- //perms (overlaps the QFile::Permission)
- ReadOwnerPerm = 0x4000, WriteOwnerPerm = 0x2000, ExeOwnerPerm = 0x1000,
- ReadUserPerm = 0x0400, WriteUserPerm = 0x0200, ExeUserPerm = 0x0100,
- ReadGroupPerm = 0x0040, WriteGroupPerm = 0x0020, ExeGroupPerm = 0x0010,
- ReadOtherPerm = 0x0004, WriteOtherPerm = 0x0002, ExeOtherPerm = 0x0001,
-
- //types
- LinkType = 0x10000,
- FileType = 0x20000,
- DirectoryType = 0x40000,
- BundleType = 0x80000,
-
- //flags
- HiddenFlag = 0x0100000,
- LocalDiskFlag = 0x0200000,
- ExistsFlag = 0x0400000,
- RootFlag = 0x0800000,
- Refresh = 0x1000000,
-
- //masks
- PermsMask = 0x0000FFFF,
- TypesMask = 0x000F0000,
- FlagsMask = 0x0FF00000,
- FileInfoAll = FlagsMask | PermsMask | TypesMask
- };
- Q_DECLARE_FLAGS(FileFlags, FileFlag)
-
- enum FileName {
- DefaultName,
- BaseName,
- PathName,
- AbsoluteName,
- AbsolutePathName,
- LinkName,
- CanonicalName,
- CanonicalPathName,
- BundleName,
- NFileNames = 9
- };
- enum FileOwner {
- OwnerUser,
- OwnerGroup
- };
- enum FileTime {
- CreationTime,
- ModificationTime,
- AccessTime
- };
-
- virtual ~QAbstractFileEngine();
-
- virtual bool open(QIODevice::OpenMode openMode);
- virtual bool close();
- virtual bool flush();
- virtual qint64 size() const;
- virtual qint64 pos() const;
- virtual bool seek(qint64 pos);
- virtual bool isSequential() const;
- virtual bool remove();
- virtual bool copy(const QString &newName);
- virtual bool rename(const QString &newName);
- virtual bool link(const QString &newName);
- virtual bool mkdir(const QString &dirName, bool createParentDirectories) const;
- virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
- virtual bool setSize(qint64 size);
- virtual bool caseSensitive() const;
- virtual bool isRelativePath() const;
- virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
- virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
- virtual bool setPermissions(uint perms);
- virtual QString fileName(FileName file=DefaultName) const;
- virtual uint ownerId(FileOwner) const;
- virtual QString owner(FileOwner) const;
- virtual QDateTime fileTime(FileTime time) const;
- virtual void setFileName(const QString &file);
- virtual int handle() const;
- bool atEnd() const;
- uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
- bool unmap(uchar *ptr);
-
- typedef QAbstractFileEngineIterator Iterator;
- virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
- virtual Iterator *endEntryList();
-
- virtual qint64 read(char *data, qint64 maxlen);
- virtual qint64 readLine(char *data, qint64 maxlen);
- virtual qint64 write(const char *data, qint64 len);
-
- QFile::FileError error() const;
- QString errorString() const;
-
- enum Extension {
- AtEndExtension,
- FastReadLineExtension,
- MapExtension,
- UnMapExtension
- };
- class ExtensionOption
- {};
- class ExtensionReturn
- {};
-
- class MapExtensionOption : public ExtensionOption {
- public:
- qint64 offset;
- qint64 size;
- QFile::MemoryMapFlags flags;
- };
- class MapExtensionReturn : public ExtensionReturn {
- public:
- uchar *address;
- };
-
- class UnMapExtensionOption : public ExtensionOption {
- public:
- uchar *address;
- };
-
- virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
- virtual bool supportsExtension(Extension extension) const;
-
- // Factory
- static QAbstractFileEngine *create(const QString &fileName);
-
-protected:
- void setError(QFile::FileError error, const QString &str);
-
- QAbstractFileEngine();
- QAbstractFileEngine(QAbstractFileEnginePrivate &);
-
- QScopedPointer<QAbstractFileEnginePrivate> d_ptr;
-private:
- Q_DECLARE_PRIVATE(QAbstractFileEngine)
- Q_DISABLE_COPY(QAbstractFileEngine)
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFileEngine::FileFlags)
-
-class Q_CORE_EXPORT QAbstractFileEngineHandler
-{
-public:
- QAbstractFileEngineHandler();
- virtual ~QAbstractFileEngineHandler();
- virtual QAbstractFileEngine *create(const QString &fileName) const = 0;
-};
-
-class QAbstractFileEngineIteratorPrivate;
-class Q_CORE_EXPORT QAbstractFileEngineIterator
-{
-public:
- QAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters);
- virtual ~QAbstractFileEngineIterator();
-
- virtual QString next() = 0;
- virtual bool hasNext() const = 0;
-
- QString path() const;
- QStringList nameFilters() const;
- QDir::Filters filters() const;
-
- virtual QString currentFileName() const = 0;
- virtual QFileInfo currentFileInfo() const;
- QString currentFilePath() const;
-
-protected:
- enum EntryInfoType {
- };
- virtual QVariant entryInfo(EntryInfoType type) const;
-
-private:
- Q_DISABLE_COPY(QAbstractFileEngineIterator)
- friend class QDirIterator;
- friend class QDirIteratorPrivate;
- void setPath(const QString &path);
- QScopedPointer<QAbstractFileEngineIteratorPrivate> d;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QABSTRACTFILEENGINE_H
diff --git a/src/corelib/io/qabstractfileengine_p.h b/src/corelib/io/qabstractfileengine_p.h
index 08bb7fb097..ae7f56e2d7 100644
--- a/src/corelib/io/qabstractfileengine_p.h
+++ b/src/corelib/io/qabstractfileengine_p.h
@@ -53,11 +53,200 @@
// We mean it.
//
-#include "QtCore/qabstractfileengine.h"
#include "QtCore/qfile.h"
+#include "QtCore/qdir.h"
+
+#ifdef open
+#error qabstractfileengine_p.h must be included before any header file that defines open
+#endif
QT_BEGIN_NAMESPACE
+class QVariant;
+class QAbstractFileEngineIterator;
+class QAbstractFileEnginePrivate;
+
+class Q_AUTOTEST_EXPORT QAbstractFileEngine
+{
+public:
+ enum FileFlag {
+ //perms (overlaps the QFile::Permission)
+ ReadOwnerPerm = 0x4000, WriteOwnerPerm = 0x2000, ExeOwnerPerm = 0x1000,
+ ReadUserPerm = 0x0400, WriteUserPerm = 0x0200, ExeUserPerm = 0x0100,
+ ReadGroupPerm = 0x0040, WriteGroupPerm = 0x0020, ExeGroupPerm = 0x0010,
+ ReadOtherPerm = 0x0004, WriteOtherPerm = 0x0002, ExeOtherPerm = 0x0001,
+
+ //types
+ LinkType = 0x10000,
+ FileType = 0x20000,
+ DirectoryType = 0x40000,
+ BundleType = 0x80000,
+
+ //flags
+ HiddenFlag = 0x0100000,
+ LocalDiskFlag = 0x0200000,
+ ExistsFlag = 0x0400000,
+ RootFlag = 0x0800000,
+ Refresh = 0x1000000,
+
+ //masks
+ PermsMask = 0x0000FFFF,
+ TypesMask = 0x000F0000,
+ FlagsMask = 0x0FF00000,
+ FileInfoAll = FlagsMask | PermsMask | TypesMask
+ };
+ Q_DECLARE_FLAGS(FileFlags, FileFlag)
+
+ enum FileName {
+ DefaultName,
+ BaseName,
+ PathName,
+ AbsoluteName,
+ AbsolutePathName,
+ LinkName,
+ CanonicalName,
+ CanonicalPathName,
+ BundleName,
+ NFileNames = 9
+ };
+ enum FileOwner {
+ OwnerUser,
+ OwnerGroup
+ };
+ enum FileTime {
+ CreationTime,
+ ModificationTime,
+ AccessTime
+ };
+
+ virtual ~QAbstractFileEngine();
+
+ virtual bool open(QIODevice::OpenMode openMode);
+ virtual bool close();
+ virtual bool flush();
+ virtual qint64 size() const;
+ virtual qint64 pos() const;
+ virtual bool seek(qint64 pos);
+ virtual bool isSequential() const;
+ virtual bool remove();
+ virtual bool copy(const QString &newName);
+ virtual bool rename(const QString &newName);
+ virtual bool link(const QString &newName);
+ virtual bool mkdir(const QString &dirName, bool createParentDirectories) const;
+ virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
+ virtual bool setSize(qint64 size);
+ virtual bool caseSensitive() const;
+ virtual bool isRelativePath() const;
+ virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
+ virtual FileFlags fileFlags(FileFlags type=FileInfoAll) const;
+ virtual bool setPermissions(uint perms);
+ virtual QString fileName(FileName file=DefaultName) const;
+ virtual uint ownerId(FileOwner) const;
+ virtual QString owner(FileOwner) const;
+ virtual QDateTime fileTime(FileTime time) const;
+ virtual void setFileName(const QString &file);
+ virtual int handle() const;
+ bool atEnd() const;
+ uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags);
+ bool unmap(uchar *ptr);
+
+ typedef QAbstractFileEngineIterator Iterator;
+ virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
+ virtual Iterator *endEntryList();
+
+ virtual qint64 read(char *data, qint64 maxlen);
+ virtual qint64 readLine(char *data, qint64 maxlen);
+ virtual qint64 write(const char *data, qint64 len);
+
+ QFile::FileError error() const;
+ QString errorString() const;
+
+ enum Extension {
+ AtEndExtension,
+ FastReadLineExtension,
+ MapExtension,
+ UnMapExtension
+ };
+ class ExtensionOption
+ {};
+ class ExtensionReturn
+ {};
+
+ class MapExtensionOption : public ExtensionOption {
+ public:
+ qint64 offset;
+ qint64 size;
+ QFile::MemoryMapFlags flags;
+ };
+ class MapExtensionReturn : public ExtensionReturn {
+ public:
+ uchar *address;
+ };
+
+ class UnMapExtensionOption : public ExtensionOption {
+ public:
+ uchar *address;
+ };
+
+ virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ virtual bool supportsExtension(Extension extension) const;
+
+ // Factory
+ static QAbstractFileEngine *create(const QString &fileName);
+
+protected:
+ void setError(QFile::FileError error, const QString &str);
+
+ QAbstractFileEngine();
+ QAbstractFileEngine(QAbstractFileEnginePrivate &);
+
+ QScopedPointer<QAbstractFileEnginePrivate> d_ptr;
+private:
+ Q_DECLARE_PRIVATE(QAbstractFileEngine)
+ Q_DISABLE_COPY(QAbstractFileEngine)
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFileEngine::FileFlags)
+
+class Q_AUTOTEST_EXPORT QAbstractFileEngineHandler
+{
+public:
+ QAbstractFileEngineHandler();
+ virtual ~QAbstractFileEngineHandler();
+ virtual QAbstractFileEngine *create(const QString &fileName) const = 0;
+};
+
+class QAbstractFileEngineIteratorPrivate;
+class Q_AUTOTEST_EXPORT QAbstractFileEngineIterator
+{
+public:
+ QAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters);
+ virtual ~QAbstractFileEngineIterator();
+
+ virtual QString next() = 0;
+ virtual bool hasNext() const = 0;
+
+ QString path() const;
+ QStringList nameFilters() const;
+ QDir::Filters filters() const;
+
+ virtual QString currentFileName() const = 0;
+ virtual QFileInfo currentFileInfo() const;
+ QString currentFilePath() const;
+
+protected:
+ enum EntryInfoType {
+ };
+ virtual QVariant entryInfo(EntryInfoType type) const;
+
+private:
+ Q_DISABLE_COPY(QAbstractFileEngineIterator)
+ friend class QDirIterator;
+ friend class QDirIteratorPrivate;
+ void setPath(const QString &path);
+ QScopedPointer<QAbstractFileEngineIteratorPrivate> d;
+};
+
class QAbstractFileEnginePrivate
{
public:
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 220fc43b92..afd402d019 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -42,12 +42,12 @@
#include "qplatformdefs.h"
#include "qdir.h"
#include "qdir_p.h"
-#include "qabstractfileengine.h"
+#include "qabstractfileengine_p.h"
+#include "qfsfileengine_p.h"
#ifndef QT_NO_DEBUG_STREAM
#include "qdebug.h"
#endif
#include "qdiriterator.h"
-#include "qfsfileengine.h"
#include "qdatetime.h"
#include "qstring.h"
#include "qregexp.h"
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index c5f24071aa..b8536a8dce 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -91,8 +91,7 @@
#include "qdiriterator.h"
#include "qdir_p.h"
-
-#include "qabstractfileengine.h"
+#include "qabstractfileengine_p.h"
#include <QtCore/qset.h>
#include <QtCore/qstack.h>
@@ -102,7 +101,6 @@
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
#include <QtCore/private/qfilesystemengine_p.h>
-#include <QtCore/qfsfileengine.h>
#include <QtCore/private/qfileinfo_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 58935fad3b..fc0c90cf69 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -42,7 +42,7 @@
#include "qplatformdefs.h"
#include "qdebug.h"
#include "qfile.h"
-#include "qfsfileengine.h"
+#include "qfsfileengine_p.h"
#include "qtemporaryfile.h"
#include "qlist.h"
#include "qfileinfo.h"
@@ -1028,52 +1028,6 @@ bool QFile::open(OpenMode mode)
Example:
\snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 3
- When a QFile is opened using this function, close() does not actually
- close the file, but only flushes it.
-
- \bold{Warning:}
- \list 1
- \o If \a fh does not refer to a regular file, e.g., it is \c stdin,
- \c stdout, or \c stderr, you may not be able to seek(). size()
- returns \c 0 in those cases. See QIODevice::isSequential() for
- more information.
- \o Since this function opens the file without specifying the file name,
- you cannot use this QFile with a QFileInfo.
- \endlist
-
- \note For Windows CE you may not be able to call resize().
-
- \sa close(), {qmake Variable Reference#CONFIG}{qmake Variable Reference}
-
- \bold{Note for the Windows Platform}
-
- \a fh must be opened in binary mode (i.e., the mode string must contain
- 'b', as in "rb" or "wb") when accessing files and other random-access
- devices. Qt will translate the end-of-line characters if you pass
- QIODevice::Text to \a mode. Sequential devices, such as stdin and stdout,
- are unaffected by this limitation.
-
- You need to enable support for console applications in order to use the
- stdin, stdout and stderr streams at the console. To do this, add the
- following declaration to your application's project file:
-
- \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 4
-*/
-// ### Qt5: merge this into new overload with a default parameter
-bool QFile::open(FILE *fh, OpenMode mode)
-{
- return open(fh, mode, DontCloseHandle);
-}
-
-/*!
- \overload
-
- Opens the existing file handle \a fh in the given \a mode.
- Returns true if successful; otherwise returns false.
-
- Example:
- \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 3
-
When a QFile is opened using this function, behaviour of close() is
controlled by the AutoCloseHandle flag.
If AutoCloseHandle is specified, and this function succeeds,
@@ -1142,39 +1096,6 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
Opens the existing file descriptor \a fd in the given \a mode.
Returns true if successful; otherwise returns false.
- When a QFile is opened using this function, close() does not
- actually close the file.
-
- The QFile that is opened using this function is automatically set
- to be in raw mode; this means that the file input/output functions
- are slow. If you run into performance issues, you should try to
- use one of the other open functions.
-
- \warning If \a fd is not a regular file, e.g, it is 0 (\c stdin),
- 1 (\c stdout), or 2 (\c stderr), you may not be able to seek(). In
- those cases, size() returns \c 0. See QIODevice::isSequential()
- for more information.
-
- \warning For Windows CE you may not be able to call seek(), setSize(),
- fileTime(). size() returns \c 0.
-
- \warning Since this function opens the file without specifying the file name,
- you cannot use this QFile with a QFileInfo.
-
- \sa close()
-*/
-// ### Qt5: merge this into new overload with a default parameter
-bool QFile::open(int fd, OpenMode mode)
-{
- return open(fd, mode, DontCloseHandle);
-}
-
-/*!
- \overload
-
- Opens the existing file descriptor \a fd in the given \a mode.
- Returns true if successful; otherwise returns false.
-
When a QFile is opened using this function, behaviour of close() is
controlled by the AutoCloseHandle flag.
If AutoCloseHandle is specified, and this function succeeds,
@@ -1276,7 +1197,7 @@ QFile::handle() const
\note On Windows CE 5.0 the file will be closed before mapping occurs.
- \sa unmap(), QAbstractFileEngine::supportsExtension()
+ \sa unmap()
*/
uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
{
@@ -1298,7 +1219,7 @@ uchar *QFile::map(qint64 offset, qint64 size, MemoryMapFlags flags)
Returns true if the unmap succeeds; false otherwise.
- \sa map(), QAbstractFileEngine::supportsExtension()
+ \sa map()
*/
bool QFile::unmap(uchar *address)
{
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index bf7290dda2..7f370d4214 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -144,10 +144,8 @@ public:
bool isSequential() const;
bool open(OpenMode flags);
- bool open(FILE *f, OpenMode flags);
- bool open(int fd, OpenMode flags);
- bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags);
- bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags);
+ bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle);
+ bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle);
virtual void close();
qint64 size() const;
diff --git a/src/corelib/io/qfile_p.h b/src/corelib/io/qfile_p.h
index 4a637d44a8..3d2d3d678b 100644
--- a/src/corelib/io/qfile_p.h
+++ b/src/corelib/io/qfile_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "QtCore/qabstractfileengine.h"
+#include "private/qabstractfileengine_p.h"
#include "private/qiodevice_p.h"
#include "private/qringbuffer_p.h"
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index aa1d88665c..4c7c9ffea8 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -54,12 +54,12 @@
//
#include "qfileinfo.h"
-#include "qabstractfileengine.h"
#include "qdatetime.h"
#include "qatomic.h"
#include "qshareddata.h"
#include "qfilesystemengine_p.h"
+#include <QtCore/private/qabstractfileengine_p.h>
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 8d08bb5944..5e466e480d 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -42,7 +42,6 @@
#include "qplatformdefs.h"
#include "qfilesystemengine_p.h"
#include "qplatformdefs.h"
-#include "qfsfileengine.h"
#include "qfile.h"
#include <QtCore/qvarlengtharray.h>
@@ -645,12 +644,12 @@ QFileSystemEntry QFileSystemEngine::currentPath()
result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath());
# if defined(QT_DEBUG)
if (result.isEmpty())
- qWarning("QFSFileEngine::currentPath: getcwd() failed");
+ qWarning("QFileSystemEngine::currentPath: getcwd() failed");
# endif
#endif
} else {
# if defined(QT_DEBUG)
- qWarning("QFSFileEngine::currentPath: stat(\".\") failed");
+ qWarning("QFileSystemEngine::currentPath: stat(\".\") failed");
# endif
}
return result;
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index b04018ca0f..294affce53 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -43,7 +43,7 @@
#define _POSIX_
#include "qplatformdefs.h"
-#include "qabstractfileengine.h"
+#include "private/qabstractfileengine_p.h"
#include "private/qfsfileengine_p.h"
#include <private/qsystemlibrary_p.h>
#include <qdebug.h>
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index 792ee0e714..6053b16752 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -56,7 +56,7 @@
#include "qplatformdefs.h"
#include <QtCore/qglobal.h>
#include <QtCore/qdatetime.h>
-#include <QtCore/qabstractfileengine.h>
+#include <QtCore/private/qabstractfileengine_p.h>
// Platform-specific includes
#ifdef Q_OS_WIN
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 4bf2e530a3..dde854e903 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -84,6 +84,7 @@ QT_BEGIN_NAMESPACE
/*! \class QFSFileEngine
\brief The QFSFileEngine class implements Qt's default file engine.
\since 4.1
+ \internal
This class is part of the file engine framework in Qt. If you only want to
access files or directories, use QFile, QFileInfo or QDir instead.
diff --git a/src/corelib/io/qfsfileengine.h b/src/corelib/io/qfsfileengine.h
deleted file mode 100644
index 63659e709a..0000000000
--- a/src/corelib/io/qfsfileengine.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFSFILEENGINE_H
-#define QFSFILEENGINE_H
-
-#include <QtCore/qabstractfileengine.h>
-
-#ifndef QT_NO_FSFILEENGINE
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-
-class QFSFileEnginePrivate;
-
-class Q_CORE_EXPORT QFSFileEngine : public QAbstractFileEngine
-{
- Q_DECLARE_PRIVATE(QFSFileEngine)
-public:
- QFSFileEngine();
- explicit QFSFileEngine(const QString &file);
- ~QFSFileEngine();
-
- bool open(QIODevice::OpenMode openMode);
- bool open(QIODevice::OpenMode flags, FILE *fh);
- bool close();
- bool flush();
- qint64 size() const;
- qint64 pos() const;
- bool seek(qint64);
- bool isSequential() const;
- bool remove();
- bool copy(const QString &newName);
- bool rename(const QString &newName);
- bool link(const QString &newName);
- bool mkdir(const QString &dirName, bool createParentDirectories) const;
- bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
- bool setSize(qint64 size);
- bool caseSensitive() const;
- bool isRelativePath() const;
- QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
- FileFlags fileFlags(FileFlags type) const;
- bool setPermissions(uint perms);
- QString fileName(FileName file) const;
- uint ownerId(FileOwner) const;
- QString owner(FileOwner) const;
- QDateTime fileTime(FileTime time) const;
- void setFileName(const QString &file);
- int handle() const;
-
- Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
- Iterator *endEntryList();
-
- qint64 read(char *data, qint64 maxlen);
- qint64 readLine(char *data, qint64 maxlen);
- qint64 write(const char *data, qint64 len);
-
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
- bool supportsExtension(Extension extension) const;
-
- //FS only!!
- bool open(QIODevice::OpenMode flags, int fd);
- bool open(QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags);
- bool open(QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags);
- static bool setCurrentPath(const QString &path);
- static QString currentPath(const QString &path = QString());
- static QString homePath();
- static QString rootPath();
- static QString tempPath();
- static QFileInfoList drives();
-
-protected:
- QFSFileEngine(QFSFileEnginePrivate &dd);
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QT_NO_FSFILEENGINE
-
-#endif // QFSFILEENGINE_H
diff --git a/src/corelib/io/qfsfileengine_iterator_p.h b/src/corelib/io/qfsfileengine_iterator_p.h
index 477e0ecd73..b0f47ea19d 100644
--- a/src/corelib/io/qfsfileengine_iterator_p.h
+++ b/src/corelib/io/qfsfileengine_iterator_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qabstractfileengine.h"
+#include "private/qabstractfileengine_p.h"
#include "qfilesystemiterator_p.h"
#include "qdir.h"
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index c06f662380..f403706479 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -54,8 +54,7 @@
//
#include "qplatformdefs.h"
-#include "QtCore/qfsfileengine.h"
-#include "private/qabstractfileengine_p.h"
+#include "QtCore/private/qabstractfileengine_p.h"
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
#include <qhash.h>
@@ -68,6 +67,68 @@ QT_BEGIN_NAMESPACE
#define Q_USE_DEPRECATED_MAP_API 1
#endif
+class QFSFileEnginePrivate;
+
+class Q_AUTOTEST_EXPORT QFSFileEngine : public QAbstractFileEngine
+{
+ Q_DECLARE_PRIVATE(QFSFileEngine)
+public:
+ QFSFileEngine();
+ explicit QFSFileEngine(const QString &file);
+ ~QFSFileEngine();
+
+ bool open(QIODevice::OpenMode openMode);
+ bool open(QIODevice::OpenMode flags, FILE *fh);
+ bool close();
+ bool flush();
+ qint64 size() const;
+ qint64 pos() const;
+ bool seek(qint64);
+ bool isSequential() const;
+ bool remove();
+ bool copy(const QString &newName);
+ bool rename(const QString &newName);
+ bool link(const QString &newName);
+ bool mkdir(const QString &dirName, bool createParentDirectories) const;
+ bool rmdir(const QString &dirName, bool recurseParentDirectories) const;
+ bool setSize(qint64 size);
+ bool caseSensitive() const;
+ bool isRelativePath() const;
+ QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const;
+ FileFlags fileFlags(FileFlags type) const;
+ bool setPermissions(uint perms);
+ QString fileName(FileName file) const;
+ uint ownerId(FileOwner) const;
+ QString owner(FileOwner) const;
+ QDateTime fileTime(FileTime time) const;
+ void setFileName(const QString &file);
+ int handle() const;
+
+ Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames);
+ Iterator *endEntryList();
+
+ qint64 read(char *data, qint64 maxlen);
+ qint64 readLine(char *data, qint64 maxlen);
+ qint64 write(const char *data, qint64 len);
+
+ bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ bool supportsExtension(Extension extension) const;
+
+ //FS only!!
+ bool open(QIODevice::OpenMode flags, int fd);
+ bool open(QIODevice::OpenMode flags, int fd, QFile::FileHandleFlags handleFlags);
+ bool open(QIODevice::OpenMode flags, FILE *fh, QFile::FileHandleFlags handleFlags);
+ static bool setCurrentPath(const QString &path);
+ static QString currentPath(const QString &path = QString());
+ static QString homePath();
+ static QString rootPath();
+ static QString tempPath();
+ static QFileInfoList drives();
+
+protected:
+ QFSFileEngine(QFSFileEnginePrivate &dd);
+};
+
class Q_AUTOTEST_EXPORT QFSFileEnginePrivate : public QAbstractFileEnginePrivate
{
Q_DECLARE_PUBLIC(QFSFileEngine)
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 805c4b5989..561e950217 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "qplatformdefs.h"
-#include "qabstractfileengine.h"
+#include "private/qabstractfileengine_p.h"
#include "private/qfsfileengine_p.h"
#include "private/qcore_unix_p.h"
#include "qfilesystementry_p.h"
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index cc78664275..347ce8429e 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -41,7 +41,7 @@
#define _POSIX_
#include "qplatformdefs.h"
-#include "qabstractfileengine.h"
+#include "private/qabstractfileengine_p.h"
#include "private/qfsfileengine_p.h"
#include "qfilesystemengine_p.h"
#include <qdebug.h>
diff --git a/src/corelib/io/qresource_iterator_p.h b/src/corelib/io/qresource_iterator_p.h
index e01b5d3e5f..763c0b72e2 100644
--- a/src/corelib/io/qresource_iterator_p.h
+++ b/src/corelib/io/qresource_iterator_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qabstractfileengine.h"
+#include "qabstractfileengine_p.h"
#include "qdir.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qresource_p.h b/src/corelib/io/qresource_p.h
index 73046888a5..b7c0a5fcb6 100644
--- a/src/corelib/io/qresource_p.h
+++ b/src/corelib/io/qresource_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "QtCore/qabstractfileengine.h"
+#include "qabstractfileengine_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index f4f285bae4..534c377102 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -66,7 +66,9 @@
QT_BEGIN_NAMESPACE
+#ifndef Q_OS_WIN
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
+#endif
// used in testing framework
#define QSETTINGS_P_H_VERSION 3
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index a6d58c760f..dd0ab85119 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -393,7 +393,7 @@ public:
};
inline bool getChar(QChar *ch);
- inline void ungetChar(const QChar &ch);
+ inline void ungetChar(QChar ch);
NumberParsingStatus getNumber(qulonglong *l);
bool getReal(double *f);
@@ -943,7 +943,7 @@ inline bool QTextStreamPrivate::getChar(QChar *ch)
/*! \internal
*/
-inline void QTextStreamPrivate::ungetChar(const QChar &ch)
+inline void QTextStreamPrivate::ungetChar(QChar ch)
{
if (string) {
if (stringOffset == 0)
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index e31337d0fd..aa3745237b 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -67,7 +67,7 @@ QWindowsPipeWriter::~QWindowsPipeWriter()
quitNow = true;
waitCondition.wakeOne();
lock.unlock();
- if (!wait(100))
+ if (!wait(30000))
terminate();
#if !defined(Q_OS_WINCE) || (_WIN32_WCE >= 0x600)
CloseHandle(writePipe);
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 1d6610af05..a8c3921f45 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -431,15 +431,9 @@ bool QPersistentModelIndex::isValid() const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QModelIndex &idx)
{
-#ifndef Q_BROKEN_DEBUG_STREAM
dbg.nospace() << "QModelIndex(" << idx.row() << ',' << idx.column()
<< ',' << idx.internalPointer() << ',' << idx.model() << ')';
return dbg.space();
-#else
- qWarning("This compiler doesn't support streaming QModelIndex to QDebug");
- return dbg;
- Q_UNUSED(idx);
-#endif
}
QDebug operator<<(QDebug dbg, const QPersistentModelIndex &idx)
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 7f31128770..c6c1f6f3cf 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1622,15 +1622,9 @@ void QItemSelectionModel::emitSelectionChanged(const QItemSelection &newSelectio
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QItemSelectionRange &range)
{
-#ifndef Q_BROKEN_DEBUG_STREAM
dbg.nospace() << "QItemSelectionRange(" << range.topLeft()
<< ',' << range.bottomRight() << ')';
return dbg.space();
-#else
- qWarning("This compiler doesn't support streaming QItemSelectionRange to QDebug");
- return dbg;
- Q_UNUSED(range);
-#endif
}
#endif
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index ebd1ce2a70..b7ef69423f 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -883,9 +883,10 @@ void QSortFilterProxyModelPrivate::source_items_removed(
if (proxy_count > source_to_proxy.size()) {
// mapping is in an inconsistent state -- redo the whole mapping
qWarning("QSortFilterProxyModel: inconsistent changes reported by source model");
- remove_from_mapping(source_parent);
Q_Q(QSortFilterProxyModel);
- q->reset();
+ q->beginResetModel();
+ remove_from_mapping(source_parent);
+ q->endResetModel();
return;
}
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index 8b0ec85679..dfdd178c35 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -322,28 +322,51 @@ class QEventLoopLockerPrivate
{
public:
explicit QEventLoopLockerPrivate(QEventLoopPrivate *loop)
- : loop(loop), app(0)
+ : loop(loop), type(EventLoop)
{
loop->ref();
}
+ explicit QEventLoopLockerPrivate(QThreadPrivate *thread)
+ : thread(thread), type(Thread)
+ {
+ thread->ref();
+ }
+
explicit QEventLoopLockerPrivate(QCoreApplicationPrivate *app)
- : loop(0), app(app)
+ : app(app), type(Application)
{
app->ref();
}
~QEventLoopLockerPrivate()
{
- if (loop)
+ switch (type)
+ {
+ case EventLoop:
loop->deref();
- else
+ break;
+ case Thread:
+ thread->deref();
+ break;
+ default:
app->deref();
+ break;
+ }
}
private:
- QEventLoopPrivate *loop;
- QCoreApplicationPrivate *app;
+ union {
+ QEventLoopPrivate * loop;
+ QThreadPrivate * thread;
+ QCoreApplicationPrivate * app;
+ };
+ enum Type {
+ EventLoop,
+ Thread,
+ Application
+ };
+ const Type type;
};
/*!
@@ -390,6 +413,12 @@ QEventLoopLocker::QEventLoopLocker(QEventLoop *loop)
}
+QEventLoopLocker::QEventLoopLocker(QThread *thread)
+ : d_ptr(new QEventLoopLockerPrivate(static_cast<QThreadPrivate*>(QObjectPrivate::get(thread))))
+{
+
+}
+
/*!
Destroys this event loop locker object
*/
diff --git a/src/corelib/kernel/qeventloop.h b/src/corelib/kernel/qeventloop.h
index 0e7195d6a7..ba082d7d9d 100644
--- a/src/corelib/kernel/qeventloop.h
+++ b/src/corelib/kernel/qeventloop.h
@@ -96,6 +96,7 @@ class Q_CORE_EXPORT QEventLoopLocker
public:
QEventLoopLocker();
explicit QEventLoopLocker(QEventLoop *loop);
+ explicit QEventLoopLocker(QThread *thread);
~QEventLoopLocker();
private:
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index a1baf28f10..003ad1c32d 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -1290,7 +1290,7 @@ namespace {
class TypeDestroyer {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct DestroyerImpl {
- static void Destroy(const int /* type */, T *where) { delete where; }
+ static void Destroy(const int /* type */, void *where) { qMetaTypeDeleteHelper<T>(where); }
};
template<typename T>
struct DestroyerImpl<T, /* IsAcceptedType = */ false> {
@@ -1318,7 +1318,7 @@ public:
template<typename T>
void delegate(const T *where) { DestroyerImpl<T>::Destroy(m_type, const_cast<T*>(where)); }
void delegate(const void *) {}
- void delegate(const QMetaTypeSwitcher::UnknownType *where) { customTypeDestroyer(m_type, (void*)where); }
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestroyer(m_type, (void*)where); }
private:
static void customTypeDestroyer(const int type, void *where)
@@ -1354,11 +1354,11 @@ namespace {
class TypeConstructor {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct ConstructorImpl {
- static void *Construct(const int /*type*/, void *where, const T *copy) { return qMetaTypeConstructHelper(where, copy); }
+ static void *Construct(const int /*type*/, void *where, const void *copy) { return qMetaTypeConstructHelper<T>(where, copy); }
};
template<typename T>
struct ConstructorImpl<T, /* IsAcceptedType = */ false> {
- static void *Construct(const int type, void *where, const T *copy)
+ static void *Construct(const int type, void *where, const void *copy)
{
if (QTypeModuleInfo<T>::IsGui)
return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) : 0;
@@ -1380,7 +1380,7 @@ public:
template<typename T>
void *delegate(const T *copy) { return ConstructorImpl<T>::Construct(m_type, m_where, copy); }
void *delegate(const void *) { return m_where; }
- void *delegate(const QMetaTypeSwitcher::UnknownType *copy) { return customTypeConstructor(m_type, m_where, copy); }
+ void *delegate(const QMetaTypeSwitcher::NotBuiltinType *copy) { return customTypeConstructor(m_type, m_where, copy); }
private:
static void *customTypeConstructor(const int type, void *where, const void *copy)
@@ -1440,7 +1440,7 @@ namespace {
class TypeDestructor {
template<typename T, bool IsAcceptedType = DefinedTypesFilter::Acceptor<T>::IsAccepted>
struct DestructorImpl {
- static void Destruct(const int /* type */, T *where) { qMetaTypeDestructHelper(where); }
+ static void Destruct(const int /* type */, void *where) { qMetaTypeDestructHelper<T>(where); }
};
template<typename T>
struct DestructorImpl<T, /* IsAcceptedType = */ false> {
@@ -1468,7 +1468,7 @@ public:
template<typename T>
void delegate(const T *where) { DestructorImpl<T>::Destruct(m_type, const_cast<T*>(where)); }
void delegate(const void *) {}
- void delegate(const QMetaTypeSwitcher::UnknownType *where) { customTypeDestructor(m_type, (void*)where); }
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType *where) { customTypeDestructor(m_type, (void*)where); }
private:
static void customTypeDestructor(const int type, void *where)
@@ -1536,7 +1536,7 @@ public:
template<typename T>
int delegate(const T*) { return SizeOfImpl<T>::Size(m_type); }
- int delegate(const QMetaTypeSwitcher::UnknownType*) { return customTypeSizeOf(m_type); }
+ int delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeSizeOf(m_type); }
private:
static int customTypeSizeOf(const int type)
{
@@ -1606,7 +1606,7 @@ public:
template<typename T>
quint32 delegate(const T*) { return FlagsImpl<T>::Flags(m_type); }
quint32 delegate(const void*) { return 0; }
- quint32 delegate(const QMetaTypeSwitcher::UnknownType*) { return customTypeFlags(m_type); }
+ quint32 delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customTypeFlags(m_type); }
private:
const int m_type;
static quint32 customTypeFlags(const int type)
@@ -1793,7 +1793,7 @@ public:
template<typename T>
void delegate(const T*) { TypeInfoImpl<T>(m_type, info); }
void delegate(const void*) {}
- void delegate(const QMetaTypeSwitcher::UnknownType*) { customTypeInfo(m_type); }
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType*) { customTypeInfo(m_type); }
private:
void customTypeInfo(const uint type)
{
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 4af77fcedc..beb7294abd 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -200,14 +200,7 @@ public:
LastWidgetsType = QSizePolicy,
HighestInternalId = LastWidgetsType,
-// This logic must match the one in qglobal.h
-#if defined(QT_COORD_TYPE)
- QReal = 0,
-#elif defined(QT_NO_FPU) || defined(Q_PROCESSOR_ARM) || defined(Q_OS_WINCE)
- QReal = Float,
-#else
- QReal = Double,
-#endif
+ QReal = sizeof(qreal) == sizeof(double) ? Double : Float,
User = 256
};
@@ -318,46 +311,57 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaType::TypeFlags)
template <typename T>
-void qMetaTypeDeleteHelper(T *t)
+void qMetaTypeDeleteHelper(void *t)
{
- delete t;
+ delete static_cast<T*>(t);
}
+template <> inline void qMetaTypeDeleteHelper<void>(void *) {}
template <typename T>
-void *qMetaTypeCreateHelper(const T *t)
+void *qMetaTypeCreateHelper(const void *t)
{
if (t)
return new T(*static_cast<const T*>(t));
return new T();
}
+template <> inline void *qMetaTypeCreateHelper<void>(const void *) { return 0; }
+
template <typename T>
-void qMetaTypeDestructHelper(T *t)
+void qMetaTypeDestructHelper(void *t)
{
Q_UNUSED(t) // Silence MSVC that warns for POD types.
- t->~T();
+ static_cast<T*>(t)->~T();
}
+template <> inline void qMetaTypeDestructHelper<void>(void *) {}
+
template <typename T>
-void *qMetaTypeConstructHelper(void *where, const T *t)
+void *qMetaTypeConstructHelper(void *where, const void *t)
{
if (t)
return new (where) T(*static_cast<const T*>(t));
return new (where) T;
}
+template <> inline void *qMetaTypeConstructHelper<void>(void *, const void *) { return 0; }
+
#ifndef QT_NO_DATASTREAM
template <typename T>
-void qMetaTypeSaveHelper(QDataStream &stream, const T *t)
+void qMetaTypeSaveHelper(QDataStream &stream, const void *t)
{
- stream << *t;
+ stream << *static_cast<const T*>(t);
}
+template <> inline void qMetaTypeSaveHelper<void>(QDataStream &, const void *) {}
+
template <typename T>
-void qMetaTypeLoadHelper(QDataStream &stream, T *t)
+void qMetaTypeLoadHelper(QDataStream &stream, void *t)
{
- stream >> *t;
+ stream >> *static_cast<T*>(t);
}
+
+template <> inline void qMetaTypeLoadHelper<void>(QDataStream &, void *) {}
#endif // QT_NO_DATASTREAM
template <typename T>
@@ -442,15 +446,6 @@ int qRegisterMetaType(const char *typeName
if (typedefOf != -1)
return QMetaType::registerTypedef(typeName, typedefOf);
- typedef void*(*CreatePtr)(const T*);
- CreatePtr cptr = qMetaTypeCreateHelper<T>;
- typedef void(*DeletePtr)(T*);
- DeletePtr dptr = qMetaTypeDeleteHelper<T>;
- typedef void*(*ConstructPtr)(void *, const T*);
- ConstructPtr ipcptr = qMetaTypeConstructHelper<T>;
- typedef void(*DestructPtr)(T*);
- DestructPtr ipdptr = qMetaTypeDestructHelper<T>;
-
QMetaType::TypeFlags flags;
if (!QTypeInfo<T>::isStatic)
flags |= QMetaType::MovableType;
@@ -461,10 +456,10 @@ int qRegisterMetaType(const char *typeName
if (QtPrivate::IsPointerToTypeDerivedFromQObject<T>::Value)
flags |= QMetaType::PointerToQObject;
- return QMetaType::registerType(typeName, reinterpret_cast<QMetaType::Deleter>(dptr),
- reinterpret_cast<QMetaType::Creator>(cptr),
- reinterpret_cast<QMetaType::Destructor>(ipdptr),
- reinterpret_cast<QMetaType::Constructor>(ipcptr),
+ return QMetaType::registerType(typeName, qMetaTypeDeleteHelper<T>,
+ qMetaTypeCreateHelper<T>,
+ qMetaTypeDestructHelper<T>,
+ qMetaTypeConstructHelper<T>,
sizeof(T),
flags);
}
@@ -477,14 +472,8 @@ void qRegisterMetaTypeStreamOperators(const char *typeName
#endif
)
{
- typedef void(*SavePtr)(QDataStream &, const T *);
- typedef void(*LoadPtr)(QDataStream &, T *);
- SavePtr sptr = qMetaTypeSaveHelper<T>;
- LoadPtr lptr = qMetaTypeLoadHelper<T>;
-
qRegisterMetaType<T>(typeName);
- QMetaType::registerStreamOperators(typeName, reinterpret_cast<QMetaType::SaveOperator>(sptr),
- reinterpret_cast<QMetaType::LoadOperator>(lptr));
+ QMetaType::registerStreamOperators(typeName, qMetaTypeSaveHelper<T>, qMetaTypeLoadHelper<T>);
}
#endif // QT_NO_DATASTREAM
@@ -516,16 +505,8 @@ inline int qRegisterMetaType(
template <typename T>
inline int qRegisterMetaTypeStreamOperators()
{
- typedef void(*SavePtr)(QDataStream &, const T *);
- typedef void(*LoadPtr)(QDataStream &, T *);
- SavePtr sptr = qMetaTypeSaveHelper<T>;
- LoadPtr lptr = qMetaTypeLoadHelper<T>;
-
register int id = qMetaTypeId<T>();
- QMetaType::registerStreamOperators(id,
- reinterpret_cast<QMetaType::SaveOperator>(sptr),
- reinterpret_cast<QMetaType::LoadOperator>(lptr));
-
+ QMetaType::registerStreamOperators(id, qMetaTypeSaveHelper<T>, qMetaTypeLoadHelper<T>);
return id;
}
#endif
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index e48c5d3033..b50521c7a6 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -122,31 +122,6 @@ QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_DECLARE_WIDGETS_MODULE_TYPES_ITER)
class QMetaTypeInterface
{
public:
- template<typename T>
- struct Impl {
- static void *creator(const T *t)
- {
- if (t)
- return new T(*t);
- return new T();
- }
-
- static void deleter(T *t) { delete t; }
- static void saver(QDataStream &stream, const T *t) { stream << *t; }
- static void loader(QDataStream &stream, T *t) { stream >> *t; }
- static void destructor(T *t)
- {
- Q_UNUSED(t) // Silence MSVC that warns for POD types.
- t->~T();
- }
- static void *constructor(void *where, const T *t)
- {
- if (t)
- return new (where) T(*static_cast<const T*>(t));
- return new (where) T;
- }
- };
-
QMetaType::Creator creator;
QMetaType::Deleter deleter;
QMetaType::SaveOperator saveOp;
@@ -157,20 +132,10 @@ public:
quint32 flags; // same as QMetaType::TypeFlags
};
-template<>
-struct QMetaTypeInterface::Impl<void> {
- static void *creator(const void *) { return 0; }
- static void deleter(void *) {}
- static void saver(QDataStream &, const void *) {}
- static void loader(QDataStream &, void *) {}
- static void destructor(void *){}
- static void *constructor(void *, const void *) { return 0; }
-};
-
#ifndef QT_NO_DATASTREAM
# define QT_METATYPE_INTERFACE_INIT_DATASTREAM_IMPL(Type) \
- /*saveOp*/(reinterpret_cast<QMetaType::SaveOperator>(QMetaTypeInterface::Impl<Type>::saver)), \
- /*loadOp*/(reinterpret_cast<QMetaType::LoadOperator>(QMetaTypeInterface::Impl<Type>::loader)),
+ /*saveOp*/(qMetaTypeSaveHelper<Type>), \
+ /*loadOp*/(qMetaTypeLoadHelper<Type>),
# define QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type) \
/*saveOp*/ 0, \
/*loadOp*/ 0,
@@ -184,11 +149,11 @@ struct QMetaTypeInterface::Impl<void> {
#define QT_METATYPE_INTERFACE_INIT_IMPL(Type, DATASTREAM_DELEGATE) \
{ \
- /*creator*/(reinterpret_cast<QMetaType::Creator>(QMetaTypeInterface::Impl<Type>::creator)), \
- /*deleter*/(reinterpret_cast<QMetaType::Deleter>(QMetaTypeInterface::Impl<Type>::deleter)), \
+ /*creator*/(qMetaTypeCreateHelper<Type>), \
+ /*deleter*/(qMetaTypeDeleteHelper<Type>), \
DATASTREAM_DELEGATE(Type) \
- /*constructor*/(reinterpret_cast<QMetaType::Constructor>(QMetaTypeInterface::Impl<Type>::constructor)), \
- /*destructor*/(reinterpret_cast<QMetaType::Destructor>(QMetaTypeInterface::Impl<Type>::destructor)), \
+ /*constructor*/(qMetaTypeConstructHelper<Type>), \
+ /*destructor*/(qMetaTypeDestructHelper<Type>), \
/*size*/(QTypeInfo<Type>::sizeOf), \
/*flags*/(!QTypeInfo<Type>::isStatic * QMetaType::MovableType) \
| (QTypeInfo<Type>::isComplex * QMetaType::NeedsConstruction) \
diff --git a/src/corelib/kernel/qmetatypeswitcher_p.h b/src/corelib/kernel/qmetatypeswitcher_p.h
index c1cccfca63..e9c15ea214 100644
--- a/src/corelib/kernel/qmetatypeswitcher_p.h
+++ b/src/corelib/kernel/qmetatypeswitcher_p.h
@@ -59,46 +59,27 @@ QT_BEGIN_NAMESPACE
class QMetaTypeSwitcher {
public:
-
- typedef void *UnknownType;
+ class NotBuiltinType;
template<class ReturnType, class DelegateObject>
static ReturnType switcher(DelegateObject &logic, int type, const void *data);
};
-#define QT_METATYPE_SWICHER_CASE_PRIMITIVE(TypeName, TypeId, Name)\
- case QMetaType::TypeName: return logic.delegate(static_cast<const Name *>(data));
-
-#define QT_METATYPE_SWICHER_CASE_PRIMITIVE_POINTER(TypeName, TypeId, Name)\
- case QMetaType::TypeName: return logic.delegate(static_cast< Name * const *>(data));
-
-#define QT_METATYPE_SWICHER_CASE_POINTER(TypeName, TypeId, Name)\
- case QMetaType::TypeName: return logic.delegate(static_cast< QT_PREPEND_NAMESPACE(Name) * const *>(data));
-
-#define QT_METATYPE_SWICHER_CASE_QCLASS(TypeName, TypeId, Name)\
- case QMetaType::TypeName: return logic.delegate(static_cast<const QT_PREPEND_NAMESPACE(Name) *>(data));
+#define QT_METATYPE_SWICHER_CASE(TypeName, TypeId, Name)\
+ case QMetaType::TypeName: return logic.delegate(static_cast<Name const *>(data));
template<class ReturnType, class DelegateObject>
ReturnType QMetaTypeSwitcher::switcher(DelegateObject &logic, int type, const void *data)
{
switch (QMetaType::Type(type)) {
- QT_FOR_EACH_STATIC_PRIMITIVE_TYPE(QT_METATYPE_SWICHER_CASE_PRIMITIVE)
- QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(QT_METATYPE_SWICHER_CASE_PRIMITIVE_POINTER)
- QT_FOR_EACH_STATIC_CORE_POINTER(QT_METATYPE_SWICHER_CASE_POINTER)
- QT_FOR_EACH_STATIC_CORE_CLASS(QT_METATYPE_SWICHER_CASE_QCLASS)
- QT_FOR_EACH_STATIC_CORE_TEMPLATE(QT_METATYPE_SWICHER_CASE_QCLASS)
- QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_SWICHER_CASE_QCLASS)
- QT_FOR_EACH_STATIC_WIDGETS_CLASS(QT_METATYPE_SWICHER_CASE_QCLASS)
+ QT_FOR_EACH_STATIC_TYPE(QT_METATYPE_SWICHER_CASE)
default:
- return logic.delegate(static_cast<const UnknownType *>(data));
+ return logic.delegate(static_cast<NotBuiltinType const *>(data));
}
}
-#undef QT_METATYPE_SWICHER_CASE_PRIMITIVE
-#undef QT_METATYPE_SWICHER_CASE_PRIMITIVE_POINTER
-#undef QT_METATYPE_SWICHER_CASE_QCLASS
-#undef QT_METATYPE_SWICHER_CASE_POINTER
+#undef QT_METATYPE_SWICHER_CASE
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 252a713872..8fa5dcdcff 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3617,7 +3617,6 @@ QObjectUserData* QObject::userData(uint id) const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QObject *o) {
-#ifndef Q_BROKEN_DEBUG_STREAM
if (!o)
return dbg << "QObject(0x0) ";
dbg.nospace() << o->metaObject()->className() << '(' << (void *)o;
@@ -3625,11 +3624,6 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
dbg << ", name = " << o->objectName();
dbg << ')';
return dbg.space();
-#else
- qWarning("This compiler doesn't support streaming QObject to QDebug");
- return dbg;
- Q_UNUSED(o);
-#endif
}
#endif
diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h
index 5adffb708f..419fcc1dd4 100644
--- a/src/corelib/kernel/qobject_impl.h
+++ b/src/corelib/kernel/qobject_impl.h
@@ -52,7 +52,6 @@ QT_BEGIN_NAMESPACE
namespace QtPrivate {
template <typename T> struct RemoveRef { typedef T Type; };
- template <typename T> struct RemoveRef<const T&> { typedef T Type; };
template <typename T> struct RemoveRef<T&> { typedef T Type; };
template <typename T> struct RemoveConstRef { typedef T Type; };
template <typename T> struct RemoveConstRef<const T&> { typedef T Type; };
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index d0470ff796..1c18883fde 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -279,7 +279,7 @@ inline bool qt_convertToBool(const QVariant::Private *const d)
Converts \a d to type \a t, which is placed in \a result.
*/
-static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, bool *ok)
+static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
{
Q_ASSERT(d->type != uint(t));
Q_ASSERT(result);
@@ -732,7 +732,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, void *result,
return true;
}
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
static void streamDebug(QDebug dbg, const QVariant &v)
{
QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr());
@@ -752,7 +752,7 @@ const QVariant::Handler qt_kernel_variant_handler = {
compare,
convert,
0,
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
streamDebug
#else
0
@@ -763,8 +763,8 @@ static void dummyConstruct(QVariant::Private *, const void *) { Q_ASSERT_X(false
static void dummyClear(QVariant::Private *) { Q_ASSERT_X(false, "QVariant", "Trying to clear an unknown type"); }
static bool dummyIsNull(const QVariant::Private *d) { Q_ASSERT_X(false, "QVariant::isNull", "Trying to call isNull on an unknown type"); return d->is_null; }
static bool dummyCompare(const QVariant::Private *, const QVariant::Private *) { Q_ASSERT_X(false, "QVariant", "Trying to compare an unknown types"); return false; }
-static bool dummyConvert(const QVariant::Private *, QVariant::Type , void *, bool *) { Q_ASSERT_X(false, "QVariant", "Trying to convert an unknown type"); return false; }
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+static bool dummyConvert(const QVariant::Private *, int, void *, bool *) { Q_ASSERT_X(false, "QVariant", "Trying to convert an unknown type"); return false; }
+#if !defined(QT_NO_DEBUG_STREAM)
static void dummyStreamDebug(QDebug, const QVariant &) { Q_ASSERT_X(false, "QVariant", "Trying to convert an unknown type"); }
#endif
const QVariant::Handler qt_dummy_variant_handler = {
@@ -778,7 +778,7 @@ const QVariant::Handler qt_dummy_variant_handler = {
dummyCompare,
dummyConvert,
0,
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
dummyStreamDebug
#else
0
@@ -840,14 +840,14 @@ static bool customCompare(const QVariant::Private *a, const QVariant::Private *b
return !memcmp(a_ptr, b_ptr, QMetaType::sizeOf(a->type));
}
-static bool customConvert(const QVariant::Private *, QVariant::Type, void *, bool *ok)
+static bool customConvert(const QVariant::Private *, int, void *, bool *ok)
{
if (ok)
*ok = false;
return false;
}
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
static void customStreamDebug(QDebug, const QVariant &) {}
#endif
@@ -862,7 +862,7 @@ const QVariant::Handler qt_custom_variant_handler = {
customCompare,
customConvert,
0,
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
customStreamDebug
#else
0
@@ -1062,9 +1062,9 @@ Q_CORE_EXPORT void QVariantPrivate::unregisterHandler(const int /* Modules::Name
/*!
- \fn QVariant::QVariant(int typeOrUserType, const void *copy)
+ \fn QVariant::QVariant(int typeId, const void *copy)
- Constructs variant of type \a typeOrUserType, and initializes with
+ Constructs variant of type \a typeId, and initializes with
\a copy if \a copy is not 0.
Note that you have to pass the address of the variable you want stored.
@@ -1162,17 +1162,15 @@ QVariant::QVariant(QDataStream &s)
\fn QVariant::QVariant(const char *val)
Constructs a new variant with a string value of \a val.
- The variant creates a deep copy of \a val, using the encoding
- set by QTextCodec::setCodecForCStrings().
+ The variant creates a deep copy of \a val into a QString assuming
+ UTF-8 encoding on the input \a val.
Note that \a val is converted to a QString for storing in the
- variant and QVariant::type() will return QMetaType::QString for
+ variant and QVariant::userType() will return QMetaType::QString for
the variant.
You can disable this operator by defining \c
QT_NO_CAST_FROM_ASCII when you compile your applications.
-
- \sa QTextCodec::setCodecForCStrings()
*/
#ifndef QT_NO_CAST_FROM_ASCII
@@ -1343,7 +1341,7 @@ QVariant::QVariant(const char *val)
*/
/*!
- \fn QVariant::QVariant(const QChar &c)
+ \fn QVariant::QVariant(QChar c)
Constructs a new variant with a char value, \a c.
*/
@@ -1375,19 +1373,19 @@ QVariant::QVariant(const char *val)
QVariant::QVariant(Type type)
{ create(type, 0); }
-QVariant::QVariant(int typeOrUserType, const void *copy)
-{ create(typeOrUserType, copy); d.is_null = false; }
+QVariant::QVariant(int typeId, const void *copy)
+{ create(typeId, copy); d.is_null = false; }
/*! \internal
flags is true if it is a pointer type
*/
-QVariant::QVariant(int typeOrUserType, const void *copy, uint flags)
+QVariant::QVariant(int typeId, const void *copy, uint flags)
{
if (flags) { //type is a pointer type
- d.type = typeOrUserType;
+ d.type = typeId;
d.data.ptr = *reinterpret_cast<void *const*>(copy);
} else {
- create(typeOrUserType, copy);
+ create(typeId, copy);
}
d.is_null = false;
}
@@ -1411,7 +1409,7 @@ QVariant::QVariant(const QBitArray &val)
{ d.is_null = false; d.type = BitArray; v_construct<QBitArray>(&d, val); }
QVariant::QVariant(const QString &val)
{ d.is_null = false; d.type = String; v_construct<QString>(&d, val); }
-QVariant::QVariant(const QChar &val)
+QVariant::QVariant(QChar val)
{ d.is_null = false; d.type = Char; v_construct<QChar>(&d, val); }
QVariant::QVariant(const QLatin1String &val)
{ QString str(val); d.is_null = false; d.type = String; v_construct<QString>(&d, str); }
@@ -1565,7 +1563,7 @@ void QVariant::detach()
*/
const char *QVariant::typeName() const
{
- return typeToName(Type(d.type));
+ return typeToName(d.type);
}
/*!
@@ -1582,17 +1580,17 @@ void QVariant::clear()
}
/*!
- Converts the enum representation of the storage type, \a typ, to
+ Converts the int representation of the storage type, \a typeId, to
its string representation.
Returns a null pointer if the type is QVariant::Invalid or doesn't exist.
*/
-const char *QVariant::typeToName(Type typ)
+const char *QVariant::typeToName(int typeId)
{
- if (typ == Invalid)
+ if (typeId == Invalid)
return 0;
- return QMetaType::typeName(typ);
+ return QMetaType::typeName(typeId);
}
@@ -1842,7 +1840,7 @@ QDataStream& operator<<(QDataStream &s, const QVariant::Type p)
template <typename T>
inline T qVariantToHelper(const QVariant::Private &d, const HandlersManager &handlerManager)
{
- const QVariant::Type targetType = static_cast<const QVariant::Type>(qMetaTypeId<T>());
+ const uint targetType = qMetaTypeId<T>();
if (d.type == targetType)
return *v_cast<T>(&d);
@@ -2163,7 +2161,7 @@ inline T qNumVariantToHelper(const QVariant::Private &d,
return val;
T ret = 0;
- if (!handlerManager[d.type]->convert(&d, QVariant::Type(t), &ret, ok) && ok)
+ if (!handlerManager[d.type]->convert(&d, t, &ret, ok) && ok)
*ok = false;
return ret;
}
@@ -2407,7 +2405,7 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
/*!
Returns true if the variant's type can be cast to the requested
- type, \a t. Such casting is done automatically when calling the
+ type, \a targetTypeId. Such casting is done automatically when calling the
toInt(), toBool(), ... methods.
The following casts are done automatically:
@@ -2439,18 +2437,18 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
\sa convert()
*/
-bool QVariant::canConvert(Type t) const
+bool QVariant::canConvert(int targetTypeId) const
{
// TODO Reimplement this function, currently it works but it is a historical mess.
const uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type);
- if (uint(t) == uint(QMetaType::Float)) t = QVariant::Double;
+ if (uint(targetTypeId) == uint(QMetaType::Float)) targetTypeId = QVariant::Double;
- if (currentType == uint(t))
+ if (currentType == uint(targetTypeId))
return true;
// FIXME It should be LastCoreType intead of Uuid
- if (currentType > QVariant::Uuid || t > QVariant::Uuid) {
- switch (uint(t)) {
+ if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) {
+ switch (uint(targetTypeId)) {
case QVariant::Int:
return currentType == QVariant::KeySequence
|| currentType == QMetaType::ULong
@@ -2492,14 +2490,14 @@ bool QVariant::canConvert(Type t) const
}
}
- if(t == String && currentType == StringList)
+ if (targetTypeId == String && currentType == StringList)
return v_cast<QStringList>(&d)->count() == 1;
else
- return qCanConvertMatrix[t] & (1 << currentType);
+ return qCanConvertMatrix[targetTypeId] & (1 << currentType);
}
/*!
- Casts the variant to the requested type, \a t. If the cast cannot be
+ Casts the variant to the requested type, \a targetTypeId. If the cast cannot be
done, the variant is cleared. Returns true if the current type of
the variant was successfully cast; otherwise returns false.
@@ -2510,23 +2508,23 @@ bool QVariant::canConvert(Type t) const
\sa canConvert(), clear()
*/
-bool QVariant::convert(Type t)
+bool QVariant::convert(int targetTypeId)
{
- if (d.type == uint(t))
+ if (d.type == uint(targetTypeId))
return true;
QVariant oldValue = *this;
clear();
- if (!oldValue.canConvert(t))
+ if (!oldValue.canConvert(targetTypeId))
return false;
- create(t, 0);
+ create(targetTypeId, 0);
if (oldValue.isNull())
return false;
bool isOk = true;
- if (!handlerManager[d.type]->convert(&oldValue.d, t, data(), &isOk))
+ if (!handlerManager[d.type]->convert(&oldValue.d, targetTypeId, data(), &isOk))
isOk = false;
d.is_null = !isOk;
return isOk;
@@ -2540,7 +2538,7 @@ bool QVariant::convert(Type t)
bool QVariant::convert(const int type, void *ptr) const
{
Q_ASSERT(type < int(QMetaType::User));
- return handlerManager[type]->convert(&d, QVariant::Type(type), ptr, 0);
+ return handlerManager[type]->convert(&d, type, ptr, 0);
}
@@ -2607,7 +2605,7 @@ bool QVariant::cmp(const QVariant &v) const
else
return toLongLong() == v.toLongLong();
}
- if (!v2.canConvert(Type(d.type)) || !v2.convert(Type(d.type)))
+ if (!v2.canConvert(d.type) || !v2.convert(d.type))
return false;
}
return handlerManager[d.type]->compare(&d, &v2.d);
@@ -2646,28 +2644,16 @@ bool QVariant::isNull() const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QVariant &v)
{
-#ifndef Q_BROKEN_DEBUG_STREAM
dbg.nospace() << "QVariant(" << QMetaType::typeName(v.userType()) << ", ";
handlerManager[v.d.type]->debugStream(dbg, v);
dbg.nospace() << ')';
return dbg.space();
-#else
- qWarning("This compiler doesn't support streaming QVariant to QDebug");
- return dbg;
- Q_UNUSED(v);
-#endif
}
QDebug operator<<(QDebug dbg, const QVariant::Type p)
{
-#ifndef Q_BROKEN_DEBUG_STREAM
dbg.nospace() << "QVariant::" << QMetaType::typeName(p);
return dbg.space();
-#else
- qWarning("This compiler doesn't support streaming QVariant::Type to QDebug");
- return dbg;
- Q_UNUSED(p);
-#endif
}
#endif
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index 089d0d643b..5da482d5cd 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -194,8 +194,8 @@ class Q_CORE_EXPORT QVariant
inline QVariant();
~QVariant();
QVariant(Type type);
- QVariant(int typeOrUserType, const void *copy);
- QVariant(int typeOrUserType, const void *copy, uint flags);
+ QVariant(int typeId, const void *copy);
+ QVariant(int typeId, const void *copy, uint flags);
QVariant(const QVariant &other);
#ifndef QT_NO_DATASTREAM
@@ -210,7 +210,7 @@ class Q_CORE_EXPORT QVariant
QVariant(double d);
QVariant(float f) { d.is_null = false; d.type = QMetaType::Float; d.data.f = f; }
#ifndef QT_NO_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN_CONSTRUCTOR QVariant(const char *str);
+ QT_ASCII_CAST_WARN QVariant(const char *str);
#endif
QVariant(const QByteArray &bytearray);
@@ -218,7 +218,7 @@ class Q_CORE_EXPORT QVariant
QVariant(const QString &string);
QVariant(const QLatin1String &string);
QVariant(const QStringList &stringlist);
- QVariant(const QChar &qchar);
+ QVariant(QChar qchar);
QVariant(const QDate &date);
QVariant(const QTime &time);
QVariant(const QDateTime &datetime);
@@ -257,8 +257,8 @@ class Q_CORE_EXPORT QVariant
int userType() const;
const char *typeName() const;
- bool canConvert(Type t) const;
- bool convert(Type t);
+ bool canConvert(int targetTypeId) const;
+ bool convert(int targetTypeId);
inline bool isValid() const;
bool isNull() const;
@@ -311,7 +311,7 @@ class Q_CORE_EXPORT QVariant
void load(QDataStream &ds);
void save(QDataStream &ds) const;
#endif
- static const char *typeToName(Type type);
+ static const char *typeToName(int typeId);
static Type nameToType(const char *name);
void *data();
@@ -331,7 +331,7 @@ class Q_CORE_EXPORT QVariant
template<typename T>
bool canConvert() const
- { return canConvert(Type(qMetaTypeId<T>())); }
+ { return canConvert(qMetaTypeId<T>()); }
public:
#ifndef qdoc
@@ -381,8 +381,8 @@ class Q_CORE_EXPORT QVariant
typedef void (*f_save)(const Private *, QDataStream &);
#endif
typedef bool (*f_compare)(const Private *, const Private *);
- typedef bool (*f_convert)(const QVariant::Private *d, Type t, void *, bool *);
- typedef bool (*f_canConvert)(const QVariant::Private *d, Type t);
+ typedef bool (*f_convert)(const QVariant::Private *d, int t, void *, bool *);
+ typedef bool (*f_canConvert)(const QVariant::Private *d, int t);
typedef void (*f_debugStream)(QDebug, const QVariant &);
struct Handler {
f_construct construct;
@@ -527,7 +527,7 @@ namespace QtPrivate {
return *reinterpret_cast<const T *>(v.constData());
if (vid < int(QMetaType::User)) {
T t;
- if (v.convert(QVariant::Type(vid), &t))
+ if (v.convert(vid, &t))
return t;
}
return T();
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index cdae8997a7..a754bc4363 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -188,7 +188,7 @@ public:
}
bool delegate(const void*) { return true; }
-
+ bool delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return false; }
protected:
const QVariant::Private *m_a;
const QVariant::Private *m_b;
@@ -282,6 +282,7 @@ public:
}
// we need that as sizof(void) is undefined and it is needed in HasIsNullMethod
bool delegate(const void *) { return m_d->is_null; }
+ bool delegate(const QMetaTypeSwitcher::NotBuiltinType *) { return m_d->is_null; }
protected:
const QVariant::Private *m_d;
};
@@ -345,7 +346,7 @@ public:
FilteredConstructor<T>(*this);
}
- void delegate(const QMetaTypeSwitcher::UnknownType*)
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType*)
{
qWarning("Trying to construct an instance of an invalid type, type id: %i", m_x->type);
m_x->type = QVariant::Invalid;
@@ -395,7 +396,7 @@ public:
FilteredDestructor<T> cleaner(m_d);
}
- void delegate(const QMetaTypeSwitcher::UnknownType*)
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType*)
{
qWarning("Trying to destruct an instance of an invalid type, type id: %i", m_d->type);
}
@@ -410,7 +411,7 @@ Q_CORE_EXPORT void registerHandler(const int /* Modules::Names */ name, const QV
Q_CORE_EXPORT void unregisterHandler(const int /* Modules::Names */ name);
}
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM)
+#if !defined(QT_NO_DEBUG_STREAM)
template<class Filter>
class QVariantDebugStream
{
@@ -441,7 +442,7 @@ public:
Filtered<T> streamIt(m_debugStream, m_d);
}
- void delegate(const QMetaTypeSwitcher::UnknownType*)
+ void delegate(const QMetaTypeSwitcher::NotBuiltinType*)
{
qWarning("Trying to stream an instance of an invalid type, type id: %i", m_d->type);
}
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 655ca365fa..e35c1923f9 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -83,6 +83,7 @@ public:
private:
const QScopedPointer<QMimeMagicRulePrivate> d;
};
+Q_DECLARE_TYPEINFO(QMimeMagicRule, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 77592880a0..4099487f9b 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -300,7 +300,6 @@ QString QMimeType::name() const
Returns the description of the MIME type to be displayed on user interfaces.
The system language (QLocale::system().name()) is used to select the appropriate translation.
- Another language can be specified by setting the \a localeName argument.
*/
QString QMimeType::comment() const
{
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 23f57367e3..4a2ec0a0b2 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -58,29 +58,29 @@
QT_BEGIN_NAMESPACE
// XML tags in MIME files
-const char *const mimeInfoTagC = "mime-info";
-const char *const mimeTypeTagC = "mime-type";
-const char *const mimeTypeAttributeC = "type";
-const char *const subClassTagC = "sub-class-of";
-const char *const commentTagC = "comment";
-const char *const genericIconTagC = "generic-icon";
-const char *const iconTagC = "icon";
-const char *const nameAttributeC = "name";
-const char *const globTagC = "glob";
-const char *const aliasTagC = "alias";
-const char *const patternAttributeC = "pattern";
-const char *const weightAttributeC = "weight";
-const char *const caseSensitiveAttributeC = "case-sensitive";
-const char *const localeAttributeC = "xml:lang";
+static const char mimeInfoTagC[] = "mime-info";
+static const char mimeTypeTagC[] = "mime-type";
+static const char mimeTypeAttributeC[] = "type";
+static const char subClassTagC[] = "sub-class-of";
+static const char commentTagC[] = "comment";
+static const char genericIconTagC[] = "generic-icon";
+static const char iconTagC[] = "icon";
+static const char nameAttributeC[] = "name";
+static const char globTagC[] = "glob";
+static const char aliasTagC[] = "alias";
+static const char patternAttributeC[] = "pattern";
+static const char weightAttributeC[] = "weight";
+static const char caseSensitiveAttributeC[] = "case-sensitive";
+static const char localeAttributeC[] = "xml:lang";
-const char *const magicTagC = "magic";
-const char *const priorityAttributeC = "priority";
+static const char magicTagC[] = "magic";
+static const char priorityAttributeC[] = "priority";
-const char *const matchTagC = "match";
-const char *const matchValueAttributeC = "value";
-const char *const matchTypeAttributeC = "type";
-const char *const matchOffsetAttributeC = "offset";
-const char *const matchMaskAttributeC = "mask";
+static const char matchTagC[] = "match";
+static const char matchValueAttributeC[] = "value";
+static const char matchTypeAttributeC[] = "type";
+static const char matchOffsetAttributeC[] = "offset";
+static const char matchMaskAttributeC[] = "mask";
/*!
\class QMimeTypeParser
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index 455c07063c..af01e1641a 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -50,30 +50,6 @@ QT_BEGIN_NAMESPACE
class QIODevice;
-// XML tags in MIME files
-extern const char *const mimeInfoTagC;
-extern const char *const mimeTypeTagC;
-extern const char *const mimeTypeAttributeC;
-extern const char *const subClassTagC;
-extern const char *const commentTagC;
-extern const char *const genericIconTagC;
-extern const char *const nameAttributeC;
-extern const char *const globTagC;
-extern const char *const aliasTagC;
-extern const char *const patternAttributeC;
-extern const char *const weightAttributeC;
-extern const char *const caseSensitiveAttributeC;
-extern const char *const localeAttributeC;
-
-extern const char *const magicTagC;
-extern const char *const priorityAttributeC;
-
-extern const char *const matchTagC;
-extern const char *const matchValueAttributeC;
-extern const char *const matchTypeAttributeC;
-extern const char *const matchOffsetAttributeC;
-extern const char *const matchMaskAttributeC;
-
class QMimeTypeParserBase
{
Q_DISABLE_COPY(QMimeTypeParserBase)
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index e13c78636c..049230f7a4 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -49,7 +49,7 @@
#include "qthread.h"
#include "qmutex_p.h"
-#ifndef Q_MUTEX_LINUX
+#ifndef QT_LINUX_FUTEX
#include "private/qfreelist_p.h"
#endif
@@ -154,7 +154,7 @@ QMutex::~QMutex()
if (quintptr(d) > 0x3 && d->recursive) {
delete static_cast<QRecursiveMutexPrivate *>(d);
} else if (d) {
-#ifndef Q_MUTEX_LINUX
+#ifndef QT_LINUX_FUTEX
if (d != dummyLocked() && static_cast<QMutexPrivate *>(d)->possiblyUnlocked.load()
&& tryLock()) {
unlock();
@@ -340,7 +340,7 @@ bool QBasicMutex::isRecursive() {
\sa unlock()
*/
-#ifndef Q_MUTEX_LINUX //linux implementation is in qmutex_linux.cpp
+#ifndef QT_LINUX_FUTEX //linux implementation is in qmutex_linux.cpp
/*!
\internal helper for lock()
*/
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index 8a9d0bf39b..92f13b1b7d 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -65,7 +65,7 @@
#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
// use Linux mutexes everywhere except for LSB builds
-# define Q_MUTEX_LINUX
+# define QT_LINUX_FUTEX
#endif
QT_BEGIN_NAMESPACE
@@ -78,7 +78,7 @@ public:
: recursive(mode == QMutex::Recursive) {}
};
-#if !defined(Q_MUTEX_LINUX)
+#if !defined(QT_LINUX_FUTEX)
class QMutexPrivate : public QMutexData
{
public:
@@ -128,7 +128,7 @@ public:
Qt::HANDLE event;
#endif
};
-#endif //Q_MUTEX_LINUX
+#endif //QT_LINUX_FUTEX
class QRecursiveMutexPrivate : public QMutexData
{
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index be0a98d3b5..a071463178 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -763,5 +763,14 @@ void QThread::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher)
}
}
+bool QThread::event(QEvent *event)
+{
+ if (event->type() == QEvent::Quit) {
+ quit();
+ return true;
+ } else {
+ return QObject::event(event);
+ }
+}
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index 719f4afbbb..ba119afb5d 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -95,6 +95,8 @@ public:
QAbstractEventDispatcher *eventDispatcher() const;
void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher);
+ bool event(QEvent *event);
+
public Q_SLOTS:
void start(Priority = InheritPriority);
void terminate();
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index d8374e9805..6597b56893 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -60,6 +60,7 @@
#include "QtCore/qstack.h"
#include "QtCore/qwaitcondition.h"
#include "QtCore/qmap.h"
+#include "QtCore/qcoreapplication.h"
#include "private/qobject_p.h"
@@ -144,6 +145,7 @@ public:
~QThreadPrivate();
mutable QMutex mutex;
+ QAtomicInt quitLockRef;
bool running;
bool finished;
@@ -179,6 +181,18 @@ public:
QThreadData *data;
static void createEventDispatcher(QThreadData *data);
+
+ void ref()
+ {
+ quitLockRef.ref();
+ }
+
+ void deref()
+ {
+ if (!quitLockRef.deref() && running) {
+ QCoreApplication::instance()->postEvent(q_ptr, new QEvent(QEvent::Quit));
+ }
+ }
};
#else // QT_NO_THREAD
@@ -195,6 +209,9 @@ public:
static QThread *threadForId(int) { return QThread::currentThread(); }
static void createEventDispatcher(QThreadData *data);
+ void ref() {}
+ void deref() {}
+
Q_DECLARE_PUBLIC(QThread)
};
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index bdee6d6b7c..38fb6ef8dd 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -72,7 +72,7 @@
QT_BEGIN_NAMESPACE
void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread);
-void qt_adopted_thread_watcher_function(void *);
+DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID);
static DWORD qt_current_thread_data_tls_index = TLS_OUT_OF_INDEXES;
void qt_create_tls()
@@ -147,7 +147,7 @@ void QAdoptedThread::init()
static QVector<HANDLE> qt_adopted_thread_handles;
static QVector<QThread *> qt_adopted_qthreads;
static QMutex qt_adopted_thread_watcher_mutex;
-static HANDLE qt_adopted_thread_watcher_handle = 0;
+static DWORD qt_adopted_thread_watcher_id = 0;
static HANDLE qt_adopted_thread_wakeup = 0;
/*! \internal
@@ -158,18 +158,25 @@ static HANDLE qt_adopted_thread_wakeup = 0;
void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread)
{
QMutexLocker lock(&qt_adopted_thread_watcher_mutex);
+
+ if (GetCurrentThreadId() == qt_adopted_thread_watcher_id) {
+#if !defined(Q_OS_WINCE) || (defined(_WIN32_WCE) && (_WIN32_WCE>=0x600))
+ CloseHandle(adoptedThreadHandle);
+#endif
+ return;
+ }
+
qt_adopted_thread_handles.append(adoptedThreadHandle);
qt_adopted_qthreads.append(qthread);
// Start watcher thread if it is not already running.
- if (qt_adopted_thread_watcher_handle == 0) {
+ if (qt_adopted_thread_watcher_id == 0) {
if (qt_adopted_thread_wakeup == 0) {
qt_adopted_thread_wakeup = CreateEvent(0, false, false, 0);
qt_adopted_thread_handles.prepend(qt_adopted_thread_wakeup);
}
- qt_adopted_thread_watcher_handle =
- (HANDLE)_beginthread(qt_adopted_thread_watcher_function, 0, NULL);
+ CreateThread(0, 0, qt_adopted_thread_watcher_function, 0, 0, &qt_adopted_thread_watcher_id);
} else {
SetEvent(qt_adopted_thread_wakeup);
}
@@ -180,13 +187,13 @@ void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread)
When this happens it derefs the QThreadData for the adopted thread
to make sure it gets cleaned up properly.
*/
-void qt_adopted_thread_watcher_function(void *)
+DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID)
{
forever {
qt_adopted_thread_watcher_mutex.lock();
if (qt_adopted_thread_handles.count() == 1) {
- qt_adopted_thread_watcher_handle = 0;
+ qt_adopted_thread_watcher_id = 0;
qt_adopted_thread_watcher_mutex.unlock();
break;
}
@@ -224,7 +231,9 @@ void qt_adopted_thread_watcher_function(void *)
// printf("(qt) - qt_adopted_thread_watcher_function... called\n");
const int qthreadIndex = handleIndex - 1;
+ qt_adopted_thread_watcher_mutex.lock();
QThreadData *data = QThreadData::get2(qt_adopted_qthreads.at(qthreadIndex));
+ qt_adopted_thread_watcher_mutex.unlock();
if (data->isAdopted) {
QThread *thread = data->thread;
Q_ASSERT(thread);
@@ -234,14 +243,20 @@ void qt_adopted_thread_watcher_function(void *)
}
data->deref();
+ QMutexLocker lock(&qt_adopted_thread_watcher_mutex);
#if !defined(Q_OS_WINCE) || (defined(_WIN32_WCE) && (_WIN32_WCE>=0x600))
CloseHandle(qt_adopted_thread_handles.at(handleIndex));
#endif
- QMutexLocker lock(&qt_adopted_thread_watcher_mutex);
qt_adopted_thread_handles.remove(handleIndex);
qt_adopted_qthreads.remove(qthreadIndex);
}
}
+
+ QThreadData *threadData = reinterpret_cast<QThreadData *>(TlsGetValue(qt_current_thread_data_tls_index));
+ if (threadData)
+ threadData->deref();
+
+ return 0;
}
#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 01241dce6b..0261843a3a 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -413,33 +413,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QChar::QChar(char ch)
+
Constructs a QChar corresponding to ASCII/Latin-1 character \a ch.
*/
-QChar::QChar(char ch)
-{
-#ifndef QT_NO_CODEC_FOR_C_STRINGS
- if (QTextCodec::codecForCStrings())
- // #####
- ucs = QTextCodec::codecForCStrings()->toUnicode(&ch, 1).at(0).unicode();
- else
-#endif
- ucs = uchar(ch);
-}
/*!
+ \fn QChar::QChar(uchar ch)
+
Constructs a QChar corresponding to ASCII/Latin-1 character \a ch.
*/
-QChar::QChar(uchar ch)
-{
-#ifndef QT_NO_CODEC_FOR_C_STRINGS
- if (QTextCodec::codecForCStrings()) {
- // #####
- char c = char(ch);
- ucs = QTextCodec::codecForCStrings()->toUnicode(&c, 1).at(0).unicode();
- } else
-#endif
- ucs = ch;
-}
/*!
\fn QChar::QChar(uchar cell, uchar row)
@@ -1256,49 +1239,35 @@ ushort QChar::toCaseFolded(ushort ucs2)
Returns the Latin-1 character equivalent to the QChar, or 0. This
is mainly useful for non-internationalized software.
- \sa toAscii(), unicode(), QTextCodec::codecForCStrings()
+ \sa toAscii(), unicode()
*/
/*!
- Returns the character value of the QChar obtained using the current
- codec used to read C strings, or 0 if the character is not representable
- using this codec. The default codec handles Latin-1 encoded text,
- but this can be changed to assist developers writing source code using
- other encodings.
+ \fn char QChar::toAscii() const
+
+ Returns the Latin-1 character value of the QChar, or 0 if the character is not
+ representable.
The main purpose of this function is to preserve ASCII characters used
in C strings. This is mainly useful for developers of non-internationalized
software.
- \sa toLatin1(), unicode(), QTextCodec::codecForCStrings()
+ \note It is not possible to distinguish a non-Latin 1 character from an ASCII 0
+ (NUL) character. Prefer to use unicode(), which does not have this ambiguity.
+
+ \sa toLatin1(), unicode()
*/
-char QChar::toAscii() const
-{
-#ifndef QT_NO_CODEC_FOR_C_STRINGS
- if (QTextCodec::codecForCStrings())
- // #####
- return QTextCodec::codecForCStrings()->fromUnicode(QString(*this)).at(0);
-#endif
- return ucs > 0xff ? 0 : char(ucs);
-}
/*!
+ \fn QChar QChar::fromAscii(char)
+
Converts the ASCII character \a c to it's equivalent QChar. This
is mainly useful for non-internationalized software.
An alternative is to use QLatin1Char.
- \sa fromLatin1(), unicode(), QTextCodec::codecForCStrings()
+ \sa fromLatin1(), unicode()
*/
-QChar QChar::fromAscii(char c)
-{
-#ifndef QT_NO_CODEC_FOR_C_STRINGS
- if (QTextCodec::codecForCStrings())
- // #####
- return QTextCodec::codecForCStrings()->toUnicode(&c, 1).at(0).unicode();
-#endif
- return QChar(ushort((uchar)c));
-}
#ifndef QT_NO_DATASTREAM
/*!
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index df3d7eac33..3209ffb0f2 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -86,9 +86,8 @@ public:
Q_DECL_CONSTEXPR QChar(QLatin1Char ch) : ucs(ch.unicode()) {} // implicit
#ifndef QT_NO_CAST_FROM_ASCII
- // these two constructors are NOT inline const_expr!
- QT_ASCII_CAST_WARN_CONSTRUCTOR explicit QChar(char c);
- QT_ASCII_CAST_WARN_CONSTRUCTOR explicit QChar(uchar c);
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) : ucs(uchar(c)) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) : ucs(c) { }
#endif
// Unicode information
@@ -222,13 +221,13 @@ public:
UnicodeVersion unicodeVersion() const;
- char toAscii() const;
+ inline char toAscii() const;
inline char toLatin1() const;
inline ushort unicode() const { return ucs; }
inline ushort &unicode() { return ucs; }
- static QChar fromAscii(char c);
- static QChar fromLatin1(char c);
+ static inline QChar fromAscii(char c);
+ static inline QChar fromLatin1(char c);
inline bool isNull() const { return ucs == 0; }
bool isPrint() const;
@@ -344,8 +343,10 @@ private:
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
+inline char QChar::toAscii() const { return ucs > 0xff ? 0 : char(ucs); }
inline char QChar::toLatin1() const { return ucs > 0xff ? '\0' : char(ucs); }
inline QChar QChar::fromLatin1(char c) { return QChar(ushort(uchar(c))); }
+inline QChar QChar::fromAscii(char c) { return QChar(ushort(uchar(c))); }
inline void QChar::setCell(uchar acell)
{ ucs = ushort((ucs & 0xff00) + acell); }
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 164660f818..31a0fdc5e6 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -46,8 +46,53 @@
#include "../../3rdparty/md4/md4.h"
#include "../../3rdparty/md4/md4.cpp"
#include "../../3rdparty/sha1/sha1.cpp"
+
+/*
+ These typedefs are needed by the RFC6234 code. Normally they would come
+ from from stdint.h, but since this header is not available on all platforms
+ (MSVC 2008, for example), we need to define them ourselves.
+*/
+typedef QT_PREPEND_NAMESPACE(quint64) uint64_t;
+typedef QT_PREPEND_NAMESPACE(quint32) uint32_t;
+typedef QT_PREPEND_NAMESPACE(quint8) uint8_t;
+typedef QT_PREPEND_NAMESPACE(qint16) int_least16_t;
+// Header from rfc6234 with 1 modification:
+// sha1.h - commented out '#include <stdint.h>' on line 74
+#include "../../3rdparty/rfc6234/sha.h"
+
+/*
+ These 2 functions replace macros of the same name in sha224-256.c and
+ sha384-512.c. Originally, these macros relied on a global static 'addTemp'
+ variable. We do not want this for 2 reasons:
+
+ 1. since we are including the sources directly, the declaration of the 2 conflict
+
+ 2. static variables are not thread-safe, we do not want multiple threads
+ computing a hash to corrupt one another
+*/
+static int SHA224_256AddLength(SHA256Context *context, unsigned int length);
+static int SHA384_512AddLength(SHA512Context *context, unsigned int length);
+
+// Sources from rfc6234, with 4 modifications:
+// sha224-256.c - commented out 'static uint32_t addTemp;' on line 68
+// sha224-256.c - appended 'M' to the SHA224_256AddLength macro on line 70
+#include "../../3rdparty/rfc6234/sha224-256.c"
+// sha384-512.c - commented out 'static uint64_t addTemp;' on line 302
+// sha384-512.c - appended 'M' to the SHA224_256AddLength macro on line 304
+#include "../../3rdparty/rfc6234/sha384-512.c"
+
#include <qiodevice.h>
+static inline int SHA224_256AddLength(SHA256Context *context, unsigned int length)
+{
+ uint32_t addTemp;
+ return SHA224_256AddLengthM(context, length);
+}
+static inline int SHA384_512AddLength(SHA512Context *context, unsigned int length)
+{
+ uint64_t addTemp;
+ return SHA384_512AddLengthM(context, length);
+}
QT_BEGIN_NAMESPACE
@@ -59,6 +104,10 @@ public:
MD5Context md5Context;
md4_context md4Context;
Sha1State sha1Context;
+ SHA224Context sha224Context;
+ SHA256Context sha256Context;
+ SHA384Context sha384Context;
+ SHA512Context sha512Context;
};
QByteArray result;
};
@@ -75,7 +124,7 @@ public:
QCryptographicHash can be used to generate cryptographic hashes of binary or text data.
- Currently MD4, MD5, and SHA-1 are supported.
+ Currently MD4, MD5, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 are supported.
*/
/*!
@@ -83,7 +132,11 @@ public:
\value Md4 Generate an MD4 hash sum
\value Md5 Generate an MD5 hash sum
- \value Sha1 Generate an SHA1 hash sum
+ \value Sha1 Generate an SHA-1 hash sum
+ \value Sha224 Generate an SHA-224 hash sum
+ \value Sha256 Generate an SHA-256 hash sum
+ \value Sha384 Generate an SHA-384 hash sum
+ \value Sha512 Generate an SHA-512 hash sum
*/
/*!
@@ -119,6 +172,18 @@ void QCryptographicHash::reset()
case Sha1:
sha1InitState(&d->sha1Context);
break;
+ case Sha224:
+ SHA224Reset(&d->sha224Context);
+ break;
+ case Sha256:
+ SHA256Reset(&d->sha256Context);
+ break;
+ case Sha384:
+ SHA384Reset(&d->sha384Context);
+ break;
+ case Sha512:
+ SHA512Reset(&d->sha512Context);
+ break;
}
d->result.clear();
}
@@ -139,6 +204,18 @@ void QCryptographicHash::addData(const char *data, int length)
case Sha1:
sha1Update(&d->sha1Context, (const unsigned char *)data, length);
break;
+ case Sha224:
+ SHA224Input(&d->sha224Context, reinterpret_cast<const unsigned char *>(data), length);
+ break;
+ case Sha256:
+ SHA256Input(&d->sha256Context, reinterpret_cast<const unsigned char *>(data), length);
+ break;
+ case Sha384:
+ SHA384Input(&d->sha384Context, reinterpret_cast<const unsigned char *>(data), length);
+ break;
+ case Sha512:
+ SHA512Input(&d->sha512Context, reinterpret_cast<const unsigned char *>(data), length);
+ break;
}
d->result.clear();
}
@@ -201,6 +278,31 @@ QByteArray QCryptographicHash::result() const
d->result.resize(20);
sha1FinalizeState(&copy);
sha1ToHash(&copy, (unsigned char *)d->result.data());
+ break;
+ }
+ case Sha224: {
+ SHA224Context copy = d->sha224Context;
+ d->result.resize(SHA224HashSize);
+ SHA224Result(&copy, reinterpret_cast<unsigned char *>(d->result.data()));
+ break;
+ }
+ case Sha256:{
+ SHA256Context copy = d->sha256Context;
+ d->result.resize(SHA256HashSize);
+ SHA256Result(&copy, reinterpret_cast<unsigned char *>(d->result.data()));
+ break;
+ }
+ case Sha384:{
+ SHA384Context copy = d->sha384Context;
+ d->result.resize(SHA384HashSize);
+ SHA384Result(&copy, reinterpret_cast<unsigned char *>(d->result.data()));
+ break;
+ }
+ case Sha512:{
+ SHA512Context copy = d->sha512Context;
+ d->result.resize(SHA512HashSize);
+ SHA512Result(&copy, reinterpret_cast<unsigned char *>(d->result.data()));
+ break;
}
}
return d->result;
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index 59314e1963..2bfc03373a 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -58,7 +58,11 @@ public:
enum Algorithm {
Md4,
Md5,
- Sha1
+ Sha1,
+ Sha224,
+ Sha256,
+ Sha384,
+ Sha512
};
QCryptographicHash(Algorithm method);
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 5731faa69c..81778f908f 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -419,6 +419,11 @@ public:
config(0),
func(&easeNone)
{ }
+ QEasingCurvePrivate(const QEasingCurvePrivate &other)
+ : type(other.type),
+ config(other.config ? other.config->copy() : 0),
+ func(other.func)
+ { }
~QEasingCurvePrivate() { delete config; }
void setType_helper(QEasingCurve::Type);
@@ -1080,12 +1085,9 @@ QEasingCurve::QEasingCurve(Type type)
Construct a copy of \a other.
*/
QEasingCurve::QEasingCurve(const QEasingCurve &other)
- : d_ptr(new QEasingCurvePrivate)
+ : d_ptr(new QEasingCurvePrivate(*other.d_ptr))
{
// ### non-atomic, requires malloc on shallow copy
- *d_ptr = *other.d_ptr;
- if (other.d_ptr->config)
- d_ptr->config = other.d_ptr->config->copy();
}
/*!
@@ -1098,22 +1100,17 @@ QEasingCurve::~QEasingCurve()
}
/*!
+ \fn QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)
Copy \a other.
*/
-QEasingCurve &QEasingCurve::operator=(const QEasingCurve &other)
-{
- // ### non-atomic, requires malloc on shallow copy
- if (d_ptr->config) {
- delete d_ptr->config;
- d_ptr->config = 0;
- }
- *d_ptr = *other.d_ptr;
- if (other.d_ptr->config)
- d_ptr->config = other.d_ptr->config->copy();
+/*!
+ \fn void QEasingCurve::swap(QEasingCurve &other)
+ \since 5.0
- return *this;
-}
+ Swaps curve \a other with this curve. This operation is very
+ fast and never fails.
+*/
/*!
Compare this easing curve with \a other and returns true if they are
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h
index ad2e510799..f3c7c9b618 100644
--- a/src/corelib/tools/qeasingcurve.h
+++ b/src/corelib/tools/qeasingcurve.h
@@ -82,7 +82,16 @@ public:
QEasingCurve(const QEasingCurve &other);
~QEasingCurve();
- QEasingCurve &operator=(const QEasingCurve &other);
+ QEasingCurve &operator=(const QEasingCurve &other)
+ { if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
+#ifdef Q_COMPILER_RVALUE_REFS
+ QEasingCurve(QEasingCurve &&other) : d_ptr(other.d_ptr) { other.d_ptr = 0; }
+ QEasingCurve &operator=(QEasingCurve &&other)
+ { qSwap(d_ptr, other.d_ptr); return *this; }
+#endif
+
+ inline void swap(QEasingCurve &other) { qSwap(d_ptr, other.d_ptr); }
+
bool operator==(const QEasingCurve &other) const;
inline bool operator!=(const QEasingCurve &other) const
{ return !(this->operator==(other)); }
@@ -120,6 +129,7 @@ private:
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &);
#endif
};
+Q_DECLARE_TYPEINFO(QEasingCurve, Q_MOVABLE_TYPE);
#ifndef QT_NO_DEBUG_STREAM
Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QEasingCurve &item);
diff --git a/src/corelib/tools/qelapsedtimer_win.cpp b/src/corelib/tools/qelapsedtimer_win.cpp
index b1faf22c3f..8171a27ea3 100644
--- a/src/corelib/tools/qelapsedtimer_win.cpp
+++ b/src/corelib/tools/qelapsedtimer_win.cpp
@@ -83,7 +83,9 @@ static inline qint64 ticksToNanoseconds(qint64 ticks)
{
if (counterFrequency > 0) {
// QueryPerformanceCounter uses an arbitrary frequency
- return ticks * 1000000000 / counterFrequency;
+ qint64 seconds = ticks / counterFrequency;
+ qint64 nanoSeconds = (ticks - seconds * counterFrequency) * 1000000000 / counterFrequency;
+ return seconds * 1000000000 + nanoSeconds;
} else {
// GetTickCount(64) return milliseconds
return ticks * 1000000;
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 18537023ad..e0cd068158 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -403,7 +403,7 @@ void QHashData::dump()
}
n = n->next;
}
- qDebug(qPrintable(line));
+ qDebug("%s", qPrintable(line));
}
}
}
diff --git a/src/corelib/tools/qline.h b/src/corelib/tools/qline.h
index 58ef0316ad..92ea4ea426 100644
--- a/src/corelib/tools/qline.h
+++ b/src/corelib/tools/qline.h
@@ -56,37 +56,37 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QLine
{
public:
- inline QLine();
- inline QLine(const QPoint &pt1, const QPoint &pt2);
- inline QLine(int x1, int y1, int x2, int y2);
+ Q_DECL_CONSTEXPR inline QLine();
+ Q_DECL_CONSTEXPR inline QLine(const QPoint &pt1, const QPoint &pt2);
+ Q_DECL_CONSTEXPR inline QLine(int x1, int y1, int x2, int y2);
- inline bool isNull() const;
+ Q_DECL_CONSTEXPR inline bool isNull() const;
- inline QPoint p1() const;
- inline QPoint p2() const;
+ Q_DECL_CONSTEXPR inline QPoint p1() const;
+ Q_DECL_CONSTEXPR inline QPoint p2() const;
- inline int x1() const;
- inline int y1() const;
+ Q_DECL_CONSTEXPR inline int x1() const;
+ Q_DECL_CONSTEXPR inline int y1() const;
- inline int x2() const;
- inline int y2() const;
+ Q_DECL_CONSTEXPR inline int x2() const;
+ Q_DECL_CONSTEXPR inline int y2() const;
- inline int dx() const;
- inline int dy() const;
+ Q_DECL_CONSTEXPR inline int dx() const;
+ Q_DECL_CONSTEXPR inline int dy() const;
inline void translate(const QPoint &p);
inline void translate(int dx, int dy);
- inline QLine translated(const QPoint &p) const;
- inline QLine translated(int dx, int dy) const;
+ Q_DECL_CONSTEXPR inline QLine translated(const QPoint &p) const;
+ Q_DECL_CONSTEXPR inline QLine translated(int dx, int dy) const;
inline void setP1(const QPoint &p1);
inline void setP2(const QPoint &p2);
inline void setPoints(const QPoint &p1, const QPoint &p2);
inline void setLine(int x1, int y1, int x2, int y2);
- inline bool operator==(const QLine &d) const;
- inline bool operator!=(const QLine &d) const { return !(*this == d); }
+ Q_DECL_CONSTEXPR inline bool operator==(const QLine &d) const;
+ Q_DECL_CONSTEXPR inline bool operator!=(const QLine &d) const { return !(*this == d); }
private:
QPoint pt1, pt2;
@@ -97,53 +97,53 @@ Q_DECLARE_TYPEINFO(QLine, Q_MOVABLE_TYPE);
* class QLine inline members
*******************************************************************************/
-inline QLine::QLine() { }
+Q_DECL_CONSTEXPR inline QLine::QLine() { }
-inline QLine::QLine(const QPoint &pt1_, const QPoint &pt2_) : pt1(pt1_), pt2(pt2_) { }
+Q_DECL_CONSTEXPR inline QLine::QLine(const QPoint &pt1_, const QPoint &pt2_) : pt1(pt1_), pt2(pt2_) { }
-inline QLine::QLine(int x1pos, int y1pos, int x2pos, int y2pos) : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
+Q_DECL_CONSTEXPR inline QLine::QLine(int x1pos, int y1pos, int x2pos, int y2pos) : pt1(QPoint(x1pos, y1pos)), pt2(QPoint(x2pos, y2pos)) { }
-inline bool QLine::isNull() const
+Q_DECL_CONSTEXPR inline bool QLine::isNull() const
{
return pt1 == pt2;
}
-inline int QLine::x1() const
+Q_DECL_CONSTEXPR inline int QLine::x1() const
{
return pt1.x();
}
-inline int QLine::y1() const
+Q_DECL_CONSTEXPR inline int QLine::y1() const
{
return pt1.y();
}
-inline int QLine::x2() const
+Q_DECL_CONSTEXPR inline int QLine::x2() const
{
return pt2.x();
}
-inline int QLine::y2() const
+Q_DECL_CONSTEXPR inline int QLine::y2() const
{
return pt2.y();
}
-inline QPoint QLine::p1() const
+Q_DECL_CONSTEXPR inline QPoint QLine::p1() const
{
return pt1;
}
-inline QPoint QLine::p2() const
+Q_DECL_CONSTEXPR inline QPoint QLine::p2() const
{
return pt2;
}
-inline int QLine::dx() const
+Q_DECL_CONSTEXPR inline int QLine::dx() const
{
return pt2.x() - pt1.x();
}
-inline int QLine::dy() const
+Q_DECL_CONSTEXPR inline int QLine::dy() const
{
return pt2.y() - pt1.y();
}
@@ -159,12 +159,12 @@ inline void QLine::translate(int adx, int ady)
this->translate(QPoint(adx, ady));
}
-inline QLine QLine::translated(const QPoint &p) const
+Q_DECL_CONSTEXPR inline QLine QLine::translated(const QPoint &p) const
{
return QLine(pt1 + p, pt2 + p);
}
-inline QLine QLine::translated(int adx, int ady) const
+Q_DECL_CONSTEXPR inline QLine QLine::translated(int adx, int ady) const
{
return translated(QPoint(adx, ady));
}
@@ -191,7 +191,7 @@ inline void QLine::setLine(int aX1, int aY1, int aX2, int aY2)
pt2 = QPoint(aX2, aY2);
}
-inline bool QLine::operator==(const QLine &d) const
+Q_DECL_CONSTEXPR inline bool QLine::operator==(const QLine &d) const
{
return pt1 == d.pt1 && pt2 == d.pt2;
}
@@ -213,26 +213,26 @@ public:
enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
- inline QLineF();
- inline QLineF(const QPointF &pt1, const QPointF &pt2);
- inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
- inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
+ Q_DECL_CONSTEXPR inline QLineF();
+ Q_DECL_CONSTEXPR inline QLineF(const QPointF &pt1, const QPointF &pt2);
+ Q_DECL_CONSTEXPR inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
+ Q_DECL_CONSTEXPR inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
static QLineF fromPolar(qreal length, qreal angle);
- bool isNull() const;
+ Q_DECL_CONSTEXPR bool isNull() const;
- inline QPointF p1() const;
- inline QPointF p2() const;
+ Q_DECL_CONSTEXPR inline QPointF p1() const;
+ Q_DECL_CONSTEXPR inline QPointF p2() const;
- inline qreal x1() const;
- inline qreal y1() const;
+ Q_DECL_CONSTEXPR inline qreal x1() const;
+ Q_DECL_CONSTEXPR inline qreal y1() const;
- inline qreal x2() const;
- inline qreal y2() const;
+ Q_DECL_CONSTEXPR inline qreal x2() const;
+ Q_DECL_CONSTEXPR inline qreal y2() const;
- inline qreal dx() const;
- inline qreal dy() const;
+ Q_DECL_CONSTEXPR inline qreal dx() const;
+ Q_DECL_CONSTEXPR inline qreal dy() const;
qreal length() const;
void setLength(qreal len);
@@ -243,29 +243,29 @@ public:
qreal angleTo(const QLineF &l) const;
QLineF unitVector() const;
- QLineF normalVector() const;
+ Q_DECL_CONSTEXPR inline QLineF normalVector() const;
// ### Qt 5: rename intersects() or intersection() and rename IntersectType IntersectionType
IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
qreal angle(const QLineF &l) const;
- QPointF pointAt(qreal t) const;
+ Q_DECL_CONSTEXPR inline QPointF pointAt(qreal t) const;
inline void translate(const QPointF &p);
inline void translate(qreal dx, qreal dy);
- inline QLineF translated(const QPointF &p) const;
- inline QLineF translated(qreal dx, qreal dy) const;
+ Q_DECL_CONSTEXPR inline QLineF translated(const QPointF &p) const;
+ Q_DECL_CONSTEXPR inline QLineF translated(qreal dx, qreal dy) const;
inline void setP1(const QPointF &p1);
inline void setP2(const QPointF &p2);
inline void setPoints(const QPointF &p1, const QPointF &p2);
inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
- inline bool operator==(const QLineF &d) const;
- inline bool operator!=(const QLineF &d) const { return !(*this == d); }
+ Q_DECL_CONSTEXPR inline bool operator==(const QLineF &d) const;
+ Q_DECL_CONSTEXPR inline bool operator!=(const QLineF &d) const { return !(*this == d); }
- QLine toLine() const;
+ Q_DECL_CONSTEXPR QLine toLine() const;
private:
QPointF pt1, pt2;
@@ -276,66 +276,66 @@ Q_DECLARE_TYPEINFO(QLineF, Q_MOVABLE_TYPE);
* class QLineF inline members
*******************************************************************************/
-inline QLineF::QLineF()
+Q_DECL_CONSTEXPR inline QLineF::QLineF()
{
}
-inline QLineF::QLineF(const QPointF &apt1, const QPointF &apt2)
+Q_DECL_CONSTEXPR inline QLineF::QLineF(const QPointF &apt1, const QPointF &apt2)
: pt1(apt1), pt2(apt2)
{
}
-inline QLineF::QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos)
+Q_DECL_CONSTEXPR inline QLineF::QLineF(qreal x1pos, qreal y1pos, qreal x2pos, qreal y2pos)
: pt1(x1pos, y1pos), pt2(x2pos, y2pos)
{
}
-inline qreal QLineF::x1() const
+Q_DECL_CONSTEXPR inline qreal QLineF::x1() const
{
return pt1.x();
}
-inline qreal QLineF::y1() const
+Q_DECL_CONSTEXPR inline qreal QLineF::y1() const
{
return pt1.y();
}
-inline qreal QLineF::x2() const
+Q_DECL_CONSTEXPR inline qreal QLineF::x2() const
{
return pt2.x();
}
-inline qreal QLineF::y2() const
+Q_DECL_CONSTEXPR inline qreal QLineF::y2() const
{
return pt2.y();
}
-inline bool QLineF::isNull() const
+Q_DECL_CONSTEXPR inline bool QLineF::isNull() const
{
return qFuzzyCompare(pt1.x(), pt2.x()) && qFuzzyCompare(pt1.y(), pt2.y());
}
-inline QPointF QLineF::p1() const
+Q_DECL_CONSTEXPR inline QPointF QLineF::p1() const
{
return pt1;
}
-inline QPointF QLineF::p2() const
+Q_DECL_CONSTEXPR inline QPointF QLineF::p2() const
{
return pt2;
}
-inline qreal QLineF::dx() const
+Q_DECL_CONSTEXPR inline qreal QLineF::dx() const
{
return pt2.x() - pt1.x();
}
-inline qreal QLineF::dy() const
+Q_DECL_CONSTEXPR inline qreal QLineF::dy() const
{
return pt2.y() - pt1.y();
}
-inline QLineF QLineF::normalVector() const
+Q_DECL_CONSTEXPR inline QLineF QLineF::normalVector() const
{
return QLineF(p1(), p1() + QPointF(dy(), -dx()));
}
@@ -351,12 +351,12 @@ inline void QLineF::translate(qreal adx, qreal ady)
this->translate(QPointF(adx, ady));
}
-inline QLineF QLineF::translated(const QPointF &p) const
+Q_DECL_CONSTEXPR inline QLineF QLineF::translated(const QPointF &p) const
{
return QLineF(pt1 + p, pt2 + p);
}
-inline QLineF QLineF::translated(qreal adx, qreal ady) const
+Q_DECL_CONSTEXPR inline QLineF QLineF::translated(qreal adx, qreal ady) const
{
return translated(QPointF(adx, ady));
}
@@ -369,14 +369,12 @@ inline void QLineF::setLength(qreal len)
pt2 = QPointF(pt1.x() + v.dx() * len, pt1.y() + v.dy() * len);
}
-inline QPointF QLineF::pointAt(qreal t) const
+Q_DECL_CONSTEXPR inline QPointF QLineF::pointAt(qreal t) const
{
- qreal vx = pt2.x() - pt1.x();
- qreal vy = pt2.y() - pt1.y();
- return QPointF(pt1.x() + vx * t, pt1.y() + vy * t);
+ return QPointF(pt1.x() + (pt2.x() - pt1.x()) * t, pt1.y() + (pt2.y() - pt1.y()) * t);
}
-inline QLine QLineF::toLine() const
+Q_DECL_CONSTEXPR inline QLine QLineF::toLine() const
{
return QLine(pt1.toPoint(), pt2.toPoint());
}
@@ -405,7 +403,7 @@ inline void QLineF::setLine(qreal aX1, qreal aY1, qreal aX2, qreal aY2)
}
-inline bool QLineF::operator==(const QLineF &d) const
+Q_DECL_CONSTEXPR inline bool QLineF::operator==(const QLineF &d) const
{
return pt1 == d.pt1 && pt2 == d.pt2;
}
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index da3bae5f6c..08dedb4e94 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -402,7 +402,7 @@ Q_INLINE_TEMPLATE void QList<T>::node_copy(Node *from, Node *to, Node *src)
}
} else {
if (src != from && to - from > 0)
- memcpy(from, src, (to - from) * sizeof(Node *));
+ memcpy(from, src, (to - from) * sizeof(Node));
}
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 6c52eb3827..31f776dc2e 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2797,7 +2797,7 @@ bool QLocalePrivate::numberToCLocale(const QString &num,
return false;
while (idx < l) {
- const QChar &in = uc[idx];
+ const QChar in = uc[idx];
char out = digitToCLocale(in);
if (out == 0) {
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index 2fff58333d..3a386c17d6 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -89,7 +89,7 @@
pair; it does not use the system locale database.
\note For the current keyboard input locale take a look at
- QInputPanel::locale().
+ QInputMethod::locale().
QLocale's data is based on Common Locale Data Repository v1.8.1.
@@ -114,7 +114,7 @@
California, Berkeley and its contributors.
\sa QString::arg(), QString::toInt(), QString::toDouble(),
- QInputPanel::locale()
+ QInputMethod::locale()
*/
/*!
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 7653f4d93d..c6902ca206 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -228,7 +228,7 @@ public:
bool numberToCLocale(const QString &num,
GroupSeparatorMode group_sep_mode,
CharBuff *result) const;
- inline char digitToCLocale(const QChar &c) const;
+ inline char digitToCLocale(QChar c) const;
static void updateSystemPrivate();
@@ -282,7 +282,7 @@ public:
};
-inline char QLocalePrivate::digitToCLocale(const QChar &in) const
+inline char QLocalePrivate::digitToCLocale(QChar in) const
{
const QChar _zero = zero();
const QChar _group = group();
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index cd9fffc7a5..e787f2fa2a 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -525,7 +525,7 @@ QVariant QSystemLocalePrivate::toCurrencyString(const QSystemLocale::CurrencyToS
QVariant QSystemLocalePrivate::uiLanguages()
{
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) {
- typedef BOOL (*GetUserPreferredUILanguagesFunc) (
+ typedef BOOL (WINAPI *GetUserPreferredUILanguagesFunc) (
DWORD dwFlags,
PULONG pulNumLanguages,
PWSTR pwszLanguagesBuffer,
diff --git a/src/corelib/tools/qmargins.h b/src/corelib/tools/qmargins.h
index 7d9d07ed46..d3551fa195 100644
--- a/src/corelib/tools/qmargins.h
+++ b/src/corelib/tools/qmargins.h
@@ -52,15 +52,15 @@ QT_BEGIN_NAMESPACE
class QMargins
{
public:
- QMargins();
- QMargins(int left, int top, int right, int bottom);
+ Q_DECL_CONSTEXPR QMargins();
+ Q_DECL_CONSTEXPR QMargins(int left, int top, int right, int bottom);
- bool isNull() const;
+ Q_DECL_CONSTEXPR bool isNull() const;
- int left() const;
- int top() const;
- int right() const;
- int bottom() const;
+ Q_DECL_CONSTEXPR int left() const;
+ Q_DECL_CONSTEXPR int top() const;
+ Q_DECL_CONSTEXPR int right() const;
+ Q_DECL_CONSTEXPR int bottom() const;
void setLeft(int left);
void setTop(int top);
@@ -73,8 +73,8 @@ private:
int m_right;
int m_bottom;
- friend inline bool operator==(const QMargins &, const QMargins &);
- friend inline bool operator!=(const QMargins &, const QMargins &);
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QMargins &, const QMargins &);
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &, const QMargins &);
};
Q_DECLARE_TYPEINFO(QMargins, Q_MOVABLE_TYPE);
@@ -91,25 +91,24 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QMargins &);
QMargins inline functions
*****************************************************************************/
-inline QMargins::QMargins()
-{ m_top = m_bottom = m_left = m_right = 0; }
+Q_DECL_CONSTEXPR inline QMargins::QMargins() : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
-inline QMargins::QMargins(int aleft, int atop, int aright, int abottom)
+Q_DECL_CONSTEXPR inline QMargins::QMargins(int aleft, int atop, int aright, int abottom)
: m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
-inline bool QMargins::isNull() const
+Q_DECL_CONSTEXPR inline bool QMargins::isNull() const
{ return m_left==0 && m_top==0 && m_right==0 && m_bottom==0; }
-inline int QMargins::left() const
+Q_DECL_CONSTEXPR inline int QMargins::left() const
{ return m_left; }
-inline int QMargins::top() const
+Q_DECL_CONSTEXPR inline int QMargins::top() const
{ return m_top; }
-inline int QMargins::right() const
+Q_DECL_CONSTEXPR inline int QMargins::right() const
{ return m_right; }
-inline int QMargins::bottom() const
+Q_DECL_CONSTEXPR inline int QMargins::bottom() const
{ return m_bottom; }
@@ -125,7 +124,7 @@ inline void QMargins::setRight(int aright)
inline void QMargins::setBottom(int abottom)
{ m_bottom = abottom; }
-inline bool operator==(const QMargins &m1, const QMargins &m2)
+Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2)
{
return
m1.m_left == m2.m_left &&
@@ -134,7 +133,7 @@ inline bool operator==(const QMargins &m1, const QMargins &m2)
m1.m_bottom == m2.m_bottom;
}
-inline bool operator!=(const QMargins &m1, const QMargins &m2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2)
{
return
m1.m_left != m2.m_left ||
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index 2e987fcf41..0eb22807e8 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -52,17 +52,17 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QPoint
{
public:
- QPoint();
- QPoint(int xpos, int ypos);
+ Q_DECL_CONSTEXPR QPoint();
+ Q_DECL_CONSTEXPR QPoint(int xpos, int ypos);
- bool isNull() const;
+ Q_DECL_CONSTEXPR bool isNull() const;
- int x() const;
- int y() const;
+ Q_DECL_CONSTEXPR int x() const;
+ Q_DECL_CONSTEXPR int y() const;
void setX(int x);
void setY(int y);
- int manhattanLength() const;
+ Q_DECL_CONSTEXPR int manhattanLength() const;
int &rx();
int &ry();
@@ -76,18 +76,18 @@ public:
QPoint &operator/=(qreal c);
- friend inline bool operator==(const QPoint &, const QPoint &);
- friend inline bool operator!=(const QPoint &, const QPoint &);
- friend inline const QPoint operator+(const QPoint &, const QPoint &);
- friend inline const QPoint operator-(const QPoint &, const QPoint &);
- friend inline const QPoint operator*(const QPoint &, float);
- friend inline const QPoint operator*(float, const QPoint &);
- friend inline const QPoint operator*(const QPoint &, double);
- friend inline const QPoint operator*(double, const QPoint &);
- friend inline const QPoint operator*(const QPoint &, int);
- friend inline const QPoint operator*(int, const QPoint &);
- friend inline const QPoint operator-(const QPoint &);
- friend inline const QPoint operator/(const QPoint &, qreal);
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QPoint &, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QPoint &, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator+(const QPoint &, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &, float);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(float, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &, double);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(double, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &, int);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator*(int, const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &);
+ friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal);
private:
friend class QTransform;
@@ -109,19 +109,17 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QPoint &);
QPoint inline functions
*****************************************************************************/
-inline QPoint::QPoint()
-{ xp=0; yp=0; }
+Q_DECL_CONSTEXPR inline QPoint::QPoint() : xp(0), yp(0) {}
-inline QPoint::QPoint(int xpos, int ypos)
-{ xp = xpos; yp = ypos; }
+Q_DECL_CONSTEXPR inline QPoint::QPoint(int xpos, int ypos) : xp(xpos), yp(ypos) {}
-inline bool QPoint::isNull() const
+Q_DECL_CONSTEXPR inline bool QPoint::isNull() const
{ return xp == 0 && yp == 0; }
-inline int QPoint::x() const
+Q_DECL_CONSTEXPR inline int QPoint::x() const
{ return xp; }
-inline int QPoint::y() const
+Q_DECL_CONSTEXPR inline int QPoint::y() const
{ return yp; }
inline void QPoint::setX(int xpos)
@@ -130,7 +128,7 @@ inline void QPoint::setX(int xpos)
inline void QPoint::setY(int ypos)
{ yp = ypos; }
-inline int QPoint::manhattanLength() const
+inline int Q_DECL_CONSTEXPR QPoint::manhattanLength() const
{ return qAbs(x())+qAbs(y()); }
inline int &QPoint::rx()
@@ -154,37 +152,37 @@ inline QPoint &QPoint::operator*=(double c)
inline QPoint &QPoint::operator*=(int c)
{ xp = xp*c; yp = yp*c; return *this; }
-inline bool operator==(const QPoint &p1, const QPoint &p2)
+Q_DECL_CONSTEXPR inline bool operator==(const QPoint &p1, const QPoint &p2)
{ return p1.xp == p2.xp && p1.yp == p2.yp; }
-inline bool operator!=(const QPoint &p1, const QPoint &p2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QPoint &p1, const QPoint &p2)
{ return p1.xp != p2.xp || p1.yp != p2.yp; }
-inline const QPoint operator+(const QPoint &p1, const QPoint &p2)
+Q_DECL_CONSTEXPR inline const QPoint operator+(const QPoint &p1, const QPoint &p2)
{ return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
-inline const QPoint operator-(const QPoint &p1, const QPoint &p2)
+Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &p1, const QPoint &p2)
{ return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
-inline const QPoint operator*(const QPoint &p, float c)
+Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &p, float c)
{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
-inline const QPoint operator*(const QPoint &p, double c)
+Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &p, double c)
{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
-inline const QPoint operator*(const QPoint &p, int c)
+Q_DECL_CONSTEXPR inline const QPoint operator*(const QPoint &p, int c)
{ return QPoint(p.xp*c, p.yp*c); }
-inline const QPoint operator*(float c, const QPoint &p)
+Q_DECL_CONSTEXPR inline const QPoint operator*(float c, const QPoint &p)
{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
-inline const QPoint operator*(double c, const QPoint &p)
+Q_DECL_CONSTEXPR inline const QPoint operator*(double c, const QPoint &p)
{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
-inline const QPoint operator*(int c, const QPoint &p)
+Q_DECL_CONSTEXPR inline const QPoint operator*(int c, const QPoint &p)
{ return QPoint(p.xp*c, p.yp*c); }
-inline const QPoint operator-(const QPoint &p)
+Q_DECL_CONSTEXPR inline const QPoint operator-(const QPoint &p)
{ return QPoint(-p.xp, -p.yp); }
inline QPoint &QPoint::operator/=(qreal c)
@@ -194,7 +192,7 @@ inline QPoint &QPoint::operator/=(qreal c)
return *this;
}
-inline const QPoint operator/(const QPoint &p, qreal c)
+Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &p, qreal c)
{
return QPoint(qRound(p.xp/c), qRound(p.yp/c));
}
@@ -210,16 +208,16 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QPoint &);
class Q_CORE_EXPORT QPointF
{
public:
- QPointF();
- QPointF(const QPoint &p);
- QPointF(qreal xpos, qreal ypos);
+ Q_DECL_CONSTEXPR QPointF();
+ Q_DECL_CONSTEXPR QPointF(const QPoint &p);
+ Q_DECL_CONSTEXPR QPointF(qreal xpos, qreal ypos);
- qreal manhattanLength() const;
+ Q_DECL_CONSTEXPR qreal manhattanLength() const;
bool isNull() const;
- qreal x() const;
- qreal y() const;
+ Q_DECL_CONSTEXPR qreal x() const;
+ Q_DECL_CONSTEXPR qreal y() const;
void setX(qreal x);
void setY(qreal y);
@@ -231,16 +229,16 @@ public:
QPointF &operator*=(qreal c);
QPointF &operator/=(qreal c);
- friend inline bool operator==(const QPointF &, const QPointF &);
- friend inline bool operator!=(const QPointF &, const QPointF &);
- friend inline const QPointF operator+(const QPointF &, const QPointF &);
- friend inline const QPointF operator-(const QPointF &, const QPointF &);
- friend inline const QPointF operator*(qreal, const QPointF &);
- friend inline const QPointF operator*(const QPointF &, qreal);
- friend inline const QPointF operator-(const QPointF &);
- friend inline const QPointF operator/(const QPointF &, qreal);
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QPointF &, const QPointF &);
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QPointF &, const QPointF &);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator+(const QPointF &, const QPointF &);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &, const QPointF &);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator*(qreal, const QPointF &);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator*(const QPointF &, qreal);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &);
+ friend Q_DECL_CONSTEXPR inline const QPointF operator/(const QPointF &, qreal);
- QPoint toPoint() const;
+ Q_DECL_CONSTEXPR QPoint toPoint() const;
private:
friend class QMatrix;
@@ -264,13 +262,13 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QPointF &);
QPointF inline functions
*****************************************************************************/
-inline QPointF::QPointF() : xp(0), yp(0) { }
+Q_DECL_CONSTEXPR inline QPointF::QPointF() : xp(0), yp(0) { }
-inline QPointF::QPointF(qreal xpos, qreal ypos) : xp(xpos), yp(ypos) { }
+Q_DECL_CONSTEXPR inline QPointF::QPointF(qreal xpos, qreal ypos) : xp(xpos), yp(ypos) { }
-inline QPointF::QPointF(const QPoint &p) : xp(p.x()), yp(p.y()) { }
+Q_DECL_CONSTEXPR inline QPointF::QPointF(const QPoint &p) : xp(p.x()), yp(p.y()) { }
-inline qreal QPointF::manhattanLength() const
+Q_DECL_CONSTEXPR inline qreal QPointF::manhattanLength() const
{
return qAbs(x())+qAbs(y());
}
@@ -280,12 +278,12 @@ inline bool QPointF::isNull() const
return qIsNull(xp) && qIsNull(yp);
}
-inline qreal QPointF::x() const
+Q_DECL_CONSTEXPR inline qreal QPointF::x() const
{
return xp;
}
-inline qreal QPointF::y() const
+Q_DECL_CONSTEXPR inline qreal QPointF::y() const
{
return yp;
}
@@ -327,37 +325,37 @@ inline QPointF &QPointF::operator*=(qreal c)
xp*=c; yp*=c; return *this;
}
-inline bool operator==(const QPointF &p1, const QPointF &p2)
+Q_DECL_CONSTEXPR inline bool operator==(const QPointF &p1, const QPointF &p2)
{
return qFuzzyIsNull(p1.xp - p2.xp) && qFuzzyIsNull(p1.yp - p2.yp);
}
-inline bool operator!=(const QPointF &p1, const QPointF &p2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QPointF &p1, const QPointF &p2)
{
return !qFuzzyIsNull(p1.xp - p2.xp) || !qFuzzyIsNull(p1.yp - p2.yp);
}
-inline const QPointF operator+(const QPointF &p1, const QPointF &p2)
+Q_DECL_CONSTEXPR inline const QPointF operator+(const QPointF &p1, const QPointF &p2)
{
return QPointF(p1.xp+p2.xp, p1.yp+p2.yp);
}
-inline const QPointF operator-(const QPointF &p1, const QPointF &p2)
+Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &p1, const QPointF &p2)
{
return QPointF(p1.xp-p2.xp, p1.yp-p2.yp);
}
-inline const QPointF operator*(const QPointF &p, qreal c)
+Q_DECL_CONSTEXPR inline const QPointF operator*(const QPointF &p, qreal c)
{
return QPointF(p.xp*c, p.yp*c);
}
-inline const QPointF operator*(qreal c, const QPointF &p)
+Q_DECL_CONSTEXPR inline const QPointF operator*(qreal c, const QPointF &p)
{
return QPointF(p.xp*c, p.yp*c);
}
-inline const QPointF operator-(const QPointF &p)
+Q_DECL_CONSTEXPR inline const QPointF operator-(const QPointF &p)
{
return QPointF(-p.xp, -p.yp);
}
@@ -369,12 +367,12 @@ inline QPointF &QPointF::operator/=(qreal c)
return *this;
}
-inline const QPointF operator/(const QPointF &p, qreal c)
+Q_DECL_CONSTEXPR inline const QPointF operator/(const QPointF &p, qreal c)
{
return QPointF(p.xp/c, p.yp/c);
}
-inline QPoint QPointF::toPoint() const
+Q_DECL_CONSTEXPR inline QPoint QPointF::toPoint() const
{
return QPoint(qRound(xp), qRound(yp));
}
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index bc9a4d68be..4bf10061ab 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -57,23 +57,23 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QRect
{
public:
- QRect() { x1 = y1 = 0; x2 = y2 = -1; }
- QRect(const QPoint &topleft, const QPoint &bottomright);
- QRect(const QPoint &topleft, const QSize &size);
- QRect(int left, int top, int width, int height);
-
- bool isNull() const;
- bool isEmpty() const;
- bool isValid() const;
-
- int left() const;
- int top() const;
- int right() const;
- int bottom() const;
+ Q_DECL_CONSTEXPR QRect() : x1(0), y1(0), x2(-1), y2(-1) {}
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QPoint &bottomright);
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QSize &size);
+ Q_DECL_CONSTEXPR QRect(int left, int top, int width, int height);
+
+ Q_DECL_CONSTEXPR bool isNull() const;
+ Q_DECL_CONSTEXPR bool isEmpty() const;
+ Q_DECL_CONSTEXPR bool isValid() const;
+
+ Q_DECL_CONSTEXPR int left() const;
+ Q_DECL_CONSTEXPR int top() const;
+ Q_DECL_CONSTEXPR int right() const;
+ Q_DECL_CONSTEXPR int bottom() const;
QRect normalized() const;
- int x() const;
- int y() const;
+ Q_DECL_CONSTEXPR int x() const;
+ Q_DECL_CONSTEXPR int y() const;
void setLeft(int pos);
void setTop(int pos);
void setRight(int pos);
@@ -86,11 +86,11 @@ public:
void setTopRight(const QPoint &p);
void setBottomLeft(const QPoint &p);
- QPoint topLeft() const;
- QPoint bottomRight() const;
- QPoint topRight() const;
- QPoint bottomLeft() const;
- QPoint center() const;
+ Q_DECL_CONSTEXPR QPoint topLeft() const;
+ Q_DECL_CONSTEXPR QPoint bottomRight() const;
+ Q_DECL_CONSTEXPR QPoint topRight() const;
+ Q_DECL_CONSTEXPR QPoint bottomLeft() const;
+ Q_DECL_CONSTEXPR QPoint center() const;
void moveLeft(int pos);
void moveTop(int pos);
@@ -104,8 +104,8 @@ public:
inline void translate(int dx, int dy);
inline void translate(const QPoint &p);
- inline QRect translated(int dx, int dy) const;
- inline QRect translated(const QPoint &p) const;
+ Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const;
+ Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const;
void moveTo(int x, int t);
void moveTo(const QPoint &p);
@@ -117,11 +117,11 @@ public:
inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
inline void adjust(int x1, int y1, int x2, int y2);
- inline QRect adjusted(int x1, int y1, int x2, int y2) const;
+ Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const;
- QSize size() const;
- int width() const;
- int height() const;
+ Q_DECL_CONSTEXPR QSize size() const;
+ Q_DECL_CONSTEXPR int width() const;
+ Q_DECL_CONSTEXPR int height() const;
void setWidth(int w);
void setHeight(int h);
void setSize(const QSize &s);
@@ -144,8 +144,8 @@ public:
QT_DEPRECATED QRect intersect(const QRect &r) const { return intersected(r); }
#endif
- friend Q_CORE_EXPORT_INLINE bool operator==(const QRect &, const QRect &);
- friend Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &);
+ friend Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator==(const QRect &, const QRect &);
+ friend Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator!=(const QRect &, const QRect &);
private:
int x1;
@@ -155,8 +155,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRect, Q_MOVABLE_TYPE);
-Q_CORE_EXPORT_INLINE bool operator==(const QRect &, const QRect &);
-Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &);
+Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator==(const QRect &, const QRect &);
+Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator!=(const QRect &, const QRect &);
/*****************************************************************************
@@ -171,55 +171,40 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRect &);
QRect inline member functions
*****************************************************************************/
-inline QRect::QRect(int aleft, int atop, int awidth, int aheight)
-{
- x1 = aleft;
- y1 = atop;
- x2 = (aleft + awidth - 1);
- y2 = (atop + aheight - 1);
-}
+Q_DECL_CONSTEXPR inline QRect::QRect(int aleft, int atop, int awidth, int aheight)
+ : x1(aleft), y1(atop), x2(aleft + awidth - 1), y2(atop + aheight - 1) {}
-inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight)
-{
- x1 = atopLeft.x();
- y1 = atopLeft.y();
- x2 = abottomRight.x();
- y2 = abottomRight.y();
-}
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight)
+ : x1(atopLeft.x()), y1(atopLeft.y()), x2(abottomRight.x()), y2(abottomRight.y()) {}
-inline QRect::QRect(const QPoint &atopLeft, const QSize &asize)
-{
- x1 = atopLeft.x();
- y1 = atopLeft.y();
- x2 = (x1+asize.width() - 1);
- y2 = (y1+asize.height() - 1);
-}
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QSize &asize)
+ : x1(atopLeft.x()), y1(atopLeft.y()), x2(atopLeft.x()+asize.width() - 1), y2(atopLeft.y()+asize.height() - 1) {}
-inline bool QRect::isNull() const
+Q_DECL_CONSTEXPR inline bool QRect::isNull() const
{ return x2 == x1 - 1 && y2 == y1 - 1; }
-inline bool QRect::isEmpty() const
+Q_DECL_CONSTEXPR inline bool QRect::isEmpty() const
{ return x1 > x2 || y1 > y2; }
-inline bool QRect::isValid() const
+Q_DECL_CONSTEXPR inline bool QRect::isValid() const
{ return x1 <= x2 && y1 <= y2; }
-inline int QRect::left() const
+Q_DECL_CONSTEXPR inline int QRect::left() const
{ return x1; }
-inline int QRect::top() const
+Q_DECL_CONSTEXPR inline int QRect::top() const
{ return y1; }
-inline int QRect::right() const
+Q_DECL_CONSTEXPR inline int QRect::right() const
{ return x2; }
-inline int QRect::bottom() const
+Q_DECL_CONSTEXPR inline int QRect::bottom() const
{ return y2; }
-inline int QRect::x() const
+Q_DECL_CONSTEXPR inline int QRect::x() const
{ return x1; }
-inline int QRect::y() const
+Q_DECL_CONSTEXPR inline int QRect::y() const
{ return y1; }
inline void QRect::setLeft(int pos)
@@ -252,28 +237,28 @@ inline void QRect::setX(int ax)
inline void QRect::setY(int ay)
{ y1 = ay; }
-inline QPoint QRect::topLeft() const
+Q_DECL_CONSTEXPR inline QPoint QRect::topLeft() const
{ return QPoint(x1, y1); }
-inline QPoint QRect::bottomRight() const
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomRight() const
{ return QPoint(x2, y2); }
-inline QPoint QRect::topRight() const
+Q_DECL_CONSTEXPR inline QPoint QRect::topRight() const
{ return QPoint(x2, y1); }
-inline QPoint QRect::bottomLeft() const
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomLeft() const
{ return QPoint(x1, y2); }
-inline QPoint QRect::center() const
+Q_DECL_CONSTEXPR inline QPoint QRect::center() const
{ return QPoint((x1+x2)/2, (y1+y2)/2); }
-inline int QRect::width() const
+Q_DECL_CONSTEXPR inline int QRect::width() const
{ return x2 - x1 + 1; }
-inline int QRect::height() const
+Q_DECL_CONSTEXPR inline int QRect::height() const
{ return y2 - y1 + 1; }
-inline QSize QRect::size() const
+Q_DECL_CONSTEXPR inline QSize QRect::size() const
{ return QSize(width(), height()); }
inline void QRect::translate(int dx, int dy)
@@ -292,10 +277,10 @@ inline void QRect::translate(const QPoint &p)
y2 += p.y();
}
-inline QRect QRect::translated(int dx, int dy) const
+Q_DECL_CONSTEXPR inline QRect QRect::translated(int dx, int dy) const
{ return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
-inline QRect QRect::translated(const QPoint &p) const
+Q_DECL_CONSTEXPR inline QRect QRect::translated(const QPoint &p) const
{ return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
inline void QRect::moveTo(int ax, int ay)
@@ -388,7 +373,7 @@ inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2)
y2 = yp2;
}
-inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
+Q_DECL_CONSTEXPR inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const
{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2)
@@ -443,12 +428,12 @@ inline QRect QRect::united(const QRect &r) const
return *this | r;
}
-inline bool operator==(const QRect &r1, const QRect &r2)
+Q_DECL_CONSTEXPR inline bool operator==(const QRect &r1, const QRect &r2)
{
return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
}
-inline bool operator!=(const QRect &r1, const QRect &r2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QRect &r1, const QRect &r2)
{
return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
}
@@ -461,24 +446,24 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QRect &);
class Q_CORE_EXPORT QRectF
{
public:
- QRectF() { xp = yp = 0.; w = h = 0.; }
- QRectF(const QPointF &topleft, const QSizeF &size);
- QRectF(const QPointF &topleft, const QPointF &bottomRight);
- QRectF(qreal left, qreal top, qreal width, qreal height);
- QRectF(const QRect &rect);
-
- bool isNull() const;
- bool isEmpty() const;
- bool isValid() const;
+ Q_DECL_CONSTEXPR QRectF() : xp(0.), yp(0.), w(0.), h(0.) {}
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QSizeF &size);
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QPointF &bottomRight);
+ Q_DECL_CONSTEXPR QRectF(qreal left, qreal top, qreal width, qreal height);
+ Q_DECL_CONSTEXPR QRectF(const QRect &rect);
+
+ Q_DECL_CONSTEXPR bool isNull() const;
+ Q_DECL_CONSTEXPR bool isEmpty() const;
+ Q_DECL_CONSTEXPR bool isValid() const;
QRectF normalized() const;
- inline qreal left() const { return xp; }
- inline qreal top() const { return yp; }
- inline qreal right() const { return xp + w; }
- inline qreal bottom() const { return yp + h; }
+ Q_DECL_CONSTEXPR inline qreal left() const { return xp; }
+ Q_DECL_CONSTEXPR inline qreal top() const { return yp; }
+ Q_DECL_CONSTEXPR inline qreal right() const { return xp + w; }
+ Q_DECL_CONSTEXPR inline qreal bottom() const { return yp + h; }
- inline qreal x() const;
- inline qreal y() const;
+ Q_DECL_CONSTEXPR inline qreal x() const;
+ Q_DECL_CONSTEXPR inline qreal y() const;
inline void setLeft(qreal pos);
inline void setTop(qreal pos);
inline void setRight(qreal pos);
@@ -486,11 +471,11 @@ public:
inline void setX(qreal pos) { setLeft(pos); }
inline void setY(qreal pos) { setTop(pos); }
- inline QPointF topLeft() const { return QPointF(xp, yp); }
- inline QPointF bottomRight() const { return QPointF(xp+w, yp+h); }
- inline QPointF topRight() const { return QPointF(xp+w, yp); }
- inline QPointF bottomLeft() const { return QPointF(xp, yp+h); }
- inline QPointF center() const;
+ Q_DECL_CONSTEXPR inline QPointF topLeft() const { return QPointF(xp, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomRight() const { return QPointF(xp+w, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF topRight() const { return QPointF(xp+w, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomLeft() const { return QPointF(xp, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF center() const;
void setTopLeft(const QPointF &p);
void setBottomRight(const QPointF &p);
@@ -510,8 +495,8 @@ public:
void translate(qreal dx, qreal dy);
void translate(const QPointF &p);
- QRectF translated(qreal dx, qreal dy) const;
- QRectF translated(const QPointF &p) const;
+ Q_DECL_CONSTEXPR QRectF translated(qreal dx, qreal dy) const;
+ Q_DECL_CONSTEXPR QRectF translated(const QPointF &p) const;
void moveTo(qreal x, qreal t);
void moveTo(const QPointF &p);
@@ -523,11 +508,11 @@ public:
void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2);
- inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const;
+ Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const;
- QSizeF size() const;
- qreal width() const;
- qreal height() const;
+ Q_DECL_CONSTEXPR QSizeF size() const;
+ Q_DECL_CONSTEXPR qreal width() const;
+ Q_DECL_CONSTEXPR qreal height() const;
void setWidth(qreal w);
void setHeight(qreal h);
void setSize(const QSizeF &s);
@@ -549,10 +534,10 @@ public:
QT_DEPRECATED QRectF intersect(const QRectF &r) const { return intersected(r); }
#endif
- friend Q_CORE_EXPORT_INLINE bool operator==(const QRectF &, const QRectF &);
- friend Q_CORE_EXPORT_INLINE bool operator!=(const QRectF &, const QRectF &);
+ friend Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator==(const QRectF &, const QRectF &);
+ friend Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator!=(const QRectF &, const QRectF &);
- QRect toRect() const;
+ Q_DECL_CONSTEXPR QRect toRect() const;
QRect toAlignedRect() const;
private:
@@ -563,8 +548,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRectF, Q_MOVABLE_TYPE);
-Q_CORE_EXPORT_INLINE bool operator==(const QRectF &, const QRectF &);
-Q_CORE_EXPORT_INLINE bool operator!=(const QRectF &, const QRectF &);
+Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator==(const QRectF &, const QRectF &);
+Q_CORE_EXPORT_INLINE Q_DECL_CONSTEXPR bool operator!=(const QRectF &, const QRectF &);
/*****************************************************************************
@@ -579,45 +564,40 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRectF &);
QRectF inline member functions
*****************************************************************************/
-inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight)
+Q_DECL_CONSTEXPR inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight)
: xp(aleft), yp(atop), w(awidth), h(aheight)
{
}
-inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize)
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize)
+ : xp(atopLeft.x()), yp(atopLeft.y()), w(asize.width()), h(asize.height())
{
- xp = atopLeft.x();
- yp = atopLeft.y();
- w = asize.width();
- h = asize.height();
}
-inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight)
+
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight)
+ : xp(atopLeft.x()), yp(atopLeft.y()), w(abottomRight.x() - atopLeft.x()), h(abottomRight.y() - atopLeft.y())
{
- xp = atopLeft.x();
- yp = atopLeft.y();
- w = abottomRight.x() - xp;
- h = abottomRight.y() - yp;
}
-inline QRectF::QRectF(const QRect &r)
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r)
: xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
{
}
-inline bool QRectF::isNull() const
+Q_DECL_CONSTEXPR inline bool QRectF::isNull() const
{ return w == 0. && h == 0.; }
-inline bool QRectF::isEmpty() const
+Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const
{ return w <= 0. || h <= 0.; }
-inline bool QRectF::isValid() const
+Q_DECL_CONSTEXPR inline bool QRectF::isValid() const
{ return w > 0. && h > 0.; }
-inline qreal QRectF::x() const
+Q_DECL_CONSTEXPR inline qreal QRectF::x() const
{ return xp; }
-inline qreal QRectF::y() const
+Q_DECL_CONSTEXPR inline qreal QRectF::y() const
{ return yp; }
inline void QRectF::setLeft(qreal pos) { qreal diff = pos - xp; xp += diff; w -= diff; }
@@ -636,7 +616,7 @@ inline void QRectF::setBottomLeft(const QPointF &p) { setLeft(p.x()); setBottom(
inline void QRectF::setBottomRight(const QPointF &p) { setRight(p.x()); setBottom(p.y()); }
-inline QPointF QRectF::center() const
+Q_DECL_CONSTEXPR inline QPointF QRectF::center() const
{ return QPointF(xp + w/2, yp + h/2); }
inline void QRectF::moveLeft(qreal pos) { xp = pos; }
@@ -657,13 +637,13 @@ inline void QRectF::moveBottomRight(const QPointF &p) { moveRight(p.x()); moveBo
inline void QRectF::moveCenter(const QPointF &p) { xp = p.x() - w/2; yp = p.y() - h/2; }
-inline qreal QRectF::width() const
+Q_DECL_CONSTEXPR inline qreal QRectF::width() const
{ return w; }
-inline qreal QRectF::height() const
+Q_DECL_CONSTEXPR inline qreal QRectF::height() const
{ return h; }
-inline QSizeF QRectF::size() const
+Q_DECL_CONSTEXPR inline QSizeF QRectF::size() const
{ return QSizeF(w, h); }
inline void QRectF::translate(qreal dx, qreal dy)
@@ -690,10 +670,10 @@ inline void QRectF::moveTo(const QPointF &p)
yp = p.y();
}
-inline QRectF QRectF::translated(qreal dx, qreal dy) const
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(qreal dx, qreal dy) const
{ return QRectF(xp + dx, yp + dy, w, h); }
-inline QRectF QRectF::translated(const QPointF &p) const
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(const QPointF &p) const
{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
@@ -731,7 +711,7 @@ inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2)
{ xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
-inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const
+Q_DECL_CONSTEXPR inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const
{ return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
inline void QRectF::setWidth(qreal aw)
@@ -773,19 +753,19 @@ inline QRectF QRectF::united(const QRectF &r) const
return *this | r;
}
-inline bool operator==(const QRectF &r1, const QRectF &r2)
+Q_DECL_CONSTEXPR inline bool operator==(const QRectF &r1, const QRectF &r2)
{
return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
&& qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
}
-inline bool operator!=(const QRectF &r1, const QRectF &r2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2)
{
return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
|| !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
}
-inline QRect QRectF::toRect() const
+Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const
{
return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
}
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index e8c0d4eccc..d7bcd0edbc 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -3934,6 +3934,7 @@ static void invalidateEngine(QRegExpPrivate *priv)
QRegExp::QRegExp()
{
priv = new QRegExpPrivate;
+ prepareEngine(priv);
}
/*!
@@ -3949,6 +3950,7 @@ QRegExp::QRegExp()
QRegExp::QRegExp(const QString &pattern, Qt::CaseSensitivity cs, PatternSyntax syntax)
{
priv = new QRegExpPrivate(QRegExpEngineKey(pattern, syntax, cs));
+ prepareEngine(priv);
}
/*!
diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h
index fece0ac943..88af9e876b 100644
--- a/src/corelib/tools/qsize.h
+++ b/src/corelib/tools/qsize.h
@@ -52,27 +52,27 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QSize
{
public:
- QSize();
- QSize(int w, int h);
+ Q_DECL_CONSTEXPR QSize();
+ Q_DECL_CONSTEXPR QSize(int w, int h);
- bool isNull() const;
- bool isEmpty() const;
- bool isValid() const;
+ Q_DECL_CONSTEXPR bool isNull() const;
+ Q_DECL_CONSTEXPR bool isEmpty() const;
+ Q_DECL_CONSTEXPR bool isValid() const;
- int width() const;
- int height() const;
+ Q_DECL_CONSTEXPR int width() const;
+ Q_DECL_CONSTEXPR int height() const;
void setWidth(int w);
void setHeight(int h);
void transpose();
- QSize transposed() const;
+ Q_DECL_CONSTEXPR QSize transposed() const;
void scale(int w, int h, Qt::AspectRatioMode mode);
void scale(const QSize &s, Qt::AspectRatioMode mode);
QSize scaled(int w, int h, Qt::AspectRatioMode mode) const;
QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const;
- QSize expandedTo(const QSize &) const;
- QSize boundedTo(const QSize &) const;
+ Q_DECL_CONSTEXPR QSize expandedTo(const QSize &) const;
+ Q_DECL_CONSTEXPR QSize boundedTo(const QSize &) const;
int &rwidth();
int &rheight();
@@ -82,12 +82,12 @@ public:
QSize &operator*=(qreal c);
QSize &operator/=(qreal c);
- friend inline bool operator==(const QSize &, const QSize &);
- friend inline bool operator!=(const QSize &, const QSize &);
- friend inline const QSize operator+(const QSize &, const QSize &);
- friend inline const QSize operator-(const QSize &, const QSize &);
- friend inline const QSize operator*(const QSize &, qreal);
- friend inline const QSize operator*(qreal, const QSize &);
+ friend inline Q_DECL_CONSTEXPR bool operator==(const QSize &, const QSize &);
+ friend inline Q_DECL_CONSTEXPR bool operator!=(const QSize &, const QSize &);
+ friend inline Q_DECL_CONSTEXPR const QSize operator+(const QSize &, const QSize &);
+ friend inline Q_DECL_CONSTEXPR const QSize operator-(const QSize &, const QSize &);
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(const QSize &, qreal);
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(qreal, const QSize &);
friend inline const QSize operator/(const QSize &, qreal);
private:
@@ -110,25 +110,23 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &);
QSize inline functions
*****************************************************************************/
-inline QSize::QSize()
-{ wd = ht = -1; }
+Q_DECL_CONSTEXPR inline QSize::QSize() : wd(-1), ht(-1) {}
-inline QSize::QSize(int w, int h)
-{ wd = w; ht = h; }
+Q_DECL_CONSTEXPR inline QSize::QSize(int w, int h) : wd(w), ht(h) {}
-inline bool QSize::isNull() const
+Q_DECL_CONSTEXPR inline bool QSize::isNull() const
{ return wd==0 && ht==0; }
-inline bool QSize::isEmpty() const
+Q_DECL_CONSTEXPR inline bool QSize::isEmpty() const
{ return wd<1 || ht<1; }
-inline bool QSize::isValid() const
+Q_DECL_CONSTEXPR inline bool QSize::isValid() const
{ return wd>=0 && ht>=0; }
-inline int QSize::width() const
+Q_DECL_CONSTEXPR inline int QSize::width() const
{ return wd; }
-inline int QSize::height() const
+Q_DECL_CONSTEXPR inline int QSize::height() const
{ return ht; }
inline void QSize::setWidth(int w)
@@ -137,7 +135,7 @@ inline void QSize::setWidth(int w)
inline void QSize::setHeight(int h)
{ ht = h; }
-inline QSize QSize::transposed() const
+Q_DECL_CONSTEXPR inline QSize QSize::transposed() const
{ return QSize(ht, wd); }
inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode)
@@ -164,22 +162,22 @@ inline QSize &QSize::operator-=(const QSize &s)
inline QSize &QSize::operator*=(qreal c)
{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
-inline bool operator==(const QSize &s1, const QSize &s2)
+Q_DECL_CONSTEXPR inline bool operator==(const QSize &s1, const QSize &s2)
{ return s1.wd == s2.wd && s1.ht == s2.ht; }
-inline bool operator!=(const QSize &s1, const QSize &s2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QSize &s1, const QSize &s2)
{ return s1.wd != s2.wd || s1.ht != s2.ht; }
-inline const QSize operator+(const QSize & s1, const QSize & s2)
+Q_DECL_CONSTEXPR inline const QSize operator+(const QSize & s1, const QSize & s2)
{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
-inline const QSize operator-(const QSize &s1, const QSize &s2)
+Q_DECL_CONSTEXPR inline const QSize operator-(const QSize &s1, const QSize &s2)
{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
-inline const QSize operator*(const QSize &s, qreal c)
+Q_DECL_CONSTEXPR inline const QSize operator*(const QSize &s, qreal c)
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
-inline const QSize operator*(qreal c, const QSize &s)
+Q_DECL_CONSTEXPR inline const QSize operator*(qreal c, const QSize &s)
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
inline QSize &QSize::operator/=(qreal c)
@@ -195,12 +193,12 @@ inline const QSize operator/(const QSize &s, qreal c)
return QSize(qRound(s.wd/c), qRound(s.ht/c));
}
-inline QSize QSize::expandedTo(const QSize & otherSize) const
+Q_DECL_CONSTEXPR inline QSize QSize::expandedTo(const QSize & otherSize) const
{
return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-inline QSize QSize::boundedTo(const QSize & otherSize) const
+Q_DECL_CONSTEXPR inline QSize QSize::boundedTo(const QSize & otherSize) const
{
return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
@@ -213,28 +211,28 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QSize &);
class Q_CORE_EXPORT QSizeF
{
public:
- QSizeF();
- QSizeF(const QSize &sz);
- QSizeF(qreal w, qreal h);
+ Q_DECL_CONSTEXPR QSizeF();
+ Q_DECL_CONSTEXPR QSizeF(const QSize &sz);
+ Q_DECL_CONSTEXPR QSizeF(qreal w, qreal h);
bool isNull() const;
- bool isEmpty() const;
- bool isValid() const;
+ Q_DECL_CONSTEXPR bool isEmpty() const;
+ Q_DECL_CONSTEXPR bool isValid() const;
- qreal width() const;
- qreal height() const;
+ Q_DECL_CONSTEXPR qreal width() const;
+ Q_DECL_CONSTEXPR qreal height() const;
void setWidth(qreal w);
void setHeight(qreal h);
void transpose();
- QSizeF transposed() const;
+ Q_DECL_CONSTEXPR QSizeF transposed() const;
void scale(qreal w, qreal h, Qt::AspectRatioMode mode);
void scale(const QSizeF &s, Qt::AspectRatioMode mode);
QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const;
QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const;
- QSizeF expandedTo(const QSizeF &) const;
- QSizeF boundedTo(const QSizeF &) const;
+ Q_DECL_CONSTEXPR QSizeF expandedTo(const QSizeF &) const;
+ Q_DECL_CONSTEXPR QSizeF boundedTo(const QSizeF &) const;
qreal &rwidth();
qreal &rheight();
@@ -244,15 +242,15 @@ public:
QSizeF &operator*=(qreal c);
QSizeF &operator/=(qreal c);
- friend inline bool operator==(const QSizeF &, const QSizeF &);
- friend inline bool operator!=(const QSizeF &, const QSizeF &);
- friend inline const QSizeF operator+(const QSizeF &, const QSizeF &);
- friend inline const QSizeF operator-(const QSizeF &, const QSizeF &);
- friend inline const QSizeF operator*(const QSizeF &, qreal);
- friend inline const QSizeF operator*(qreal, const QSizeF &);
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &, const QSizeF &);
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &, const QSizeF &);
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF &, const QSizeF &);
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &, const QSizeF &);
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &, qreal);
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal, const QSizeF &);
friend inline const QSizeF operator/(const QSizeF &, qreal);
- inline QSize toSize() const;
+ Q_DECL_CONSTEXPR inline QSize toSize() const;
private:
qreal wd;
@@ -275,30 +273,25 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &);
QSizeF inline functions
*****************************************************************************/
-inline QSizeF::QSizeF()
-{ wd = ht = -1.; }
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF() : wd(-1.), ht(-1.) {}
-inline QSizeF::QSizeF(const QSize &sz)
- : wd(sz.width()), ht(sz.height())
-{
-}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(const QSize &sz) : wd(sz.width()), ht(sz.height()) {}
-inline QSizeF::QSizeF(qreal w, qreal h)
-{ wd = w; ht = h; }
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(qreal w, qreal h) : wd(w), ht(h) {}
inline bool QSizeF::isNull() const
{ return qIsNull(wd) && qIsNull(ht); }
-inline bool QSizeF::isEmpty() const
+Q_DECL_CONSTEXPR inline bool QSizeF::isEmpty() const
{ return wd <= 0. || ht <= 0.; }
-inline bool QSizeF::isValid() const
+Q_DECL_CONSTEXPR inline bool QSizeF::isValid() const
{ return wd >= 0. && ht >= 0.; }
-inline qreal QSizeF::width() const
+Q_DECL_CONSTEXPR inline qreal QSizeF::width() const
{ return wd; }
-inline qreal QSizeF::height() const
+Q_DECL_CONSTEXPR inline qreal QSizeF::height() const
{ return ht; }
inline void QSizeF::setWidth(qreal w)
@@ -307,7 +300,7 @@ inline void QSizeF::setWidth(qreal w)
inline void QSizeF::setHeight(qreal h)
{ ht = h; }
-inline QSizeF QSizeF::transposed() const
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::transposed() const
{ return QSizeF(ht, wd); }
inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode)
@@ -334,22 +327,22 @@ inline QSizeF &QSizeF::operator-=(const QSizeF &s)
inline QSizeF &QSizeF::operator*=(qreal c)
{ wd *= c; ht *= c; return *this; }
-inline bool operator==(const QSizeF &s1, const QSizeF &s2)
+Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &s1, const QSizeF &s2)
{ return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
-inline bool operator!=(const QSizeF &s1, const QSizeF &s2)
+Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &s1, const QSizeF &s2)
{ return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
-inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2)
+Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2)
{ return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
-inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2)
+Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2)
{ return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
-inline const QSizeF operator*(const QSizeF &s, qreal c)
+Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &s, qreal c)
{ return QSizeF(s.wd*c, s.ht*c); }
-inline const QSizeF operator*(qreal c, const QSizeF &s)
+Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal c, const QSizeF &s)
{ return QSizeF(s.wd*c, s.ht*c); }
inline QSizeF &QSizeF::operator/=(qreal c)
@@ -365,17 +358,17 @@ inline const QSizeF operator/(const QSizeF &s, qreal c)
return QSizeF(s.wd/c, s.ht/c);
}
-inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const
{
return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const
{
return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
-inline QSize QSizeF::toSize() const
+Q_DECL_CONSTEXPR inline QSize QSizeF::toSize() const
{
return QSize(qRound(wd), qRound(ht));
}
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index be6f48808c..d0c2dd7148 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -98,10 +98,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_TEXTCODEC
-QTextCodec *QString::codecForCStrings;
-#endif
-
#ifdef QT_USE_ICU
// qlocale_icu.cpp
extern bool qt_ucol_strcoll(const QChar *source, int sourceLength, const QChar *target, int targetLength, int *result);
@@ -473,9 +469,8 @@ const QString::Null QString::null = { };
\snippet doc/src/snippets/qstring/main.cpp 0
QString converts the \c{const char *} data into Unicode using the
- fromAscii() function. By default, fromAscii() treats character
- above 128 as Latin-1 characters, but this can be changed by
- calling QTextCodec::setCodecForCStrings().
+ fromAscii() function. fromAscii() treats ordinals above 128 as Latin-1
+ characters.
In all of the QString functions that take \c{const char *}
parameters, the \c{const char *} is interpreted as a classic
@@ -613,9 +608,7 @@ const QString::Null QString::null = { };
toLatin1(), toUtf8(), and toLocal8Bit().
\list
- \o toAscii() returns an 8-bit string encoded using the codec
- specified by QTextCodec::codecForCStrings (by default, that is
- Latin 1).
+ \o toAscii() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.
\o toLatin1() returns a Latin-1 (ISO 8859-1) encoded 8-bit string.
\o toUtf8() returns a UTF-8 encoded 8-bit string. UTF-8 is a
superset of US-ASCII (ANSI X3.4-1986) that supports the entire
@@ -723,11 +716,11 @@ const QString::Null QString::null = { };
\section1 More Efficient String Construction
Many strings are known at compile time. But the trivial
- constructor QString("Hello"), will convert the string literal
- to a QString using the codecForCStrings(). To avoid this one
- can use the QStringLiteral macro to directly create the required
- data at compile time. Constructing a QString out of the literal
- does then not cause any overhead at runtime.
+ constructor QString("Hello"), will copy the contents of the string,
+ treating the contents as Latin-1. To avoid this one can use the
+ QStringLiteral macro to directly create the required data at compile
+ time. Constructing a QString out of the literal does then not cause
+ any overhead at runtime.
A slightly less efficient way is to use QLatin1String. This class wraps
a C string literal, precalculates it length at compile time and can
@@ -3631,9 +3624,7 @@ QByteArray QString::toLatin1() const
/*!
Returns an 8-bit representation of the string as a QByteArray.
- If a codec has been set using QTextCodec::setCodecForCStrings(),
- it is used to convert Unicode to 8-bit char; otherwise this
- function does the same as toLatin1().
+ This function does the same as toLatin1().
Note that, despite the name, this function does not necessarily return an US-ASCII
(ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
@@ -3642,10 +3633,6 @@ QByteArray QString::toLatin1() const
*/
QByteArray QString::toAscii() const
{
-#ifndef QT_NO_TEXTCODEC
- if (codecForCStrings)
- return codecForCStrings->fromUnicode(*this);
-#endif // QT_NO_TEXTCODEC
return toLatin1();
}
@@ -3779,23 +3766,6 @@ QString::Data *QString::fromLatin1_helper(const char *str, int size)
QString::Data *QString::fromAscii_helper(const char *str, int size)
{
-#ifndef QT_NO_TEXTCODEC
- if (codecForCStrings) {
- Data *d;
- if (!str) {
- d = const_cast<Data *>(&shared_null.str);
- } else if (size == 0 || (!*str && size < 0)) {
- d = const_cast<Data *>(&shared_empty.str);
- } else {
- if (size < 0)
- size = qstrlen(str);
- QString s = codecForCStrings->toUnicode(str, size);
- d = s.d;
- d->ref.ref();
- }
- return d;
- }
-#endif
return fromLatin1_helper(str, size);
}
@@ -3844,11 +3814,7 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
If \a size is -1 (default), it is taken to be strlen(\a
str).
- Note that, despite the name, this function actually uses the codec
- defined by QTextCodec::setCodecForCStrings() to convert \a str to
- Unicode. Depending on the codec, it may not accept valid US-ASCII (ANSI
- X3.4-1986) input. If no codec has been set, this function does the same
- as fromLatin1().
+ This function does the same as fromLatin1().
\sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
*/
@@ -4050,6 +4016,7 @@ QString QString::simplified() const
if (from == fromEnd)
goto done;
} while (!ch.isSpace());
+
}
done:
*to++ = ch;
@@ -4870,42 +4837,51 @@ QString QString::toLower() const
const ushort *p = d->data();
if (!p)
return *this;
- if (!d->size)
- return *this;
-
- const ushort *e = d->data() + d->size;
- // this avoids one out of bounds check in the loop
- if (QChar(*p).isLowSurrogate())
- ++p;
+ const ushort *e = p + d->size;
+ // this avoids out of bounds check in the loop
+ while (e != p && QChar::isHighSurrogate(*(e - 1)))
+ --e;
+ const QUnicodeTables::Properties *prop;
while (p != e) {
- uint c = *p;
- if (QChar(c).isLowSurrogate() && QChar(*(p - 1)).isHighSurrogate())
- c = QChar::surrogateToUcs4(*(p - 1), c);
- const QUnicodeTables::Properties *prop = qGetProp(c);
- if (prop->lowerCaseDiff || prop->lowerCaseSpecial) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ ushort high = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(high, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
+ if (prop->lowerCaseDiff) {
+ if (QChar::isLowSurrogate(*p))
+ --p; // safe; diff is 0 for surrogates
QString s(d->size, Qt::Uninitialized);
memcpy(s.d->data(), d->data(), (p - d->data())*sizeof(ushort));
ushort *pp = s.d->data() + (p - d->data());
- while (p < e) {
- uint c = *p;
- if (QChar(c).isLowSurrogate() && QChar(*(p - 1)).isHighSurrogate())
- c = QChar::surrogateToUcs4(*(p - 1), c);
- prop = qGetProp(c);
+ while (p != e) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ *pp = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(*pp++, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
if (prop->lowerCaseSpecial) {
+ const ushort *specialCase = specialCaseMap + prop->lowerCaseDiff;
+ ushort length = *specialCase++;
int pos = pp - s.d->data();
- s.resize(s.d->size + SPECIAL_CASE_MAX_LEN);
+ s.resize(s.d->size + length - 1);
pp = s.d->data() + pos;
- const ushort *specialCase = specialCaseMap + prop->lowerCaseDiff;
- while (*specialCase)
+ while (length--)
*pp++ = *specialCase++;
} else {
*pp++ = *p + prop->lowerCaseDiff;
}
++p;
}
- s.truncate(pp - s.d->data());
+
+ // this restores high surrogate parts eaten above, if any
+ while (e != d->data() + d->size)
+ *pp++ = *e++;
+
return s;
}
++p;
@@ -4919,31 +4895,51 @@ QString QString::toLower() const
*/
QString QString::toCaseFolded() const
{
- if (!d->size)
- return *this;
-
const ushort *p = d->data();
if (!p)
return *this;
- const ushort *e = d->data() + d->size;
+ const ushort *e = p + d->size;
+ // this avoids out of bounds check in the loop
+ while (e != p && QChar::isHighSurrogate(*(e - 1)))
+ --e;
- uint last = 0;
- while (p < e) {
- ushort folded = foldCase(*p, last);
- if (folded != *p) {
- QString s(*this);
- s.detach();
+ const QUnicodeTables::Properties *prop;
+ while (p != e) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ ushort high = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(high, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
+ if (prop->caseFoldDiff) {
+ if (QChar::isLowSurrogate(*p))
+ --p; // safe; diff is 0 for surrogates
+ QString s(d->size, Qt::Uninitialized);
+ memcpy(s.d->data(), d->data(), (p - d->data())*sizeof(ushort));
ushort *pp = s.d->data() + (p - d->data());
- const ushort *ppe = s.d->data() + s.d->size;
- last = pp > s.d->data() ? *(pp - 1) : 0;
- while (pp < ppe) {
- *pp = foldCase(*pp, last);
- ++pp;
+ while (p != e) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ *pp = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(*pp++, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
+ if (prop->caseFoldSpecial) {
+ //### we currently don't support full case foldings
+ } else {
+ *pp++ = *p + prop->caseFoldDiff;
+ }
+ ++p;
}
+
+ // this restores high surrogate parts eaten above, if any
+ while (e != d->data() + d->size)
+ *pp++ = *e++;
+
return s;
}
- p++;
+ ++p;
}
return *this;
}
@@ -4958,48 +4954,56 @@ QString QString::toCaseFolded() const
\sa toLower(), QLocale::toLower()
*/
-
QString QString::toUpper() const
{
const ushort *p = d->data();
if (!p)
return *this;
- if (!d->size)
- return *this;
- const ushort *e = d->data() + d->size;
-
- // this avoids one out of bounds check in the loop
- if (QChar(*p).isLowSurrogate())
- ++p;
+ const ushort *e = p + d->size;
+ // this avoids out of bounds check in the loop
+ while (e != p && QChar::isHighSurrogate(*(e - 1)))
+ --e;
+ const QUnicodeTables::Properties *prop;
while (p != e) {
- uint c = *p;
- if (QChar(c).isLowSurrogate() && QChar(*(p - 1)).isHighSurrogate())
- c = QChar::surrogateToUcs4(*(p - 1), c);
- const QUnicodeTables::Properties *prop = qGetProp(c);
- if (prop->upperCaseDiff || prop->upperCaseSpecial) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ ushort high = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(high, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
+ if (prop->upperCaseDiff) {
+ if (QChar::isLowSurrogate(*p))
+ --p; // safe; diff is 0 for surrogates
QString s(d->size, Qt::Uninitialized);
memcpy(s.d->data(), d->data(), (p - d->data())*sizeof(ushort));
ushort *pp = s.d->data() + (p - d->data());
- while (p < e) {
- uint c = *p;
- if (QChar(c).isLowSurrogate() && QChar(*(p - 1)).isHighSurrogate())
- c = QChar::surrogateToUcs4(*(p - 1), c);
- prop = qGetProp(c);
+ while (p != e) {
+ if (QChar::isHighSurrogate(*p) && QChar::isLowSurrogate(p[1])) {
+ *pp = *p++;
+ prop = qGetProp(QChar::surrogateToUcs4(*pp++, *p));
+ } else {
+ prop = qGetProp(*p);
+ }
if (prop->upperCaseSpecial) {
+ const ushort *specialCase = specialCaseMap + prop->upperCaseDiff;
+ ushort length = *specialCase++;
int pos = pp - s.d->data();
- s.resize(s.d->size + SPECIAL_CASE_MAX_LEN);
+ s.resize(s.d->size + length - 1);
pp = s.d->data() + pos;
- const ushort *specialCase = specialCaseMap + prop->upperCaseDiff;
- while (*specialCase)
+ while (length--)
*pp++ = *specialCase++;
} else {
*pp++ = *p + prop->upperCaseDiff;
}
++p;
}
- s.truncate(pp - s.d->data());
+
+ // this restores high surrogate parts eaten above, if any
+ while (e != d->data() + d->size)
+ *pp++ = *e++;
+
return s;
}
++p;
@@ -5079,19 +5083,8 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
const char *c = cformat;
for (;;) {
// Copy non-escape chars to result
-#ifndef QT_NO_TEXTCODEC
- int i = 0;
- while (*(c + i) != '\0' && *(c + i) != '%')
- ++i;
- if (codecForCStrings)
- result.append(codecForCStrings->toUnicode(c, i));
- else
- result.append(fromLatin1(c, i));
- c += i;
-#else
while (*c != '\0' && *c != '%')
result.append(QLatin1Char(*c++));
-#endif
if (*c == '\0')
break;
@@ -7003,8 +6996,7 @@ bool QString::isRightToLeft() const
This operator is mostly useful to pass a QString to a function
that accepts a std::string object.
- If the QString contains Unicode characters that the
- QTextCodec::codecForCStrings() codec cannot handle, using this operator
+ If the QString contains non-Latin1 Unicode characters, using this
can lead to loss of information.
This operator is only available if Qt is configured with STL
@@ -8673,9 +8665,7 @@ QByteArray QStringRef::toLatin1() const
Returns an 8-bit representation of the string as a QByteArray.
- If a codec has been set using QTextCodec::setCodecForCStrings(),
- it is used to convert Unicode to 8-bit char; otherwise this
- function does the same as toLatin1().
+ This function does the same as toLatin1().
Note that, despite the name, this function does not necessarily return an US-ASCII
(ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
@@ -8684,10 +8674,6 @@ QByteArray QStringRef::toLatin1() const
*/
QByteArray QStringRef::toAscii() const
{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings)
- return QString::codecForCStrings->fromUnicode(unicode(), length());
-#endif // QT_NO_TEXTCODEC
return toLatin1();
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 90fed78a15..ba68ab022b 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -496,10 +496,10 @@ public:
// ASCII compatibility
#ifndef QT_NO_CAST_FROM_ASCII
- inline QT_ASCII_CAST_WARN_CONSTRUCTOR QString(const char *ch)
+ inline QT_ASCII_CAST_WARN QString(const char *ch)
: d(fromAscii_helper(ch, ch ? int(strlen(ch)) : -1))
{}
- inline QT_ASCII_CAST_WARN_CONSTRUCTOR QString(const QByteArray &a)
+ inline QT_ASCII_CAST_WARN QString(const QByteArray &a)
: d(fromAscii_helper(a.constData(), qstrnlen(a.constData(), a.size())))
{}
inline QT_ASCII_CAST_WARN QString &operator=(const char *ch)
@@ -603,9 +603,6 @@ private:
Data *d;
inline QString(Data *dd, int /*dummy*/) : d(dd) {}
-#ifndef QT_NO_TEXTCODEC
- static QTextCodec *codecForCStrings;
-#endif
static int grow(int);
static void free(Data *);
void realloc();
@@ -926,9 +923,6 @@ inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
#ifndef QT_NO_CAST_FROM_ASCII
inline bool qStringComparisonHelper(const QString &s1, const char *s2)
{
-# ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2, s2 ? int(strlen(s2)) : -1));
-# endif
return (s1 == QLatin1String(s2));
}
inline bool QString::operator==(const char *s) const
@@ -1215,9 +1209,6 @@ inline bool operator>=(const QStringRef &s1, const QStringRef &s2)
inline bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
{
-# ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings) return (s1 == QString::fromAscii(s2, s2 ? int(strlen(s2)) : -1));
-# endif
return (s1 == QLatin1String(s2));
}
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 3d6b0eb709..6999972172 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -105,14 +105,6 @@ QT_BEGIN_NAMESPACE
*/
void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out)
{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings && len) {
- QString tmp = QString::fromAscii(a, len > 0 ? len : -1);
- memcpy(out, reinterpret_cast<const char *>(tmp.constData()), sizeof(QChar) * tmp.size());
- out += tmp.length();
- return;
- }
-#endif
if (len == -1) {
if (!a)
return;
@@ -124,25 +116,4 @@ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out
}
}
-/*! \internal */
-void QAbstractConcatenable::convertToAscii(const QChar* a, int len, char*& out)
-{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings) {
- QByteArray tmp = QString::codecForCStrings->fromUnicode(a, len);
- memcpy(out, tmp.constData(), tmp.size());
- out += tmp.length();
- return;
- }
-#endif
- if (len == -1) {
- while (a->unicode())
- convertToLatin1(*a++, out);
- } else {
- for (int i = 0; i < len; ++i)
- convertToLatin1(a[i], out);
- }
-}
-
-
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index e524523c36..c19d733243 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -62,30 +62,9 @@ struct Q_CORE_EXPORT QAbstractConcatenable
{
protected:
static void convertFromAscii(const char *a, int len, QChar *&out);
- static void convertToAscii(const QChar *a, int len, char *&out);
static inline void convertFromAscii(char a, QChar *&out)
{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings)
- *out++ = QChar::fromAscii(a);
- else
-#endif
- *out++ = QLatin1Char(a);
- }
-
- static inline void convertToAscii(QChar a, char *&out)
- {
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings)
- *out++ = a.toAscii(); //###
- else
-#endif
- convertToLatin1(a, out);
- }
-
- static inline void convertToLatin1(QChar a, char *&out)
- {
- *out++ = a.unicode() > 0xff ? '?' : char(a.unicode());
+ *out++ = QLatin1Char(a);
}
};
@@ -192,10 +171,6 @@ template <> struct QConcatenable<QChar> : private QAbstractConcatenable
static int size(const QChar) { return 1; }
static inline void appendTo(const QChar c, QChar *&out)
{ *out++ = c; }
-#ifndef QT_NO_CAST_TO_ASCII
- static inline QT_ASCII_CAST_WARN void appendTo(const QChar c, char *&out)
- { convertToAscii(c, out); }
-#endif
};
template <> struct QConcatenable<QCharRef> : private QAbstractConcatenable
@@ -206,10 +181,6 @@ template <> struct QConcatenable<QCharRef> : private QAbstractConcatenable
static int size(const QCharRef &) { return 1; }
static inline void appendTo(const QCharRef &c, QChar *&out)
{ *out++ = QChar(c); }
-#ifndef QT_NO_CAST_TO_ASCII
- static inline QT_ASCII_CAST_WARN void appendTo(const QCharRef &c, char *&out)
- { convertToAscii(c, out); }
-#endif
};
template <> struct QConcatenable<QLatin1String>
@@ -242,10 +213,6 @@ template <> struct QConcatenable<QString> : private QAbstractConcatenable
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
out += n;
}
-#ifndef QT_NO_CAST_TO_ASCII
- static inline QT_ASCII_CAST_WARN void appendTo(const QString &a, char *&out)
- { convertToAscii(a.constData(), a.length(), out); }
-#endif
};
template <int N> struct QConcatenable<QStaticStringDataPtr<N> > : private QAbstractConcatenable
@@ -259,10 +226,6 @@ template <int N> struct QConcatenable<QStaticStringDataPtr<N> > : private QAbstr
memcpy(out, reinterpret_cast<const char*>(a.ptr->data), sizeof(QChar) * N);
out += N;
}
-#ifndef QT_NO_CAST_TO_ASCII
- static inline QT_ASCII_CAST_WARN void appendTo(const type &a, char *&out)
- { convertToAscii(a.ptr->data, N, out); }
-#endif
};
template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
@@ -277,11 +240,6 @@ template <> struct QConcatenable<QStringRef> : private QAbstractConcatenable
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
out += n;
}
-#ifndef QT_NO_CAST_TO_ASCII
- static inline QT_ASCII_CAST_WARN void appendTo(const QStringRef &a, char *&out)
- { convertToAscii(a.constData(), a.length(), out); }
-#endif
-
};
template <int N> struct QConcatenable<char[N]> : private QAbstractConcatenable
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 7f823d4380..91d260b724 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -3488,13 +3488,13 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 5, 11, 2, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0, 10 },
{ 5, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 3, 0, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 4, 1, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 121, 121, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 3, 4 },
- { 14, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 3, 5 },
+ { 14, 11, 0, 0, 0, -1, 1, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 3, 5 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -232, -232, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 85, 85, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 86, 86, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -121, 0, 0, -121, 0, 3, 5 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -300, -300, -268, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 195, 195, 0, 0, 3, 4 },
@@ -3521,7 +3521,7 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 16, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 1, -1, 0, 1, 0, 3, 5 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -2, -1, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -79, -79, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 96, 96, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 97, 97, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -97, 0, 0, -97, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 3, 5 },
@@ -3591,10 +3591,10 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 37, 0, 0, 37, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 64, 0, 0, 64, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 63, 0, 0, 63, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 88, 88, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 89, 89, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -38, -38, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -37, -37, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 92, 92, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 93, 93, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -31, -31, 1, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -64, -64, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -63, -63, 0, 0, 3, 4 },
@@ -3627,7 +3627,7 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 25, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 25, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -48, -48, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 52, 49, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 53, 50, 0, 0, 3, 4 },
{ 25, 7, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 9 },
{ 20, 15, 10, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 13, 11, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -3911,105 +3911,105 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 17, 11, 0, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
{ 17, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 3814, 3814, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 99, 99, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 102, 102, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 105, 105, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 108, 108, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 111, 111, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 100, 100, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 103, 103, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 106, 106, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 109, 109, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 112, 112, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, -59, -59, -58, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -8, 0, 0, -8, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 114, 114, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 117, 117, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 121, 121, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 125, 125, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 115, 115, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 118, 118, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 122, 122, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 126, 126, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 74, 74, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 86, 86, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 100, 100, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 112, 112, 0, 0, 3, 4 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 126, 126, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 163, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 166, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 169, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 172, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 175, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 178, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 181, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 184, 8, 0, 0, 3, 4 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 163, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 166, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 169, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 172, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 175, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 178, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 181, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 184, 0, -8, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 187, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 190, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 193, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 196, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 199, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 202, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 205, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 208, 8, 0, 0, 3, 4 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 187, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 190, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 193, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 196, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 199, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 202, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 205, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 208, 0, -8, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 211, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 214, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 217, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 220, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 223, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 226, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 229, 8, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 232, 8, 0, 0, 3, 4 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 211, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 214, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 217, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 220, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 223, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 226, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 229, 0, -8, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 232, 0, -8, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 247, 244, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 235, 9, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 253, 250, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 129, 129, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 284, 280, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 164, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 167, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 170, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 173, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 176, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 179, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 182, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 185, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 164, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 167, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 170, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 173, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 176, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 179, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 182, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 185, 0, -8, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 188, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 191, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 194, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 197, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 200, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 203, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 206, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 209, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 188, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 191, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 194, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 197, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 200, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 203, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 206, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 209, 0, -8, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 212, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 215, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 218, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 221, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 224, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 227, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 230, 8, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 233, 8, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 212, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 215, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 218, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 221, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 224, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 227, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 230, 0, -8, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -8, 233, 0, -8, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 248, 245, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 236, 9, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 254, 251, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 130, 130, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 285, 281, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -74, 0, 0, -74, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 235, 0, -9, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 236, 0, -9, 0, 3, 5 },
{ 15, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, -7205, -7205, -7173, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 259, 256, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 238, 9, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 265, 262, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 132, 132, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 292, 288, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 260, 257, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 239, 9, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 266, 263, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 133, 133, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 293, 289, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -86, 0, 0, -86, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 238, 0, -9, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 135, 135, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 139, 139, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 142, 142, 0, 0, 3, 4 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 239, 0, -9, 0, 3, 5 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 136, 136, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 140, 140, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 143, 143, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -100, 0, 0, -100, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 146, 146, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 150, 150, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 153, 153, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 156, 156, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 147, 147, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 151, 151, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 154, 154, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 157, 157, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -112, 0, 0, -112, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -7, 0, 0, -7, 0, 3, 5 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 271, 268, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 241, 9, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 277, 274, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 160, 160, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 300, 296, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 272, 269, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, 0, 242, 9, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 278, 275, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 161, 161, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 301, 297, 0, 0, 3, 4 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -128, 0, 0, -128, 0, 3, 5 },
{ 14, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, -126, 0, 0, -126, 0, 3, 5 },
- { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 241, 0, -9, 0, 3, 5 },
+ { 16, 11, 0, 0, 0, -1, 1, 0, 1, 0, 0, 0, -9, 242, 0, -9, 0, 3, 5 },
{ 6, 15, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
{ 6, 3, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 },
{ 10, 18, 18, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 },
@@ -4212,17 +4212,17 @@ static const QUnicodeTables::Properties uc_properties[] = {
{ 11, 27, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 12, 11, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 18, 12, 0, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 12, 9, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 18, 15, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 24, 21, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 31, 27, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 39, 35, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 46, 43, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 58, 55, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 64, 61, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 70, 67, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 76, 73, 0, 0, 3, 4 },
- { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 82, 79, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 13, 10, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 19, 16, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 25, 22, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 32, 28, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 40, 36, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 47, 44, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 59, 56, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 65, 62, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 71, 68, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 77, 74, 0, 0, 3, 4 },
+ { 15, 11, 0, 0, 0, -1, 1, 0, 1, 1, 0, 0, 0, 83, 80, 0, 0, 3, 4 },
{ 18, 11, 1, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6 },
{ 0, 19, 17, 26, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0 },
{ 13, 11, 0, 0, 0, -1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -4351,102 +4351,102 @@ Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL QUnicodeTables::lineBre
}
static const ushort specialCaseMap[] = {
- 0x53, 0x73, 0x0,
- 0x53, 0x53, 0x0,
- 0x69, 0x307, 0x0,
- 0x46, 0x66, 0x0,
- 0x46, 0x46, 0x0,
- 0x46, 0x69, 0x0,
- 0x46, 0x49, 0x0,
- 0x46, 0x6c, 0x0,
- 0x46, 0x4c, 0x0,
- 0x46, 0x66, 0x69, 0x0,
- 0x46, 0x46, 0x49, 0x0,
- 0x46, 0x66, 0x6c, 0x0,
- 0x46, 0x46, 0x4c, 0x0,
- 0x53, 0x74, 0x0,
- 0x53, 0x54, 0x0,
- 0x535, 0x582, 0x0,
- 0x535, 0x552, 0x0,
- 0x544, 0x576, 0x0,
- 0x544, 0x546, 0x0,
- 0x544, 0x565, 0x0,
- 0x544, 0x535, 0x0,
- 0x544, 0x56b, 0x0,
- 0x544, 0x53b, 0x0,
- 0x54e, 0x576, 0x0,
- 0x54e, 0x546, 0x0,
- 0x544, 0x56d, 0x0,
- 0x544, 0x53d, 0x0,
- 0x2bc, 0x4e, 0x0,
- 0x399, 0x308, 0x301, 0x0,
- 0x3a5, 0x308, 0x301, 0x0,
- 0x4a, 0x30c, 0x0,
- 0x48, 0x331, 0x0,
- 0x54, 0x308, 0x0,
- 0x57, 0x30a, 0x0,
- 0x59, 0x30a, 0x0,
- 0x41, 0x2be, 0x0,
- 0x3a5, 0x313, 0x0,
- 0x3a5, 0x313, 0x300, 0x0,
- 0x3a5, 0x313, 0x301, 0x0,
- 0x3a5, 0x313, 0x342, 0x0,
- 0x391, 0x342, 0x0,
- 0x397, 0x342, 0x0,
- 0x399, 0x308, 0x300, 0x0,
- 0x399, 0x342, 0x0,
- 0x399, 0x308, 0x342, 0x0,
- 0x3a5, 0x308, 0x300, 0x0,
- 0x3a1, 0x313, 0x0,
- 0x3a5, 0x342, 0x0,
- 0x3a5, 0x308, 0x342, 0x0,
- 0x3a9, 0x342, 0x0,
- 0x1f08, 0x399, 0x0,
- 0x1f09, 0x399, 0x0,
- 0x1f0a, 0x399, 0x0,
- 0x1f0b, 0x399, 0x0,
- 0x1f0c, 0x399, 0x0,
- 0x1f0d, 0x399, 0x0,
- 0x1f0e, 0x399, 0x0,
- 0x1f0f, 0x399, 0x0,
- 0x1f28, 0x399, 0x0,
- 0x1f29, 0x399, 0x0,
- 0x1f2a, 0x399, 0x0,
- 0x1f2b, 0x399, 0x0,
- 0x1f2c, 0x399, 0x0,
- 0x1f2d, 0x399, 0x0,
- 0x1f2e, 0x399, 0x0,
- 0x1f2f, 0x399, 0x0,
- 0x1f68, 0x399, 0x0,
- 0x1f69, 0x399, 0x0,
- 0x1f6a, 0x399, 0x0,
- 0x1f6b, 0x399, 0x0,
- 0x1f6c, 0x399, 0x0,
- 0x1f6d, 0x399, 0x0,
- 0x1f6e, 0x399, 0x0,
- 0x1f6f, 0x399, 0x0,
- 0x391, 0x399, 0x0,
- 0x397, 0x399, 0x0,
- 0x3a9, 0x399, 0x0,
- 0x1fba, 0x345, 0x0,
- 0x1fba, 0x399, 0x0,
- 0x386, 0x345, 0x0,
- 0x386, 0x399, 0x0,
- 0x1fca, 0x345, 0x0,
- 0x1fca, 0x399, 0x0,
- 0x389, 0x345, 0x0,
- 0x389, 0x399, 0x0,
- 0x1ffa, 0x345, 0x0,
- 0x1ffa, 0x399, 0x0,
- 0x38f, 0x345, 0x0,
- 0x38f, 0x399, 0x0,
- 0x391, 0x342, 0x345, 0x0,
- 0x391, 0x342, 0x399, 0x0,
- 0x397, 0x342, 0x345, 0x0,
- 0x397, 0x342, 0x399, 0x0,
- 0x3a9, 0x342, 0x345, 0x0,
- 0x3a9, 0x342, 0x399, 0x0
-
+ 0x0, // placeholder
+ 0x2, 0x53, 0x73,
+ 0x2, 0x53, 0x53,
+ 0x2, 0x69, 0x307,
+ 0x2, 0x46, 0x66,
+ 0x2, 0x46, 0x46,
+ 0x2, 0x46, 0x69,
+ 0x2, 0x46, 0x49,
+ 0x2, 0x46, 0x6c,
+ 0x2, 0x46, 0x4c,
+ 0x3, 0x46, 0x66, 0x69,
+ 0x3, 0x46, 0x46, 0x49,
+ 0x3, 0x46, 0x66, 0x6c,
+ 0x3, 0x46, 0x46, 0x4c,
+ 0x2, 0x53, 0x74,
+ 0x2, 0x53, 0x54,
+ 0x2, 0x535, 0x582,
+ 0x2, 0x535, 0x552,
+ 0x2, 0x544, 0x576,
+ 0x2, 0x544, 0x546,
+ 0x2, 0x544, 0x565,
+ 0x2, 0x544, 0x535,
+ 0x2, 0x544, 0x56b,
+ 0x2, 0x544, 0x53b,
+ 0x2, 0x54e, 0x576,
+ 0x2, 0x54e, 0x546,
+ 0x2, 0x544, 0x56d,
+ 0x2, 0x544, 0x53d,
+ 0x2, 0x2bc, 0x4e,
+ 0x3, 0x399, 0x308, 0x301,
+ 0x3, 0x3a5, 0x308, 0x301,
+ 0x2, 0x4a, 0x30c,
+ 0x2, 0x48, 0x331,
+ 0x2, 0x54, 0x308,
+ 0x2, 0x57, 0x30a,
+ 0x2, 0x59, 0x30a,
+ 0x2, 0x41, 0x2be,
+ 0x2, 0x3a5, 0x313,
+ 0x3, 0x3a5, 0x313, 0x300,
+ 0x3, 0x3a5, 0x313, 0x301,
+ 0x3, 0x3a5, 0x313, 0x342,
+ 0x2, 0x391, 0x342,
+ 0x2, 0x397, 0x342,
+ 0x3, 0x399, 0x308, 0x300,
+ 0x2, 0x399, 0x342,
+ 0x3, 0x399, 0x308, 0x342,
+ 0x3, 0x3a5, 0x308, 0x300,
+ 0x2, 0x3a1, 0x313,
+ 0x2, 0x3a5, 0x342,
+ 0x3, 0x3a5, 0x308, 0x342,
+ 0x2, 0x3a9, 0x342,
+ 0x2, 0x1f08, 0x399,
+ 0x2, 0x1f09, 0x399,
+ 0x2, 0x1f0a, 0x399,
+ 0x2, 0x1f0b, 0x399,
+ 0x2, 0x1f0c, 0x399,
+ 0x2, 0x1f0d, 0x399,
+ 0x2, 0x1f0e, 0x399,
+ 0x2, 0x1f0f, 0x399,
+ 0x2, 0x1f28, 0x399,
+ 0x2, 0x1f29, 0x399,
+ 0x2, 0x1f2a, 0x399,
+ 0x2, 0x1f2b, 0x399,
+ 0x2, 0x1f2c, 0x399,
+ 0x2, 0x1f2d, 0x399,
+ 0x2, 0x1f2e, 0x399,
+ 0x2, 0x1f2f, 0x399,
+ 0x2, 0x1f68, 0x399,
+ 0x2, 0x1f69, 0x399,
+ 0x2, 0x1f6a, 0x399,
+ 0x2, 0x1f6b, 0x399,
+ 0x2, 0x1f6c, 0x399,
+ 0x2, 0x1f6d, 0x399,
+ 0x2, 0x1f6e, 0x399,
+ 0x2, 0x1f6f, 0x399,
+ 0x2, 0x391, 0x399,
+ 0x2, 0x397, 0x399,
+ 0x2, 0x3a9, 0x399,
+ 0x2, 0x1fba, 0x345,
+ 0x2, 0x1fba, 0x399,
+ 0x2, 0x386, 0x345,
+ 0x2, 0x386, 0x399,
+ 0x2, 0x1fca, 0x345,
+ 0x2, 0x1fca, 0x399,
+ 0x2, 0x389, 0x345,
+ 0x2, 0x389, 0x399,
+ 0x2, 0x1ffa, 0x345,
+ 0x2, 0x1ffa, 0x399,
+ 0x2, 0x38f, 0x345,
+ 0x2, 0x38f, 0x399,
+ 0x3, 0x391, 0x342, 0x345,
+ 0x3, 0x391, 0x342, 0x399,
+ 0x3, 0x397, 0x342, 0x345,
+ 0x3, 0x397, 0x342, 0x399,
+ 0x3, 0x3a9, 0x342, 0x345,
+ 0x3, 0x3a9, 0x342, 0x399
};
#define SPECIAL_CASE_MAX_LEN 3
diff --git a/src/corelib/xml/qxmlutils.cpp b/src/corelib/xml/qxmlutils.cpp
index 954846a573..7ec208816c 100644
--- a/src/corelib/xml/qxmlutils.cpp
+++ b/src/corelib/xml/qxmlutils.cpp
@@ -379,7 +379,7 @@ bool QXmlUtils::isNCName(const QStringRef &ncName)
const int len = ncName.size();
for(int i = 0; i < len; ++i)
{
- const QChar &at = ncName.at(i);
+ const QChar at = ncName.at(i);
if(!QXmlUtils::isNameChar(at) || at == QLatin1Char(':'))
return false;
}