Merge "Merge branch 'stable' into dev" into refs/staging/dev

This commit is contained in:
Sergio Ahumada 2013-07-12 14:03:21 +02:00 committed by The Qt Project
commit 1866c13b7d
205 changed files with 87268 additions and 1601 deletions

20
configure vendored
View File

@ -5369,7 +5369,18 @@ elif [ "$CFG_XKBCOMMON" = "no" ]; then
fi
# EGL Support
if [ "$CFG_EGL" != "no" ]; then
if [ "$CFG_OPENGL" != "es2" ]; then
if [ "$CFG_EGL" = "yes" ] && [ "$CFG_OPENGL" = "desktop" ]; then
echo "EGL support was requested but Qt is being configured for desktop OpenGL."
echo "Either disable EGL support or enable OpenGL ES support."
exit 101
elif [ "$CFG_EGL" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then
echo "EGL support was requested but OpenGL ES support is disabled."
echo "Either disable EGL support or enable OpenGL ES support."
exit 101
fi
CFG_EGL=no
elif [ "$CFG_EGL" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists egl 2>/dev/null; then
QMAKE_INCDIR_EGL=`$PKG_CONFIG --cflags-only-I egl 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
QMAKE_LIBS_EGL=`$PKG_CONFIG --libs egl 2>/dev/null`
@ -5387,13 +5398,6 @@ if [ "$CFG_EGL" != "no" ]; then
else
CFG_EGL=no
fi
elif [ "$CFG_OPENGL" = "desktop" ]; then
if [ "$CFG_EGL" = "yes" ]; then
echo "EGL support was requested but Qt is being configured for desktop OpenGL."
echo "Either disable EGL support or enable OpenGL ES support."
exit 101
fi
CFG_EGL=no
fi
if [ "$CFG_EGLFS" != "no" ]; then

View File

@ -33,7 +33,7 @@
\title Qt Bug Tracker
*/
/*!
\externalpage http://qt.digia.com/downloads
\externalpage http://qt-project.org/downloads
\title Downloads
*/
/*!

View File

@ -1,5 +1,5 @@
#
# Qmake configuration for Clang on Linux and Mac
# Qmake configuration for Clang on Linux, OS X and iOS
#
QMAKE_COMPILER = gcc clang llvm # clang pretends to be gcc

View File

@ -1,5 +1,5 @@
#
# Qmake configuration for the GNU C++ compiler on Mac OS X
# Qmake configuration for the GNU C++ compiler on OS X
#
# Before making changes to this file, please read the comment in
# gcc-base.conf, to make sure the change goes in the right place.

View File

@ -1,5 +1,5 @@
#
# Base qmake configuration for GCC on Mac OS X and iOS
# Base qmake configuration for GCC on OS X and iOS
#
# Before making changes to this file, please read the comment in
# gcc-base.conf, to make sure the change goes in the right place.

View File

@ -1,5 +1,5 @@
#
# Qmake configuration for LLVM on Linux and Mac
# Qmake configuration for LLVM on Linux, OS X and iOS
#
QMAKE_COMPILER = gcc llvm

View File

@ -1,5 +1,5 @@
#
# qmake configuration for common Mac OS (OSX and iOS)
# qmake configuration common to OS X and iOS
#
!load(device_config): error(Could not successfully load device configuration)

View File

@ -1,5 +1,5 @@
#
# qmake configuration for common Mac OS X
# qmake configuration for common OS X
#
QMAKE_PLATFORM += osx macx

View File

@ -1,96 +1,9 @@
win32 {
CMAKE_VERSION = $$system(cmake --version 2>NUL)
} else {
CMAKE_VERSION = $$system(cmake --version 2>/dev/null)
CMAKE_TEST_LOCATION = $$_PRO_FILE_PWD_
for(d, $$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))) {
CMAKE_PREFIX_PATH *= $$clean_path($$dirname(d))
}
CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\"
check.commands =
isEmpty(CMAKE_VERSION) {
message("cmake executable not found. Not running CMake unit tests")
} else {
CTEST_VERSION = $$system(ctest --version)
isEmpty(CTEST_VERSION) {
message("ctest executable not found. Not running CMake unit tests")
} else {
CMAKE_VERSION = $$last(CMAKE_VERSION)
CMAKE_VERSION_MAJOR = $$section(CMAKE_VERSION, ., 0, 0)
CMAKE_VERSION_MINOR = $$section(CMAKE_VERSION, ., 1, 1)
CMAKE_VERSION_PATCH = $$section(CMAKE_VERSION, ., 2, 2)
# CMake can report versions like 2.8.11-rc1, so strip off the rc part.
CMAKE_VERSION_PATCH ~= s,-.*,,
VERSION_OK =
greaterThan(CMAKE_VERSION_MAJOR, 2) {
VERSION_OK = 1
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 8) {
VERSION_OK = 1
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 7):greaterThan(CMAKE_VERSION_PATCH, 2) {
VERSION_OK = 1
}
isEmpty(VERSION_OK) {
message("cmake $$CMAKE_VERSION is too old for this test.")
} else {
load(cmake_functions)
CMAKE_BUILD_TYPE = Debug
CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release
win32-g++*:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
win32:equals(QT_ARCH, x86_64) {
win32-msvc2010:CMAKE_GENERATOR = -G \"Visual Studio 10 Win64\"
win32-msvc2012:CMAKE_GENERATOR = -G \"Visual Studio 11 Win64\"
}
BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP)
for(d, $$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))) {
CMAKE_PREFIX_PATH *= $$dirname(d)
}
CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\"
!qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True
!qtHaveModule(dbus): CMAKE_MODULE_DEFINES += -DNO_DBUS=True
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
dependentmodules = $$cmakeModuleList($$dependentmodules)
contains(QT_CONFIG, angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
!contains(QT_CONFIG, egl): CMAKE_GL_DEFINES += -DNO_EGL=True
CMAKE_MODULE_VERSIONS =
CMAKE_MODULES_UNDER_TEST =
for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) {
CMAKE_NAME = $$cmakeModuleName($$MODULE_UNDER_TEST)
CMAKE_MODULE_VERSIONS += \
-DCMAKE_$${CMAKE_NAME}_MODULE_MAJOR_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.MAJOR_VERSION) \
-DCMAKE_$${CMAKE_NAME}_MODULE_MINOR_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.MINOR_VERSION) \
-DCMAKE_$${CMAKE_NAME}_MODULE_PATCH_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.PATCH_VERSION)
CMAKE_MODULES_UNDER_TEST += $$CMAKE_NAME
}
CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;)
check.commands = \
$(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR \
-DCMAKE_VERBOSE_MAKEFILE=1 \
$$CMAKE_MODULE_DEFINES \
$$CMAKE_GL_DEFINES \
-DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} \
-DCMAKE_PREFIX_PATH=$$CMAKE_PREFIX_PATH \
-DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" \
$${CMAKE_MODULE_VERSIONS} \
-DCMAKE_MODULES_UNDER_TEST=\"$$CMAKE_MODULES_UNDER_TEST\" && \
$(TESTRUNNER) ctest --output-on-failure
}
}
}
insignificant_test:!isEmpty(check.commands) {
check.commands = -$${check.commands}
}
QMAKE_EXTRA_TARGETS *= check
include(ctest_testcase_common.prf)

View File

@ -0,0 +1,97 @@
win32 {
CMAKE_VERSION = $$system(cmake --version 2>NUL)
} else {
CMAKE_VERSION = $$system(cmake --version 2>/dev/null)
}
check.commands =
QMAKE_EXTRA_TARGETS *= check
isEmpty(CMAKE_VERSION) {
message("cmake executable not found. Not running CMake unit tests")
return()
}
win32 {
CTEST_VERSION = $$system(ctest --version 2>NUL)
} else {
CTEST_VERSION = $$system(ctest --version 2>/dev/null)
}
isEmpty(CTEST_VERSION) {
message("ctest executable not found. Not running CMake unit tests")
return()
}
CMAKE_VERSION = $$last(CMAKE_VERSION)
CMAKE_VERSION_MAJOR = $$section(CMAKE_VERSION, ., 0, 0)
CMAKE_VERSION_MINOR = $$section(CMAKE_VERSION, ., 1, 1)
CMAKE_VERSION_PATCH = $$section(CMAKE_VERSION, ., 2, 2)
# CMake can report versions like 2.8.11-rc1, so strip off the rc part.
CMAKE_VERSION_PATCH ~= s,-.*,,
VERSION_OK =
greaterThan(CMAKE_VERSION_MAJOR, 2) {
VERSION_OK = 1
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 8) {
VERSION_OK = 1
} else:greaterThan(CMAKE_VERSION_MAJOR, 1):greaterThan(CMAKE_VERSION_MINOR, 7):greaterThan(CMAKE_VERSION_PATCH, 2) {
VERSION_OK = 1
}
isEmpty(VERSION_OK) {
message("cmake $$CMAKE_VERSION is too old for this test.")
return()
}
load(cmake_functions)
CMAKE_BUILD_TYPE = Debug
CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release
win32-g++*:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
win32:equals(QT_ARCH, x86_64) {
win32-msvc2010:CMAKE_GENERATOR = -G \"Visual Studio 10 Win64\"
win32-msvc2012:CMAKE_GENERATOR = -G \"Visual Studio 11 Win64\"
}
BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP)
!qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True
!qtHaveModule(dbus): CMAKE_MODULE_DEFINES += -DNO_DBUS=True
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
dependentmodules = $$cmakeModuleList($$dependentmodules)
contains(QT_CONFIG, angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
!contains(QT_CONFIG, egl): CMAKE_GL_DEFINES += -DNO_EGL=True
CMAKE_MODULE_VERSIONS =
CMAKE_MODULES_UNDER_TEST =
for (MODULE_UNDER_TEST, CMAKE_QT_MODULES_UNDER_TEST) {
CMAKE_NAME = $$cmakeModuleName($$MODULE_UNDER_TEST)
CMAKE_MODULE_VERSIONS += \
-DCMAKE_$${CMAKE_NAME}_MODULE_MAJOR_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.MAJOR_VERSION) \
-DCMAKE_$${CMAKE_NAME}_MODULE_MINOR_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.MINOR_VERSION) \
-DCMAKE_$${CMAKE_NAME}_MODULE_PATCH_VERSION=$$eval(QT.$${MODULE_UNDER_TEST}.PATCH_VERSION)
CMAKE_MODULES_UNDER_TEST += $$CMAKE_NAME
}
CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;)
check.commands = \
$(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
cmake $$CMAKE_TEST_LOCATION $$CMAKE_GENERATOR \
-DCMAKE_VERBOSE_MAKEFILE=1 \
$$CMAKE_MODULE_DEFINES \
$$CMAKE_GL_DEFINES \
-DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} \
-DCMAKE_PREFIX_PATH=$$CMAKE_PREFIX_PATH \
-DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" \
$${CMAKE_MODULE_VERSIONS} \
-DCMAKE_MODULES_UNDER_TEST=\"$$CMAKE_MODULES_UNDER_TEST\" && \
$(TESTRUNNER) ctest --output-on-failure
insignificant_test:!isEmpty(check.commands): \
check.commands = -$${check.commands}

View File

@ -0,0 +1,8 @@
CMAKE_TEST_LOCATION = $$_PRO_FILE_PWD_/../cmake
CMAKE_PREFIX_PATH = $$[QT_INSTALL_PREFIX]
CONFIG += insignificant_test
include(ctest_testcase_common.prf)

View File

@ -27,34 +27,35 @@ REM and set up progdir to be the fully-qualified pathname of its directory.
set prog=%~f0
if [%1]==[] goto badArgs
set "androidsdk=%1"
set "dx_jar_path=%1"
shift /1
if [%1]==[] goto badArgs
REM Use dpZ here to make it more like the Google version.
for %%F in ("%dx_jar_path%") do set dpZ=%%~dpF
rem Check we have a valid Java.exe in the path.
set java_exe=
call "%androidsdk%\tools\lib\find_java.bat"
if exist "%dpZ%..\tools\lib\find_java.bat" call "%dpZ%..\tools\lib\find_java.bat"
if exist "%dpZ%..\..\tools\lib\find_java.bat" call "%dpZ%..\..\tools\lib\find_java.bat"
if not defined java_exe goto :EOF
set jarfile=dx.jar
set "frameworkdir=%androidsdk%\platform-tools"
set "frameworkdir=%dpZ%"
rem frameworkdir must not end with a dir sep.
set "frameworkdir=%frameworkdir:~0,-1%"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%frameworkdir%\lib"
set "frameworkdir=%dpZ%lib"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%androidsdk%\framework"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%androidsdk%\build-tools\%ANDROID_BUILD_TOOLS_REVISION%\lib"
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
set "frameworkdir=%androidsdk%\build-tools\17.0.0\lib"
set "frameworkdir=%dpZ%..\framework"
:JarFileOk
set jarpath=%frameworkdir%\%jarfile%
set "jarpath=%frameworkdir%\%jarfile%"
set javaOpts=
set args=
@ -97,12 +98,11 @@ set a=%~1
:endArgs
set javaOpts=%javaOpts% %defaultXmx% %defaultXss%
call "%java_exe%" %javaOpts% -Djava.ext.dirs="%frameworkdir%" -jar "%jarpath%" %params%
goto :EOF
:badArgs
echo Usage: dx (for Qt) <android_sdk_path> <dx_arguments>
echo Example: dx (for Qt) C:\android-sdk --dex --output=target.jar .classes
echo Usage: dx (for Qt) ^<android_sdk_dx_jar_path^> ^<dx_arguments^>
echo Example: dx (for Qt) C:\android-sdk\build-tools\17.0.0\dx.jar --dex --output=target.jar .classes

View File

@ -78,12 +78,26 @@ endmacro()
if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !no_module_headers
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
)
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
!!ENDIF
!!ELSE
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
@ -92,13 +106,14 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}\"
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING}/$${MODULE_INCNAME}\"
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
)
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
!!ENDIF
!!ENDIF
!!ENDIF
!!ELSE
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS)
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
@ -135,7 +150,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
if (NOT Qt5${_module_dep}_FOUND)
find_package(Qt5${_module_dep}
${Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING} ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
$$VERSION ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
PATHS \"${CMAKE_CURRENT_LIST_DIR}/..\" NO_DEFAULT_PATH

View File

@ -58,7 +58,13 @@ QMAKE_EXTENSION_SHLIB = jar
# Override linker with dex (for distributable Android archives) or jar (for other java builds)
android:!bundled_jar_file {
contains(QMAKE_HOST.os, Windows) {
DEX_CMD = $$PWD/data/android/dx $$SDK_ROOT
# The location where dx.bat expects itself to be found is used as the landmark instead
# of the base sdk folder.
# Doing it this way makes this logic more similar to the other platforms and
# also means that our dx.bat is more like Google's dx.bat
DEX_BAT = $$SDK_ROOT/platform-tools/dx.bat
!exists($$DEX_BAT): DEX_BAT = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx.bat
DEX_CMD = $$PWD/data/android/dx $$DEX_BAT
} else {
DEX_CMD = $$SDK_ROOT/platform-tools/dx
!exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx

View File

@ -19,11 +19,12 @@ isEmpty(QMAKE_DOCS_TARGETDIR): QMAKE_DOCS_TARGETDIR = $$QMAKE_DOCS_TARGET
QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
qtPrepareTool(QDOC, qdoc)
for(qmod, QMAKEMODULES): \
QDOC += -indexdir $$section(qmod, /, 0, -3)/doc
QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
!build_online_docs: \
QDOC += -installdir $$[QT_INSTALL_DOCS]
DOC_INDEXES =
for(qmod, QMAKEMODULES): \
DOC_INDEXES += -indexdir $$section(qmod, /, 0, -3)/doc
qtver.name = QT_VERSION
qtver.value = $$VERSION
isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
@ -38,9 +39,9 @@ qtAddToolEnv(QDOC, qtver qtmver qtvertag qtdocs)
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
prepare_docs.commands += $$doc_command -prepare -no-link-errors
generate_docs.commands += $$doc_command -generate
generate_docs.commands += $$doc_command -generate $$DOC_INDEXES
} else {
html_docs.commands += $$doc_command
html_docs.commands += $$doc_command $$DOC_INDEXES
}
!build_online_docs {

View File

@ -61,6 +61,9 @@ defineTest(qtAddModule) {
MODULE_CONFIG = $$eval(QT.$${1}.module_config)
MODULE_MAJOR_VERSION = $$eval(QT.$${1}.MAJOR_VERSION)
contains(MODULE_CONFIG, internal_module):!if(auto_use_privates|isEqual(2, UsePrivate)): \
error("Module $$1 has no public API.")
qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG)
qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES)

View File

@ -36,7 +36,8 @@ TARGET = tst_headersclean
includes =
for(q, QT) {
qn = $$eval(QT.$${q}.name)
sq = $$replace(q, -private\$, )
qn = $$eval(QT.$${sq}.name)
isEmpty(qn): \
QT -= $$q
else: \

View File

@ -87,19 +87,19 @@ contains(TARGET, QtAddOn.*): \
else: \
DEFINES += QT_BUILD_$${ucmodule}_LIB
#mac frameworks
# OS X and iOS frameworks
mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
#QMAKE_FRAMEWORK_VERSION = 4.0
CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework
CONFIG -= qt_install_headers #no need to install these as well
CONFIG += lib_bundle qt_framework
!debug_and_release|if(build_all:CONFIG(release, debug|release)) {
FRAMEWORK_HEADERS.version = Versions
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
FRAMEWORK_HEADERS.path = Headers
FRAMEWORK_PRIVATE_HEADERS.version = Versions
FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES
FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS
FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private
FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES
FRAMEWORK_QPA_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/qpa
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS FRAMEWORK_QPA_HEADERS
}
}

View File

@ -51,11 +51,15 @@ else: \
else: \
module_rundep =
static: \
module_build_type = "QT.$${MODULE}.module_config = staticlib"
module_build_type = staticlib
else:mac:contains(QT_CONFIG, qt_framework): \
module_build_type = "QT.$${MODULE}.module_config = lib_bundle"
module_build_type = lib_bundle
else: \
module_build_type =
internal_module: \
module_build_type += internal_module
!isEmpty(module_build_type): \
module_build_type = "QT.$${MODULE}.module_config = $$module_build_type"
!isEmpty(MODULE_CONFIG): \
module_config = "QT.$${MODULE}.CONFIG = $$MODULE_CONFIG"
else: \

View File

@ -119,7 +119,6 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
}
neon {
HEADERS += $$NEON_HEADERS
SOURCES += $$NEON_ASM
neon_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS)
!contains(QT_CPU_FEATURES, neon):neon_compiler.commands += $$QMAKE_CFLAGS_NEON
@ -130,7 +129,16 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
neon_compiler.variable_out = OBJECTS
neon_compiler.name = compiling[neon] ${QMAKE_FILE_IN}
silent:neon_compiler.commands = @echo compiling[neon] ${QMAKE_FILE_IN} && $$neon_compiler.commands
QMAKE_EXTRA_COMPILERS += neon_compiler
neon_assembler.commands = $$QMAKE_CC -c $(CFLAGS)
!contains(QT_CPU_FEATURES, neon):neon_assembler.commands += $$QMAKE_CFLAGS_NEON
neon_assembler.commands += $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
neon_assembler.dependency_type = TYPE_C
neon_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
neon_assembler.input = NEON_ASM
neon_assembler.variable_out = OBJECTS
neon_assembler.name = assembling[neon] ${QMAKE_FILE_IN}
silent:neon_assembler.commands = @echo assembling[neon] ${QMAKE_FILE_IN} && $$neon_assembler.commands
QMAKE_EXTRA_COMPILERS += neon_compiler neon_assembler
}
iwmmxt {
HEADERS += $$IWMMXT_HEADERS
@ -153,24 +161,32 @@ QT_CPU_FEATURES = $$eval(QT_CPU_FEATURES.$$QT_ARCH)
mips_dsp_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mips_dsp_compiler.dependency_type = TYPE_C
mips_dsp_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
mips_dsp_compiler.input = MIPS_DSP_ASM MIPS_DSP_SOURCES
mips_dsp_compiler.input = MIPS_DSP_SOURCES
mips_dsp_compiler.variable_out = OBJECTS
mips_dsp_compiler.name = compiling[mips_dsp] ${QMAKE_FILE_IN}
silent:mips_dsp_compiler.commands = @echo compiling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_compiler.commands
mips_dsp_assembler.commands = $$QMAKE_CC -c
mips_dsp_assembler.commands += $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mips_dsp_assembler.dependency_type = TYPE_C
mips_dsp_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
mips_dsp_assembler.input = MIPS_DSP_ASM
mips_dsp_assembler.variable_out = OBJECTS
mips_dsp_assembler.name = assembling[mips_dsp] ${QMAKE_FILE_IN}
silent:mips_dsp_assembler.commands = @echo assembling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_assembler.commands
QMAKE_EXTRA_COMPILERS += mips_dsp_compiler
}
mips_dspr2 {
HEADERS += $$MIPS_DSP_HEADERS
mips_dspr2_compiler.commands = $$QMAKE_CXX -c
mips_dspr2_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mips_dspr2_compiler.dependency_type = TYPE_C
mips_dspr2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
mips_dspr2_compiler.input = MIPS_DSPR2_ASM
mips_dspr2_compiler.variable_out = OBJECTS
mips_dspr2_compiler.name = compiling[mips_dspr2] ${QMAKE_FILE_IN}
silent:mips_dspr2_compiler.commands = @echo compiling[mips_dspr2] ${QMAKE_FILE_IN} && $$mips_dspr2_compiler.commands
QMAKE_EXTRA_COMPILERS += mips_dspr2_compiler
mips_dspr2_assembler.commands = $$QMAKE_CC -c
mips_dspr2_assembler.commands += $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mips_dspr2_assembler.dependency_type = TYPE_C
mips_dspr2_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
mips_dspr2_assembler.input = MIPS_DSPR2_ASM
mips_dspr2_assembler.variable_out = OBJECTS
mips_dspr2_assembler.name = assembling[mips_dspr2] ${QMAKE_FILE_IN}
silent:mips_dspr2_assembler.commands = @echo assembling[mips_dspr2] ${QMAKE_FILE_IN} && $$mips_dspr2_assembler.commands
QMAKE_EXTRA_COMPILERS += mips_dspr2_assembler
}
} else:win32-msvc* {
sse2 {

View File

@ -2,6 +2,8 @@
# qmake configuration for 32-bit Clang on OS X
#
warning("QMakespec macx-clang-libc++-32 is deprecated. Use macx-clang-32 instead.")
MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname
QMAKE_INCREMENTAL_STYLE = sublib

View File

@ -2,6 +2,8 @@
# qmake configuration for Clang on OS X
#
warning("QMakespec macx-clang-libc++ is deprecated. Use macx-clang instead.")
MAKEFILE_GENERATOR = UNIX
CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname
QMAKE_INCREMENTAL_STYLE = sublib

View File

@ -3,7 +3,7 @@
#
# qmake configuration for macx-g++
#
# Mac OS X + command-line compiler
# OS X + command-line compiler
#
MAKEFILE_GENERATOR = UNIX

View File

@ -3,7 +3,7 @@
#
# qmake configuration for macx-g++
#
# Mac OS X + command-line compiler
# OS X + command-line compiler
#
MAKEFILE_GENERATOR = UNIX

View File

@ -3,7 +3,7 @@
#
# qmake configuration for macx-g++
#
# Mac OS X + command-line compiler
# OS X + command-line compiler
#
MAKEFILE_GENERATOR = UNIX

View File

@ -3,7 +3,7 @@
#
# qmake configuration for macx-g++
#
# Mac OS X + command-line compiler
# OS X + command-line compiler
#
MAKEFILE_GENERATOR = UNIX

View File

@ -1,7 +1,7 @@
#
# qmake configuration for macx-icc
#
# Written for Intel C++ Compiler versions 8.x and 9.x for Mac OS X
# Written for Intel C++ Compiler versions 8.x and 9.x for OS X
#
# Note: Some of the remarks from the Intel compiler are disabled (even
# with 'warn_on' specified):

View File

@ -3,7 +3,7 @@
#
# qmake configuration for macx-g++
#
# Mac OS X + command-line compiler
# OS X + command-line compiler
#
MAKEFILE_GENERATOR = UNIX

View File

@ -1,7 +1,7 @@
#
# qmake configuration for macx-xcode
#
# Mac OS X + XCode
# OS X + Xcode
#
include(../$$[QMAKE_XSPEC]/qmake.conf)

View File

@ -39,110 +39,4 @@
**
****************************************************************************/
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
#ifdef UNICODE
#ifndef _UNICODE
#define _UNICODE
#endif
#endif
// Get Qt defines/settings
#include "qglobal.h"
#define _POSIX_
#include <limits.h>
#undef _POSIX_
#include <tchar.h>
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <windows.h>
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#define QT_TSTAT ::_tstati64
#else
#define QT_LSEEK ::_lseek
#define QT_TSTAT ::_tstat
#endif
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#if defined(O_TEXT)
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#endif
#include "../common/c89/qplatformdefs.h"
#if defined(QT_LARGEFILE_SUPPORT) && _MSC_VER > 1310
#undef QT_FSEEK
#undef QT_FTELL
#define QT_FSEEK ::_fseeki64
#define QT_FTELL ::_ftelli64
#endif
#if defined(QT_LARGEFILE_SUPPORT)
#undef QT_OFF_T
#define QT_OFF_T __int64
#endif
#define QT_SIGNAL_ARGS int
#if _MSC_VER>=1400
# define QT_VSNPRINTF(buffer, count, format, arg) \
::vsnprintf_s(buffer, count, count-1, format, arg)
#else
# define QT_VSNPRINTF ::_vsnprintf
#endif
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
typedef int mode_t;
#endif // QPLATFORMDEFS_H
#include "../win32-msvc2005/qplatformdefs.h"

View File

@ -0,0 +1,98 @@
#
# qmake configuration for win32-msvc2013
#
# Written for Microsoft Visual C++ 2013
#
MAKEFILE_GENERATOR = MSBUILD
QMAKE_PLATFORM = win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE WIN32
QMAKE_COMPILER_DEFINES += _MSC_VER=1800 _WIN32
contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += WIN64
QMAKE_COMPILER_DEFINES += _WIN64
}
QMAKE_COMPILER = msvc
QMAKE_CC = cl
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = byacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t
QMAKE_CFLAGS_WARN_ON = -W3
QMAKE_CFLAGS_WARN_OFF = -W0
QMAKE_CFLAGS_RELEASE = -O2 -MD
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
QMAKE_CFLAGS_DEBUG = -Zi -MDd
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_LTCG = -GL
QMAKE_CFLAGS_MP = -MP
QMAKE_CFLAGS_SSE2 = -arch:SSE2
QMAKE_CFLAGS_SSE3 = -arch:SSE2
QMAKE_CFLAGS_SSSE3 = -arch:SSE2
QMAKE_CFLAGS_SSE4_1 = -arch:SSE2
QMAKE_CFLAGS_SSE4_2 = -arch:SSE2
QMAKE_CFLAGS_AVX = -arch:AVX
QMAKE_CFLAGS_AVX2 = -arch:AVX
QMAKE_CXX = $$QMAKE_CC
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
QMAKE_CXXFLAGS_STL_ON = -EHsc
QMAKE_CXXFLAGS_STL_OFF =
QMAKE_CXXFLAGS_RTTI_ON = -GR
QMAKE_CXXFLAGS_RTTI_OFF =
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
QMAKE_INCDIR =
QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$obj $src
QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ $<
QMAKE_RUN_CC_IMP_BATCH = $(CC) -c $(CFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ $<
QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
QMAKE_LFLAGS_DLL = /DLL
QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
QMAKE_LIBS_NETWORK = ws2_32.lib
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib gdi32.lib user32.lib
QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib
QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc
include(../common/shell-win32.conf)
VCPROJ_EXTENSION = .vcxproj
VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0
load(qt_config)

View File

@ -0,0 +1,42 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, 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, Digia gives you certain additional
** rights. These rights are described in the Digia 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.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "../win32-msvc2005/qplatformdefs.h"

View File

@ -1,4 +1,4 @@
!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-icc"
!IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-icc"
!if "$(SOURCE_PATH)" == ""
SOURCE_PATH = ..
@ -26,7 +26,7 @@ LINKER = link
#
!if "$(QMAKESPEC)" == "win32-msvc2005"
CFLAGS_EXTRA = /Zc:wchar_t-
!elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012"
!elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP
!endif

View File

@ -113,8 +113,8 @@ GBuildMakefileGenerator::write()
/* this is for bulding an INTEGRITY application.
* generate the .int integrate file and the .gpj INTEGRITY Application
* project file, then go on with regular files */
t << "#!gbuild" << "\n";
t << "[INTEGRITY Application]" << "\n";
t << "#!gbuild\n";
t << "[INTEGRITY Application]\n";
t << "\t:binDirRelative=.\n";
t << "\t-o " << strtarget << "\n";
t << intname << "\n";
@ -125,24 +125,24 @@ GBuildMakefileGenerator::write()
QFile f(intname);
f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
QTextStream ti(&f);
ti << "# This is a file automatically generated by qmake" << "\n";
ti << "# Modifications will be lost next time you run qmake" << "\n";
ti << "Kernel" << "\n";
ti << "\tFilename\tDynamicDownload" << "\n";
ti << "EndKernel" << "\n" << "\n";
ti << "AddressSpace" << "\n";
ti << "# This is a file automatically generated by qmake\n";
ti << "# Modifications will be lost next time you run qmake\n";
ti << "Kernel\n";
ti << "\tFilename\tDynamicDownload\n";
ti << "EndKernel\n\n";
ti << "AddressSpace\n";
ti << "\tName\t" << strtarget << "\n";
ti << "\tFilename\t" << strtarget << "_app" << "\n";
ti << "\tMemoryPoolSize\t0x100000" << "\n";
ti << "\tLanguage\tC++" << "\n";
ti << "\tFilename\t" << strtarget << "_app\n";
ti << "\tMemoryPoolSize\t0x100000\n";
ti << "\tLanguage\tC++\n";
/* FIXME : heap size is huge to be big enough for every example
* it should probably be tailored for each example, btu there is no
* good way to guess that */
ti << "\tHeapSize\t0x00D00000" << "\n";
ti << "\tTask\tInitial" << "\n";
ti << "\t\tStackSize\t0x30000" << "\n";
ti << "\tEndTask" << "\n";
ti << "EndAddressSpace" << "\n";
ti << "\tHeapSize\t0x00D00000\n";
ti << "\tTask\tInitial\n";
ti << "\t\tStackSize\t0x30000\n";
ti << "\tEndTask\n";
ti << "EndAddressSpace\n";
ti.flush();
/* change current project file to <projectname>_app.gpj and continue
@ -220,19 +220,19 @@ GBuildMakefileGenerator::write()
filename.remove(qmake_getpwd());
//HEADER
t << "#!gbuild" << "\n";
t << "#!gbuild\n";
/* find the architecture out of the compiler name */
if (filename.endsWith("projects.gpj")) {
primaryTarget.remove(0, 5);
t << "macro QT_BUILD_DIR=%expand_path(.)\n";
t << "macro __OS_DIR=" << project->values("INTEGRITY_DIR").first() << "\n";
t << "primaryTarget=" << primaryTarget << "_integrity.tgt" << "\n";
t << "primaryTarget=" << primaryTarget << "_integrity.tgt\n";
t << "customization=util/integrity/qt.bod\n";
}
/* project type */
if (project->first("TEMPLATE") == "app") {
t << "[Program]" << "\n";
t << "[Program]\n";
if (isnativebin) {
t << "\t:binDir=bin\n";
t << "\t-o " << strtarget << "\n";
@ -241,16 +241,16 @@ GBuildMakefileGenerator::write()
t << "\t-o " << strtarget << "_app\n";
}
} else if (project->first("TEMPLATE") == "lib") {
t << "[Library]" << "\n";
t << "\t:binDir=lib" << "\n";
t << "\t-o lib" << strtarget << ".a" << "\n";
t << "[Library]\n";
t << "\t:binDir=lib\n";
t << "\t-o lib" << strtarget << ".a\n";
} else if (project->first("TEMPLATE") == "subdirs")
t << "[Project]" << "\n";
t << "[Project]\n";
else
t << project->first("TEMPLATE") << "\n";
/* compilations options */
t << "\t:sourceDir=." << "\n";
t << "\t:sourceDir=.\n";
t << "\t:outputDir=work" << relpath << "\n";
if (filename.endsWith("projects.gpj")) {
@ -261,7 +261,7 @@ GBuildMakefileGenerator::write()
const ProStringList &l = project->values("QMAKE_CXXFLAGS");
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
t << "\n\t" << (*it);
else
t << " " << (*it);
}
@ -287,7 +287,7 @@ GBuildMakefileGenerator::write()
const ProStringList &l = project->values(src[i]);
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
if ((*it).startsWith("-"))
t << "\n" << "\t" << (*it);
t << "\n\t" << (*it);
else
t << " " << (*it);
}

File diff suppressed because it is too large Load Diff

View File

@ -317,6 +317,10 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
if(!val.isEmpty()) {
QString qval = val.toQString();
QString file = fixEnvVariables(qval);
if (file.isEmpty()) {
++val_it;
continue;
}
if(!(flags & VPATH_NoFixify))
file = fileFixify(file, qmake_getpwd(), Option::output_dir);
if (file.at(0) == '\"' && file.at(file.length() - 1) == '\"')
@ -1037,7 +1041,7 @@ MakefileGenerator::writeProjectMakefile()
}
}
if(project->isActiveConfig("build_all")) {
t << "first: all" << endl;
t << "first: all\n";
QList<SubTarget*>::Iterator it;
//install
@ -1053,8 +1057,8 @@ MakefileGenerator::writeProjectMakefile()
t << endl;
} else {
t << "first: " << targets.first()->target << endl
<< "install: " << targets.first()->target << "-install" << endl
<< "uninstall: " << targets.first()->target << "-uninstall" << endl;
<< "install: " << targets.first()->target << "-install\n"
<< "uninstall: " << targets.first()->target << "-uninstall\n";
}
writeSubTargets(t, targets, SubTargetsNoFlags);
@ -1393,7 +1397,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
t << "uninstall_" << (*it) << ": FORCE";
for (int i = uninst.size(); --i >= 0; )
t << "\n\t" << uninst.at(i);
t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " " << endl << endl;
t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " \n\n";
}
t << endl;
@ -1906,7 +1910,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(tmp_clean.isEmpty())
tmp_clean = tmp_out;
if(tmp_clean.indexOf("${QMAKE_") == -1) {
t << "\n\t" << "-$(DEL_FILE) " << tmp_clean;
t << "\n\t-$(DEL_FILE) " << tmp_clean;
wrote_clean = true;
}
if(!wrote_clean_cmds || !wrote_clean) {
@ -2142,7 +2146,7 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
const ProStringList &vars = project->values(ProKey(*it + ".variables"));
for (ProStringList::ConstIterator varit = vars.begin(); varit != vars.end(); ++varit) {
if(first) {
t << "\n####### Custom Compiler Variables" << endl;
t << "\n####### Custom Compiler Variables\n";
first = false;
}
t << "QMAKE_COMP_" << (*varit) << " = "
@ -2169,7 +2173,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
}
}
if (!outlist.isEmpty()) {
t << "####### Custom Variables" << endl;
t << "####### Custom Variables\n";
t << outlist.join("\n") << endl << endl;
}
}
@ -2182,24 +2186,24 @@ MakefileGenerator::writeStubMakefile(QTextStream &t)
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
//const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
t << "first all clean install distclean uninstall: " << "qmake" << endl
<< "qmake_all:" << endl;
t << "first all clean install distclean uninstall: qmake\n"
<< "qmake_all:\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
bool
MakefileGenerator::writeMakefile(QTextStream &t)
{
t << "####### Compile" << endl << endl;
t << "####### Compile\n\n";
writeObj(t, "SOURCES");
writeObj(t, "GENERATED_SOURCES");
t << "####### Install" << endl << endl;
t << "####### Install\n\n";
writeInstalls(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
@ -2242,14 +2246,14 @@ QString MakefileGenerator::build_args(const QString &outdir)
void
MakefileGenerator::writeHeader(QTextStream &t)
{
t << "#############################################################################" << endl;
t << "#############################################################################\n";
t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")" << endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n";
t << "# Project: " << fileFixify(project->projectFile()) << endl;
t << "# Template: " << var("TEMPLATE") << endl;
if(!project->isActiveConfig("build_pass"))
t << "# Command: " << build_args().replace("$(QMAKE)", var("QMAKE_QMAKE")) << endl;
t << "#############################################################################" << endl;
t << "#############################################################################\n";
t << endl;
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if (ofile.lastIndexOf(Option::dir_sep) != -1)
@ -2374,7 +2378,7 @@ void
MakefileGenerator::writeSubDirs(QTextStream &t)
{
QList<SubTarget*> targets = findSubDirsSubTargets();
t << "first: make_first" << endl;
t << "first: make_first\n";
int flags = SubTargetInstalls;
if(project->isActiveConfig("ordered"))
flags |= SubTargetOrdered;
@ -2534,10 +2538,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!targets.isEmpty()) {
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it) {
if(!(*it)->profile.isEmpty())
t << " " << (*it)->target << "-" << "qmake_all";
t << " " << (*it)->target << "-qmake_all";
}
}
t << " FORCE" << endl << endl;
t << " FORCE\n\n";
}
for(int s = 0; s < targetSuffixes.size(); ++s) {
@ -2566,7 +2570,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
t << varGlue("ALL_DEPS"," "," ","");
if(suffix == "clean")
t << varGlue("CLEAN_DEPS"," "," ","");
t << " FORCE" << endl;
t << " FORCE\n";
if(suffix == "clean") {
t << fileVarGlue("QMAKE_CLEAN", "\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", "\n");
} else if(suffix == "distclean") {
@ -2667,7 +2671,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
project->values("UNINSTALLDEPS") += "uninstall_subtargets";
writeInstalls(t, true);
}
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
}
void
@ -2676,7 +2680,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = fileFixify(Option::mkfile::project_files);
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": " << "\n\t"
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << files.join(' ') << endl;
}
@ -2700,13 +2704,13 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
for(int include = 0; include < included.size(); ++include) {
const ProString &i = included.at(include);
if(!i.isEmpty())
t << i << ":" << endl;
t << i << ":\n";
}
}
if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
t << "qmake: FORCE\n\t@" << qmake << endl << endl;
if (!noDummyQmakeAll)
t << "qmake_all: FORCE" << endl << endl;
t << "qmake_all: FORCE\n\n";
}
}
@ -3249,7 +3253,7 @@ MakefileGenerator::writePkgConfigFile()
if (project->isActiveConfig("shared"))
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl;
t << pkgConfiglibDir << " " << pkgConfiglibName << " \n";
ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
@ -3273,7 +3277,7 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("PRL_EXPORT_CXXFLAGS", "", " ", " ")
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
<< "-I${includedir}" << endl;
<< "-I${includedir}\n";
// requires
const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');

View File

@ -154,7 +154,7 @@ UnixMakefileGenerator::init()
}
}
ldadd += project->values("QMAKE_LIBDIR_FLAGS");
if (project->isActiveConfig("macx")) {
if (project->isActiveConfig("mac")) {
if (!project->isEmpty("QMAKE_FRAMEWORKPATH")) {
const ProStringList &fwdirs = project->values("QMAKE_FRAMEWORKPATH");
for (int i = 0; i < fwdirs.size(); ++i)
@ -262,7 +262,7 @@ UnixMakefileGenerator::init()
project->values(runCompImp).append("$(" + compiler + ") " + compile_flag + " " + var("QMAKE_CC_O_FLAG") + "\"$@\" \"$<\"");
}
if(project->isActiveConfig("macx") && !project->isEmpty("TARGET") && !project->isActiveConfig("compile_libtool") &&
if (project->isActiveConfig("mac") && !project->isEmpty("TARGET") && !project->isActiveConfig("compile_libtool") &&
((project->isActiveConfig("build_pass") || project->isEmpty("BUILDS")))) {
ProString bundle;
if(project->isActiveConfig("bundle") && !project->isEmpty("QMAKE_BUNDLE_EXTENSION")) {

View File

@ -85,12 +85,12 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall qmake_all:" << "\n\t"
t << "first all clean install distclean uninstall qmake_all:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
@ -118,15 +118,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
(!project->isActiveConfig("staticlib")))),
src_incremental=false;
t << "####### Compiler, tools and options" << endl << endl;
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)" << endl;
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)" << endl;
t << "INCPATH = " << "-I" << specdir();
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH = -I" << specdir();
if(!project->isActiveConfig("no_include_pwd")) {
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
if(pwd.isEmpty())
@ -138,7 +138,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(int i = 0; i < incs.size(); ++i) {
ProString inc = escapeFilePath(incs.at(i));
if(!inc.isEmpty())
t << " " << "-I" << inc;
t << " -I" << inc;
}
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
@ -148,7 +148,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isActiveConfig("staticlib")) {
t << "LINK = " << var("QMAKE_LINK") << endl;
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
t << "LIBS = $(SUBLIBS) " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl;
}
t << "AR = " << var("QMAKE_AR") << endl;
@ -176,15 +176,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl;
t << "####### Output directory" << endl << endl;
t << "####### Output directory\n\n";
if (! project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl;
else
t << "OBJECTS_DIR = ./" << endl;
t << "OBJECTS_DIR = ./\n";
t << endl;
/* files */
t << "####### Files" << endl << endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES"))) << " "
<< valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
if(do_incremental) {
@ -225,7 +225,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
// would be interpreted as line continuation. The lack of spacing between the value and the
// comment is also important as otherwise quoted use of "$(DESTDIR)" would include this
// spacing.
t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak" << endl;
t << "DESTDIR = " << var("DESTDIR") << "#avoid trailing-slash linebreak\n";
if(project->isActiveConfig("compile_libtool"))
t << "TARGETL = " << var("TARGET_la") << endl;
t << "TARGET = " << escapeFilePath(var("TARGET")) << endl;
@ -257,8 +257,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "include " << (*it) << endl;
/* rules */
t << "first: all" << endl;
t << "####### Implicit rules" << endl << endl;
t << "first: all\n";
t << "####### Implicit rules\n\n";
t << ".SUFFIXES: " << Option::obj_ext;
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << " " << (*cit);
@ -290,18 +290,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString pwd = escapeFilePath(fileFixify(qmake_getpwd()));
t << "###### Dependencies" << endl << endl;
t << "###### Dependencies\n\n";
t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
t << "@echo Creating depend for $<\n\t";
t << mkdir_p_asstring("$(@D)") << "\n\t"
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@" << endl << endl;
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
t << odir << ".deps/%.d: " << pwd << "/%.c\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<" << "\n\t";
t << "@echo Creating depend for $<\n\t";
t << mkdir_p_asstring("$(@D)") << "\n\t"
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@" << endl << endl;
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 };
for (int x = 0; src[x]; x++) {
@ -341,7 +341,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
t << "####### Build rules" << endl << endl;
t << "####### Build rules\n\n";
if(!project->values("SUBLIBS").isEmpty()) {
ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
@ -371,9 +371,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << ":\n\t@echo \"Creating '";
else
t << ": FORCE\n\t@echo \"Creating/updating '";
t << targ << "'\"" << "\n\t"
t << targ << "'\"\n\t"
<< "(cd " << libinfo.first("QMAKE_PRL_BUILD_DIR") << ";"
<< "$(MAKE))" << endl;
<< "$(MAKE))\n";
}
}
}
@ -397,8 +397,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
QString incr_target_dir = var("OBJECTS_DIR") + incr_target + Option::obj_ext;
//actual target
t << incr_target_dir << ": $(OBJECTS)" << "\n\t"
<< "ld -r -o "<< incr_target_dir << " $(OBJECTS)" << endl;
t << incr_target_dir << ": $(OBJECTS)\n\t"
<< "ld -r -o "<< incr_target_dir << " $(OBJECTS)\n";
//communicated below
deps.prepend(incr_target_dir + " ");
incr_deps = "$(INCREMENTAL_OBJECTS)";
@ -414,11 +414,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)" << "\n\t";
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
if(!destdir.isEmpty())
t << "\n\t" << mkdir_p_asstring(destdir) << "\n\t";
t << "$(LINK) " << incr_lflags << " -o "<< incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
" $(INCREMENTAL_OBJECTS)\n";
//communicated below
if(!destdir.isEmpty()) {
if(!incr_objs.isEmpty())
@ -509,11 +509,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)" << "\n\t";
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir <<
" $(INCREMENTAL_OBJECTS)" << endl;
" $(INCREMENTAL_OBJECTS)\n";
//communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
if(!destdir.isEmpty())
@ -523,15 +523,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_deps = "$(OBJECTS)";
}
t << "all: " << " " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ")
<< " " << destdir << "$(TARGET)" << endl << endl;
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ")
<< " " << destdir << "$(TARGET)\n\n";
//real target
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " "
<< incr_deps << " $(SUBLIBS) " << target_deps << " " << var("POST_TARGETDEPS");
} else {
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << " " <<
destdir << "$(TARGET)" << endl << endl;
destdir << "$(TARGET)\n\n";
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
<< " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps
<< " " << var("POST_TARGETDEPS");
@ -546,7 +546,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< var("QMAKE_LINK_SHLIB_CMD");
} else if(project->isActiveConfig("plugin")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD");
if(!destdir.isEmpty())
t << "\n\t"
@ -556,15 +556,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)" << "\n\t"
<< "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)\n\t"
<< mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," Versions/" +
project->first("QMAKE_FRAMEWORK_VERSION") +
"/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t"
<< "-$(DEL_FILE) " << destdir << "Versions/Current" << "\n\t"
<< "-$(DEL_FILE) " << destdir << "Versions/Current\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") +
" " + destdir + "Versions/Current") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
@ -572,7 +572,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t";
t << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET0)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET1)") << "\n\t"
@ -592,7 +592,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
} else {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)" << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t";
t << varGlue("QMAKE_LN_SHLIB",""," "," $(TARGET) $(TARGET0)");
if(!destdir.isEmpty())
@ -608,38 +608,38 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << endl << endl;
if (! project->isActiveConfig("plugin")) {
t << "staticlib: $(TARGETA)" << endl << endl;
t << "staticlib: $(TARGETA)\n\n";
t << "$(TARGETA): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)";
if(do_incremental)
t << " $(INCREMENTAL_OBJECTS)";
t << " " << var("POST_TARGETDEPS") << "\n\t"
<< "-$(DEL_FILE) $(TARGETA) " << "\n\t"
<< "-$(DEL_FILE) $(TARGETA) \n\t"
<< var("QMAKE_AR_CMD");
if(do_incremental)
t << " $(INCREMENTAL_OBJECTS)";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\n\t" << "$(RANLIB) $(TARGETA)";
t << "\n\t$(RANLIB) $(TARGETA)";
t << endl << endl;
}
} else {
QString destdir = project->first("DESTDIR").toQString();
t << "all: " << escapeDependencyPath(deps) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS")),""," "," ") << destdir << "$(TARGET) "
<< varGlue("QMAKE_AR_SUBLIBS", destdir, " " + destdir, "") << "\n\n"
<< "staticlib: " << destdir << "$(TARGET)" << "\n\n";
<< "staticlib: " << destdir << "$(TARGET)\n\n";
if(project->isEmpty("QMAKE_AR_SUBLIBS")) {
t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS")
<< " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "-$(DEL_FILE) $(TARGET)" << "\n\t"
t << "-$(DEL_FILE) $(TARGET)\n\t"
<< var("QMAKE_AR_CMD") << "\n";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t" << "$(RANLIB) $(TARGET)" << "\n";
t << "\t$(RANLIB) $(TARGET)\n";
if(!destdir.isEmpty())
t << "\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)" << "\n"
<< "\t" << "-$(MOVE) $(TARGET) " << destdir << " \n";
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)\n"
<< "\t-$(MOVE) $(TARGET) " << destdir << " \n";
} else {
int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt();
ProStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"),
@ -667,10 +667,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\t" << "$(RANLIB) " << (*libit) << "\n";
t << "\t$(RANLIB) " << (*libit) << "\n";
if(!destdir.isEmpty())
t << "\t" << "-$(DEL_FILE) " << destdir << (*libit) << "\n"
<< "\t" << "-$(MOVE) " << (*libit) << " " << destdir << " \n";
t << "\t-$(DEL_FILE) " << destdir << (*libit) << "\n"
<< "\t-$(MOVE) " << (*libit) << " " << destdir << " \n";
}
}
t << endl << endl;
@ -687,14 +687,14 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
meta_files += pkgConfigFileName();
}
if(!meta_files.isEmpty())
t << escapeDependencyPaths(meta_files).join(" ") << ": " << "\n\t"
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
<< "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl;
}
if(!project->first("QMAKE_PKGINFO").isEmpty()) {
ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents");
t << pkginfo << ": " << "\n\t";
t << pkginfo << ": \n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
t << "@$(DEL_FILE) " << pkginfo << "\n\t"
@ -705,16 +705,16 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources");
t << resources << ": " << "\n\t";
t << resources << ": \n\t";
t << mkdir_p_asstring(destdir) << "\n\t";
t << "@touch " << resources << "\n\t" << endl;
t << "@touch " << resources << "\n\t\n";
}
if(!project->isEmpty("QMAKE_BUNDLE")) {
//copy the plist
QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())),
info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString());
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
t << info_plist_out << ": " << "\n\t";
t << info_plist_out << ": \n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
ProStringList commonSedArgs;
@ -765,7 +765,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty(vkey)) {
QString version = project->first(vkey) + "/" +
project->first("QMAKE_FRAMEWORK_VERSION") + "/";
t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": " << "\n\t"
t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": \n\t"
<< mkdir_p_asstring(path) << "\n\t"
<< "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl;
path += version;
@ -805,7 +805,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") :
project->first("OBJECTS_DIR")) + ddir,
Option::output_dir, Option::output_dir));
t << "dist: " << "\n\t"
t << "dist: \n\t"
<< mkdir_p_asstring(ddir_c) << "\n\t"
<< "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
@ -833,18 +833,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString clean_targets = "compiler_clean " + var("CLEAN_DEPS");
if(do_incremental) {
t << "incrclean:" << "\n";
t << "incrclean:\n";
if(src_incremental)
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)" << "\n";
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
t << endl;
}
t << "clean:" << clean_targets << "\n\t";
if(!project->isEmpty("OBJECTS")) {
if(project->isActiveConfig("compile_libtool"))
t << "-$(LIBTOOL) --mode=clean $(DEL_FILE) $(OBJECTS)" << "\n\t";
t << "-$(LIBTOOL) --mode=clean $(DEL_FILE) $(OBJECTS)\n\t";
else
t << "-$(DEL_FILE) $(OBJECTS)" << "\n\t";
t << "-$(DEL_FILE) $(OBJECTS)\n\t";
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
ProStringList precomp_files;
@ -891,11 +891,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("IMAGES"))
t << varGlue("QMAKE_IMAGE_COLLECTION", "\t-$(DEL_FILE) ", " ", "") << "\n\t";
if(src_incremental)
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)" << "\n\t";
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
t << varGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
<< "-$(DEL_FILE) *~ core *.core" << "\n"
<< "-$(DEL_FILE) *~ core *.core\n"
<< varGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
t << "####### Sub-libraries" << endl << endl;
t << "####### Sub-libraries\n\n";
if (!project->values("SUBLIBS").isEmpty()) {
ProString libdir = "tmp/";
if(!project->isEmpty("SUBLIBS_DIR"))
@ -910,19 +910,19 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProString destdir = project->first("DESTDIR");
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
destdir += Option::dir_sep;
t << "distclean: " << "clean\n";
t << "distclean: clean\n";
if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
} else if(project->isActiveConfig("compile_libtool")) {
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) " << "$(TARGET)" << endl;
t << "\t-$(LIBTOOL) --mode=clean $(DEL_FILE) $(TARGET)\n";
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() &&
!project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl;
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
<< destdir << "$(TARGET2) $(TARGETA)" << endl;
<< destdir << "$(TARGET2) $(TARGETA)\n";
} else {
t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl;
t << "\t-$(DEL_FILE) $(TARGET) \n";
}
t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
{
@ -934,7 +934,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
QString pchInput = project->first("PRECOMPILED_HEADER").toQString();
t << "###### Prefix headers" << endl;
t << "###### Prefix headers\n";
QString comps[] = { "C", "CXX", "OBJC", "OBJCXX", QString() };
for(int i = 0; !comps[i].isNull(); i++) {
QString pchFlags = var(ProKey("QMAKE_" + comps[i] + "FLAGS_PRECOMPILE"));

View File

@ -115,10 +115,10 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
{
writeHeader(t);
if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
t << "all clean:" << "\n\t"
t << "all clean:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
return true;
}
@ -134,10 +134,10 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "first all clean install distclean uninstall: qmake" << endl
<< "qmake_all:" << endl;
t << "first all clean install distclean uninstall: qmake\n"
<< "qmake_all:\n";
writeMakeQmake(t);
t << "FORCE:" << endl << endl;
t << "FORCE:\n\n";
return true;
}
writeMingwParts(t);
@ -156,7 +156,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
t << "INPUT(" << endl;
t << "INPUT(\n";
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
if (QDir::isRelativePath(path))
@ -164,7 +164,7 @@ void createLdObjectScriptFile(const QString &fileName, const ProStringList &objL
else
t << path << endl;
}
t << ");" << endl;
t << ");\n";
t.flush();
file.close();
}
@ -180,7 +180,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
t << "ADDMOD " << *it << endl;
}
t << "SAVE" << endl;
t << "SAVE\n";
t.flush();
file.close();
}
@ -214,13 +214,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << "$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << cHeader << " " << header
<< endl << endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t" << "$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << cppHeader << " " << header
<< endl << endl;
}
}
@ -393,19 +393,19 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
t << "first: all" << endl;
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)" << endl << endl;
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
t << "\n\t" << "$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
} else {
t << "\n\t" << objectsLinkLine << " " ;
}
} else if (project->first("TEMPLATE") != "aux") {
t << "\n\t" << "$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)";
t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK");
@ -432,7 +432,7 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
if (!rc_file.isEmpty()) {
t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t"
<< var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE")
<< incPathStr << " $(DEFINES)" << endl << endl;
<< incPathStr << " $(DEFINES)\n\n";
}
}

View File

@ -2053,6 +2053,8 @@ QString VCXProjectWriter::platformToolSetVersion(const DotNET version)
{
case NET2012:
return "v110";
case NET2013:
return "v120";
}
return QString();
}

View File

@ -62,10 +62,10 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
t << "all first clean:" << "\n\t"
t << "all first clean:\n\t"
<< "@echo \"Some of the required modules ("
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t"
<< "@echo \"Skipped.\"" << endl << endl;
<< var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"\n\t"
<< "@echo \"Skipped.\"\n\n";
writeMakeQmake(t);
return true;
}
@ -193,7 +193,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
if(usePCH) {
QString precompRule = QString("-c -Yc -Fp%1 -Fo%2").arg(precompPch).arg(precompObj);
t << precompObj << ": " << precompH << " " << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t" << "$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl;
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << precompH << endl << endl;
}
}
@ -359,10 +359,10 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
objDir = "";
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << "{" << it.key() << "}" << (*cppit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<" << endl << "<<" << endl << endl;
<< var("QMAKE_RUN_CXX_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
t << "{" << it.key() << "}" << (*cit) << "{" << objDir << "}" << Option::obj_ext << "::\n\t"
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<" << endl << "<<" << endl << endl;
<< var("QMAKE_RUN_CC_IMP_BATCH").replace(QRegExp("\\$@"), var("OBJECTS_DIR")) << endl << "\t$<\n<<\n\n";
}
} else {
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
@ -377,14 +377,14 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
const ProString templateName = project->first("TEMPLATE");
t << "first: all" << endl;
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)" << endl << endl;
t << "first: all\n";
t << "all: " << fileFixify(Option::output.fileName()) << " " << varGlue("ALL_DEPS"," "," "," ") << "$(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
if(project->isActiveConfig("staticlib")) {
t << "\n\t" << "$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<" << "\n\t "
t << "\n\t$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n\t "
<< "$(OBJECTS)"
<< "\n<<";
} else if (templateName != "aux") {
@ -433,7 +433,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
writeLinkCommand(t, extraLFlags, manifest_res);
t << "\n\tif exist " << manifest_bak << " del " << manifest_bak;
} else {
t << "\n\t" << "rc.exe /fo" << manifest_res << " " << manifest_rc;
t << "\n\trc.exe /fo" << manifest_res << " " << manifest_rc;
t << "\n\t";
writeLinkCommand(t, extraLFlags, manifest_res);
}
@ -441,7 +441,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
// directly embed the manifest in the executable after linking
t << "\n\t";
writeLinkCommand(t, extraLFlags);
t << "\n\t" << "mt.exe /nologo /manifest " << manifest
t << "\n\tmt.exe /nologo /manifest " << manifest
<< " /outputresource:$(DESTDIR_TARGET);" << resourceId;
}
} else {

View File

@ -235,6 +235,7 @@ const char _WarningLevel[] = "WarningLevel";
const char _WholeProgramOptimization[] = "WholeProgramOptimization";
const char _CompileForArchitecture[] = "CompileForArchitecture";
const char _InterworkCalls[] = "InterworkCalls";
const char _GenerateManifest[] = "GenerateManifest";
// XmlOutput stream functions ------------------------------
inline XmlOutput::xml_output attrT(const char *name, const triState v)
@ -2649,6 +2650,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< attrS(_TypeLibraryFile, tool.TypeLibraryFile)
<< attrL(_TypeLibraryResourceID, tool.TypeLibraryResourceID, /*ifNot*/ rcUseDefault)
<< attrS(_Version, tool.Version)
<< attrT(_GenerateManifest, tool.GenerateManifest)
<< closetag(_Tool);
}

View File

@ -63,7 +63,8 @@ enum DotNET {
NET2005 = 0x80,
NET2008 = 0x90,
NET2010 = 0xa0,
NET2012 = 0xb0
NET2012 = 0xb0,
NET2013 = 0xc0
};
/*

View File

@ -77,6 +77,8 @@ struct DotNetCombo {
const char *regKey;
} dotNetCombo[] = {
#ifdef Q_OS_WIN64
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 Express Edition (11.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir"},
{NET2010, "MSVC.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"},
@ -88,6 +90,8 @@ struct DotNetCombo {
{NET2003, "MSVC.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"},
{NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"},
#else
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 (11.0)", "Software\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 Express Edition (11.0)", "Software\\Microsoft\\VCExpress\\11.0\\Setup\\VC\\ProductDir"},
{NET2010, "MSVC.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"},
@ -183,6 +187,8 @@ const char _slnHeader100[] = "Microsoft Visual Studio Solution File, Format
"\n# Visual Studio 2010";
const char _slnHeader110[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2012";
const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2013";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@ -592,6 +598,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch(which_dotnet_version()) {
case NET2013:
t << _slnHeader120;
break;
case NET2012:
t << _slnHeader110;
break;
@ -868,6 +877,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET").toQString());
switch(which_dotnet_version()) {
case NET2013:
vcProject.Version = "13.00";
break;
case NET2012:
vcProject.Version = "12.00";
break;
@ -1322,7 +1334,8 @@ void VcprojGenerator::initGeneratedFiles()
vcProject.GeneratedFiles.addFiles(project->values("GENERATED_SOURCES"));
vcProject.GeneratedFiles.addFiles(project->values("GENERATED_FILES"));
vcProject.GeneratedFiles.addFiles(project->values("IDLSOURCES"));
vcProject.GeneratedFiles.addFiles(project->values("RES_FILE"));
if (project->values("RC_FILE").isEmpty())
vcProject.GeneratedFiles.addFiles(project->values("RES_FILE"));
vcProject.GeneratedFiles.addFiles(project->values("QMAKE_IMAGE_COLLECTION")); // compat
if(!extraCompilerOutputs.isEmpty())
vcProject.GeneratedFiles.addFiles(extraCompilerOutputs.keys());

View File

@ -423,56 +423,56 @@ void Win32MakefileGenerator::processRcFileVar()
int rcLang = project->intValue("RC_LANG", 1033); // default: English(USA)
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
ts << "# if defined(UNDER_CE)" << endl;
ts << "# include <winbase.h>" << endl;
ts << "# else" << endl;
ts << "# include <winver.h>" << endl;
ts << "# endif" << endl;
ts << "# if defined(UNDER_CE)\n";
ts << "# include <winbase.h>\n";
ts << "# else\n";
ts << "# include <winver.h>\n";
ts << "# endif\n";
ts << endl;
if (!rcIcons.isEmpty()) {
for (int i = 0; i < rcIcons.size(); ++i)
ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl;
ts << endl;
}
ts << "VS_VERSION_INFO VERSIONINFO" << endl;
ts << "VS_VERSION_INFO VERSIONINFO\n";
ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl;
ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl;
ts << "\tFILEFLAGSMASK 0x3fL" << endl;
ts << "#ifdef _DEBUG" << endl;
ts << "\tFILEFLAGS VS_FF_DEBUG" << endl;
ts << "#else" << endl;
ts << "\tFILEFLAGS 0x0L" << endl;
ts << "#endif" << endl;
ts << "\tFILEOS VOS__WINDOWS32" << endl;
ts << "\tFILEFLAGSMASK 0x3fL\n";
ts << "#ifdef _DEBUG\n";
ts << "\tFILEFLAGS VS_FF_DEBUG\n";
ts << "#else\n";
ts << "\tFILEFLAGS 0x0L\n";
ts << "#endif\n";
ts << "\tFILEOS VOS__WINDOWS32\n";
if (project->isActiveConfig("shared"))
ts << "\tFILETYPE VFT_DLL" << endl;
ts << "\tFILETYPE VFT_DLL\n";
else
ts << "\tFILETYPE VFT_APP" << endl;
ts << "\tFILESUBTYPE 0x0L" << endl;
ts << "\tBEGIN" << endl;
ts << "\t\tBLOCK \"StringFileInfo\"" << endl;
ts << "\t\tBEGIN" << endl;
ts << "\tFILETYPE VFT_APP\n";
ts << "\tFILESUBTYPE 0x0L\n";
ts << "\tBEGIN\n";
ts << "\t\tBLOCK \"StringFileInfo\"\n";
ts << "\t\tBEGIN\n";
ts << "\t\t\tBLOCK \""
<< QString("%1%2").arg(rcLang, 4, 16, QLatin1Char('0')).arg(rcCodePage, 4, 16, QLatin1Char('0'))
<< "\"" << endl;
ts << "\t\t\tBEGIN" << endl;
ts << "\t\t\t\tVALUE \"CompanyName\", \"" << companyName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"FileDescription\", \"" << description << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"FileVersion\", \"" << versionString << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl;
ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"" << endl;
ts << "\t\t\tEND" << endl;
ts << "\t\tEND" << endl;
ts << "\t\tBLOCK \"VarFileInfo\"" << endl;
ts << "\t\tBEGIN" << endl;
<< "\"\n";
ts << "\t\t\tBEGIN\n";
ts << "\t\t\t\tVALUE \"CompanyName\", \"" << companyName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"FileDescription\", \"" << description << "\\0\"\n";
ts << "\t\t\t\tVALUE \"FileVersion\", \"" << versionString << "\\0\"\n";
ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"\n";
ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"\n";
ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"\n";
ts << "\t\t\tEND\n";
ts << "\t\tEND\n";
ts << "\t\tBLOCK \"VarFileInfo\"\n";
ts << "\t\tBEGIN\n";
ts << "\t\t\tVALUE \"Translation\", "
<< QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0'))
<< ", " << QString("%1").arg(rcCodePage, 4) << endl;
ts << "\t\tEND" << endl;
ts << "\tEND" << endl;
ts << "/* End of Version info */" << endl;
ts << "\t\tEND\n";
ts << "\tEND\n";
ts << "/* End of Version info */\n";
ts << endl;
ts.flush();
@ -598,7 +598,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
}
}
}
t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)" << endl;
t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)\n";
{
QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
if(!ofile.isEmpty())
@ -617,7 +617,7 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
inc.replace(QRegExp("\\\\$"), "");
inc.replace(QRegExp("\""), "");
if(!inc.isEmpty())
t << "-I" << "\"" << inc << "\" ";
t << "-I\"" << inc << "\" ";
}
t << "-I\"" << specdir() << "\""
<< endl;
@ -625,14 +625,14 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
{
t << "####### Compiler, tools and options" << endl << endl;
t << "####### Compiler, tools and options\n\n";
t << "CC = " << var("QMAKE_CC") << endl;
t << "CXX = " << var("QMAKE_CXX") << endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
<< varGlue("DEFINES","-D"," -D","") << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)" << endl;
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)" << endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
writeIncPart(t);
writeLibsPart(t);
@ -659,14 +659,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
t << endl;
t << "####### Output directory" << endl << endl;
t << "####### Output directory\n\n";
if(!project->values("OBJECTS_DIR").isEmpty())
t << "OBJECTS_DIR = " << var("OBJECTS_DIR").replace(QRegExp("\\\\$"),"") << endl;
else
t << "OBJECTS_DIR = . " << endl;
t << "OBJECTS_DIR = . \n";
t << endl;
t << "####### Files" << endl << endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES")))
<< " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
@ -688,21 +688,21 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl;
// The comment is important to maintain variable compatibility with Unix
// Makefiles, while not interpreting a trailing-slash as a linebreak
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak" << endl;
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
t << "TARGET = " << escapeFilePath(target) << endl;
t << "DESTDIR_TARGET = " << escapeFilePath(var("DEST_TARGET")) << endl;
t << endl;
t << "####### Implicit rules" << endl << endl;
t << "####### Implicit rules\n\n";
writeImplicitRulesPart(t);
t << "####### Build rules" << endl << endl;
t << "####### Build rules\n\n";
writeBuildRulesPart(t);
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t" << "-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
t << "\t-$(COPY_FILE) \"$(DESTDIR_TARGET)\" "
<< Option::fixPathToTargetOS((*dlldir).toQString(), false) << endl;
}
}
@ -725,8 +725,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
dist_files << ui_h;
}
}
t << "dist:" << "\n\t"
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip " << "$(SOURCES) $(DIST) "
t << "dist:\n\t"
<< "$(ZIP) " << var("QMAKE_ORIG_TARGET") << ".zip $(SOURCES) $(DIST) "
<< dist_files.join(' ') << " " << var("TRANSLATIONS") << " ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");

View File

@ -276,6 +276,8 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
ushort unicode = vals_data[x].unicode();
if (unicode == quote) {
quote = 0;
hadWord = true;
build += QChar(unicode);
continue;
}
switch (unicode) {
@ -283,7 +285,7 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
case '\'':
quote = unicode;
hadWord = true;
continue;
break;
case ' ':
case '\t':
if (!quote) {
@ -294,22 +296,23 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
}
continue;
}
build += QChar(unicode);
break;
case '\\':
if (x + 1 != vals_len) {
ushort next = vals_data[++x].unicode();
if (next == '\'' || next == '"' || next == '\\')
if (next == '\'' || next == '"' || next == '\\') {
build += QChar(unicode);
unicode = next;
else
} else {
--x;
}
}
// fallthrough
default:
hadWord = true;
build += QChar(unicode);
break;
}
build += QChar(unicode);
}
if (hadWord)
ret << ProString(build).setSource(source);

View File

@ -249,7 +249,8 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
int srcLen = srcpath.length();
int dstLen = dstpath.length();
int lastSl = -1;
while (++lastSl, srcpath.at(--srcLen) == dstpath.at(--dstLen))
while (++lastSl, --srcLen, --dstLen,
srcLen && dstLen && srcpath.at(srcLen) == dstpath.at(dstLen))
if (srcpath.at(srcLen) == QLatin1Char('/'))
lastSl = 0;
source_root = srcpath.left(srcLen + lastSl);

View File

@ -8,6 +8,14 @@
#
# We mean it.
message("CMAKE_VERSION: ${CMAKE_VERSION}")
message("CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
message("CMAKE_MODULES_UNDER_TEST: ${CMAKE_MODULES_UNDER_TEST}")
foreach(_mod ${CMAKE_MODULES_UNDER_TEST})
message("CMAKE_${_mod}_MODULE_MAJOR_VERSION: ${CMAKE_${_mod}_MODULE_MAJOR_VERSION}")
message("CMAKE_${_mod}_MODULE_MINOR_VERSION: ${CMAKE_${_mod}_MODULE_MINOR_VERSION}")
message("CMAKE_${_mod}_MODULE_PATCH_VERSION: ${CMAKE_${_mod}_MODULE_PATCH_VERSION}")
endforeach()
set(BUILD_OPTIONS_LIST)

View File

@ -186,7 +186,7 @@ settings.endArray();
//! [17]
QSettings settings;
settings.setValue("fridge/color", Qt::white);
settings.setValue("fridge/color", QColor(Qt::white));
settings.setValue("fridge/size", QSize(32, 96));
settings.setValue("sofa", true);
settings.setValue("tv", false);
@ -205,7 +205,7 @@ keys = settings.allKeys();
//! [19]
QSettings settings;
settings.setValue("fridge/color", Qt::white);
settings.setValue("fridge/color", QColor(Qt::white));
settings.setValue("fridge/size", QSize(32, 96));
settings.setValue("sofa", true);
settings.setValue("tv", false);
@ -224,7 +224,7 @@ keys = settings.childKeys();
//! [21]
QSettings settings;
settings.setValue("fridge/color", Qt::white);
settings.setValue("fridge/color", QColor(Qt::white));
settings.setValue("fridge/size", QSize(32, 96));
settings.setValue("sofa", true);
settings.setValue("tv", false);

View File

@ -367,23 +367,6 @@ public:
};
//! [35]
//! [36]
Q_PROPERTY(type name
READ getFunction
[WRITE setFunction]
[RESET resetFunction]
[NOTIFY notifySignal]
[REVISION int]
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
[USER bool]
[CONSTANT]
[FINAL])
//! [36]
//! [37]
Q_PROPERTY(QString title READ title WRITE setTitle USER true)
//! [37]

View File

@ -467,7 +467,7 @@
# if __INTEL_COMPILER < 1200
# define Q_NO_TEMPLATE_FRIENDS
# endif
# if defined(_CHAR16T) || __cplusplus >= 201103L
# if __cplusplus >= 201103L
# define Q_COMPILER_VARIADIC_MACROS
# if __INTEL_COMPILER >= 1200
# define Q_COMPILER_AUTO_TYPE

View File

@ -2068,11 +2068,11 @@ namespace {
// version in portable code. However, it's impossible to do that if
// _GNU_SOURCE is defined so we use C++ overloading to decide what to do
// depending on the return type
static inline QString fromstrerror_helper(int, const QByteArray &buf)
static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf)
{
return QString::fromLocal8Bit(buf);
}
static inline QString fromstrerror_helper(const char *str, const QByteArray &)
static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &)
{
return QString::fromLocal8Bit(str);
}

View File

@ -494,6 +494,8 @@ QT_END_NAMESPACE
# include <stdio.h>
# include <stdlib.h>
#include "private/qcoreapplication_p.h"
extern const char qt_core_interpreter[] __attribute__((section(".interp")))
= ELF_INTERPRETER;
@ -516,8 +518,8 @@ void qt_core_boilerplate()
QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
#ifdef QT_EVAL
extern void qt_core_eval_init(uint);
qt_core_eval_init(1);
extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
qt_core_eval_init(QCoreApplicationPrivate::Tty);
#endif
exit(0);

View File

@ -1049,7 +1049,8 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
if (slash) {
QString chunk = dirName.left(slash);
if (!mkDir(chunk)) {
if (GetLastError() == ERROR_ALREADY_EXISTS) {
const DWORD lastError = GetLastError();
if (lastError == ERROR_ALREADY_EXISTS || lastError == ERROR_ACCESS_DENIED) {
bool existed = false;
if (isDirPath(chunk, &existed) && existed)
continue;

View File

@ -95,7 +95,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
)
#endif
normalPath.chop(1);
QFileInfo fileInfo(normalPath.toLower());
QFileInfo fileInfo(normalPath);
if (!fileInfo.exists())
continue;
@ -136,15 +136,16 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
thread = *jt;
QMutexLocker locker(&(thread->mutex));
handle = thread->handleForDir.value(absolutePath);
handle = thread->handleForDir.value(QFileSystemWatcherPathKey(absolutePath));
if (handle.handle != INVALID_HANDLE_VALUE && handle.flags == flags) {
// found a thread now insert...
DEBUG() << "Found a thread" << thread;
QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> &h
= thread->pathInfoForHandle[handle.handle];
if (!h.contains(fileInfo.absoluteFilePath())) {
thread->pathInfoForHandle[handle.handle].insert(fileInfo.absoluteFilePath(), pathInfo);
QWindowsFileSystemWatcherEngineThread::PathInfoHash &h =
thread->pathInfoForHandle[handle.handle];
const QFileSystemWatcherPathKey key(fileInfo.absoluteFilePath());
if (!h.contains(key)) {
thread->pathInfoForHandle[handle.handle].insert(key, pathInfo);
if (isDir)
directories->append(path);
else
@ -177,9 +178,9 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath()
<< "to existing thread " << thread;
thread->handles.append(handle.handle);
thread->handleForDir.insert(absolutePath, handle);
thread->handleForDir.insert(QFileSystemWatcherPathKey(absolutePath), handle);
thread->pathInfoForHandle[handle.handle].insert(fileInfo.absoluteFilePath(), pathInfo);
thread->pathInfoForHandle[handle.handle].insert(QFileSystemWatcherPathKey(fileInfo.absoluteFilePath()), pathInfo);
if (isDir)
directories->append(path);
else
@ -195,9 +196,9 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QWindowsFileSystemWatcherEngineThread *thread = new QWindowsFileSystemWatcherEngineThread();
DEBUG() << " ###Creating new thread" << thread << "(" << (threads.count()+1) << "threads)";
thread->handles.append(handle.handle);
thread->handleForDir.insert(absolutePath, handle);
thread->handleForDir.insert(QFileSystemWatcherPathKey(absolutePath), handle);
thread->pathInfoForHandle[handle.handle].insert(fileInfo.absoluteFilePath(), pathInfo);
thread->pathInfoForHandle[handle.handle].insert(QFileSystemWatcherPathKey(fileInfo.absoluteFilePath()), pathInfo);
if (isDir)
directories->append(path);
else
@ -230,7 +231,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
QString normalPath = path;
if (normalPath.endsWith(QLatin1Char('/')) || normalPath.endsWith(QLatin1Char('\\')))
normalPath.chop(1);
QFileInfo fileInfo(normalPath.toLower());
QFileInfo fileInfo(normalPath);
DEBUG() << "removing" << normalPath;
QString absolutePath = fileInfo.absoluteFilePath();
QList<QWindowsFileSystemWatcherEngineThread *>::iterator jt, end;
@ -242,16 +243,16 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
QMutexLocker locker(&(thread->mutex));
QWindowsFileSystemWatcherEngine::Handle handle = thread->handleForDir.value(absolutePath);
QWindowsFileSystemWatcherEngine::Handle handle = thread->handleForDir.value(QFileSystemWatcherPathKey(absolutePath));
if (handle.handle == INVALID_HANDLE_VALUE) {
// perhaps path is a file?
absolutePath = fileInfo.absolutePath();
handle = thread->handleForDir.value(absolutePath);
handle = thread->handleForDir.value(QFileSystemWatcherPathKey(absolutePath));
}
if (handle.handle != INVALID_HANDLE_VALUE) {
QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> &h =
QWindowsFileSystemWatcherEngineThread::PathInfoHash &h =
thread->pathInfoForHandle[handle.handle];
if (h.remove(fileInfo.absoluteFilePath())) {
if (h.remove(QFileSystemWatcherPathKey(fileInfo.absoluteFilePath()))) {
// ###
files->removeAll(path);
directories->removeAll(path);
@ -264,7 +265,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
Q_ASSERT(indexOfHandle != -1);
thread->handles.remove(indexOfHandle);
thread->handleForDir.remove(absolutePath);
thread->handleForDir.remove(QFileSystemWatcherPathKey(absolutePath));
// h is now invalid
it.remove();
@ -326,7 +327,7 @@ QWindowsFileSystemWatcherEngineThread::~QWindowsFileSystemWatcherEngineThread()
}
}
static inline QString msgFindNextFailed(const QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> &pathInfos)
static inline QString msgFindNextFailed(const QWindowsFileSystemWatcherEngineThread::PathInfoHash &pathInfos)
{
QString result;
QTextStream str(&result);
@ -366,7 +367,7 @@ void QWindowsFileSystemWatcherEngineThread::run()
// for some reason, so we must check if the handle exist in the handles vector
if (handles.contains(handle)) {
DEBUG() << "thread" << this << "Acknowledged handle:" << at << handle;
QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> &h = pathInfoForHandle[handle];
QWindowsFileSystemWatcherEngineThread::PathInfoHash &h = pathInfoForHandle[handle];
bool fakeRemove = false;
if (!FindNextChangeNotification(handle)) {
@ -381,9 +382,9 @@ void QWindowsFileSystemWatcherEngineThread::run()
qErrnoWarning(error, "%s", qPrintable(msgFindNextFailed(h)));
}
QMutableHashIterator<QString, QWindowsFileSystemWatcherEngine::PathInfo> it(h);
QMutableHashIterator<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::PathInfo> it(h);
while (it.hasNext()) {
QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo>::iterator x = it.next();
QWindowsFileSystemWatcherEngineThread::PathInfoHash::iterator x = it.next();
QString absolutePath = x.value().absolutePath;
QFileInfo fileInfo(x.value().path);
DEBUG() << "checking" << x.key();
@ -407,7 +408,7 @@ void QWindowsFileSystemWatcherEngineThread::run()
Q_ASSERT(indexOfHandle != -1);
handles.remove(indexOfHandle);
handleForDir.remove(absolutePath);
handleForDir.remove(QFileSystemWatcherPathKey(absolutePath));
// h is now invalid
}
} else if (x.value().isDir) {

View File

@ -128,11 +128,27 @@ private:
};
class QFileSystemWatcherPathKey : public QString
{
public:
QFileSystemWatcherPathKey() {}
explicit QFileSystemWatcherPathKey(const QString &other) : QString(other) {}
QFileSystemWatcherPathKey(const QFileSystemWatcherPathKey &other) : QString(other) {}
bool operator==(const QFileSystemWatcherPathKey &other) const { return !compare(other, Qt::CaseInsensitive); }
};
Q_DECLARE_TYPEINFO(QFileSystemWatcherPathKey, Q_MOVABLE_TYPE);
inline uint qHash(const QFileSystemWatcherPathKey &key) { return qHash(key.toCaseFolded()); }
class QWindowsFileSystemWatcherEngineThread : public QThread
{
Q_OBJECT
public:
typedef QHash<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::Handle> HandleForDirHash;
typedef QHash<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::PathInfo> PathInfoHash;
QWindowsFileSystemWatcherEngineThread();
~QWindowsFileSystemWatcherEngineThread();
void run();
@ -143,9 +159,9 @@ public:
QVector<Qt::HANDLE> handles;
int msg;
QHash<QString, QWindowsFileSystemWatcherEngine::Handle> handleForDir;
HandleForDirHash handleForDir;
QHash<Qt::HANDLE, QHash<QString, QWindowsFileSystemWatcherEngine::PathInfo> > pathInfoForHandle;
QHash<Qt::HANDLE, PathInfoHash> pathInfoForHandle;
Q_SIGNALS:
void fileChanged(const QString &path, bool removed);

View File

@ -641,7 +641,7 @@ bool QProcessPrivate::drainOutputPipes()
readyReadEmitted |= stderrReader->waitForReadyRead(0);
readOperationActive |= stderrReader->isReadOperationActive();
}
if (!readOperationActive)
if (!readOperationActive || !readyReadEmitted)
break;
Sleep(100);
}

View File

@ -114,6 +114,10 @@ public:
template<typename E1, typename E2>
class QTypeInfo<QUrlTwoFlags<E1, E2> > : public QTypeInfoMerger<QUrlTwoFlags<E1, E2>, E1, E2> {};
class QUrl;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) Q_DECL_NOTHROW;
class Q_CORE_EXPORT QUrl
{
public:
@ -326,7 +330,7 @@ public:
static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
static void setIdnWhitelist(const QStringList &);
friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) Q_DECL_NOTHROW;
friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW;
private:
QUrlPrivate *d;

View File

@ -83,7 +83,9 @@ class QWinIoCompletionPort : protected QThread
{
public:
QWinIoCompletionPort()
: hPort(INVALID_HANDLE_VALUE)
: finishThreadKey(reinterpret_cast<ULONG_PTR>(this)),
drainQueueKey(reinterpret_cast<ULONG_PTR>(this + 1)),
hPort(INVALID_HANDLE_VALUE)
{
setObjectName(QLatin1String("I/O completion port thread"));
HANDLE hIOCP = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
@ -92,13 +94,19 @@ public:
return;
}
hPort = hIOCP;
hQueueDrainedEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (!hQueueDrainedEvent) {
qErrnoWarning("CreateEvent failed.");
return;
}
}
~QWinIoCompletionPort()
{
PostQueuedCompletionStatus(hPort, 0, 0, NULL);
PostQueuedCompletionStatus(hPort, 0, finishThreadKey, NULL);
QThread::wait();
CloseHandle(hPort);
CloseHandle(hQueueDrainedEvent);
}
void registerNotifier(QWinOverlappedIoNotifier *notifier)
@ -122,29 +130,50 @@ public:
mutex.unlock();
}
void drainQueue()
{
QMutexLocker locker(&drainQueueMutex);
ResetEvent(hQueueDrainedEvent);
PostQueuedCompletionStatus(hPort, 0, drainQueueKey, NULL);
WaitForSingleObject(hQueueDrainedEvent, INFINITE);
}
using QThread::isRunning;
protected:
void run()
{
DWORD dwBytesRead;
ULONG_PTR pulCompletionKey;
OVERLAPPED *overlapped;
DWORD msecs = INFINITE;
forever {
BOOL success = GetQueuedCompletionStatus(hPort,
&dwBytesRead,
&pulCompletionKey,
&overlapped,
INFINITE);
msecs);
DWORD errorCode = success ? ERROR_SUCCESS : GetLastError();
if (!success && !overlapped) {
if (!msecs) {
// Time out in drain mode. The completion status queue is empty.
msecs = INFINITE;
SetEvent(hQueueDrainedEvent);
continue;
}
qErrnoWarning(errorCode, "GetQueuedCompletionStatus failed.");
return;
}
if (success && !(dwBytesRead || pulCompletionKey || overlapped)) {
// We've posted null values via PostQueuedCompletionStatus to end this thread.
if (pulCompletionKey == finishThreadKey)
return;
if (pulCompletionKey == drainQueueKey) {
// Enter drain mode.
Q_ASSERT(msecs == INFINITE);
msecs = 0;
continue;
}
QWinOverlappedIoNotifier *notifier = reinterpret_cast<QWinOverlappedIoNotifier *>(pulCompletionKey);
@ -156,9 +185,13 @@ protected:
}
private:
const ULONG_PTR finishThreadKey;
const ULONG_PTR drainQueueKey;
HANDLE hPort;
QSet<QWinOverlappedIoNotifier *> notifiers;
QMutex mutex;
QMutex drainQueueMutex;
HANDLE hQueueDrainedEvent;
};
QWinIoCompletionPort *QWinOverlappedIoNotifier::iocp = 0;
@ -216,7 +249,14 @@ void QWinOverlappedIoNotifier::setEnabled(bool enabled)
*/
bool QWinOverlappedIoNotifier::waitForNotified(int msecs, OVERLAPPED *overlapped)
{
if (!iocp->isRunning()) {
qWarning("Called QWinOverlappedIoNotifier::waitForNotified on inactive notifier.");
return false;
}
forever {
if (msecs == 0)
iocp->drainQueue();
DWORD result = WaitForSingleObject(hSemaphore, msecs == -1 ? INFINITE : DWORD(msecs));
if (result == WAIT_OBJECT_0) {
ReleaseSemaphore(hSemaphore, 1, NULL);

View File

@ -98,6 +98,9 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &);
class QPersistentModelIndexData;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
uint qHash(const QPersistentModelIndex &index, uint seed = 0);
class Q_CORE_EXPORT QPersistentModelIndex
{
public:
@ -133,7 +136,7 @@ public:
bool isValid() const;
private:
QPersistentModelIndexData *d;
friend uint qHash(const QPersistentModelIndex &, uint seed = 0);
friend uint qHash(const QPersistentModelIndex &, uint seed);
#ifndef QT_NO_DEBUG_STREAM
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
#endif

View File

@ -63,12 +63,8 @@ QT_BEGIN_NAMESPACE
static inline bool time_update(struct timespec *tv, const struct timespec &start,
const struct timespec &timeout)
{
if (!QElapsedTimer::isMonotonic()) {
// we cannot recalculate the timeout without a monotonic clock as the time may have changed
return false;
}
// clock source is monotonic, so we can recalculate how much timeout is left
// clock source is (hopefully) monotonic, so we can recalculate how much timeout is left;
// if it isn't monotonic, we'll simply hope that it hasn't jumped, because we have no alternative
struct timespec now = qt_gettime();
*tv = timeout + start - now;
return tv->tv_sec >= 0;

View File

@ -381,7 +381,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, origArgc(aargc)
, origArgv(new char *[aargc])
#endif
, application_type(0)
, application_type(QCoreApplicationPrivate::Tty)
#ifndef QT_NO_QOBJECT
, in_exec(false)
, aboutToQuitEmitted(false)
@ -724,7 +724,7 @@ void QCoreApplication::init()
#endif
#ifdef QT_EVAL
extern void qt_core_eval_init(uint);
extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
qt_core_eval_init(d->application_type);
#endif
@ -1451,7 +1451,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
// first, we diddle the event so that we can deliver
// it, and that no one will try to touch it later.
pe.event->posted = false;
QScopedPointer<QEvent> e(pe.event);
QEvent *e = pe.event;
QObject * r = pe.receiver;
--r->d_func()->postedEvents;
@ -1469,8 +1469,10 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
};
MutexUnlocker unlocker(locker);
QScopedPointer<QEvent> event_deleter(e); // will delete the event (with the mutex unlocked)
// after all that work, it's time to deliver the event.
QCoreApplication::sendEvent(r, e.data());
QCoreApplication::sendEvent(r, e);
// careful when adding anything below this point - the
// sendEvent() call might invalidate any invariants this

View File

@ -135,7 +135,7 @@ public:
static bool isTranslatorInstalled(QTranslator *translator);
#endif
uint application_type;
QCoreApplicationPrivate::Type application_type;
QString cachedApplicationDirPath;
QString cachedApplicationFilePath;

View File

@ -43,6 +43,7 @@
#include "qsocketnotifier.h"
#include "qdebug.h"
#include "qelapsedtimer.h"
#include "private/qthread_p.h"
#include <bps/bps.h>
#include <bps/event.h>
@ -352,11 +353,16 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
}
}
// Wait for event or file to be ready
event = 0;
const int result = bps_get_event(&event, timeoutLeft);
if (Q_UNLIKELY(result != BPS_SUCCESS))
qWarning("QEventDispatcherBlackberry bps_get_event failed");
{ // We need to increase loop level in this scope,
// because bps_get_event can also invoke callbacks
QScopedLoopLevelCounter loopLevelCounter(d->threadData);
// Wait for event or file to be ready
const int result = bps_get_event(&event, timeoutLeft);
if (Q_UNLIKELY(result != BPS_SUCCESS))
qWarning("QEventDispatcherBlackberry: bps_get_event failed");
}
if (!event) // In case of !event, we break out of the loop to let Qt process the timers
break; // (since timeout has expired) and socket notifiers that are now ready.

View File

@ -1582,7 +1582,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Create,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Destruct,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Construct,
sizeof(T),
int(sizeof(T)),
flags,
QtPrivate::MetaObjectForType<T>::value());
@ -1753,8 +1753,8 @@ struct QMetaTypeId< SINGLE_ARG_TEMPLATE<T> > \
Q_ASSERT(tName); \
const int tNameLen = qstrlen(tName); \
QByteArray typeName; \
typeName.reserve(sizeof(#SINGLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + 1); \
typeName.append(#SINGLE_ARG_TEMPLATE, sizeof(#SINGLE_ARG_TEMPLATE) - 1) \
typeName.reserve(int(sizeof(#SINGLE_ARG_TEMPLATE)) + 1 + tNameLen + 1 + 1); \
typeName.append(#SINGLE_ARG_TEMPLATE, int(sizeof(#SINGLE_ARG_TEMPLATE)) - 1) \
.append('<').append(tName, tNameLen); \
if (typeName.endsWith('>')) \
typeName.append(' '); \
@ -1786,8 +1786,8 @@ struct QMetaTypeId< DOUBLE_ARG_TEMPLATE<T, U> > \
const int tNameLen = qstrlen(tName); \
const int uNameLen = qstrlen(uName); \
QByteArray typeName; \
typeName.reserve(sizeof(#DOUBLE_ARG_TEMPLATE) + 1 + tNameLen + 1 + uNameLen + 1 + 1); \
typeName.append(#DOUBLE_ARG_TEMPLATE, sizeof(#DOUBLE_ARG_TEMPLATE) - 1) \
typeName.reserve(int(sizeof(#DOUBLE_ARG_TEMPLATE)) + 1 + tNameLen + 1 + uNameLen + 1 + 1); \
typeName.append(#DOUBLE_ARG_TEMPLATE, int(sizeof(#DOUBLE_ARG_TEMPLATE)) - 1) \
.append('<').append(tName, tNameLen).append(',').append(uName, uNameLen); \
if (typeName.endsWith('>')) \
typeName.append(' '); \

View File

@ -3921,7 +3921,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
they have additional features accessible through the \l
{Meta-Object System}.
\snippet code/src_corelib_kernel_qobject.cpp 36
\snippet code/doc_src_properties.cpp 0
The property name and type and the \c READ function are required.
The type can be any type supported by QVariant, or it can be a

View File

@ -44,6 +44,7 @@
#include <qlibraryinfo.h>
#include <qobject.h>
#include <qcoreapplication.h>
#include <private/qcoreapplication_p.h>
#include "stdio.h"
#include "stdlib.h"
@ -52,7 +53,7 @@ QT_BEGIN_NAMESPACE
#include "qconfig_eval.cpp"
static const char boilerplate_unsuported[] =
static const char boilerplate_supported_but_time_limited[] =
"\nQt %1 Evaluation License\n"
"Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).\n"
"This trial version may only be used for evaluation purposes\n"
@ -86,13 +87,19 @@ static const char will_shutdown_now[] =
"timeout and will shut down.\n"
"Contact http://qt.digia.com/contact-us for pricing and purchasing information.\n";
static int qt_eval_is_supported()
enum EvaluationStatus {
EvaluationNotSupported = 0,
EvaluationSupportedButTimeLimited,
EvaluationSupported
};
static EvaluationStatus qt_eval_is_supported()
{
const volatile char *const license_key = qt_eval_key_data + 12;
// fast fail
if (!qt_eval_key_data[0] || !*license_key)
return -1;
return EvaluationNotSupported;
// is this an unsupported evaluation?
const volatile char *typecode = license_key;
@ -103,31 +110,33 @@ static int qt_eval_is_supported()
if (!field && typecode[1] == '4' && typecode[2] == 'M') {
if (typecode[0] == 'Q')
return 0;
return EvaluationSupportedButTimeLimited;
else if (typecode[0] == 'R' || typecode[0] == 'Z')
return 1;
return EvaluationSupported;
}
return -1;
return EvaluationNotSupported;
}
static int qt_eval_days_left()
{
if (qt_eval_is_supported() < 0)
return -2;
QDate today = QDate::currentDate();
QDate build = QLibraryInfo::buildDate();
return qMax<qint64>(-1, today.daysTo(build) + 30);
}
static bool qt_eval_is_expired()
{
return qt_eval_days_left() < 0;
}
static QString qt_eval_string()
{
const char *msg;
switch (qt_eval_is_supported()) {
case 0:
msg = boilerplate_unsuported;
case EvaluationSupportedButTimeLimited:
msg = boilerplate_supported_but_time_limited;
break;
case 1:
case EvaluationSupported:
msg = boilerplate_supported;
break;
default:
@ -153,7 +162,7 @@ public:
QCoreFuriCuri() : QObject(), warn(-1), kill(-1)
{
if (!qt_eval_is_supported()) {
if (qt_eval_is_supported() == EvaluationSupportedButTimeLimited) {
warn = startTimer(WARN_TIMEOUT);
kill = 0;
}
@ -173,27 +182,20 @@ public:
#if defined(QT_BUILD_CORE_LIB) || defined (QT_BOOTSTRAPPED)
void qt_core_eval_init(uint type)
void qt_core_eval_init(QCoreApplicationPrivate::Type type)
{
if (!type)
return; // GUI app
switch (qt_eval_days_left()) {
case -2:
if (type != QCoreApplicationPrivate::Tty)
return;
case -1:
fprintf(stderr, "%s\n", boilerplate_expired);
if (type == 0) {
// if we're a console app only.
exit(0);
}
if (!qt_eval_is_supported())
return;
default:
if (qt_eval_is_expired()) {
fprintf(stderr, "%s\n", boilerplate_expired);
exit(0);
} else {
fprintf(stderr, "%s\n", qPrintable(qt_eval_string()));
if (type == 0) {
Q_UNUSED(new QCoreFuriCuri());
}
Q_UNUSED(new QCoreFuriCuri());
}
}
#endif
@ -453,12 +455,7 @@ public:
{
setWindowTitle(QLatin1String(" "));
QString str = qt_eval_string();
if (expired) {
str = QLatin1String(boilerplate_expired);
} else {
str = qt_eval_string();
}
QString str = expired ? QLatin1String(boilerplate_expired) : qt_eval_string();
str = str.trimmed();
QFrame *border = new QFrame(this);
@ -520,24 +517,22 @@ public:
};
void qt_gui_eval_init(uint)
void qt_gui_eval_init(QCoreApplicationPrivate::Type type)
{
switch (qt_eval_days_left()) {
case -2:
Q_UNUSED(type);
if (!qt_eval_is_supported())
return;
case -1: {
if (qt_eval_is_expired()) {
EvalMessageBox box(true);
box.exec();
::exit(0);
}
default: {
} else {
EvalMessageBox *box = new EvalMessageBox(false);
box->show();
Q_UNUSED(new QGuiFuriCuri());
}
}
}
static QString qt_eval_title_prefix()
@ -547,14 +542,14 @@ static QString qt_eval_title_prefix()
QString qt_eval_adapt_window_title(const QString &title)
{
if (qt_eval_days_left() == -2)
if (!qt_eval_is_supported())
return title;
return qt_eval_title_prefix() + title;
}
void qt_eval_init_widget(QWidget *w)
{
if (qt_eval_days_left() == -2)
if (!qt_eval_is_supported())
return;
if (w->isTopLevel() && w->windowTitle().isEmpty() && w->windowType() != Qt::Desktop ) {
w->setWindowTitle(QLatin1String(" "));

View File

@ -224,7 +224,7 @@ class QVariantIsNull
public:
static const bool Value = (sizeof(test<T>(0)) == sizeof(Yes));
};
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype)
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 && !defined(Q_CC_INTEL) // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype)
template<typename T>
class HasIsNullMethod {
struct Yes { char unused[1]; };

View File

@ -3873,7 +3873,7 @@ static inline __m128i mergeQuestionMarks(__m128i chunk)
// SSE has no compare instruction for unsigned comparison.
// The variables must be shiffted + 0x8000 to be compared
const __m128i signedBitOffset = _mm_set1_epi16(0x8000);
const __m128i thresholdMask = _mm_set1_epi16(0xff + 0x8000);
const __m128i thresholdMask = _mm_set1_epi16(short(0xff + 0x8000));
const __m128i signedChunk = _mm_add_epi16(chunk, signedBitOffset);
const __m128i offLimitMask = _mm_cmpgt_epi16(signedChunk, thresholdMask);

View File

@ -2038,7 +2038,7 @@ QStringRef QXmlStreamReader::dtdSystemId() const
element's namespace declarations. Otherwise an empty vector is
returned.
The QXmlStreamNamespaceDeclaration class is defined to be a QVector
The QXmlStreamNamespaceDeclarations class is defined to be a QVector
of QXmlStreamNamespaceDeclaration.
\sa addExtraNamespaceDeclaration(), addExtraNamespaceDeclarations()

View File

@ -279,7 +279,16 @@ void QDBusAdaptorConnector::polish()
void QDBusAdaptorConnector::relaySlot(void **argv)
{
relay(sender(), senderSignalIndex(), argv);
QObject *sndr = sender();
if (Q_LIKELY(sndr)) {
relay(sndr, senderSignalIndex(), argv);
} else {
qWarning("QtDBus: cannot relay signals from parent %s(%p \"%s\") unless they are emitted in the object's thread %s(%p \"%s\"). "
"Current thread is %s(%p \"%s\").",
parent()->metaObject()->className(), parent(), qPrintable(parent()->objectName()),
parent()->thread()->metaObject()->className(), parent()->thread(), qPrintable(parent()->thread()->objectName()),
QThread::currentThread()->metaObject()->className(), QThread::currentThread(), qPrintable(QThread::currentThread()->objectName()));
}
}
void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **argv)

View File

@ -181,7 +181,7 @@ void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode
{
QSize pixmapSize = rect.size() * qt_effective_device_pixel_ratio(0);
QPixmap px = pixmap(pixmapSize, mode, state);
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
painter->drawPixmap(rect, px);
}
static inline int area(const QSize &s) { return s.width() * s.height(); }

View File

@ -311,7 +311,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler: the" << keys.at(i) << "plugin can read this format";
qDebug() << "QImageReader::createReadHandler: the" << keyMap.keys().at(i) << "plugin can read this format";
#endif
handler = plugin->create(device, testFormat);
break;
@ -392,7 +392,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (plugin && plugin->capabilities(device, QByteArray()) & QImageIOPlugin::CanRead) {
handler = plugin->create(device, testFormat);
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler: the" << keys.at(i) << "plugin can read this data";
qDebug() << "QImageReader::createReadHandler: the" << keyMap.keys().at(i) << "plugin can read this data";
#endif
break;
}

View File

@ -4217,6 +4217,7 @@ void QTouchEvent::TouchPoint::setFlags(InfoFlags flags)
QScrollPrepareEvent::QScrollPrepareEvent(const QPointF &startPos)
: QEvent(QEvent::ScrollPrepare), m_target(0), m_startPos(startPos)
{
Q_UNUSED(m_target);
}
/*!

View File

@ -860,14 +860,7 @@ public:
void setContentPos(const QPointF &pos);
private:
#ifdef Q_CC_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunused-private-field"
#endif // Q_CC_CLANG
QObject* m_target; // Qt 6 remove.
#ifdef Q_CC_CLANG
# pragma clang diagnostic pop
#endif // Q_CC_CLANG
QPointF m_startPos;
QSizeF m_viewportSize;
QRectF m_contentPosRange;

View File

@ -787,11 +787,12 @@ static void init_platform(const QString &pluginArgument, const QString &platform
QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath);
QString fatalMessage
= QStringLiteral("Failed to find or load platform plugin \"%1\".\n").arg(name);
if (!keys.isEmpty())
fatalMessage += QStringLiteral("Available platforms are: %1\n").arg(
= QStringLiteral("This application failed to start because it could not find or load the Qt platform plugin \"%1\".\n\n").arg(name);
if (!keys.isEmpty()) {
fatalMessage += QStringLiteral("Available platform plugins are: %1.\n\n").arg(
keys.join(QStringLiteral(", ")));
fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating.");
}
fatalMessage += QStringLiteral("Reinstalling the application may fix this problem.");
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Windows: Display message box unless it is a console application
// or debug build showing an assert box.

View File

@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtGui
\brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.
\sa QSystemTray
\sa QSystemTrayIcon
*/
/*!

View File

@ -119,7 +119,7 @@ public:
the size of the alpha buffer; the size of the depth and stencil buffers;
and number of samples per pixel for multisampling. In addition, the format
contains surface configuration parameters such as OpenGL profile and
version for rendering, whether or not enable stereo buffers, and swap
version for rendering, whether or not to enable stereo buffers, and swap
behaviour.
*/
@ -361,7 +361,7 @@ int QSurfaceFormat::depthBufferSize() const
Set the swap \a behavior of the surface.
The swap behavior specifies whether single, double, or triple
buffering is desired. The default, SwapBehavior::DefaultSwapBehavior,
buffering is desired. The default, DefaultSwapBehavior,
gives the default swap behavior of the platform.
*/
void QSurfaceFormat::setSwapBehavior(SwapBehavior behavior)

View File

@ -933,7 +933,6 @@ bool QWindow::isActive() const
/*!
\property QWindow::contentOrientation
\brief the orientation of the window's contents
\since 5.1
This is a hint to the window manager in case it needs to display
additional content like popups, dialogs, status bars, or similar
@ -1190,7 +1189,6 @@ void QWindow::setHeight(int arg)
/*!
\property QWindow::minimumWidth
\brief the minimum width of the window's geometry
\since 5.1
*/
void QWindow::setMinimumWidth(int w)
{
@ -1200,7 +1198,6 @@ void QWindow::setMinimumWidth(int w)
/*!
\property QWindow::minimumHeight
\brief the minimum height of the window's geometry
\since 5.1
*/
void QWindow::setMinimumHeight(int h)
{
@ -1233,7 +1230,6 @@ void QWindow::setMaximumSize(const QSize &size)
/*!
\property QWindow::maximumWidth
\brief the maximum width of the window's geometry
\since 5.1
*/
void QWindow::setMaximumWidth(int w)
{
@ -1243,7 +1239,6 @@ void QWindow::setMaximumWidth(int w)
/*!
\property QWindow::maximumHeight
\brief the maximum height of the window's geometry
\since 5.1
*/
void QWindow::setMaximumHeight(int h)
{

View File

@ -110,14 +110,14 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged)
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged REVISION 1)
Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged REVISION 1)
Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged REVISION 1)
Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged REVISION 1)
Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged)
Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged)
Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged)
Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged REVISION 1)
Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged REVISION 1)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged REVISION 1)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION 1)
public:
@ -286,12 +286,12 @@ public Q_SLOTS:
void setWidth(int arg);
void setHeight(int arg);
Q_REVISION(1) void setMinimumWidth(int w);
Q_REVISION(1) void setMinimumHeight(int h);
Q_REVISION(1) void setMaximumWidth(int w);
Q_REVISION(1) void setMaximumHeight(int h);
void setMinimumWidth(int w);
void setMinimumHeight(int h);
void setMaximumWidth(int w);
void setMaximumHeight(int h);
void alert(int msec);
Q_REVISION(1) void alert(int msec);
Q_SIGNALS:
void screenChanged(QScreen *screen);
@ -304,15 +304,15 @@ Q_SIGNALS:
void widthChanged(int arg);
void heightChanged(int arg);
Q_REVISION(1) void minimumWidthChanged(int arg);
Q_REVISION(1) void minimumHeightChanged(int arg);
Q_REVISION(1) void maximumWidthChanged(int arg);
Q_REVISION(1) void maximumHeightChanged(int arg);
void minimumWidthChanged(int arg);
void minimumHeightChanged(int arg);
void maximumWidthChanged(int arg);
void maximumHeightChanged(int arg);
void visibleChanged(bool arg);
Q_REVISION(1) void visibilityChanged(QWindow::Visibility visibility);
Q_REVISION(1) void activeChanged();
Q_REVISION(1) void contentOrientationChanged(Qt::ScreenOrientation orientation);
void contentOrientationChanged(Qt::ScreenOrientation orientation);
void focusObjectChanged(QObject *object);

View File

@ -549,8 +549,10 @@ void QOpenGL2PaintEngineEx::beginNativePainting()
#ifndef QT_OPENGL_ES_2
Q_ASSERT(QOpenGLContext::currentContext());
const QOpenGLContext *ctx = d->ctx;
const QSurfaceFormat &fmt = d->device->context()->format();
if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1)
|| (fmt.majorVersion() == 3 && fmt.minorVersion() == 1 && ctx->hasExtension(QByteArrayLiteral("GL_ARB_compatibility")))
|| fmt.profile() == QSurfaceFormat::CompatibilityProfile)
{
// be nice to people who mix OpenGL 1.x code with QPainter commands
@ -1548,8 +1550,28 @@ namespace {
bool QOpenGL2PaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &t) const
{
// Don't try to cache vastly transformed fonts
return t.type() < QTransform::TxProject && QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
// The paint engine does not support projected cached glyph drawing
if (t.type() == QTransform::TxProject)
return false;
// The font engine might not support filling the glyph cache
// with the given transform applied, in which case we need to
// fall back to the QPainterPath code-path.
if (!fontEngine->supportsTransformation(t)) {
// Except that drawing paths is slow, so for scales between
// 0.5 and 2.0 we leave the glyph cache untransformed and deal
// with the transform ourselves when painting, resulting in
// drawing 1x cached glyphs with a smooth-scale.
float det = t.determinant();
if (det >= 0.25f && det <= 4.f) {
// Assuming the baseclass still agrees
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
return false; // Fall back to path-drawing
}
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType,
@ -1561,20 +1583,24 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type
void *cacheKey = ctx->shareGroup();
bool recreateVertexArrays = false;
QFontEngine *fe = staticTextItem->fontEngine();
// We allow scaling, so that the glyph-cache will contain glyphs with the
// appropriate resolution in the case of displays with a device-pixel-ratio != 1.
QTransform transform = s->matrix.type() < QTransform::TxRotate ?
QTransform::fromScale(qAbs(s->matrix.m11()), qAbs(s->matrix.m22())) :
QTransform::fromScale(
QVector2D(s->matrix.m11(), s->matrix.m12()).length(),
QVector2D(s->matrix.m21(), s->matrix.m22()).length());
QTransform glyphCacheTransform;
QFontEngine *fe = staticTextItem->fontEngine();
if (fe->supportsTransformation(s->matrix)) {
// The font-engine supports rendering glyphs with the current transform, so we
// build a glyph-cache with the scale pre-applied, so that the cache contains
// glyphs with the appropriate resolution in the case of retina displays.
glyphCacheTransform = s->matrix.type() < QTransform::TxRotate ?
QTransform::fromScale(qAbs(s->matrix.m11()), qAbs(s->matrix.m22())) :
QTransform::fromScale(
QVector2D(s->matrix.m11(), s->matrix.m12()).length(),
QVector2D(s->matrix.m21(), s->matrix.m22()).length());
}
QOpenGLTextureGlyphCache *cache =
(QOpenGLTextureGlyphCache *) fe->glyphCache(cacheKey, glyphType, transform);
(QOpenGLTextureGlyphCache *) fe->glyphCache(cacheKey, glyphType, glyphCacheTransform);
if (!cache || cache->cacheType() != glyphType || cache->contextGroup() == 0) {
cache = new QOpenGLTextureGlyphCache(glyphType, transform);
cache = new QOpenGLTextureGlyphCache(glyphType, glyphCacheTransform);
fe->setGlyphCache(cacheKey, cache);
recreateVertexArrays = true;
}

View File

@ -118,6 +118,9 @@ public:
void destroy();
void bind();
void release();
void _q_contextAboutToBeDestroyed();
Q_DECLARE_PUBLIC(QOpenGLVertexArrayObject)
GLuint vao;
@ -141,12 +144,22 @@ public:
bool QOpenGLVertexArrayObjectPrivate::create()
{
if (vao) {
qWarning("QOpenGLVertexArrayObject::create() VAO is already created");
return false;
}
Q_Q(QOpenGLVertexArrayObject);
if (context)
QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (!ctx) {
qWarning("QOpenGLVertexArrayObject::create() requires a valid current OpenGL context");
return false;
}
context = ctx;
QObject::connect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed()));
#if defined(QT_OPENGL_ES_2)
if (ctx->hasExtension("GL_OES_vertex_array_object")) {
@ -197,8 +210,16 @@ void QOpenGLVertexArrayObjectPrivate::destroy()
case NotSupported:
break;
}
vao = 0;
#endif
vao = 0;
}
/*!
\internal
*/
void QOpenGLVertexArrayObjectPrivate::_q_contextAboutToBeDestroyed()
{
destroy();
}
void QOpenGLVertexArrayObjectPrivate::bind()
@ -327,7 +348,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject()
Q_D(QOpenGLVertexArrayObject);
QOpenGLContext *oldContext = 0;
if (d->context && d->context != ctx) {
if (d->context && ctx && d->context != ctx) {
oldContext = ctx;
if (d->context->makeCurrent(oldContext->surface())) {
ctx = d->context;
@ -471,3 +492,5 @@ void QOpenGLVertexArrayObject::release()
*/
QT_END_NAMESPACE
#include "moc_qopenglvertexarrayobject.cpp"

View File

@ -102,6 +102,7 @@ public:
private:
Q_DISABLE_COPY(QOpenGLVertexArrayObject)
Q_DECLARE_PRIVATE(QOpenGLVertexArrayObject)
Q_PRIVATE_SLOT(d_func(), void _q_contextAboutToBeDestroyed())
QOpenGLVertexArrayObject(QOpenGLVertexArrayObjectPrivate &dd);
};

View File

@ -150,33 +150,6 @@ static inline int quadraticRoots(qreal a, qreal b, qreal c,
}
}
static inline bool findInflections(qreal a, qreal b, qreal c,
qreal *t1 , qreal *t2, qreal *tCups)
{
qreal r1 = 0, r2 = 0;
short rootsCount = quadraticRoots(a, b, c, &r1, &r2);
if (rootsCount >= 1) {
if (r1 < r2) {
*t1 = r1;
*t2 = r2;
} else {
*t1 = r2;
*t2 = r1;
}
if (!qFuzzyIsNull(a))
*tCups = qreal(0.5) * (-b / a);
else
*tCups = 2;
return true;
}
return false;
}
void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold) const
{
QBezier beziers[10];
@ -531,34 +504,6 @@ static QDebug operator<<(QDebug dbg, const QBezier &bz)
}
#endif
static inline void splitBezierAt(const QBezier &bez, qreal t,
QBezier *left, QBezier *right)
{
left->x1 = bez.x1;
left->y1 = bez.y1;
left->x2 = bez.x1 + t * ( bez.x2 - bez.x1 );
left->y2 = bez.y1 + t * ( bez.y2 - bez.y1 );
left->x3 = bez.x2 + t * ( bez.x3 - bez.x2 ); // temporary holding spot
left->y3 = bez.y2 + t * ( bez.y3 - bez.y2 ); // temporary holding spot
right->x3 = bez.x3 + t * ( bez.x4 - bez.x3 );
right->y3 = bez.y3 + t * ( bez.y4 - bez.y3 );
right->x2 = left->x3 + t * ( right->x3 - left->x3);
right->y2 = left->y3 + t * ( right->y3 - left->y3);
left->x3 = left->x2 + t * ( left->x3 - left->x2 );
left->y3 = left->y2 + t * ( left->y3 - left->y2 );
left->x4 = right->x1 = left->x3 + t * (right->x2 - left->x3);
left->y4 = right->y1 = left->y3 + t * (right->y2 - left->y3);
right->x4 = bez.x4;
right->y4 = bez.y4;
}
qreal QBezier::length(qreal error) const
{
qreal length = qreal(0.0);

View File

@ -3327,10 +3327,16 @@ bool QRasterPaintEngine::requiresPretransformedGlyphPositions(QFontEngine *fontE
bool QRasterPaintEngine::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
{
// The raster engine does not support projected cached glyph drawing
if (m.type() >= QTransform::TxProject)
return false;
// The font engine might not support filling the glyph cache
// with the given transform applied, in which case we need to
// fall back to the QPainterPath code-path.
if (!fontEngine->supportsTransformation(m))
// fall back to the QPainterPath code-path. This does not apply
// for engines with internal caching, as we don't use the engine
// to fill up our cache in that case.
if (!fontEngine->hasInternalCaching() && !fontEngine->supportsTransformation(m))
return false;
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, m);

View File

@ -1036,16 +1036,6 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
return result;
}
static inline QPointF midPoint(const QWingedEdge &list, int ei)
{
const QPathEdge *ep = list.edge(ei);
Q_ASSERT(ep);
const QPointF a = *list.vertex(ep->first);
const QPointF b = *list.vertex(ep->second);
return a + 0.5 * (b - a);
}
QWingedEdge::TraversalStatus QWingedEdge::findInsertStatus(int vi, int ei) const
{
const QPathVertex *vp = vertex(vi);

View File

@ -1469,7 +1469,12 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const
return val;
}
static inline QSizeF pageSizeToPostScriptPoints(const QSizeF &pageSizeMM)
{
#define Q_MM(n) int((n * 720 + 127) / 254)
return QSizeF(Q_MM(pageSizeMM.width()), Q_MM(pageSizeMM.height()));
#undef Q_MM
}
QPdfEnginePrivate::QPdfEnginePrivate()
: clipEnabled(false), allClipped(false), hasPen(true), hasBrush(false), simplePen(false),
@ -1477,7 +1482,7 @@ QPdfEnginePrivate::QPdfEnginePrivate()
fullPage(false), embedFonts(true),
landscape(false),
grayscale(false),
paperSize(Q_MM(210), Q_MM(297)), // A4
paperSize(pageSizeToPostScriptPoints(QSizeF(210, 297))), // A4
leftMargin(10), topMargin(10), rightMargin(10), bottomMargin(10) // ~3.5 mm
{
resolution = 1200;
@ -1491,6 +1496,11 @@ QPdfEnginePrivate::QPdfEnginePrivate()
stream = new QDataStream;
}
void QPdfEnginePrivate::setPaperSize(const QSizeF &pageSizeMM)
{
paperSize = pageSizeToPostScriptPoints(pageSizeMM);
}
bool QPdfEngine::begin(QPaintDevice *pdev)
{
Q_D(QPdfEngine);
@ -2518,6 +2528,10 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
qreal size = ti.fontEngine->fontDef.pixelSize;
#if defined(Q_OS_WIN)
size = (ti.fontEngine->ascent() + ti.fontEngine->descent()).toReal();
#endif
QVarLengthArray<glyph_t> glyphs;
QVarLengthArray<QFixedPoint> positions;
QTransform m = QTransform::fromTranslate(p.x(), p.y());

View File

@ -226,6 +226,7 @@ public:
QRect paperRect() const;
QRect pageRect() const;
void setPaperSize(const QSizeF &pageSizeMM);
int width() const {
QRect r = paperRect();

View File

@ -166,7 +166,7 @@ void QPdfWriter::setPageSize(PageSize size)
Q_D(const QPdfWriter);
QPagedPaintDevice::setPageSize(size);
d->engine->d_func()->paperSize = pageSizeMM() * 25.4/72.;
d->engine->d_func()->setPaperSize(pageSizeMM());
}
/*!
@ -177,7 +177,7 @@ void QPdfWriter::setPageSizeMM(const QSizeF &size)
Q_D(const QPdfWriter);
QPagedPaintDevice::setPageSizeMM(size);
d->engine->d_func()->paperSize = pageSizeMM() * 25.4/72.;
d->engine->d_func()->setPaperSize(pageSizeMM());
}
/*!

View File

@ -1437,6 +1437,14 @@ void QFontEngineFT::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_me
unlockFace();
}
bool QFontEngineFT::supportsTransformation(const QTransform &transform) const
{
// The freetype engine falls back to QFontEngine for tranformed glyphs,
// which uses fast-tranform and produces very ugly results, so we claim
// to support just translations.
return transform.type() <= QTransform::TxTranslate;
}
static inline unsigned int getChar(const QChar *str, int &i, const int len)
{
uint ucs4 = str[i].unicode();

View File

@ -233,6 +233,8 @@ private:
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
virtual bool supportsTransformation(const QTransform &transform) const;
virtual bool canRender(const QChar *string, int len);
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,

View File

@ -1185,6 +1185,22 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
case QAbstractSocket::SslHandshakeFailedError:
errorCode = QNetworkReply::SslHandshakeFailedError;
break;
case QAbstractSocket::ProxyConnectionClosedError:
// try to reconnect/resend before sending an error.
if (reconnectAttempts-- > 0) {
closeAndResendCurrentRequest();
return;
}
errorCode = QNetworkReply::ProxyConnectionClosedError;
break;
case QAbstractSocket::ProxyConnectionTimeoutError:
// try to reconnect/resend before sending an error.
if (reconnectAttempts-- > 0) {
closeAndResendCurrentRequest();
return;
}
errorCode = QNetworkReply::ProxyTimeoutError;
break;
default:
// all other errors are treated as NetworkError
errorCode = QNetworkReply::UnknownNetworkError;

View File

@ -64,6 +64,10 @@ public:
typedef QIPv6Address Q_IPV6ADDR;
class QHostAddress;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0);
class Q_NETWORK_EXPORT QHostAddress
{
public:
@ -121,7 +125,7 @@ public:
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0);
friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed);
protected:
QScopedPointer<QHostAddressPrivate> d;
};

View File

@ -545,8 +545,10 @@ void QGL2PaintEngineEx::beginNativePainting()
d->funcs.glDisableVertexAttribArray(i);
#ifndef QT_OPENGL_ES_2
const QGLContext *ctx = d->ctx;
const QGLFormat &fmt = d->device->format();
if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1)
|| (fmt.majorVersion() == 3 && fmt.minorVersion() == 1 && ctx->contextHandle()->hasExtension(QByteArrayLiteral("GL_ARB_compatibility")))
|| fmt.profile() == QGLFormat::CompatibilityProfile)
{
// be nice to people who mix OpenGL 1.x code with QPainter commands
@ -625,8 +627,28 @@ bool QGL2PaintEngineEx::isNativePaintingActive() const {
bool QGL2PaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &t) const
{
// Don't try to cache vastly transformed fonts
return t.type() < QTransform::TxProject && QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
// The paint engine does not support projected cached glyph drawing
if (t.type() == QTransform::TxProject)
return false;
// The font engine might not support filling the glyph cache
// with the given transform applied, in which case we need to
// fall back to the QPainterPath code-path.
if (!fontEngine->supportsTransformation(t)) {
// Except that drawing paths is slow, so for scales between
// 0.5 and 2.0 we leave the glyph cache untransformed and deal
// with the transform ourselves when painting, resulting in
// drawing 1x cached glyphs with a smooth-scale.
float det = t.determinant();
if (det >= 0.25f && det <= 4.f) {
// Assuming the baseclass still agrees
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
return false; // Fall back to path-drawing
}
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
@ -1584,19 +1606,23 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
void *cacheKey = const_cast<QGLContext *>(QGLContextPrivate::contextGroup(ctx)->context());
bool recreateVertexArrays = false;
// We allow scaling, so that the glyph-cache will contain glyphs with the
// appropriate resolution in the case of displays with a device-pixel-ratio != 1.
QTransform transform = s->matrix.type() < QTransform::TxRotate ?
QTransform::fromScale(qAbs(s->matrix.m11()), qAbs(s->matrix.m22())) :
QTransform::fromScale(
QVector2D(s->matrix.m11(), s->matrix.m12()).length(),
QVector2D(s->matrix.m21(), s->matrix.m22()).length());
QTransform glyphCacheTransform;
QFontEngine *fe = staticTextItem->fontEngine();
if (fe->supportsTransformation(s->matrix)) {
// The font-engine supports rendering glyphs with the current transform, so we
// build a glyph-cache with the scale pre-applied, so that the cache contains
// glyphs with the appropriate resolution in the case of retina displays.
glyphCacheTransform = s->matrix.type() < QTransform::TxRotate ?
QTransform::fromScale(qAbs(s->matrix.m11()), qAbs(s->matrix.m22())) :
QTransform::fromScale(
QVector2D(s->matrix.m11(), s->matrix.m12()).length(),
QVector2D(s->matrix.m21(), s->matrix.m22()).length());
}
QGLTextureGlyphCache *cache =
(QGLTextureGlyphCache *) fe->glyphCache(cacheKey, glyphType, transform);
(QGLTextureGlyphCache *) fe->glyphCache(cacheKey, glyphType, glyphCacheTransform);
if (!cache || cache->cacheType() != glyphType || cache->contextGroup() == 0) {
cache = new QGLTextureGlyphCache(glyphType, transform);
cache = new QGLTextureGlyphCache(glyphType, glyphCacheTransform);
fe->setGlyphCache(cacheKey, cache);
recreateVertexArrays = true;
}

View File

@ -250,45 +250,6 @@ static const char *languageForWritingSystem[] = {
};
enum { LanguageCount = sizeof(languageForWritingSystem) / sizeof(const char *) };
// Unfortunately FontConfig doesn't know about some languages. We have to test these through the
// charset. The lists below contain the systems where we need to do this.
static const ushort sampleCharForWritingSystem[] = {
0, // Any
0, // Latin
0, // Greek
0, // Cyrillic
0, // Armenian
0, // Hebrew
0, // Arabic
0, // Syriac
0, // Thaana
0, // Devanagari
0, // Bengali
0, // Gurmukhi
0, // Gujarati
0, // Oriya
0, // Tamil
0xc15, // Telugu
0xc95, // Kannada
0xd15, // Malayalam
0xd9a, // Sinhala
0, // Thai
0, // Lao
0, // Tibetan
0x1000, // Myanmar
0, // Georgian
0, // Khmer
0, // SimplifiedChinese
0, // TraditionalChinese
0, // Japanese
0, // Korean
0, // Vietnamese
0, // Symbol
0x1681, // Ogham
0x16a0, // Runic
0x7ca // N'Ko
};
enum { SampleCharCount = sizeof(sampleCharForWritingSystem) / sizeof(ushort) };
// Newer FontConfig let's us sort out fonts that contain certain glyphs, but no
// open type tables for is directly. Do this so we don't pick some strange
@ -356,26 +317,6 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style)
return stylehint;
}
static bool isSymbolFont(FontFile *fontFile)
{
if (fontFile == 0 || fontFile->fileName.isEmpty())
return false;
QFontEngine::FaceId id;
id.filename = QFile::encodeName(fontFile->fileName);
id.index = fontFile->indexValue;
QFreetypeFace *f = QFreetypeFace::getFace(id);
if (f == 0) {
qWarning("isSymbolFont: Couldn't open face %s/%d", id.filename.data(), id.index);
return false;
}
bool hasSymbolMap = f->symbol_map;
f->release(id);
return hasSymbolMap;
}
Q_GUI_EXPORT void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias);
void QFontconfigDatabase::populateFontDatabase()
@ -453,14 +394,20 @@ void QFontconfigDatabase::populateFontDatabase()
FcLangSet *langset = 0;
FcResult res = FcPatternGetLangSet(fonts->fonts[i], FC_LANG, 0, &langset);
if (res == FcResultMatch) {
bool hasLang = false;
for (int i = 1; i < LanguageCount; ++i) {
const FcChar8 *lang = (const FcChar8*) languageForWritingSystem[i];
if (lang) {
FcLangResult langRes = FcLangSetHasLang(langset, lang);
if (langRes != FcLangDifferentLang)
if (langRes != FcLangDifferentLang) {
writingSystems.setSupported(QFontDatabase::WritingSystem(i));
hasLang = true;
}
}
}
if (!hasLang)
// none of our known languages, add it to the other set
writingSystems.setSupported(QFontDatabase::Other);
} else {
// we set Other to supported for symbol fonts. It makes no
// sense to merge these with other ones, as they are
@ -468,18 +415,6 @@ void QFontconfigDatabase::populateFontDatabase()
writingSystems.setSupported(QFontDatabase::Other);
}
FcCharSet *cs = 0;
res = FcPatternGetCharSet(fonts->fonts[i], FC_CHARSET, 0, &cs);
if (res == FcResultMatch) {
// some languages are not supported by FontConfig, we rather check the
// charset to detect these
for (int i = 1; i < SampleCharCount; ++i) {
if (!sampleCharForWritingSystem[i] || writingSystems.supported(QFontDatabase::WritingSystem(i)))
continue;
if (FcCharSetHasChar(cs, sampleCharForWritingSystem[i]))
writingSystems.setSupported(QFontDatabase::WritingSystem(i));
}
}
#if FC_VERSION >= 20297
for (int j = 1; j < LanguageCount; ++j) {
@ -497,23 +432,6 @@ void QFontconfigDatabase::populateFontDatabase()
fontFile->fileName = QLatin1String((const char *)file_value);
fontFile->indexValue = indexValue;
if (!writingSystems.supported(QFontDatabase::Symbol)) {
// Symbol encoding used to encode various crap in the 32..255 character
// code range, which belongs to Latin character code range.
// Symbol fonts usually don't have any other code ranges support.
bool mightBeSymbolFont = true;
for (int j = 2; j < QFontDatabase::WritingSystemsCount; ++j) {
if (writingSystems.supported(QFontDatabase::WritingSystem(j))) {
mightBeSymbolFont = false;
break;
}
}
if (mightBeSymbolFont && isSymbolFont(fontFile)) {
writingSystems.setSupported(QFontDatabase::Latin, false);
writingSystems.setSupported(QFontDatabase::Symbol);
}
}
QFont::Style style = (slant_value == FC_SLANT_ITALIC)
? QFont::StyleItalic
: ((slant_value == FC_SLANT_OBLIQUE)

View File

@ -370,18 +370,6 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam
#endif // QT_NO_COMBOBOX
static inline void removeInvisibleWidgetsFromList(QWidgetList *list)
{
if (!list || list->isEmpty())
return;
for (int i = 0; i < list->count(); ++i) {
QWidget *widget = list->at(i);
if (!widget->isVisible())
list->removeAt(i);
}
}
#ifndef QT_NO_SCROLLAREA
// ======================= QAccessibleAbstractScrollArea =======================
QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)

View File

@ -220,6 +220,16 @@ QPlatformServices *QAndroidPlatformIntegration::services() const
return m_androidPlatformServices;
}
QVariant QAndroidPlatformIntegration::styleHint(StyleHint hint) const
{
switch (hint) {
case ShowIsFullScreen:
return true;
default:
return QPlatformIntegration::styleHint(hint);
}
}
static const QLatin1String androidThemeName("android");
QStringList QAndroidPlatformIntegration::themeNames() const
{

View File

@ -113,6 +113,8 @@ public:
QPlatformNativeInterface *nativeInterface() const;
QPlatformServices *services() const;
QVariant styleHint(StyleHint hint) const;
QStringList themeNames() const;
QPlatformTheme *createPlatformTheme(const QString &name) const;

View File

@ -59,15 +59,6 @@ public:
void setCurrentColor(const QColor&);
QColor currentColor() const;
public:
bool showCocoaColorPanel(Qt::WindowModality windowModality, QWindow *parent);
bool hideCocoaColorPanel();
void createNSColorPanelDelegate();
private:
void *mDelegate;
};
QT_END_NAMESPACE

View File

@ -91,11 +91,14 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
@implementation QNSColorPanelDelegate
- (id)initWithDialogHelper:(QCocoaColorDialogHelper *)helper
- (id)init
{
self = [super init];
mColorPanel = [NSColorPanel sharedColorPanel];
mHelper = helper;
mHelper = 0;
mStolenContentView = 0;
mOkButton = 0;
mCancelButton = 0;
mResultCode = NSCancelButton;
mDialogIsExecuting = false;
mResultSet = false;
@ -105,11 +108,31 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
[mColorPanel setRestorable:NO];
#endif
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(colorChanged:)
name:NSColorPanelColorDidChangeNotification
object:mColorPanel];
[mColorPanel retain];
return self;
}
- (void)dealloc
{
[self restoreOriginalContentView];
[mColorPanel setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (void)setDialogHelper:(QCocoaColorDialogHelper *)helper
{
mHelper = helper;
[mColorPanel setShowsAlpha:mHelper->options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) {
mStolenContentView = 0;
mOkButton = 0;
mCancelButton = 0;
} else {
[self restoreOriginalContentView];
} else if (!mStolenContentView) {
// steal the color panel's contents view
mStolenContentView = [mColorPanel contentView];
[mStolenContentView retain];
@ -134,33 +157,6 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
[mCancelButton setAction:@selector(onCancelClicked)];
[mCancelButton setTarget:self];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(colorChanged:)
name:NSColorPanelColorDidChangeNotification
object:mColorPanel];
[mColorPanel retain];
return self;
}
- (void)dealloc
{
if (mOkButton) {
NSView *ourContentView = [mColorPanel contentView];
// return stolen stuff to its rightful owner
[mStolenContentView removeFromSuperview];
[mColorPanel setContentView:mStolenContentView];
[mOkButton release];
[mCancelButton release];
[ourContentView release];
}
[mColorPanel setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (void)closePanel
@ -178,7 +174,25 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
{
Q_UNUSED(notification);
[self updateQtColor];
emit mHelper->colorSelected(mQtColor);
if (mHelper)
emit mHelper->colorSelected(mQtColor);
}
- (void)restoreOriginalContentView
{
if (mStolenContentView) {
NSView *ourContentView = [mColorPanel contentView];
// return stolen stuff to its rightful owner
[mStolenContentView removeFromSuperview];
[mColorPanel setContentView:mStolenContentView];
[mOkButton release];
[mCancelButton release];
[ourContentView release];
mOkButton = 0;
mCancelButton = 0;
mStolenContentView = 0;
}
}
- (void)relayout
@ -275,7 +289,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mQtColor.setRgbF(red, green, blue, alpha);
}
}
emit mHelper->currentColorChanged(mQtColor);
if (mHelper)
emit mHelper->currentColorChanged(mQtColor);
}
- (void)showModelessPanel
@ -313,7 +328,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
[self finishOffWithCode:NSCancelButton];
} else {
mResultSet = true;
emit mHelper->reject();
if (mHelper)
emit mHelper->reject();
}
return true;
}
@ -348,27 +364,101 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
QT_BEGIN_NAMESPACE
QCocoaColorDialogHelper::QCocoaColorDialogHelper() :
mDelegate(0)
class QCocoaColorPanel
{
public:
QCocoaColorPanel()
{
mDelegate = [[QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) alloc] init];
}
~QCocoaColorPanel()
{
[mDelegate release];
}
void init(QCocoaColorDialogHelper *helper)
{
[mDelegate setDialogHelper:helper];
}
void cleanup(QCocoaColorDialogHelper *helper)
{
if (mDelegate->mHelper == helper)
mDelegate->mHelper = 0;
}
bool exec()
{
// Note: If NSApp is not running (which is the case if e.g a top-most
// QEventLoop has been interrupted, and the second-most event loop has not
// yet been reactivated (regardless if [NSApp run] is still on the stack)),
// showing a native modal dialog will fail.
return [mDelegate runApplicationModalPanel];
}
bool show(Qt::WindowModality windowModality, QWindow *parent)
{
Q_UNUSED(parent);
if (windowModality != Qt::WindowModal)
[mDelegate showModelessPanel];
// no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case
return true;
}
void hide()
{
[mDelegate closePanel];
}
QColor currentColor() const
{
return mDelegate->mQtColor;
}
void setCurrentColor(const QColor &color)
{
// make sure that if ShowAlphaChannel option is set then also setShowsAlpha
// needs to be set, otherwise alpha value is omitted
if (color.alpha() < 255)
[mDelegate->mColorPanel setShowsAlpha:YES];
NSColor *nsColor;
const QColor::Spec spec = color.spec();
if (spec == QColor::Cmyk) {
nsColor = [NSColor colorWithDeviceCyan:color.cyanF()
magenta:color.magentaF()
yellow:color.yellowF()
black:color.blackF()
alpha:color.alphaF()];
} else {
nsColor = [NSColor colorWithCalibratedRed:color.redF()
green:color.greenF()
blue:color.blueF()
alpha:color.alphaF()];
}
mDelegate->mQtColor = color;
[mDelegate->mColorPanel setColor:nsColor];
}
private:
QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *mDelegate;
};
Q_GLOBAL_STATIC(QCocoaColorPanel, sharedColorPanel)
QCocoaColorDialogHelper::QCocoaColorDialogHelper()
{
}
QCocoaColorDialogHelper::~QCocoaColorDialogHelper()
{
if (!mDelegate)
return;
[reinterpret_cast<QNSColorPanelDelegate *>(mDelegate) release];
mDelegate = 0;
sharedColorPanel()->cleanup(this);
}
void QCocoaColorDialogHelper::exec()
{
// Note: If NSApp is not running (which is the case if e.g a top-most
// QEventLoop has been interrupted, and the second-most event loop has not
// yet been reactivated (regardless if [NSApp run] is still on the stack)),
// showing a native modal dialog will fail.
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
if ([delegate runApplicationModalPanel])
if (sharedColorPanel()->exec())
emit accept();
else
emit reject();
@ -378,89 +468,24 @@ bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowMod
{
if (windowModality == Qt::WindowModal)
windowModality = Qt::ApplicationModal;
return showCocoaColorPanel(windowModality, parent);
sharedColorPanel()->init(this);
return sharedColorPanel()->show(windowModality, parent);
}
void QCocoaColorDialogHelper::hide()
{
if (!mDelegate)
return;
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
if (![delegate->mColorPanel isVisible])
return;
if (delegate->mDialogIsExecuting)
[delegate->mColorPanel performClose:delegate];
else
[delegate->mColorPanel close];
sharedColorPanel()->hide();
}
void QCocoaColorDialogHelper::setCurrentColor(const QColor &color)
{
if (!mDelegate)
createNSColorPanelDelegate();
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
// make sure that if ShowAlphaChannel option is set then also setShowsAlpha
// needs to be set, otherwise alpha value is omitted
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
NSColor *nsColor;
const QColor::Spec spec = color.spec();
if (spec == QColor::Cmyk) {
nsColor = [NSColor colorWithDeviceCyan:color.cyanF()
magenta:color.magentaF()
yellow:color.yellowF()
black:color.blackF()
alpha:color.alphaF()];
} else {
nsColor = [NSColor colorWithCalibratedRed:color.redF()
green:color.greenF()
blue:color.blueF()
alpha:color.alphaF()];
}
delegate->mQtColor = color;
[delegate->mColorPanel setColor:nsColor];
sharedColorPanel()->init(this);
sharedColorPanel()->setCurrentColor(color);
}
QColor QCocoaColorDialogHelper::currentColor() const
{
if (!mDelegate)
return QColor();
return reinterpret_cast<QNSColorPanelDelegate *>(mDelegate)->mQtColor;
}
void QCocoaColorDialogHelper::createNSColorPanelDelegate()
{
if (mDelegate)
return;
QNSColorPanelDelegate *delegate = [[QNSColorPanelDelegate alloc]
initWithDialogHelper:this];
mDelegate = delegate;
}
bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModality, QWindow *parent)
{
Q_UNUSED(parent);
createNSColorPanelDelegate();
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
if (windowModality != Qt::WindowModal)
[delegate showModelessPanel];
// no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case
return true;
}
bool QCocoaColorDialogHelper::hideCocoaColorPanel()
{
if (!mDelegate){
return false;
} else {
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate closePanel];
return true;
}
return sharedColorPanel()->currentColor();
}
QT_END_NAMESPACE

Some files were not shown because too many files have changed in this diff Show More