Merge remote-tracking branch 'origin/stable' into dev

Conflicts:
	configure
	mkspecs/features/create_cmake.prf

Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5
This commit is contained in:
Frederik Gladhorn 2013-06-27 13:06:38 +02:00
commit 572200989b
89 changed files with 765 additions and 420 deletions

View File

@ -44,8 +44,8 @@ else
fi
if strings - $binary 2>/dev/null | \
awk -F: '/==Qt=magic=Qt== Architecture/ { print "'$VARPREFIX'_ARCH=\"" $2 "\"" }
/==Qt=magic=Qt== Sub-architecture/ { print "'$VARPREFIX'_CPUFEATURES=\"" $2 "\"" }' > "$RESULTFILE"
awk -F: '/\=\=Qt\=magic\=Qt\=\= Architecture/ { print "'$VARPREFIX'_ARCH=\"" $2 "\"" }
/\=\=Qt\=magic\=Qt\=\= Sub-architecture/ { print "'$VARPREFIX'_CPUFEATURES=\"" $2 "\"" }' > "$RESULTFILE"
then
[ "$VERBOSE" = "yes" ] && echo " Found architecture in binary" && \
cat "$RESULTFILE"

24
configure vendored
View File

@ -61,6 +61,13 @@ if [ -f "$LICENSE_FILE" ]; then
diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
fi
# do this early so we don't store it in config.status
CFG_TOPLEVEL=
if [ x"$1" = x"-top-level" ]; then
CFG_TOPLEVEL=yes
shift
fi
# later cache the command line in config.status
OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
@ -6067,7 +6074,7 @@ case "$XPLATFORM" in
;;
solaris-cc*)
# Check the compiler version
case `${QMAKE_CONF_COMPILER} -V 2>&1 | awk '{print $4}'` in
case `${QMAKE_CONF_COMPILER} -V 2>&1 | $AWK '{print $4}'` in
5.[012345678])
canBuildWebKit="no"
canBuildQtXmlPatterns="no"
@ -6693,11 +6700,9 @@ report_support()
return
:;
esac
local heading
heading=$1
shift
local value
value=$1
shift
@ -6907,14 +6912,23 @@ rm -f "$QMAKE_VARS_FILE" 2>/dev/null
#-------------------------------------------------------------------------------
if [ "$CFG_PROCESS" != "no" ]; then
( # fork to make the cd stay local
relpathMangled=$relpath
if [ -n "$CFG_TOPLEVEL" ]; then
relpathMangled=`dirname "$relpath"`
cd ..
fi
if [ "$CFG_PROCESS" = "full" ]; then
echo "Creating makefiles. Please wait..."
"$outpath/bin/qmake" -r "$relpath"
"$outpath/bin/qmake" -r "$relpathMangled"
echo "Done"
else
"$outpath/bin/qmake" "$relpath"
"$outpath/bin/qmake" "$relpathMangled"
fi
)
fi
#-------------------------------------------------------------------------------

11
dist/changes-5.1.0 vendored
View File

@ -88,7 +88,16 @@ QtGui
QtNetwork
---------
-
- QNetworkAccessManager / QNetworkReply:
* Add a new encrypted() signal so that applications can perform
additional checks on the certificate chain.
- QSslSocket:
* Support for sending intermediate certificates when QSslSocket is used
as a server, and when using client certificates.
- HTTPS internals:
* SSL sessions are re-used by default.
- QHostInfo:
* Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache.
QtWidgets
---------

View File

@ -32,11 +32,10 @@
# manifestmeta.global.names = *
# manifestmeta.global.tags = qt5
manifestmeta.filters = highlighted webkit1 webkit2
manifestmeta.filters = highlighted webkit1 webkit2 android
manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Photo Surface" \
"QtQuick/Qt Quick Demo - Tweet Search" \
"QtQuick/Qt Quick Demo - Maroon*" \
"QtQuick/Qt Quick Demo - Calqlatr" \
"QtQuick/Qt Quick Particles Examples - Emitters" \
@ -70,3 +69,102 @@ manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \
"QtWebKitExamples/YouTube View Example"
manifestmeta.webkit2.tags = webkit2
manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \
"QtQuick/Qt Quick Demo - Calqlatr" \
"QtWidgets/Application Chooser Example" \
"QtWidgets/Stickman Example" \
"QtWidgets/Move Blocks Example" \
"QtWidgets/Border Layout Example" \
"QtWidgets/Dynamic Layouts Example" \
"QtWidgets/Flow Layout Example" \
"QtWidgets/MDI Example" \
"QtWidgets/Dock Widgets Example" \
"QtWidgets/Recent Files Example" \
"QtWidgets/Menus Example" \
"QtWidgets/Concentric Circles Example" \
"QtWidgets/Gradients" \
"QtWidgets/Font Sampler Example" \
"QtWidgets/Path Stroking" \
"QtWidgets/Transformations Example" \
"QtWidgets/Syntax Highlighter Example" \
"QtWidgets/Calendar Example" \
"QtWidgets/Movie Example" \
"QtWidgets/Validators Example" \
"QtWidgets/Analog Clock Example" \
"QtWidgets/Calculator Example" \
"QtWidgets/Mouse Button Tester" \
"QtWidgets/Character Map Example" \
"QtWidgets/Wiggly Example" \
"QtWidgets/Digital Clock Example" \
"QtWidgets/Elided Label Example" \
"QtWidgets/Image Viewer Example" \
"QtWidgets/Sliders Example" \
"QtWidgets/Tetrix Example" \
"QtWidgets/Group Box Example" \
"QtWidgets/Spin Boxes Example" \
"QtWidgets/Undo Framework" \
"QtWidgets/Regular Expressions Example" \
"QtWidgets/Colliding Mice Example" \
"QtWidgets/Basic Graphics Layouts Example" \
"QtWidgets/Boxes" \
"QtWidgets/40000 Chips" \
"QtWidgets/Diagram Scene Example" \
"QtWidgets/Drag and Drop Robot Example" \
"QtWidgets/Elastic Nodes Example" \
"QtWidgets/Pad Navigator Example" \
"QtWidgets/Anchor Layout Example" \
"QtWidgets/Weather Anchor Layout Example" \
"QtConcurrent/Image Scaling Example" \
"QtConcurrent/QtConcurrent Progress Dialog Example" \
"QtNetwork/Torrent Example" \
"QtNetwork/Network Chat Example" \
"QtSQL/Master Detail Example" \
"QtOpenGL/Cube OpenGL ES 2.0 example" \
"QtOpenGL/Textures Example" \
"QtLinguist/Arrow Pad Example" \
"QtGui/Raster Window Example" \
"QtGui/Analog Clock Window Example" \
"QtMultimedia/Video Widget Example" \
"QtMultimedia/Media Player Example" \
"QtSVG/Text Object Example" \
"QtQML/Qt Quick Examples - XMLHttpRequest" \
"QtQuick/Qt Quick Particles Examples - *" \
"QtQuick/Qt Quick Examples - Touch Interaction" \
"QtQuick/Scene Graph - *" \
"QtQuick/Qt Quick Examples - Image Elements" \
"QtQuick/Qt Quick Examples - Key Interaction" \
"QtQuick/Qt Quick Examples - Text" \
"QtQuick/Qt Quick Examples - Animation" \
"QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuick/Qt Quick Examples - Canvas" \
"QtWidgets/Interview" \
"QtWidgets/Spreadsheet" \
"QtWidgets/Pixelator Example" \
"QtWidgets/Class Wizard Example" \
"QtWidgets/Animated Tiles Example" \
"QtWidgets/Basic Layouts Example" \
"QtWidgets/Application Example" \
"QtWidgets/Affine Transformations" \
"QtWidgets/Image Composition Example" \
"QtWidgets/Basic Drawing Example" \
"QtWidgets/Vector Deformation" \
"QtWidgets/Painter Paths Example" \
"QtWidgets/Text Edit" \
"QtWidgets/Style Sheet Example" \
"QtWidgets/Code Editor Example" \
"QtWidgets/Window Flags Example" \
"QtWidgets/Scribble Example" \
"QtWidgets/Shaped Clock Example" \
"QtWidgets/Line Edits Example" \
"QtWidgets/Calendar Widget Example" \
"QtWidgets/Completer Example" \
"QtWidgets/I18N Example" \
"QtQML/Extending QML - Grouped Properties Example" \
"QtQML/Extending QML - Methods Example" \
"QtQML/Extending QML - Signal Support Example" \
"QtQML/Extending QML - Attached Properties Example" \
"QtQuick/Qt Quick Examples - Window and Screen" \
"QtWidgets/Address Book Example"
manifestmeta.android.tags = android

View File

@ -63,7 +63,6 @@ Window::Window(QWidget *parent)
//! [1]
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addWidget(fileLabel, 0, 0);
mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
mainLayout->addWidget(textLabel, 1, 0);

View File

@ -65,7 +65,6 @@ TabDialog::TabDialog(const QString &fileName, QWidget *parent)
//! [4]
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
mainLayout->addWidget(tabWidget);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);

View File

@ -16,6 +16,8 @@ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2
QMAKE_LFLAGS_STATIC_LIB += -all_load
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvmgcc42
QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}

View File

