summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in5
-rw-r--r--src/corelib/Qt5CoreMacros.cmake80
-rw-r--r--src/corelib/doc/qtcore.qdocconf3
-rw-r--r--src/corelib/doc/src/datastreamformat.qdoc2
-rw-r--r--src/corelib/doc/src/json.qdoc2
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc2
-rw-r--r--src/corelib/global/qglobal.cpp7
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/json/qjsonarray.cpp2
-rw-r--r--src/corelib/json/qjsondocument.cpp2
-rw-r--r--src/corelib/json/qjsonobject.cpp6
-rw-r--r--src/corelib/json/qjsonparser.cpp2
-rw-r--r--src/corelib/json/qjsonvalue.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp2
14 files changed, 84 insertions, 37 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 36a54787b3..2d87783107 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -131,6 +131,11 @@ if (NOT TARGET Qt5::WinMain)
get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS)
foreach(_config ${_configs})
set_property(TARGET Qt5::Core APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
+ )
+ # For backward compatibility with CMake < 2.8.12
+ set_property(TARGET Qt5::Core APPEND PROPERTY
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
)
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 6630885257..dca257f080 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -94,34 +94,45 @@ endmacro()
# helper macro to set up a moc rule
-macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
- # For Windows, create a parameters file to work around command line length limit
- if(WIN32)
- # Pass the parameters in a file. Set the working directory to
- # be that containing the parameters file and reference it by
- # just the file name. This is necessary because the moc tool on
- # MinGW builds does not seem to handle spaces in the path to the
- # file given with the @ syntax.
- get_filename_component(_moc_outfile_name "${outfile}" NAME)
- get_filename_component(_moc_outfile_dir "${outfile}" PATH)
- if(_moc_outfile_dir)
- set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
- endif()
- set(_moc_parameters_file ${outfile}_parameters)
- set(_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
- string(REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
- file(WRITE ${_moc_parameters_file} "${_moc_parameters}")
- add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Core_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
- DEPENDS ${infile}
- ${_moc_working_dir}
- VERBATIM)
+macro(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
+ # Pass the parameters in a file. Set the working directory to
+ # be that containing the parameters file and reference it by
+ # just the file name. This is necessary because the moc tool on
+ # MinGW builds does not seem to handle spaces in the path to the
+ # file given with the @ syntax.
+ get_filename_component(_moc_outfile_name "${outfile}" NAME)
+ get_filename_component(_moc_outfile_dir "${outfile}" PATH)
+ if(_moc_outfile_dir)
+ set(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+ endif()
+ set (_moc_parameters_file ${outfile}_parameters)
+ set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+ string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
+
+ if(moc_target)
+ set(targetincludes "$<TARGET_PROPERTY:${moc_target},INCLUDE_DIRECTORIES>")
+ set(targetdefines "$<TARGET_PROPERTY:${moc_target},COMPILE_DEFINITIONS>")
+
+ set(targetincludes "$<$<BOOL:${targetincludes}>:-I$<JOIN:${targetincludes},\n-I>\n>")
+ set(targetdefines "$<$<BOOL:${targetdefines}>:-D$<JOIN:${targetdefines},\n-D>\n>")
+
+ file (GENERATE
+ OUTPUT ${_moc_parameters_file}
+ CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n"
+ )
+
+ set(targetincludes)
+ set(targetdefines)
else()
- add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Core_MOC_EXECUTABLE}
- ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
- DEPENDS ${infile} VERBATIM)
+ file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n")
endif()
+
+ set(_moc_extra_parameters_file @${_moc_parameters_file})
+ add_custom_command(OUTPUT ${outfile}
+ COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
+ DEPENDS ${infile}
+ ${_moc_working_dir}
+ VERBATIM)
endmacro()
@@ -133,7 +144,13 @@ function(QT5_GENERATE_MOC infile outfile )
if(NOT IS_ABSOLUTE "${outfile}")
set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}")
endif()
- qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "")
+ if ("x${ARGV2}" STREQUAL "xTARGET")
+ if (CMAKE_VERSION VERSION_LESS 2.8.12)
+ message(FATAL_ERROR "The TARGET parameter to qt5_generate_moc is only available when using CMake 2.8.12 or later.")
+ endif()
+ set(moc_target ${ARGV3})
+ endif()
+ qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
endfunction()
@@ -145,17 +162,22 @@ function(QT5_WRAP_CPP outfiles )
qt5_get_moc_flags(moc_flags)
set(options)
- set(oneValueArgs)
+ set(oneValueArgs TARGET)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(moc_files ${_WRAP_CPP_UNPARSED_ARGUMENTS})
set(moc_options ${_WRAP_CPP_OPTIONS})
+ set(moc_target ${_WRAP_CPP_TARGET})
+
+ if (moc_target AND CMAKE_VERSION VERSION_LESS 2.8.12)
+ message(FATAL_ERROR "The TARGET parameter to qt5_wrap_cpp is only available when using CMake 2.8.12 or later.")
+ endif()
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
qt5_make_output_file(${it} moc_ cpp outfile)
- qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}")
+ qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 7a3e20aa89..fdd46995c5 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -36,7 +36,8 @@ exampledirs += \
../ \
snippets \
../../../examples/threads/ \
- ../../../examples/tools/
+ ../../../examples/tools/ \
+ ../../../examples/json/
imagedirs += images
diff --git a/src/corelib/doc/src/datastreamformat.qdoc b/src/corelib/doc/src/datastreamformat.qdoc
index 99a0a077cd..b6efe6aa33 100644
--- a/src/corelib/doc/src/datastreamformat.qdoc
+++ b/src/corelib/doc/src/datastreamformat.qdoc
@@ -369,4 +369,6 @@
\li The items (T)
\endlist
\endtable
+
+ \sa {JSON Support in Qt}
*/
diff --git a/src/corelib/doc/src/json.qdoc b/src/corelib/doc/src/json.qdoc
index 89e1bcac34..5bffe98ae5 100644
--- a/src/corelib/doc/src/json.qdoc
+++ b/src/corelib/doc/src/json.qdoc
@@ -99,6 +99,8 @@
A valid JSON document is either an array or an object, so a document always starts
with a square or curly bracket.
+ \sa {JSON Save Game Example}
+
\section1 The JSON Classes
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index d1690c5908..70f0b88e06 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -67,7 +67,7 @@
\li A \c READ accessor function is required if no \c MEMBER variable was
specified. It is for reading the property value. Ideally, a const function
is used for this purpose, and it must return either the property's type or a
- pointer or reference to that type. e.g., QWidget::focus is a read-only
+ const reference to that type. e.g., QWidget::focus is a read-only
property with \c READ function, QWidget::hasFocus().
\li A \c WRITE accessor function is optional. It is for setting the
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 4ee4235278..9656f4b68a 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1168,6 +1168,13 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
+ \macro Q_OS_ANDROID
+ \relates <QtGlobal>
+
+ Defined on Android.
+*/
+
+/*!
\macro Q_OS_FREEBSD
\relates <QtGlobal>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 41f21bb0dd..e72ea792dd 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -206,11 +206,7 @@ typedef quint64 qulonglong;
QT_BEGIN_INCLUDE_NAMESPACE
typedef unsigned char uchar;
typedef unsigned short ushort;
-#if defined(Q_QDOC) || !defined(Q_OS_ANDROID)
typedef unsigned int uint;
-#else
-# include <sys/types.h>
-#endif
typedef unsigned long ulong;
QT_END_INCLUDE_NAMESPACE
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index fb8d2e83ff..8dd7f6092f 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -71,6 +71,8 @@ QT_BEGIN_NAMESPACE
it has been created from as long as it is not being modified.
You can convert the array to and from text based JSON through QJsonDocument.
+
+ \sa {JSON Support in Qt}, {JSON Save Game Example}
*/
/*!
diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp
index bdb46528d3..05d57e2ab9 100644
--- a/src/corelib/json/qjsondocument.cpp
+++ b/src/corelib/json/qjsondocument.cpp
@@ -76,6 +76,8 @@ QT_BEGIN_NAMESPACE
A document can also be created from a stored binary representation using fromBinaryData() or
fromRawData().
+
+ \sa {JSON Support in Qt}, {JSON Save Game Example}
*/
/*!
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index 43336de2e7..362d01384e 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -70,6 +70,8 @@ QT_BEGIN_NAMESPACE
it has been created from as long as it is not being modified.
You can convert the object to and from text based JSON through QJsonDocument.
+
+ \sa {JSON Support in Qt}, {JSON Save Game Example}
*/
/*!
@@ -604,7 +606,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
Multiple iterators can be used on the same object. Existing iterators will however
become dangling once the object gets modified.
- \sa QJsonObject::const_iterator
+ \sa QJsonObject::const_iterator, {JSON Support in Qt}, {JSON Save Game Example}
*/
/*! \typedef QJsonObject::iterator::difference_type
@@ -799,7 +801,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
Multiple iterators can be used on the same object. Existing iterators
will however become dangling if the object gets modified.
- \sa QJsonObject::iterator
+ \sa QJsonObject::iterator, {JSON Support in Qt}, {JSON Save Game Example}
*/
/*! \typedef QJsonObject::const_iterator::difference_type
diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp
index b151af7955..8721f06064 100644
--- a/src/corelib/json/qjsonparser.cpp
+++ b/src/corelib/json/qjsonparser.cpp
@@ -86,6 +86,8 @@ QT_BEGIN_NAMESPACE
\since 5.0
\brief The QJsonParseError class is used to report errors during JSON parsing.
+
+ \sa {JSON Support in Qt}, {JSON Save Game Example}
*/
/*!
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index ef9f057d77..d0634602f3 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -81,6 +81,8 @@ QT_BEGIN_NAMESPACE
Values are strictly typed internally and contrary to QVariant will not attempt to do any implicit type
conversions. This implies that converting to a type that is not stored in the value will return a default
constructed return value.
+
+ \sa {JSON Support in Qt}, {JSON Save Game Example}
*/
/*!
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index a2d3891f00..20d4339a19 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -646,6 +646,8 @@ static inline char qToLower(char c)
store raw binary data, and when memory conservation is critical
(e.g., with Qt for Embedded Linux).
+ The maximum array size of a QByteArray is under 2^30.
+
One way to initialize a QByteArray is simply to pass a \c{const
char *} to its constructor. For example, the following code
creates a byte array of size 5 containing the data "Hello":