@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) {
variable = $$1
out =
for(v, variable) {
if(!equals(v, -framework):!equals(v, -L.*)) {
if(!equals(v, -framework):!contains(v, -L.*)) {
v ~= s,^-l,,
v ~= s,^-lib,,
v ~= s,.lib$,,

View File

@ -55,6 +55,17 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
CMAKE_BIN_DIR_IS_ABSOLUTE = True
}
!isEmpty(DLLDESTDIR):!static:!staticlib {
CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
CMAKE_DLL_DIR_IS_ABSOLUTE = True
}
} else {
CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
}
static|staticlib:CMAKE_STATIC_TYPE = true
unix:contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"

View File

@ -46,10 +46,10 @@ endmacro()
macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ELSE
set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
@ -187,22 +187,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_DEBUG_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ELSE
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!ELSE
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ELSE
if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!ENDIF
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ENDIF
AND EXISTS
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()
@ -220,22 +224,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
!!IF isEmpty(CMAKE_RELEASE_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ELSE
if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!ELSE
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ELSE
if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
!!ENDIF
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
if (EXISTS
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ELSE
\"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
AND EXISTS
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
endif()

View File

@ -1,5 +1,5 @@
# Unset makefile generator, so we can auto-detect value in default_post
unset(MAKEFILE_GENERATOR)
!macx-xcode: unset(MAKEFILE_GENERATOR)
load(default_pre)

View File

@ -1,12 +1,12 @@
load(default_post)
!no_objective_c:CONFIG += objective_c
# Pick a suitable default architecture for qmake-based applications.
# If the Qt package contains one of x86 and x86_64, pick that one. If it
# contains both then use the compiler default. Make a similiar decision for
# PowerPC-based systems. Note that this logic assumes that Qt has been
# configured with an architecture that is usable on the system.
qt:!isEmpty(QT_CONFIG) {
# Pick a suitable default architecture for qmake-based applications.
# If the Qt package contains one of x86 and x86_64, pick that one. If it
# contains both then use the compiler default. Make a similar decision for
# PowerPC-based systems. Note that this logic assumes that Qt has been
# configured with an architecture that is usable on the system.
contains(QMAKE_HOST.arch, ppc)|contains(QMAKE_HOST.arch, "Power Macintosh") {
!contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc
contains(QT_CONFIG, ppc64):!contains(QT_CONFIG, ppc):CONFIG += ppc64
@ -14,6 +14,9 @@ qt:!isEmpty(QT_CONFIG) {
!contains(QT_CONFIG, x86_64):contains(QT_CONFIG, x86):CONFIG += x86
contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64
}
# Ensure that C++11 is always used when linking against a static Qt build
contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11
}
isEmpty(_QMAKE_CACHE_) {

View File

@ -24,10 +24,13 @@ sysrootified =
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
QMAKE_INCDIR_OPENGL = $$sysrootified
QMAKESPEC_NAME = $$basename(QMAKESPEC)
# Resolve SDK version of various tools
for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB)) {
!isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool}) {
$$tool = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool})
tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
!isEmpty($$tool_variable) {
$$tool = $$eval($$tool_variable)
next()
}
@ -38,7 +41,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
isEmpty(sysrooted): next()
$$tool = $$sysrooted $$member(value, 1, -1)
!isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.$${tool}, set, $$tool)
!isEmpty(_QMAKE_CACHE_): cache($$tool_variable, set, $$tool)
}
isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {

View File

@ -74,17 +74,17 @@ defineTest(qtAddModule) {
}
unset(LINKAGE)
mac {
contains(MODULE_CONFIG, lib_bundle) {
mac:contains(MODULE_CONFIG, lib_bundle) {
FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
INCLUDEPATH *= $$FRAMEWORK_INCLUDE
LINKAGE = -F$${MODULE_LIBS}
} else {
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
}
auto_use_privates|isEqual(2, UsePrivate): \
INCLUDEPATH += \
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \
$$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX}
}
}
# Re-insert the major version in the library name (cf qtLibraryTarget above)
@ -187,9 +187,9 @@ defineTest(qtAddRpathLink) {
export(QMAKE_RPATHLINKDIR)
}
# variable, default
# variable, default, [suffix for variable for system() use]
defineTest(qtPrepareTool) {
$$1 = $$eval(QT_TOOL.$${2}.command)
$$1 = $$eval(QT_TOOL.$${2}.binary)
isEmpty($$1) {
$$1 = $$[QT_HOST_BINS]/$$2
exists($$eval($$1).pl) {
@ -202,17 +202,26 @@ defineTest(qtPrepareTool) {
$$1 = $$BUNDLENAME
}
}
$$1 = $$shell_path($$eval($$1))
}
export($$1)
!isEmpty(3) {
$$1$$3 = $$system_path($$eval($$1))
qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system)
}
$$1 = $$shell_path($$eval($$1))
qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, )
}
# target variable, list of env var names, [non-empty: prepare for system(), not make]
defineTest(qtAddToolEnv) {
isEmpty(3): \
ds = $$QMAKE_DIR_SEP
else: \
ds = $$DIR_SEPARATOR
for(env, 2) {
value = $$eval($${env}.value)
!isEmpty(value) {
name = $$eval($${env}.name)
equals(QMAKE_DIR_SEP, /) {
equals(ds, /) {
contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
else: infix =
val = "$$name=$$join(value, :)$$infix"
@ -222,20 +231,27 @@ defineTest(qtAddToolEnv) {
else: infix =
val = "(set $$name=$$join(value, ;)$$infix) &"
}
contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
else: val ~= s,\\\$,\$\$,g
isEmpty(3): !contains(TEMPLATE, vc.*) {
contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
val ~= s,\\\$,\$\$,g
}
$$1 = "$$val $$eval($$1)"
}
}
export($$1)
}
# target variable, dependency var name, [non-empty: prepare for system(), not make]
defineTest(qtAddTargetEnv) {
deps = $$replace(QT, -private$, )
deps = $$replace($$2, -private$, )
deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
!isEmpty(deps) {
for(dep, deps): \
deppath += $$shell_path($$eval(QT.$${dep}.libs))
for(dep, deps) {
isEmpty(3): \
deppath += $$shell_path($$eval(QT.$${dep}.libs))
else: \
deppath += $$system_path($$eval(QT.$${dep}.libs))
}
equals(QMAKE_HOST.os, Windows) {
deppath.name = PATH
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
@ -256,13 +272,18 @@ defineTest(qtAddTargetEnv) {
pluginpath.value =
for(qmod, QMAKEMODULES) {
qmod = $$section(qmod, /, 0, -3)/plugins
exists($$qmod): pluginpath.value += $$shell_path($$qmod)
exists($$qmod) {
isEmpty(3): \
pluginpath.value += $$shell_path($$qmod)
else: \
pluginpath.value += $$system_path($$qmod)
}
}
pluginpath.name = QT_PLUGIN_PATH
QT_TOOL_ENV += deppath pluginpath
}
qtAddToolEnv($$1, $$QT_TOOL_ENV)
qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3)
}
defineReplace(pkgConfigExecutable) {

View File

@ -91,14 +91,15 @@ else: \
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(release, debug|release) {
!debug_and_release|build_pass {
CONFIG -= qt_install_headers #no need to install these as well
FRAMEWORK_HEADERS.version = Versions
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
FRAMEWORK_HEADERS.path = Headers
}
QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS
CONFIG -= qt_install_headers #no need to install these as well
!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
}
}

View File

@ -19,17 +19,17 @@ CONFIG += console
!build_pass:if(!host_build|!force_bootstrap|force_independent) {
isEmpty(MODULE):MODULE = $$TARGET
MODULE_DEPENDS = $$replace(QT, -private$, )
!host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, )
load(qt_build_paths)
load(resolve_target)
cmd = $$shell_path($$QMAKE_RESOLVED_TARGET)
!host_build|!force_bootstrap: qtAddTargetEnv(cmd)
TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri
TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)"
TOOL_PRI_CONT = \
"QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \
"QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")"
write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.")
# Then, inject the new tool into the current cache state
@ -39,6 +39,7 @@ CONFIG += console
unset(added)
}
include($$TOOL_PRI)
cache(QT_TOOL.$${MODULE}.command, transient)
for(var, $$list(binary depends)): \
cache(QT_TOOL.$${MODULE}.$$var, transient)
}

View File

@ -1,4 +1,4 @@
qtPrepareTool(QMAKE_RCC, rcc)
qtPrepareTool(QMAKE_RCC, rcc, _DEP)
isEmpty(RCC_DIR):RCC_DIR = .
isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
@ -19,7 +19,7 @@ resource_combine {
}
}
rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
rcc.depend_command = $$QMAKE_RCC -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
rcc.CONFIG += add_inputs_as_makefile_deps
rcc.input = RESOURCES
rcc.variable_out = SOURCES

View File

@ -43,7 +43,7 @@ else: check.commands += $(DESTDIR_TARGET)
check.commands += $(TESTARGS)
# Add environment for non-installed builds
qtAddTargetEnv(check.commands)
qtAddTargetEnv(check.commands, QT)
# If the test is marked as insignificant, discard the exit code
insignificant_test:check.commands = -$${check.commands}

View File

@ -1,10 +1,10 @@
qtPrepareTool(QMAKE_UIC, uic)
qtPrepareTool(QMAKE_UIC, uic, _DEP)
isEmpty(UI_DIR):UI_DIR = .
isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_
uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
uic.depend_command = $$QMAKE_UIC -d ${QMAKE_FILE_IN}
uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN}
uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
uic.input = FORMS
uic.variable_out = GENERATED_FILES

View File

@ -4,23 +4,6 @@
# Mac OS X + XCode
#
MAKEFILE_GENERATOR = XCODE
CONFIG += lib_version_first incremental plugin_no_soname app_bundle
include(../$$[QMAKE_XSPEC]/qmake.conf)
include(../common/macx.conf)
include(../common/gcc-base-mac.conf)
include(../common/g++-macx.conf)
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
QMAKE_LINK =
QMAKE_LINK_C =
QMAKE_LINK_C_SHLIB =
QMAKE_LINK_SHLIB =
QMAKE_CFLAGS_HIDESYMS =
QMAKE_LFLAGS_VERSION =
QMAKE_LFLAGS_COMPAT_VERSION =
QMAKE_LFLAGS_SONAME =
QMAKE_INCDIR += /usr/local/include /System/Library/Frameworks/CarbonCore.framework/Headers
load(qt_config)
MAKEFILE_GENERATOR = XCODE

View File

@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
const char _CLCompile[] = "ClCompile";
const char _ItemGroup[] = "ItemGroup";
const char _Link[] = "Link";
const char _ManifestTool[] = "ManifestTool";
const char _Midl[] = "Midl";
const char _ResourceCompile[] = "ResourceCompile";
@ -104,6 +105,7 @@ const char _DisableSpecificWarnings[] = "DisableSpecificWarnings";
const char _DisplayLibrary[] = "DisplayLibrary";
const char _DLLDataFileName[] = "DLLDataFileName";
const char _EmbedManagedResourceFile[] = "EmbedManagedResourceFile";
const char _EmbedManifest[] = "EmbedManifest";
const char _EnableCOMDATFolding[] = "EnableCOMDATFolding";
const char _EnableUAC[] = "EnableUAC";
const char _EnableErrorChecks[] = "EnableErrorChecks";
@ -1657,6 +1659,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
<< attrTagS(_UseOfATL, toString(tool.UseOfATL))
<< attrTagS(_UseOfMfc, toString(tool.UseOfMfc))
<< attrTagT(_WholeProgramOptimization, tool.WholeProgramOptimization)
<< attrTagT(_EmbedManifest, tool.manifestTool.EmbedManifest)
<< closetag();
}

View File

@ -97,6 +97,7 @@ const char _Description[] = "Description";
const char _Detect64BitPortabilityProblems[] = "Detect64BitPortabilityProblems";
const char _DisableLanguageExtensions[] = "DisableLanguageExtensions";
const char _DisableSpecificWarnings[] = "DisableSpecificWarnings";
const char _EmbedManifest[] = "EmbedManifest";
const char _EnableCOMDATFolding[] = "EnableCOMDATFolding";
const char _EnableErrorChecks[] = "EnableErrorChecks";
const char _EnableEnhancedInstructionSet[] = "EnableEnhancedInstructionSet";
@ -224,6 +225,7 @@ const char _ValidateParameters[] = "ValidateParameters";
const char _VCCLCompilerTool[] = "VCCLCompilerTool";
const char _VCLibrarianTool[] = "VCLibrarianTool";
const char _VCLinkerTool[] = "VCLinkerTool";
const char _VCManifestTool[] = "VCManifestTool";
const char _VCCustomBuildTool[] = "VCCustomBuildTool";
const char _VCResourceCompilerTool[] = "VCResourceCompilerTool";
const char _VCMIDLTool[] = "VCMIDLTool";
@ -1718,6 +1720,23 @@ bool VCLinkerTool::parseOption(const char* option)
return found;
}
// VCManifestTool ---------------------------------------------------
VCManifestTool::VCManifestTool()
: EmbedManifest(unset)
{
}
VCManifestTool::~VCManifestTool()
{
}
bool VCManifestTool::parseOption(const char *option)
{
Q_UNUSED(option);
// ### implement if we introduce QMAKE_MT_FLAGS
return false;
}
// VCMIDLTool -------------------------------------------------------
VCMIDLTool::VCMIDLTool()
: DefaultCharType(midlCharUnsigned),
@ -2335,7 +2354,6 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
CustomBuildTool.Outputs += out;
deps += CustomBuildTool.AdditionalDependencies;
deps += cmd.left(cmd.indexOf(' '));
// Make sure that all deps are only once
QHash<QString, bool> uniqDeps;
for (int c = 0; c < deps.count(); ++c) {
@ -2634,6 +2652,14 @@ void VCProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< closetag(_Tool);
}
void VCProjectWriter::write(XmlOutput &xml, const VCManifestTool &tool)
{
xml << tag(_Tool)
<< attrS(_Name, _VCManifestTool)
<< attrT(_EmbedManifest, tool.EmbedManifest)
<< closetag(_Tool);
}
void VCProjectWriter::write(XmlOutput &xml, const VCMIDLTool &tool)
{
xml << tag(_Tool)
@ -2765,6 +2791,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
write(xml, tool.librarian);
else
write(xml, tool.linker);
write(xml, tool.manifestTool);
write(xml, tool.idl);
write(xml, tool.postBuild);
write(xml, tool.preBuild);

View File

@ -675,6 +675,16 @@ public:
VCConfiguration* config;
};
class VCManifestTool : public VCToolBase
{
public:
VCManifestTool();
~VCManifestTool();
bool parseOption(const char* option);
triState EmbedManifest;
};
class VCMIDLTool : public VCToolBase
{
public:
@ -874,6 +884,7 @@ public:
VCCLCompilerTool compiler;
VCLinkerTool linker;
VCLibrarianTool librarian;
VCManifestTool manifestTool;
VCCustomBuildTool custom;
VCMIDLTool idl;
VCPostBuildEventTool postBuild;
@ -1127,6 +1138,7 @@ public:
virtual void write(XmlOutput &, const VCCLCompilerTool &);
virtual void write(XmlOutput &, const VCLinkerTool &);
virtual void write(XmlOutput &, const VCManifestTool &);
virtual void write(XmlOutput &, const VCMIDLTool &);
virtual void write(XmlOutput &, const VCCustomBuildTool &);
virtual void write(XmlOutput &, const VCLibrarianTool &);

View File

@ -925,6 +925,7 @@ void VcprojGenerator::initConfiguration()
conf.linker.GenerateDebugInformation = isDebug ? _True : _False;
initLinkerTool();
}
initManifestTool();
initResourceTool();
initIDLTool();
@ -1045,6 +1046,19 @@ void VcprojGenerator::initLibrarianTool()
conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS").toQStringList();
}
void VcprojGenerator::initManifestTool()
{
VCManifestTool &tool = vcProject.Configuration.manifestTool;
const ProString tmplt = project->first("TEMPLATE");
if ((tmplt == "vclib"
&& !project->isActiveConfig("embed_manifest_dll")
&& !project->isActiveConfig("static"))
|| (tmplt == "vcapp"
&& !project->isActiveConfig("embed_manifest_exe"))) {
tool.EmbedManifest = _False;
}
}
void VcprojGenerator::initLinkerTool()
{
VCConfiguration &conf = vcProject.Configuration;

View File

@ -102,6 +102,7 @@ protected:
void initCompilerTool();
void initLinkerTool();
void initLibrarianTool();
void initManifestTool();
void initResourceTool();
void initIDLTool();
void initCustomBuildTool();

View File

@ -1037,7 +1037,7 @@ void QMakeEvaluator::loadDefaults()
# endif
#elif defined(Q_OS_UNIX)
struct utsname name;
if (!uname(&name)) {
if (uname(&name) != -1) {
vars[ProKey("QMAKE_HOST.os")] << ProString(name.sysname);
vars[ProKey("QMAKE_HOST.name")] << ProString(QString::fromLocal8Bit(name.nodename));
vars[ProKey("QMAKE_HOST.version")] << ProString(name.release);
@ -1224,7 +1224,7 @@ bool QMakeEvaluator::loadSpec()
m_qmakespec = QDir::cleanPath(qmakespec);
if (!m_superfile.isEmpty()
&& evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) {
&& evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) {
return false;
}
if (!loadSpecInternal())
@ -1820,7 +1820,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile(
m_current = m_locationStack.pop();
pro->deref();
#ifdef PROEVALUATOR_FULL
if (ok == ReturnTrue) {
if (ok == ReturnTrue && !(flags & LoadHidden)) {
ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
ProString ifn(fileName);
if (!iif.contains(ifn))

View File

@ -102,7 +102,8 @@ public:
LoadPreFiles = 1,
LoadPostFiles = 2,
LoadAll = LoadPreFiles|LoadPostFiles,
LoadSilent = 0x10
LoadSilent = 0x10,
LoadHidden = 0x20
};
Q_DECLARE_FLAGS(LoadFlags, LoadFlag)

View File

@ -90,7 +90,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri
TOOL_PRI_CONT = "QT_TOOL.syncqt.command = $$val_escape(cmd)"
TOOL_PRI_CONT = "QT_TOOL.syncqt.binary = $$val_escape(cmd)"
write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.")
# Then, inject the new tool into the current cache state
@ -99,7 +99,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added)
}
include($$TOOL_PRI)
cache(QT_TOOL.syncqt.command, transient)
cache(QT_TOOL.syncqt.binary, transient)
}

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.qtproject.example">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name">
<activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden" >
<activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden|navigation" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

View File

@ -80,6 +80,8 @@ list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
!!ENDIF
set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
!!IF contains(QT_CONFIG, reduce_exports)
set(QT_VISIBILITY_AVAILABLE \"True\")
!!ENDIF

View File

@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_TEXTCODEC
#if defined(Q_OS_MAC) || defined(Q_OS_IOS) || defined(Q_OS_ANDROID) || defined(Q_OS_QNX)
#if defined(Q_OS_MAC) || defined(Q_OS_ANDROID) || defined(Q_OS_QNX)
#define QT_LOCALE_IS_UTF8
#endif

View File

@ -30,9 +30,12 @@ SOURCES += \
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# configure creates these, not syncqt, so we need to manually inject them
targ_headers.files += \
qconfig_h_files = \
$$OUT_PWD/global/qconfig.h \
$$QT_BUILD_TREE/include/QtCore/QtConfig
targ_headers.files += $$qconfig_h_files
contains(QMAKE_BUNDLE_DATA, FRAMEWORK_HEADERS): \
FRAMEWORK_HEADERS.files += $$qconfig_h_files
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h

View File

@ -1042,7 +1042,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\enum QSysInfo::MacVersion
This enum provides symbolic names for the various versions of the
Macintosh operating system. On Mac, the
OS X operating system. On OS X, the
QSysInfo::MacintoshVersion variable gives the version of the
system on which the application is run.
@ -1054,8 +1054,9 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value MV_10_4 Mac OS X 10.4 (unsupported)
\value MV_10_5 Mac OS X 10.5 (unsupported)
\value MV_10_6 Mac OS X 10.6
\value MV_10_7 Mac OS X 10.7
\value MV_10_8 Mac OS X 10.8
\value MV_10_7 OS X 10.7
\value MV_10_8 OS X 10.8
\value MV_10_9 OS X 10.9
\value MV_Unknown An unknown and currently unsupported platform
\value MV_CHEETAH Apple codename for MV_10_0
@ -1067,6 +1068,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value MV_SNOWLEOPARD Apple codename for MV_10_6
\value MV_LION Apple codename for MV_10_7
\value MV_MOUNTAINLION Apple codename for MV_10_8
\value MV_MAVERICKS Apple codename for MV_10_9
\sa WinVersion
*/
@ -1694,7 +1696,7 @@ Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
QSysInfo::MacVersion QSysInfo::macVersion()
{
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
SInt32 gestalt_version;
if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) {
return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2);

View File

@ -917,21 +917,19 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const QString &message)
{
#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
wchar_t contextFileL[256];
// we probably should let the compiler do this for us, by
// declaring QMessageLogContext::file to be const wchar_t * in
// the first place, but the #ifdefery above is very complex
// and we wouldn't be able to change it later on...
convert_to_wchar_t_elided(contextFileL, sizeof contextFileL / sizeof *contextFileL, context.file);
wchar_t contextFileL[256];
// we probably should let the compiler do this for us, by declaring QMessageLogContext::file to
// be const wchar_t * in the first place, but the #ifdefery above is very complex and we
// wouldn't be able to change it later on...
convert_to_wchar_t_elided(contextFileL, sizeof contextFileL / sizeof *contextFileL,
context.file);
// get the current report mode
int reportMode = _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_WNDW);
_CrtSetReportMode(_CRT_ERROR, reportMode);
int ret = _CrtDbgReportW(_CRT_ERROR, contextFileL,
context.line, _CRT_WIDE(QT_VERSION_STR),
reinterpret_cast<const wchar_t *> (
message.utf16()));
if (ret == 0 && reportMode & _CRTDBG_MODE_WNDW)
int ret = _CrtDbgReportW(_CRT_ERROR, contextFileL, context.line, _CRT_WIDE(QT_VERSION_STR),
reinterpret_cast<const wchar_t *>(message.utf16()));
if ((ret == 0) && (reportMode & _CRTDBG_MODE_WNDW))
return; // ignore
else if (ret == 1)
_CrtDbgBreak();

View File

@ -980,6 +980,8 @@ public:
Key_TouchpadOn = 0x01000111,
Key_TouchpadOff = 0x01000112,
Key_MicMute = 0x01000113,
Key_MediaLast = 0x0100ffff,
// Keypad navigation keys

View File

@ -1621,6 +1621,7 @@
\value Key_TouchpadToggle
\value Key_TouchpadOn
\value Key_TouchpadOff
\value Key_MicMute
\value Key_MediaLast
\value Key_unknown

View File

@ -132,6 +132,7 @@ public:
MV_10_6 = 0x0008,
MV_10_7 = 0x0009,
MV_10_8 = 0x000A,
MV_10_9 = 0x000B,
/* codenames */
MV_CHEETAH = MV_10_0,
@ -142,7 +143,8 @@ public:
MV_LEOPARD = MV_10_5,
MV_SNOWLEOPARD = MV_10_6,
MV_LION = MV_10_7,
MV_MOUNTAINLION = MV_10_8
MV_MOUNTAINLION = MV_10_8,
MV_MAVERICKS = MV_10_9
};
static const MacVersion MacintoshVersion;
static MacVersion macVersion();

View File

@ -207,12 +207,18 @@
# if !defined(__MAC_10_8)
# define __MAC_10_8 1080
# endif
# if !defined(__MAC_10_9)
# define __MAC_10_9 1090
# endif
# if !defined(MAC_OS_X_VERSION_10_7)
# define MAC_OS_X_VERSION_10_7 1070
# endif
# if !defined(MAC_OS_X_VERSION_10_8)
# define MAC_OS_X_VERSION_10_8 1080
# endif
# if !defined(MAC_OS_X_VERSION_10_9)
# define MAC_OS_X_VERSION_10_9 1090
# endif
#
# if !defined(__IPHONE_4_3)
# define __IPHONE_4_3 40300
@ -229,9 +235,12 @@
# if !defined(__IPHONE_6_1)
# define __IPHONE_6_1 60100
# endif
# if !defined(__IPHONE_7_0)
# define __IPHONE_7_0 70000
# endif
#
# if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_8)
# warning "This version of Mac OS X is unsupported"
# warning "This version of OS X is unsupported"
# endif
#endif

View File

@ -510,11 +510,12 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
}
if (slash) {
const QByteArray chunk = QFile::encodeName(dirName.left(slash));
QT_STATBUF st;
if (QT_STAT(chunk.constData(), &st) != -1) {
if ((st.st_mode & S_IFMT) != S_IFDIR)
return false;
} else if (QT_MKDIR(chunk.constData(), 0777) != 0) {
if (QT_MKDIR(chunk.constData(), 0777) != 0) {
if (errno == EEXIST) {
QT_STATBUF st;
if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
continue;
}
return false;
}
}

View File

@ -1034,6 +1034,10 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
}
if (oldslash != -1)
oldslash = dirName.indexOf(QDir::separator(), oldslash);
} else if (dirName.size() > 2
&& dirName.at(1) == QLatin1Char(':')) {
// Don't try to call mkdir with just a drive letter
oldslash = 2;
}
for (int slash=0; slash != -1; oldslash = slash) {
slash = dirName.indexOf(QDir::separator(), oldslash+1);
@ -1044,14 +1048,13 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
}
if (slash) {
QString chunk = dirName.left(slash);
bool existed = false;
if (!isDirPath(chunk, &existed)) {
if (!existed) {
if (!mkDir(chunk))
return false;
} else {
return false;
if (!mkDir(chunk)) {
if (GetLastError() == ERROR_ALREADY_EXISTS) {
bool existed = false;
if (isDirPath(chunk, &existed) && existed)
continue;
}
return false;
}
}
}

View File

@ -65,7 +65,7 @@
#include "qglobal.h"
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
#include <CoreServices/CoreServices.h>
#endif

View File

@ -72,7 +72,6 @@ public:
QByteArray iid;
QList<QLibraryPrivate*> libraryList;
QMap<QString,QLibraryPrivate*> keyMap;
QStringList keyList;
QString suffix;
Qt::CaseSensitivity cs;
QStringList loadedPaths;
@ -176,10 +175,8 @@ void QFactoryLoader::update()
metaDataOk = true;
QJsonArray k = object.value(QLatin1String("Keys")).toArray();
for (int i = 0; i < k.size(); ++i) {
QString s = k.at(i).toString();
keys += s;
}
for (int i = 0; i < k.size(); ++i)
keys += d->cs ? k.at(i).toString() : k.at(i).toString().toLower();
}
if (qt_debug_component())
qDebug() << "Got keys from plugin meta data" << keys;
@ -190,15 +187,13 @@ void QFactoryLoader::update()
continue;
}
d->libraryList += library;
int keyUsageCount = 0;
for (int k = 0; k < keys.count(); ++k) {
// first come first serve, unless the first
// library was built with a future Qt version,
// whereas the new one has a Qt version that fits
// better
QString key = keys.at(k);
if (!d->cs)
key = key.toLower();
const QString &key = keys.at(k);
QLibraryPrivate *previous = d->keyMap.value(key);
int prev_qt_version = 0;
if (previous) {
@ -207,9 +202,13 @@ void QFactoryLoader::update()
int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble();
if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) {
d->keyMap[key] = library;
d->keyList += keys.at(k);
++keyUsageCount;
}
}
if (keyUsageCount || keys.isEmpty())
d->libraryList += library;
else
library->release();
}
}
#else

View File

@ -83,9 +83,9 @@
# define old_qDebug qDebug
# undef qDebug
# endif
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
# include <CoreServices/CoreServices.h>
#endif //Q_OS_IOS
#endif // Q_OS_MACX
# ifdef old_qDebug
# undef qDebug

View File

@ -16,11 +16,12 @@ set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS})
macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ELSE
set(imported_location \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ENDIF
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
!!ELSE

View File

@ -94,9 +94,12 @@
#include <QtGui/QClipboard>
#endif
#ifdef Q_OS_MAC
#if defined(Q_OS_MAC)
# include "private/qcore_mac_p.h"
#endif
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
# include <QtCore/qt_windows.h>
# include <QtCore/QLibraryInfo>
#endif // Q_OS_WIN && !Q_OS_WINCE
QT_BEGIN_NAMESPACE
@ -789,6 +792,12 @@ static void init_platform(const QString &pluginArgument, const QString &platform
fatalMessage += QStringLiteral("Available platforms are: %1\n").arg(
keys.join(QStringLiteral(", ")));
fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating.");
#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.
if (!QLibraryInfo::isDebugBuild() && !GetConsoleWindow())
MessageBox(0, (LPCTSTR)fatalMessage.utf16(), (LPCTSTR)(QCoreApplication::applicationName().utf16()), MB_OK | MB_ICONERROR);
#endif // Q_OS_WIN && !Q_OS_WINCE
qFatal("%s", qPrintable(fatalMessage));
return;
}

View File

@ -752,7 +752,8 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria
static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName)
{
// headerName is not empty here
if (headerName.isEmpty())
return QNetworkRequest::KnownHeaders(-1);
switch (tolower(headerName.at(0))) {
case 'c':

View File

@ -5,35 +5,34 @@
**
** This file is part of the QtGui module 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.
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** 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.
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** 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.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**

View File

@ -5,35 +5,34 @@
**
** This file is part of the QtGui module 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.
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** 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.
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** 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.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**

View File

@ -41,7 +41,7 @@
#include "qglobal.h"
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
#import <Cocoa/Cocoa.h>
#import <IOKit/graphics/IOGraphicsLib.h>
#endif
@ -107,7 +107,7 @@ static NSInteger languageMapSort(id obj1, id obj2, void *context)
QCoreTextFontDatabase::QCoreTextFontDatabase()
{
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
QSettings appleSettings(QLatin1String("apple.com"));
QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
if (appleValue.isValid())
@ -408,7 +408,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
static bool didPopulateStyleFallbacks = false;
if (!didPopulateStyleFallbacks) {
#if !defined(Q_OS_IOS)
#if defined(Q_OS_MACX)
// Ensure we have the psNameToFamily mapping set up
const_cast<QCoreTextFontDatabase*>(this)->populateFontDatabase();
@ -457,7 +457,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
return fallbackLists[styleLookupKey.arg(styleHint)];
}
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8

View File

@ -55,7 +55,7 @@ public:
QFontEngine *fontEngine(const QFontDef &fontDef, QChar::Script script, void *handle);
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const;
#ifndef Q_OS_IOS
#ifdef Q_OS_MACX
QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName);
#endif
void releaseHandle(void *handle);

View File

@ -430,8 +430,9 @@ QAccessible::State QAccessibleMdiSubWindow::state() const
state.focused = true;
if (!mdiSubWindow()->isVisible())
state.invisible = true;
if (!mdiSubWindow()->parentWidget()->contentsRect().contains(mdiSubWindow()->geometry()))
state.offscreen = true;
if (const QWidget *parent = mdiSubWindow()->parentWidget())
if (!parent->contentsRect().contains(mdiSubWindow()->geometry()))
state.offscreen = true;
if (!mdiSubWindow()->isEnabled())
state.disabled = true;
return state;

View File

@ -333,7 +333,7 @@ namespace QtAndroidInput
return Qt::Key_BracketLeft;
case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD
return Qt::Key_Forward;
return Qt::Key_AudioForward;
case 0x00000057:
return Qt::Key_MediaNext;
@ -344,7 +344,7 @@ namespace QtAndroidInput
case 0x00000058:
return Qt::Key_MediaPrevious;
case 0x00000059:
case 0x00000059: // KEYCODE_MEDIA_REWIND
return Qt::Key_AudioRewind;
case 0x00000056:
@ -356,8 +356,8 @@ namespace QtAndroidInput
case 0x00000045:
return Qt::Key_Minus;
case 0x0000005b:
return Qt::Key_VolumeMute;
case 0x0000005b: // KEYCODE_MUTE
return Qt::Key_MicMute;
case 0x0000004e:
return Qt::Key_NumLock;
@ -405,6 +405,9 @@ namespace QtAndroidInput
case 0x00000019:
return Qt::Key_VolumeDown;
case 0x000000a4: // KEYCODE_VOLUME_MUTE
return Qt::Key_VolumeMute;
case 0x00000018:
return Qt::Key_VolumeUp;

View File

@ -46,11 +46,11 @@
#include <QtGui>
#include <qpa/qplatformaccessibility.h>
class QCococaAccessibility : public QPlatformAccessibility
class QCocoaAccessibility : public QPlatformAccessibility
{
public:
QCococaAccessibility();
~QCococaAccessibility();
QCocoaAccessibility();
~QCocoaAccessibility();
void notifyAccessibilityUpdate(QAccessibleEvent *event);
void setRootObject(QObject *o);
void initialize();
@ -79,6 +79,7 @@ namespace QCocoaAccessible {
NSString *macRole(QAccessibleInterface *interface);
bool shouldBeIgnored(QAccessibleInterface *interface);
NSArray *unignoredChildren(id parentObject, QAccessibleInterface *interface);
NSString *getTranslatedAction(const QString &qtAction);
NSMutableArray *createTranslatedActionsList(const QStringList &qtActions);
QString translateAction(NSString *nsAction);

View File

@ -44,17 +44,17 @@
#include <QtGui/private/qaccessible2_p.h>
#include <private/qcore_mac_p.h>
QCococaAccessibility::QCococaAccessibility()
QCocoaAccessibility::QCocoaAccessibility()
{
}
QCococaAccessibility::~QCococaAccessibility()
QCocoaAccessibility::~QCocoaAccessibility()
{
}
void QCococaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
void QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
QObject *object = event->object();
if (!object)
@ -78,17 +78,17 @@ void QCococaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
}
}
void QCococaAccessibility::setRootObject(QObject *o)
void QCocoaAccessibility::setRootObject(QObject *o)
{
Q_UNUSED(o)
}
void QCococaAccessibility::initialize()
void QCocoaAccessibility::initialize()
{
}
void QCococaAccessibility::cleanup()
void QCocoaAccessibility::cleanup()
{
}
@ -223,6 +223,26 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
return false;
}
NSArray *unignoredChildren(id parentObject, QAccessibleInterface *interface)
{
int numKids = interface->childCount();
// qDebug() << "Children for: " << axid << iface << " are: " << numKids;
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
QAccessibleInterface *child = interface->child(i);
Q_ASSERT(child);
if (child->state().invalid || child->state().invisible)
continue;
QAccessible::Id childId = QAccessible::uniqueId(child);
//qDebug() << " kid: " << childId << child;
QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId:childId parent:parentObject];
[kids addObject: element];
[element release];
}
return NSAccessibilityUnignoredChildren(kids);
}
/*
Translates a predefined QAccessibleActionInterface action to a Mac action constant.
Returns 0 if the Qt Action has no mac equivalent. Ownership of the NSString is

View File

@ -137,22 +137,7 @@
} else if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
return NSAccessibilityRoleDescription(role, nil);
} else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
int numKids = iface->childCount();
// qDebug() << "Children for: " << axid << iface << " are: " << numKids;
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
QAccessibleInterface *child = iface->child(i);
Q_ASSERT(child);
QAccessible::Id childId = QAccessible::uniqueId(child);
//qDebug() << " kid: " << childId << child;
QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId:childId parent:self];
[kids addObject: element];
[element release];
}
return NSAccessibilityUnignoredChildren(kids);
return QCocoaAccessible::unignoredChildren(self, iface);
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
// Just check if the app thinks we're focused.
id focusedElement = [NSApp accessibilityAttributeValue:NSAccessibilityFocusedUIElementAttribute];

View File

@ -100,6 +100,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
mDialogIsExecuting = false;
mResultSet = false;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7)
[mColorPanel setRestorable:NO];
#endif
if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) {
mStolenContentView = 0;
mOkButton = 0;
@ -276,6 +281,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
- (void)showModelessPanel
{
mDialogIsExecuting = false;
mResultSet = false;
[mColorPanel makeKeyAndOrderFront:mColorPanel];
}
@ -369,10 +375,8 @@ void QCocoaColorDialogHelper::exec()
bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent)
{
if (windowModality == Qt::WindowModal) {
// Cocoa's shared color panel cannot be shown as a sheet
return false;
}
if (windowModality == Qt::WindowModal)
windowModality = Qt::ApplicationModal;
return showCocoaColorPanel(windowModality, parent);
}
@ -435,9 +439,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal
createNSColorPanelDelegate();
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
if (windowModality == Qt::NonModal)
if (windowModality != Qt::WindowModal)
[delegate showModelessPanel];
// no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel()
// no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case
return true;
}

View File

@ -219,7 +219,7 @@ QCocoaIntegration::QCocoaIntegration()
, mEventDispatcher(new QCocoaEventDispatcher())
, mInputContext(new QCocoaInputContext)
#ifndef QT_NO_ACCESSIBILITY
, mAccessibility(new QCococaAccessibility)
, mAccessibility(new QCocoaAccessibility)
#endif
, mCocoaClipboard(new QCocoaClipboard)
, mCocoaDrag(new QCocoaDrag)

View File

@ -238,6 +238,8 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
setGeometry(tlw->geometry());
recreateWindow(parent());
tlw->setGeometry(geometry());
if (tlw->isTopLevel())
setWindowIcon(tlw->icon());
m_inConstructor = false;
}

View File

@ -1288,7 +1288,7 @@ static QTouchDevice *touchDevice = 0;
NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType,
NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType,
NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType,
NSRTFDPboardType, NSHTMLPboardType, NSPICTPboardType,
NSRTFDPboardType, NSHTMLPboardType,
NSURLPboardType, NSPDFPboardType, NSVCardPboardType,
NSFilesPromisePboardType, NSInkTextPboardType,
NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil];

View File

@ -74,21 +74,7 @@
} else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
if (!m_window->accessibleRoot())
return [super accessibilityAttributeValue:attribute];
// Create QCocoaAccessibleElements for each child if the
// root accessible interface.
int numKids = m_window->accessibleRoot()->childCount();
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
QAccessibleInterface *child = m_window->accessibleRoot()->child(i);
Q_ASSERT(child);
QAccessible::Id childAxid = QAccessible::uniqueId(child);
QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId:childAxid parent:self];
[kids addObject: element];
[element release];
}
return NSAccessibilityUnignoredChildren(kids);
return QCocoaAccessible::unignoredChildren(self, m_window->accessibleRoot());
} else {
return [super accessibilityAttributeValue:attribute];
}

View File

@ -1720,7 +1720,9 @@ int QWindowsXpNativeFileDialog::existingDirCallback(HWND hwnd, UINT uMsg, LPARAM
{
switch (uMsg) {
case BFFM_INITIALIZED: {
const QString initialFile = m_data.selectedFile();
if (!m_title.isEmpty())
SetWindowText(hwnd, (wchar_t *)m_title.utf16());
const QString initialFile = QDir::toNativeSeparators(m_data.directory());
if (!initialFile.isEmpty())
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, LPARAM(initialFile.utf16()));
}
@ -1743,8 +1745,7 @@ QStringList QWindowsXpNativeFileDialog::execExistingDir(HWND owner)
initPath[0] = 0;
bi.hwndOwner = owner;
bi.pidlRoot = NULL;
//### This does not seem to be respected? - the dialog always displays "Browse for folder"
bi.lpszTitle = (wchar_t*)m_title.utf16();
bi.lpszTitle = 0;
bi.pszDisplayName = initPath;
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_NEWDIALOGSTYLE;
bi.lpfn = xpFileDialogGetExistingDirCallbackProc;

View File

@ -837,6 +837,8 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) :
const qreal opacity = qt_window_private(aWindow)->opacity;
if (!qFuzzyCompare(opacity, qreal(1.0)))
setOpacity(opacity);
if (aWindow->isTopLevel())
setWindowIcon(aWindow->icon());
clearFlag(WithinCreate);
}

View File

@ -248,6 +248,7 @@
#define XF86XK_TouchpadToggle 0x1008FFA9
#define XF86XK_TouchpadOn 0x1008FFB0
#define XF86XK_TouchpadOff 0x1008FFB1
#define XF86XK_AudioMicMute 0x1008FFB2
// end of XF86keysyms.h
@ -543,6 +544,7 @@ static const unsigned int KeyTbl[] = {
XF86XK_TouchpadToggle, Qt::Key_TouchpadToggle,
XF86XK_TouchpadOn, Qt::Key_TouchpadOn,
XF86XK_TouchpadOff, Qt::Key_TouchpadOff,
XF86XK_AudioMicMute, Qt::Key_MicMute,
XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 6: remap properly
XF86XK_Launch1, Qt::Key_Launch3,
XF86XK_Launch2, Qt::Key_Launch4,

View File

@ -458,6 +458,8 @@ void QXcbWindow::create()
const qreal opacity = qt_window_private(window())->opacity;
if (!qFuzzyCompare(opacity, qreal(1.0)))
setOpacity(opacity);
if (window()->isTopLevel())
setWindowIcon(window()->icon());
}
QXcbWindow::~QXcbWindow()
@ -1367,10 +1369,10 @@ void QXcbWindow::requestActivateWindow()
event.data.data32[4] = 0;
Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, m_screen->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event));
} else {
Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time()));
}
Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time()));
connection()->sync();
}

View File

@ -104,11 +104,6 @@ QT_BEGIN_NAMESPACE
QPageSetupDialogPrivate::QPageSetupDialogPrivate(QPrinter *prntr) : printer(0), ownsPrinter(false)
{
setPrinter(prntr);
init();
}
void QPageSetupDialogPrivate::init()
{
}
void QPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter)

View File

@ -73,7 +73,6 @@ class QPageSetupDialogPrivate : public QDialogPrivate
public:
QPageSetupDialogPrivate(QPrinter *printer);
virtual void init();
void setPrinter(QPrinter *newPrinter);
QPrinter *printer;

View File

@ -574,14 +574,18 @@ void QPageSetupWidget::setRightMargin(double newValue)
QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent)
: QDialog(*(new QUnixPageSetupDialogPrivate(printer)), parent)
{
Q_D(QPageSetupDialog);
setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
}
QPageSetupDialog::QPageSetupDialog(QWidget *parent)
: QDialog(*(new QUnixPageSetupDialogPrivate(0)), parent)
{
Q_D(QPageSetupDialog);
setWindowTitle(QCoreApplication::translate("QPrintPreviewDialog", "Page Setup"));
static_cast<QUnixPageSetupDialogPrivate *>(d)->init();
}
int QPageSetupDialog::exec()

View File

@ -4140,11 +4140,12 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
if (match) {
tags += manifestMetaContent[idx].tags;
foreach (const QString &attr, manifestMetaContent[idx].attributes) {
QStringList attrList = attr.split(QLatin1Char(':'), QString::SkipEmptyParts);
QLatin1Char div(':');
QStringList attrList = attr.split(div);
if (attrList.count() == 1)
attrList.append(QStringLiteral("true"));
if (attrList.count() == 2)
writer.writeAttribute(attrList[0], attrList[1]);
QString attrName = attrList.takeFirst();
writer.writeAttribute(attrName, attrList.join(div));
}
}
}

View File

@ -1893,6 +1893,8 @@ void QColorDialog::setOptions(ColorDialogOptions options)
d->options->setOptions(QColorDialogOptions::ColorDialogOptions(int(options)));
d->buttons->setVisible(!(options & NoButtons));
d->showAlpha(options & ShowAlphaChannel);
if (options & DontUseNativeDialog)
d->nativeDialogInUse = false;
}
QColorDialog::ColorDialogOptions QColorDialog::options() const
@ -1911,8 +1913,8 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const
\value ShowAlphaChannel Allow the user to select the alpha component of a color.
\value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".)
\value DontUseNativeDialog Use Qt's standard color dialog on the Mac instead of Apple's
native color panel.
\value DontUseNativeDialog Use Qt's standard color dialog instead of the operating system
native color dialog.
\sa options, setOption(), testOption(), windowModality()
*/

View File

@ -1392,7 +1392,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
#if !defined(QT_NO_TEXTEDIT)
if (e == QKeySequence::Copy) {
if (d->detailsText->isVisible() && d->detailsText->copy()) {
if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) {
e->setAccepted(true);
return;
}

View File

@ -2842,6 +2842,37 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
break;
}
switch (e->type()) {
case QEvent::KeyPress:
{
bool isWidget = receiver->isWidgetType();
bool isWindow = receiver->isWindowType();
bool isGraphicsWidget = false;
#ifndef QT_NO_GRAPHICSVIEW
isGraphicsWidget = !isWidget && !isWindow && qobject_cast<QGraphicsWidget *>(receiver);
#endif
if (!isWidget && !isGraphicsWidget && !isWindow) {
return d->notify_helper(receiver, e);
}
QKeyEvent* key = static_cast<QKeyEvent*>(e);
#ifndef QT_NO_SHORTCUT
// Try looking for a Shortcut before sending key events
if (qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key))
return true;
#endif
qt_in_tab_key_event = (key->key() == Qt::Key_Backtab
|| key->key() == Qt::Key_Tab
|| key->key() == Qt::Key_Left
|| key->key() == Qt::Key_Up
|| key->key() == Qt::Key_Right
|| key->key() == Qt::Key_Down);
}
default:
break;
}
bool res = false;
if (!receiver->isWidgetType()) {
res = d->notify_helper(receiver, e);
@ -2855,25 +2886,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
#ifndef QT_NO_GRAPHICSVIEW
isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
#endif
if (!isWidget && !isGraphicsWidget) {
res = d->notify_helper(receiver, e);
break;
}
QKeyEvent* key = static_cast<QKeyEvent*>(e);
if (key->type()==QEvent::KeyPress) {
#ifndef QT_NO_SHORTCUT
// Try looking for a Shortcut before sending key events
if ((res = qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key)))
return res;
#endif
qt_in_tab_key_event = (key->key() == Qt::Key_Backtab
|| key->key() == Qt::Key_Tab
|| key->key() == Qt::Key_Left
|| key->key() == Qt::Key_Up
|| key->key() == Qt::Key_Right
|| key->key() == Qt::Key_Down);
}
bool def = key->isAccepted();
QPointer<QObject> pr = receiver;
while (receiver) {

View File

@ -51,6 +51,7 @@
#include <private/qapplication_p.h>
#include <private/qshortcutmap_p.h>
#include <private/qaction_p.h>
#include <private/qwidgetwindow_qpa_p.h>
QT_BEGIN_NAMESPACE
@ -86,6 +87,20 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
if (QApplication::activePopupWidget())
active_window = QApplication::activePopupWidget();
if (!active_window) {
QWindow *qwindow = QGuiApplication::focusWindow();
if (qwindow && qwindow->isActive()) {
while (qwindow) {
QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(qwindow);
if (widgetWindow) {
active_window = widgetWindow->widget();
break;
}
qwindow = qwindow->parent();
}
}
}
if (!active_window)
return false;
@ -106,6 +121,18 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
w = s->parentWidget();
}
if (!w) {
QWindow *qwindow = qobject_cast<QWindow *>(object);
while (qwindow) {
QWidgetWindow *widget_window = qobject_cast<QWidgetWindow *>(qwindow);
if (widget_window) {
w = widget_window->widget();
break;
}
qwindow = qwindow->parent();
}
}
if (!w)
return false;

View File

@ -104,6 +104,8 @@
#include "qtabwidget.h" // Needed in inTabWidget()
#endif // QT_KEYPAD_NAVIGATION
#include "qwindowcontainer_p.h"
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
@ -1549,10 +1551,11 @@ void QWidgetPrivate::createTLExtra()
x->inTopLevelResize = false;
x->inRepaint = false;
x->embedded = 0;
x->window = 0;
x->screenIndex = 0;
#ifdef Q_WS_MAC
x->wasMaximized = false;
#endif // Q_WS_MAC
createTLSysExtra();
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "tlextra" << ++count;
@ -6252,6 +6255,17 @@ bool QWidget::isActiveWindow() const
}
}
// Check for an active window container
if (QWindow *ww = QGuiApplication::focusWindow()) {
while (ww) {
QWidgetWindow *qww = qobject_cast<QWidgetWindow *>(ww);
QWindowContainer *qwc = qww ? qobject_cast<QWindowContainer *>(qww->widget()) : 0;
if (qwc && qwc->topLevelWidget() == tlw)
return true;
ww = ww->parent();
}
}
// Check if platform adaptation thinks the window is active. This is necessary for
// example in case of ActiveQt servers that are embedded into another application.
// Those are separate processes that are not part of the parent application Qt window/widget
@ -10112,6 +10126,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break; }
case Qt::WA_NativeWindow: {
d->createTLExtra();
if (on)
d->createTLSysExtra();
#ifndef QT_NO_IM
QWidget *focusWidget = d->effectiveFocusWidget();
if (on && !internalWinId() && hasFocus()

View File

@ -890,9 +890,7 @@ void QWidgetPrivate::deleteSysExtra()
void QWidgetPrivate::createTLSysExtra()
{
Q_Q(QWidget);
extra->topextra->screenIndex = 0;
extra->topextra->window = 0;
if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) {
if (!extra->topextra->window && (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow())) {
extra->topextra->window = new QWidgetWindow(q);
if (extra->minw || extra->minh)
extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh));

View File

@ -446,7 +446,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (!widget)
widget = m_widget;
if (event->type() == QEvent::MouseButtonPress && !qt_button_down)
if (event->type() == QEvent::MouseButtonPress)
qt_button_down = widget;
QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(),

View File

@ -1630,6 +1630,19 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
}
}
void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
{
if (autoDefaultButton != button) {
if (QStyleAnimation *anim = animation(autoDefaultButton)) {
anim->updateTarget();
stopAnimation(autoDefaultButton);
}
autoDefaultButton = button;
}
if (autoDefaultButton && !animation(autoDefaultButton))
startAnimation(new QStyleAnimation(autoDefaultButton));
}
QMacStylePrivate::QMacStylePrivate()
: mouseDown(false)
{
@ -3497,15 +3510,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// takes precedence over a normal default button
if (btn->features & QStyleOptionButton::AutoDefaultButton
&& opt->state & State_Active && opt->state & State_HasFocus) {
d->autoDefaultButton = opt->styleObject;
if (!d->animation(opt->styleObject))
d->startAnimation(new QStyleAnimation(opt->styleObject));
d->setAutoDefaultButton(opt->styleObject);
} else if (d->autoDefaultButton == opt->styleObject) {
if (QStyleAnimation *animation = d->animation(opt->styleObject)) {
animation->updateTarget();
d->stopAnimation(opt->styleObject);
}
d->autoDefaultButton = 0;
d->setAutoDefaultButton(0);
}
if (!d->autoDefaultButton) {

View File

@ -194,6 +194,8 @@ public:
HIThemeButtonDrawInfo *bdi) const;
QPixmap generateBackgroundPattern() const;
void setAutoDefaultButton(QObject *button) const;
public:
mutable QPointer<QObject> pressedButton;
mutable QPointer<QObject> defaultButton;

View File

@ -873,7 +873,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
QPoint pos = event->globalPos() - state->pressPos;
q->move(pos);
if (!state->ctrlDrag)
if (state && !state->ctrlDrag)
mwlayout->hover(state->widgetItem, event->globalPos());
ret = true;

View File

@ -311,12 +311,28 @@ void tst_QDir::mkdir()
void tst_QDir::makedirReturnCode()
{
QString dirName = QString::fromLatin1("makedirReturnCode");
QDir::current().rmdir(dirName); // cleanup a previous run.
QFile f(QDir::current().filePath(dirName));
// cleanup a previous run.
f.remove();
QDir::current().rmdir(dirName);
QDir dir(dirName);
QVERIFY(!dir.exists());
QVERIFY(QDir::current().mkdir(dirName));
QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail.
QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass
// Remove the directory and create a file with the same path
QDir::current().rmdir(dirName);
QVERIFY(!f.exists());
f.open(QIODevice::WriteOnly);
f.write("test");
f.close();
QVERIFY(f.exists());
QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail.
QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail.
f.remove();
}
void tst_QDir::rmdir_data()

View File

@ -279,17 +279,18 @@ void tst_QTemporaryDir::openOnRootDrives()
void tst_QTemporaryDir::stressTest()
{
const int iterations = 1000;
QTemporaryDir rootDir;
QVERIFY(rootDir.isValid());
QSet<QString> names;
const QString pattern = rootDir.path() + QStringLiteral("/XXXXXX");
for (int i = 0; i < iterations; ++i) {
QTemporaryDir dir;
QTemporaryDir dir(pattern);
dir.setAutoRemove(false);
QVERIFY2(dir.isValid(), qPrintable(QString::number(i)));
QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern))));
QVERIFY(!names.contains(dir.path()));
names.insert(dir.path());
}
for (QSet<QString>::const_iterator it = names.constBegin(); it != names.constEnd(); ++it)
QDir(*it).removeRecursively();
}
void tst_QTemporaryDir::rename()

View File

@ -66,7 +66,7 @@ private slots:
void constructCopy();
};
#define FOR_EACH_GUI_METATYPE(F) \
#define FOR_EACH_GUI_METATYPE_BASE(F) \
F(QFont, QFont) \
F(QPixmap, QPixmap) \
F(QBrush, QBrush) \
@ -76,7 +76,6 @@ private slots:
F(QPolygon, QPolygon) \
F(QRegion, QRegion) \
F(QBitmap, QBitmap) \
F(QCursor, QCursor) \
F(QKeySequence, QKeySequence) \
F(QPen, QPen) \
F(QTextLength, QTextLength) \
@ -89,6 +88,16 @@ private slots:
F(QVector4D, QVector4D) \
F(QQuaternion, QQuaternion)
#ifndef QTEST_NO_CURSOR
# define FOR_EACH_GUI_METATYPE(F) \
FOR_EACH_GUI_METATYPE_BASE(F) \
F(QCursor, QCursor)
#else // !QTEST_NO_CURSOR
# define FOR_EACH_GUI_METATYPE(F) \
FOR_EACH_GUI_METATYPE_BASE(F)
#endif // !QTEST_NO_CURSOR
namespace {
template <typename T>
struct static_assert_trigger {

View File

@ -215,8 +215,8 @@ void tst_QRawFont::correctFontData_data()
<< QFont::StyleNormal
<< QFont::Normal
<< QFont::HintingPreference(*hintingPreference)
<< 1000.0
<< 10.0;
<< qreal(1000.0)
<< qreal(10.0);
fileName = testFontBoldItalic;
title = fileName
@ -229,8 +229,8 @@ void tst_QRawFont::correctFontData_data()
<< QFont::StyleItalic
<< QFont::Bold
<< QFont::HintingPreference(*hintingPreference)
<< 1000.0
<< 10.0;
<< qreal(1000.0)
<< qreal(10.0);
++hintingPreference;
}

View File

@ -380,7 +380,7 @@ void tst_QNetworkProxyFactory::genericSystemProxy()
QFETCH(int, port);
// The generic system proxy is only available on the following platforms
#if (!defined Q_OS_BLACKBERRY) && (!defined Q_OS_WIN) && ((!defined Q_OS_MAC) || defined Q_OS_IOS)
#if (!defined Q_OS_BLACKBERRY) && (!defined Q_OS_WIN) && (!defined Q_OS_MACX)
qputenv(envVar, url);
const QList<QNetworkProxy> systemProxy = QNetworkProxyFactory::systemProxyForQuery();
QCOMPARE(systemProxy.size(), 1);

View File

@ -314,6 +314,9 @@ void tst_qmake::export_across_file_boundaries()
void tst_qmake::include_dir()
{
#ifdef QT_NO_WIDGETS
QSKIP("This test depends on QtWidgets");
#else
QString workDir = base_path + "/testdata/include_dir";
QVERIFY( test_compiler.qmake( workDir, "foo" ));
QVERIFY( test_compiler.make( workDir ));
@ -325,6 +328,7 @@ void tst_qmake::include_dir()
QVERIFY( test_compiler.make( buildDir ));
QVERIFY( test_compiler.exists( buildDir, "foo", Exe, "1.0.0" ));
QVERIFY( test_compiler.makeDistClean( buildDir ));
#endif
}
void tst_qmake::include_pwd()

View File

@ -44,6 +44,7 @@
#include <qcoreapplication.h>
#include <qdebug.h>
#include <qsharedpointer.h>
#include <qfiledialog.h>
#include <qabstractitemdelegate.h>
#include <qdirmodel.h>
@ -441,33 +442,25 @@ void tst_QFiledialog::completer_data()
void tst_QFiledialog::completer()
{
typedef QSharedPointer<QTemporaryFile> TemporaryFilePtr;
QFETCH(QString, input);
QFETCH(QString, startPath);
QFETCH(int, expected);
QString tempPath = QDir::tempPath() + '/' + "QFileDialogTestDir";
if (startPath.isEmpty())
startPath = tempPath;
QTemporaryDir tempDir;
QVERIFY(tempDir.isValid());
startPath = QDir::cleanPath(startPath);
const QString tempPath = tempDir.path();
startPath = startPath.isEmpty() ? tempPath : QDir::cleanPath(startPath);
// make temp dir and files
{
QDir cleanup(tempPath);
QStringList x = cleanup.entryList();
for (int i = 0; i < x.count(); ++i)
QFile::remove(tempPath + '/' + x[i]);
cleanup.rmdir(tempPath);
}
QDir tmp(QDir::tempPath());
if (!tmp.exists(tempPath))
QVERIFY(tmp.mkdir("QFileDialogTestDir"));
QList<QTemporaryFile*> files;
QList<TemporaryFilePtr> files;
QT_TRY {
for (int i = 0; i < 10; ++i) {
QScopedPointer<QTemporaryFile> file(new QTemporaryFile(tempPath + "/rXXXXXX"));
file->open();
files.append(file.take());
TemporaryFilePtr file(new QTemporaryFile(tempPath + QStringLiteral("/rXXXXXX")));
QVERIFY(file->open());
files.append(file);
}
// ### flesh this out more
@ -515,7 +508,7 @@ void tst_QFiledialog::completer()
QStringList expectedFiles;
if (expected == -1) {
QString fullPath = startPath.isEmpty() ? tempPath : startPath;
QString fullPath = startPath;
if (!fullPath.endsWith(QLatin1Char('/')))
fullPath.append(QLatin1Char('/'));
fullPath.append(input);
@ -551,10 +544,8 @@ void tst_QFiledialog::completer()
QTRY_COMPARE(cModel->rowCount(), expected);
} QT_CATCH(...) {
qDeleteAll(files);
QT_RETHROW;
}
qDeleteAll(files);
}
void tst_QFiledialog::completer_up()
@ -890,9 +881,9 @@ void tst_QFiledialog::selectFiles()
{
QNonNativeFileDialog fd;
fd.setViewMode(QFileDialog::List);
QString tempPath = QDir::tempPath() + '/' + "QFileDialogTestDir4SelectFiles";
QDir dir;
QVERIFY(dir.mkpath(tempPath));
QTemporaryDir tempDir;
QVERIFY(tempDir.isValid());
const QString tempPath = tempDir.path();
fd.setDirectory(tempPath);
QSignalSpy spyCurrentChanged(&fd, SIGNAL(currentChanged(QString)));
QSignalSpy spyDirectoryEntered(&fd, SIGNAL(directoryEntered(QString)));
@ -936,15 +927,12 @@ void tst_QFiledialog::selectFiles()
QCOMPARE(spyDirectoryEntered.count(), 0);
QCOMPARE(spyFilesSelected.count(), 0);
QCOMPARE(spyFilterSelected.count(), 0);
for (int i=0; i < 5; ++i)
QFile::remove(filesPath + QString::fromLatin1("/qfiledialog_auto_test_not_pres_%1").arg(i));
//If the selection is invalid then we fill the line edit but without the /
QNonNativeFileDialog * dialog = new QNonNativeFileDialog( 0, "Save" );
dialog->setFileMode( QFileDialog::AnyFile );
dialog->setAcceptMode( QFileDialog::AcceptSave );
QString temporary = QDir::tempPath() + QLatin1String("/blah");
dialog->selectFile(temporary);
dialog->selectFile(tempPath + QStringLiteral("/blah"));
dialog->show();
QVERIFY(QTest::qWaitForWindowExposed(dialog));
QLineEdit *lineEdit = dialog->findChild<QLineEdit*>("fileNameEdit");

View File

@ -192,6 +192,11 @@ void tst_QWindowContainer::testActivation()
QVERIFY(QTest::qWaitForWindowActive(root.windowHandle()));
QVERIFY(QGuiApplication::focusWindow() == root.windowHandle());
// Verify that all states in the root widget indicate it is active
QVERIFY(root.windowHandle()->isActive());
QVERIFY(root.isActiveWindow());
QCOMPARE(root.palette().currentColorGroup(), QPalette::Active);
// Under KDE (ubuntu 12.10), we experience that doing two activateWindow in a row
// does not work. The second gets ignored by the window manager, even though the
// timestamp in the xcb connection is unique for both.
@ -201,6 +206,11 @@ void tst_QWindowContainer::testActivation()
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
// Verify that all states in the root widget still indicate it is active
QVERIFY(root.windowHandle()->isActive());
QVERIFY(root.isActiveWindow());
QCOMPARE(root.palette().currentColorGroup(), QPalette::Active);
}

View File

@ -375,6 +375,11 @@ QString Configure::firstLicensePath()
void Configure::parseCmdLine()
{
if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") {
dictionary[ "TOPLEVEL" ] = "yes";
configCmdLine.removeAt(0);
}
int argCount = configCmdLine.size();
int i = 0;
const QStringList imageFormats = QStringList() << "gif" << "png" << "jpeg";
@ -3956,15 +3961,17 @@ void Configure::generateMakefiles()
QString pwd = QDir::currentPath();
{
QString dirName;
QString sourcePathMangled = sourcePath;
QString buildPathMangled = buildPath;
if (dictionary.contains("TOPLEVEL")) {
sourcePathMangled = QFileInfo(sourcePath).path();
buildPathMangled = QFileInfo(buildPath).path();
}
bool generate = true;
bool doDsp = (dictionary["VCPROJFILES"] == "yes"
&& dictionary["PROCESS"] == "full");
while (generate) {
QString pwd = QDir::currentPath();
QString dirPath = buildPath + dirName;
QStringList args;
args << buildPath + "/bin/qmake";
if (doDsp) {
@ -3979,11 +3986,9 @@ void Configure::generateMakefiles()
}
if (dictionary[ "PROCESS" ] == "full")
args << "-r";
args << (sourcePath + "/qtbase.pro");
args << "-o";
args << buildPath;
args << sourcePathMangled;
QDir::setCurrent(dirPath);
QDir::setCurrent(buildPathMangled);
if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
cout << "Qmake failed, return code " << exitCode << endl << endl;
dictionary[ "DONE" ] = "error";

View File

@ -5,35 +5,34 @@
**
** This file is part of the QtGui module 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.
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** 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.
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** 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.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**

View File

@ -5,35 +5,34 @@
**
** This file is part of the QtGui module 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.
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** 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.
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** 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.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**