Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev

This commit is contained in:
J-P Nurmi 2014-06-07 00:40:44 +02:00 committed by The Qt Project
commit d9a7ad80f7
158 changed files with 2121 additions and 850 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -28,4 +28,14 @@
/*! /*!
\example chat \example chat
\title D-Bus Chat Example \title D-Bus Chat Example
\ingroup examples-dbus
\brief Demonstrates communication among instances of an application.
\e Chat is a \l{Qt D-Bus} example which demonstrates a simple chat system
among instances of an application. Users connect and send message to
each other.
\image dbus-chat-example.png
\include examples-run.qdocinc
*/ */

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -28,4 +28,16 @@
/*! /*!
\example complexpingpong \example complexpingpong
\title D-Bus Complex Ping Pong Example \title D-Bus Complex Ping Pong Example
\ingroup examples-dbus
\brief Demonstrates usage of the Qt D-Bus typesystem.
\e{Complex Ping Pong Example} demonstrates the use of \l{Qt D-Bus}
typesystem with QDBusVariant and QDBusReply. The example consists of the
main application \c complexping which starts the other application, \c
complexpong. Entering keywords such as \c hello and \c ping is handled by
complexpong and the reply is printed to the standard output.
\include examples-run.qdocinc
To run, execute the \c complexping application.
*/ */

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -28,4 +28,12 @@
/*! /*!
\example listnames \example listnames
\title D-Bus List Names Example \title D-Bus List Names Example
\ingroup examples-dbus
\brief Shows how to access the D-Bus bus daemon service.
\e{List Names} is a command-line example which shows how to
access the \l{Qt D-Bus} bus daemon service. The example prints various
information about the bus daemon service.
\include examples-run.qdocinc
*/ */

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -28,4 +28,21 @@
/*! /*!
\example pingpong \example pingpong
\title D-Bus Ping Pong Example \title D-Bus Ping Pong Example
\ingroup examples-dbus
\brief Demonstrates a simple message system using D-Bus.
\e{Ping Pong} is a command-line example that demonstrates the basics of
\l{Qt D-Bus}. A message is sent to another application and there is a
confirmation of the message.
\include examples-run.qdocinc
Run the \c pong application and run the \c ping application with the message
as the argument.
\badcode
$ ./pong &
$ ./ping Hello
Reply was: ping("Hello") got called
\endcode
*/ */

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -28,9 +28,13 @@
/*! /*!
\example remotecontrolledcar \example remotecontrolledcar
\title D-Bus Remote Controlled Car Example \title D-Bus Remote Controlled Car Example
\ingroup examples-dbus
\brief Shows how to use Qt D-Bus to control a car from another application.
The Remote Controlled Car example shows how to use D-Bus to control one The Remote Controlled Car example shows how to use \l{Qt D-Bus} to control
application using another. one application from another.
\image remotecontrolledcar-car-example.png \image remotecontrolledcar-car-example.png
\include examples-run.qdocinc
*/ */

View File

@ -2,6 +2,6 @@ TEMPLATE = subdirs
macx { macx {
SUBDIRS = \ SUBDIRS = \
qmacnativewidget \ qmaccocoaviewcontainer \
qmacnativewidget qmacnativewidget
} }

View File

@ -39,8 +39,8 @@
** **
****************************************************************************/ ****************************************************************************/
#include <QtWidgets>
#include <Cocoa/Cocoa.h> #include <Cocoa/Cocoa.h>
#include <QtWidgets>
#include <QMacCocoaViewContainer> #include <QMacCocoaViewContainer>
class WindowWidget : public QWidget class WindowWidget : public QWidget

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,5 +1,5 @@
<?xml version=\"1.0\" encoding=\"utf-8\"?> <?xml version=\"1.0\" encoding=\"utf-8\"?>
<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:v2=\"http://schemas.microsoft.com/appx/2013/manifest\"> <Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m2=\"http://schemas.microsoft.com/appx/2013/manifest\">
<Identity <Identity
Name=\"$${WINRT_MANIFEST.identity}\" Name=\"$${WINRT_MANIFEST.identity}\"
ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\" ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\"
@ -22,20 +22,20 @@
Id=\"App\" Id=\"App\"
Executable=\"$${WINRT_MANIFEST.target}.exe\" Executable=\"$${WINRT_MANIFEST.target}.exe\"
EntryPoint=\"$${WINRT_MANIFEST.target}.App\"> EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
<v2:VisualElements <m2:VisualElements
DisplayName=\"$${WINRT_MANIFEST.name}\" DisplayName=\"$${WINRT_MANIFEST.name}\"
Description=\"$${WINRT_MANIFEST.description}\" Description=\"$${WINRT_MANIFEST.description}\"
BackgroundColor=\"$${WINRT_MANIFEST.background}\" BackgroundColor=\"$${WINRT_MANIFEST.background}\"
ForegroundText=\"$${WINRT_MANIFEST.foreground}\" ForegroundText=\"$${WINRT_MANIFEST.foreground}\"
Square150x150Logo=\"$${WINRT_MANIFEST.logo_large}\" Square150x150Logo=\"$${WINRT_MANIFEST.logo_large}\"
Square30x30Logo=\"$${WINRT_MANIFEST.logo_small}\"> Square30x30Logo=\"$${WINRT_MANIFEST.logo_small}\">
<v2:DefaultTile> <m2:DefaultTile>
<v2:ShowNameOnTiles> <m2:ShowNameOnTiles>
<v2:ShowOn Tile=\"square150x150Logo\" /> <m2:ShowOn Tile=\"square150x150Logo\" />
</v2:ShowNameOnTiles> </m2:ShowNameOnTiles>
</v2:DefaultTile> </m2:DefaultTile>
<v2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" /> <m2:SplashScreen Image=\"$${WINRT_MANIFEST.logo_splash}\" />
</v2:VisualElements> </m2:VisualElements>
</Application> </Application>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies} </Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
</Package> </Package>

View File

@ -0,0 +1,45 @@
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\" xmlns:m3=\"http://schemas.microsoft.com/appx/2014/manifest\" xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\">
<Identity
Name=\"$${WINRT_MANIFEST.identity}\"
ProcessorArchitecture=\"$${WINRT_MANIFEST.architecture}\"
Publisher=\"$${WINRT_MANIFEST.publisherid}\"
Version=\"$${WINRT_MANIFEST.version}\" />
<mp:PhoneIdentity
PhoneProductId=\"$${WINRT_MANIFEST.phone_product_id}\"
PhonePublisherId=\"$${WINRT_MANIFEST.phone_publisher_id}\" />
<Properties>
<DisplayName>$${WINRT_MANIFEST.name}</DisplayName>
<PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName>
<Logo>$${WINRT_MANIFEST.logo_store}</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language=\"en\" />
</Resources>
<Applications>
<Application
Id=\"App\"
Executable=\"$${WINRT_MANIFEST.target}.exe\"
EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
<m3:VisualElements
DisplayName=\"$${WINRT_MANIFEST.name}\"
Description=\"$${WINRT_MANIFEST.description}\"
BackgroundColor=\"$${WINRT_MANIFEST.background}\"
ForegroundText=\"$${WINRT_MANIFEST.foreground}\"
Square150x150Logo=\"$${WINRT_MANIFEST.logo_large}\"
Square44x44Logo=\"$${WINRT_MANIFEST.logo_44x44}\">
<m3:DefaultTile Square71x71Logo=\"$${WINRT_MANIFEST.logo_71x71}\">
<m3:ShowNameOnTiles>
<m3:ShowOn Tile=\"square150x150Logo\" />
</m3:ShowNameOnTiles>
</m3:DefaultTile>
<m3:SplashScreen Image=\"$${WINRT_MANIFEST.logo_480x800}\" />
</m3:VisualElements>
</Application>
</Applications>$${WINRT_MANIFEST.capabilities}$${WINRT_MANIFEST.dependencies}
</Package>
<!-- Generated by qmake using the $$[QMAKE_XSPEC] mkspec. -->

View File

@ -239,6 +239,10 @@ mac {
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
} else:unversioned_libname {
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so
CMAKE_LIB_SONAME = lib$${CMAKE_QT_STEM}.so
} else { } else {
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION) CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION) CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.so.$$eval(QT.$${MODULE}.VERSION)

View File

@ -75,18 +75,22 @@ load(qt_common)
} }
load(resolve_target) load(resolve_target)
qml1_target: \ qml1_target {
qmlplugindump = qml1plugindump qmlplugindump = qml1plugindump
else: \ importpath.name = QML_IMPORT_PATH
} else {
qmlplugindump = qmlplugindump qmlplugindump = qmlplugindump
importpath.name = QML2_IMPORT_PATH
}
qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump) qtPrepareTool(QMLPLUGINDUMP, $$qmlplugindump)
importpath.value = importpath.value =
for(qmod, QMAKEMODULES) { for(qmod, QTREPOS) {
qmod = $$section(qmod, /, 0, -3)/imports qml1_target: \
qml1_target: qmod = $$qmod/QtDeclarative qmod = $$qmod/imports
else: \
qmod = $$qmod/qml
exists($$qmod): importpath.value += $$shell_path($$qmod) exists($$qmod): importpath.value += $$shell_path($$qmod)
} }
importpath.name = QML_IMPORT_PATH
importpath.value = $$unique(importpath.value) importpath.value = $$unique(importpath.value)
qtAddToolEnv(QMLPLUGINDUMP, importpath) qtAddToolEnv(QMLPLUGINDUMP, importpath)
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, )

View File

@ -80,13 +80,16 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
# static builds: link qml import plugins into the app. # static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \ contains(qt_module_deps, qml): \
contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan { contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
!isEmpty(QTREPOS) {
for (qrep, QTREPOS): \
exists($$qrep/qml): \
QMLPATHS += $$qrep/qml
} else {
QMLPATHS += $$[QT_INSTALL_QML/get]
}
# run qmlimportscanner # run qmlimportscanner
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, _SYS) qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, _SYS)
for (MODULE, QT_MODULES) {
PATH = $$eval(QT.$${MODULE}.qml)
!isEmpty(PATH):exists($$PATH): QMLPATHS += $$PATH
}
QMLPATHS = $$unique(QMLPATHS)
for (QMLPATH, QMLPATHS): \ for (QMLPATH, QMLPATHS): \
IMPORTPATHS += -importPath $$QMLPATH IMPORTPATHS += -importPath $$QMLPATH

View File

@ -59,7 +59,6 @@ CONFIG += \
create_prl link_prl \ create_prl link_prl \
prepare_docs qt_docs_targets \ prepare_docs qt_docs_targets \
no_private_qt_headers_warning QTDIR_build \ no_private_qt_headers_warning QTDIR_build \
no_dll \
# Qt modules get compiled without exceptions enabled by default. # Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions. # However, testcases should be still built with exceptions.
exceptions_off testcase_exceptions exceptions_off testcase_exceptions

View File

@ -22,10 +22,27 @@ qtPrepareTool(QDOC, qdoc)
QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
!build_online_docs: \ !build_online_docs: \
QDOC += -installdir $$[QT_INSTALL_DOCS] QDOC += -installdir $$[QT_INSTALL_DOCS]
PREP_DOC_INDEXES =
DOC_INDEXES = DOC_INDEXES =
for(qrep, QTREPOS): \ !isEmpty(QTREPOS) {
exists($$qrep/doc): \ prepare_docs {
# This is not for linking, but for providing type information.
mps =
deps = $$replace(QT, -private$, )
deps = $$resolve_depends(deps, "QT.")
for (d, deps): \
mps += $$dirname(QT.$${d}.libs)
mps = $$unique(mps)
for (mp, mps): \
PREP_DOC_INDEXES += -indexdir $$mp/doc
}
for(qrep, QTREPOS): \
DOC_INDEXES += -indexdir $$qrep/doc DOC_INDEXES += -indexdir $$qrep/doc
} else {
prepare_docs: \
PREP_DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
}
qtver.name = QT_VERSION qtver.name = QT_VERSION
qtver.value = $$VERSION qtver.value = $$VERSION
isEmpty(qtver.value): qtver.value = $$MODULE_VERSION isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
@ -39,7 +56,7 @@ qtdocs.value = $$[QT_INSTALL_DOCS/src]
qtAddToolEnv(QDOC, qtver qtmver qtvertag qtdocs) qtAddToolEnv(QDOC, qtver qtmver qtvertag qtdocs)
doc_command = $$QDOC $$QMAKE_DOCS doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs { prepare_docs {
prepare_docs.commands += $$doc_command -prepare -no-link-errors prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors
generate_docs.commands += $$doc_command -generate $$DOC_INDEXES generate_docs.commands += $$doc_command -generate $$DOC_INDEXES
} else { } else {
html_docs.commands += $$doc_command $$DOC_INDEXES html_docs.commands += $$doc_command $$DOC_INDEXES

View File

@ -191,26 +191,30 @@ defineTest(qtAddRpathLink) {
# variable, default, [suffix for variable for system() use] # variable, default, [suffix for variable for system() use]
defineTest(qtPrepareTool) { defineTest(qtPrepareTool) {
$$1 = $$eval(QT_TOOL.$${2}.binary) cmd = $$eval(QT_TOOL.$${2}.binary)
isEmpty($$1) { isEmpty(cmd) {
$$1 = $$[QT_HOST_BINS]/$$2 cmd = $$[QT_HOST_BINS]/$$2
exists($$eval($$1).pl) { exists($${cmd}.pl) {
$$1 = perl -w $$eval($$1).pl cmd = perl -w $$system_path($${cmd}.pl)
} else: contains(QMAKE_HOST.os, Windows) { } else: contains(QMAKE_HOST.os, Windows) {
$$1 = $$eval($$1).exe cmd = $$system_path($${cmd}.exe)
} else:contains(QMAKE_HOST.os, Darwin) { } else:contains(QMAKE_HOST.os, Darwin) {
BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2 BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
exists($$BUNDLENAME) { exists($$BUNDLENAME) {
$$1 = $$BUNDLENAME cmd = $$BUNDLENAME
} }
} }
} }
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars) QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
!isEmpty(3) { !isEmpty(3) {
$$1$$3 = $$system_path($$eval($$1)) $$1$$3 =
for (arg, cmd): \
$$1$$3 += $$system_quote($$arg)
qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system)
} }
$$1 = $$system_path($$eval($$1)) $$1 =
for (arg, cmd): \
$$1 += $$shell_quote($$arg)
qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, ) qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, )
} }
@ -249,11 +253,13 @@ defineTest(qtAddTargetEnv) {
deps = $$replace($$2, -private$, _private) deps = $$replace($$2, -private$, _private)
deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
!isEmpty(deps) { !isEmpty(deps) {
ptypes =
for(dep, deps) { for(dep, deps) {
isEmpty(3): \ isEmpty(3): \
deppath += $$shell_path($$eval(QT.$${dep}.libs)) deppath += $$shell_path($$eval(QT.$${dep}.libs))
else: \ else: \
deppath += $$system_path($$eval(QT.$${dep}.libs)) deppath += $$system_path($$eval(QT.$${dep}.libs))
ptypes += $$eval(QT.$${dep}.plugin_types)
} }
equals(QMAKE_HOST.os, Windows) { equals(QMAKE_HOST.os, Windows) {
deppath.name = PATH deppath.name = PATH
@ -273,14 +279,16 @@ defineTest(qtAddTargetEnv) {
deppath.CONFIG = prepend deppath.CONFIG = prepend
pluginpath.value = pluginpath.value =
for(qmod, QMAKEMODULES) { ppaths = $$[QT_INSTALL_PLUGINS/get]
qmod = $$section(qmod, /, 0, -3)/plugins for(qplug, QT_PLUGINS): \
exists($$qmod) { contains(ptypes, QT_PLUGIN.$${qplug}.TYPE): \
ppaths += $$eval(QT_PLUGIN.$${qplug}.PATH)
ppaths = $$unique(ppaths)
for(qplug, ppaths) {
isEmpty(3): \ isEmpty(3): \
pluginpath.value += $$shell_path($$qmod) pluginpath.value += $$shell_path($$qplug)
else: \ else: \
pluginpath.value += $$system_path($$qmod) pluginpath.value += $$system_path($$qplug)
}
} }
pluginpath.name = QT_PLUGIN_PATH pluginpath.name = QT_PLUGIN_PATH

View File

@ -22,6 +22,7 @@
target.path = $$[QT_HOST_LIBS] target.path = $$[QT_HOST_LIBS]
else: \ else: \
target.path = $$[QT_INSTALL_LIBS] target.path = $$[QT_INSTALL_LIBS]
target.CONFIG = no_dll
INSTALLS += target INSTALLS += target
} }

View File

@ -24,7 +24,7 @@ tool_plugin {
contains(QT_CONFIG, build_all):CONFIG += build_all contains(QT_CONFIG, build_all):CONFIG += build_all
} }
CONFIG(static, static|shared) { CONFIG(static, static|shared)|prefix_build {
isEmpty(MODULE): MODULE = $$basename(TARGET) isEmpty(MODULE): MODULE = $$basename(TARGET)
mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules
@ -66,9 +66,11 @@ CONFIG(static, static|shared) {
cache(QT_PLUGINS, transient) cache(QT_PLUGINS, transient)
} }
CONFIG(static, static|shared) {
pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
pritarget.files = $$MODULE_PRI pritarget.files = $$MODULE_PRI
INSTALLS += pritarget INSTALLS += pritarget
}
} }
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE

View File

@ -45,8 +45,9 @@ CONFIG += console
} else { } else {
module_envvars = module_envvars =
} }
bin = $$system_path($$QMAKE_RESOLVED_TARGET)
TOOL_PRI_CONT = \ TOOL_PRI_CONT = \
"QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ "QT_TOOL.$${MODULE}.binary = $$val_escape(bin)" \
"QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_envvars $$module_envvars
write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.")

View File

@ -14,10 +14,12 @@
# WINRT_MANIFEST.version: The version number of the package. Defaults to "1.0.0.0". # WINRT_MANIFEST.version: The version number of the package. Defaults to "1.0.0.0".
# WINRT_MANIFEST.arguments: Allows arguments to be passed to the executable. # WINRT_MANIFEST.arguments: Allows arguments to be passed to the executable.
# WINRT_MANIFEST.publisher: Display name of the publisher. Defaults to "Default publisher display name". # WINRT_MANIFEST.publisher: Display name of the publisher. Defaults to "Default publisher display name".
# WINRT_MANIFEST.publisher_id: On Windows 8/RT, the publisher's distinguished name (default: CN=MyCN). On Windows Phone, the publisher's UUID (default: invalid UUID string). # WINRT_MANIFEST.publisher_id: On Windows 8/RT/Phone 8.1, the publisher's distinguished name (default: CN=MyCN). On Windows Phone 8.0, the publisher's UUID (default: invalid UUID string).
# WINRT_MANIFEST.phone_product_id): On Windows Phone 8.1, the GUID of the product. Defaults to the value of WINRT_MANIFEST.identity.
# WINRT_MANIFEST.phone_publisher_id: On Windows Phone 8.1, the GUID of the publiser. Defaults to an invalid GUID.
# WINRT_MANIFEST.description: Package description. Defaults to "Default package description". # WINRT_MANIFEST.description: Package description. Defaults to "Default package description".
# WINRT_MANIFEST.author: Package author (Windows Phone only). Defaults to "Default package author". # WINRT_MANIFEST.author: Package author (Windows Phone 8.0 only). Defaults to "Default package author".
# WINRT_MANIFEST.genre: Package genre (Windows Phone only). Defaults to "apps.normal". # WINRT_MANIFEST.genre: Package genre (Windows Phone 8.0 only). Defaults to "apps.normal".
# WINRT_MANIFEST.background: Tile background color. Defaults to "green". # WINRT_MANIFEST.background: Tile background color. Defaults to "green".
# WINRT_MANIFEST.foreground: Tile foreground (text) color (Windows 8/RT only). Defaults to "light". # WINRT_MANIFEST.foreground: Tile foreground (text) color (Windows 8/RT only). Defaults to "light".
# WINRT_MANIFEST.logo_store: Logo image file for Windows Store. Default provided by the mkspec. # WINRT_MANIFEST.logo_store: Logo image file for Windows Store. Default provided by the mkspec.
@ -49,7 +51,7 @@
BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET) BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET)
} }
winphone: \ winphone:equals(WINSDK_VER, 8.0): \
manifest_file.output = $$BUILD_DIR/WMAppManifest.xml manifest_file.output = $$BUILD_DIR/WMAppManifest.xml
else: contains(TEMPLATE, "vc.*"): \ else: contains(TEMPLATE, "vc.*"): \
manifest_file.output = $$BUILD_DIR/Package.appxmanifest manifest_file.output = $$BUILD_DIR/Package.appxmanifest
@ -59,6 +61,7 @@
# Provide the C-runtime dependency # Provide the C-runtime dependency
equals(TEMPLATE, "app") { equals(TEMPLATE, "app") {
VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00 VCLIBS = Microsoft.VCLibs.$$replace(MSVC_VER, \\., ).00
winphone: VCLIBS = $${VCLIBS}.Phone
CONFIG(debug, debug|release): \ CONFIG(debug, debug|release): \
WINRT_MANIFEST.dependencies += $${VCLIBS}.Debug WINRT_MANIFEST.dependencies += $${VCLIBS}.Debug
else: \ else: \
@ -77,16 +80,18 @@
write_file($$UUID_CACHE, WINRT_UUID)|error("Unable to write the UUID cache; aborting.") write_file($$UUID_CACHE, WINRT_UUID)|error("Unable to write the UUID cache; aborting.")
eval($$WINRT_UUID) eval($$WINRT_UUID)
} }
winphone: WINRT_MANIFEST.identity = {$$WINRT_MANIFEST.identity} winphone:equals(WINSDK_VER, 8.0): WINRT_MANIFEST.identity = {$$WINRT_MANIFEST.identity}
} }
isEmpty(WINRT_MANIFEST.name): WINRT_MANIFEST.name = $$TARGET isEmpty(WINRT_MANIFEST.name): WINRT_MANIFEST.name = $$TARGET
isEmpty(WINRT_MANIFEST.architecture): WINRT_MANIFEST.architecture = $$VCPROJ_ARCH isEmpty(WINRT_MANIFEST.architecture): WINRT_MANIFEST.architecture = $$VCPROJ_ARCH
isEmpty(WINRT_MANIFEST.version): WINRT_MANIFEST.version = 1.0.0.0 isEmpty(WINRT_MANIFEST.version): WINRT_MANIFEST.version = 1.0.0.0
isEmpty(WINRT_MANIFEST.publisher): WINRT_MANIFEST.publisher = Default publisher display name isEmpty(WINRT_MANIFEST.publisher): WINRT_MANIFEST.publisher = Default publisher display name
isEmpty(WINRT_MANIFEST.publisherid) { isEmpty(WINRT_MANIFEST.publisherid) {
winphone: WINRT_MANIFEST.publisherid = {00000000-0000-0000-0000-000000000000} winphone:equals(WINSDK_VER, 8.0): WINRT_MANIFEST.publisherid = {00000000-0000-0000-0000-000000000000}
else: WINRT_MANIFEST.publisherid = CN=$$(USERNAME) else: WINRT_MANIFEST.publisherid = CN=$$(USERNAME)
} }
isEmpty(WINRT_MANIFEST.phone_product_id): WINRT_MANIFEST.phone_product_id = $$WINRT_MANIFEST.identity
isEmpty(WINRT_MANIFEST.phone_publisher_id): WINRT_MANIFEST.phone_publisher_id = 00000000-0000-0000-0000-000000000000
isEmpty(WINRT_MANIFEST.description): WINRT_MANIFEST.description = Default package description isEmpty(WINRT_MANIFEST.description): WINRT_MANIFEST.description = Default package description
isEmpty(WINRT_MANIFEST.author): WINRT_MANIFEST.author = Default package author isEmpty(WINRT_MANIFEST.author): WINRT_MANIFEST.author = Default package author
isEmpty(WINRT_MANIFEST.genre): WINRT_MANIFEST.genre = apps.normal isEmpty(WINRT_MANIFEST.genre): WINRT_MANIFEST.genre = apps.normal
@ -94,7 +99,7 @@
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
winphone: INDENT = "$$escape_expand(\\r\\n) " winphone:equals(WINSDK_VER, 8.0): INDENT = "$$escape_expand(\\r\\n) "
else: INDENT = "$$escape_expand(\\r\\n) " else: INDENT = "$$escape_expand(\\r\\n) "
# Languages are given as a string list # Languages are given as a string list
@ -142,16 +147,12 @@
ICONS_FOUND ~= s/.*\\\$\\\$\\{WINRT_MANIFEST\\.((logo|tile)_[^\}]+)\\}.*/\\1/g ICONS_FOUND ~= s/.*\\\$\\\$\\{WINRT_MANIFEST\\.((logo|tile)_[^\}]+)\\}.*/\\1/g
for (ICON_NAME, ICONS_FOUND) { for (ICON_NAME, ICONS_FOUND) {
ICON_FILE = $$eval(WINRT_MANIFEST.$$ICON_NAME) ICON_FILE = $$eval(WINRT_MANIFEST.$$ICON_NAME)
isEmpty(ICON_FILE) { isEmpty(ICON_FILE): ICON_FILE = $$WINRT_ASSETS_PATH/$${ICON_NAME}.png
icon_$${ICON_NAME}.input = $$WINRT_ASSETS_PATH/$${ICON_NAME}.png
icon_$${ICON_NAME}.output = $$BUILD_DIR/assets/$${ICON_NAME}.png
WINRT_MANIFEST.$${ICON_NAME} = assets/$${ICON_NAME}.png
} else {
icon_$${ICON_NAME}.input = $$ICON_FILE icon_$${ICON_NAME}.input = $$ICON_FILE
icon_$${ICON_NAME}.output = $$BUILD_DIR/$$ICON_FILE icon_$${ICON_NAME}.output = $$BUILD_DIR/assets/$$basename(ICON_FILE)
}
icon_$${ICON_NAME}.CONFIG = verbatim icon_$${ICON_NAME}.CONFIG = verbatim
QMAKE_SUBSTITUTES += icon_$${ICON_NAME} QMAKE_SUBSTITUTES += icon_$${ICON_NAME}
WINRT_MANIFEST.$${ICON_NAME} = assets/$$basename(ICON_FILE)
} }
QMAKE_SUBSTITUTES += manifest_file QMAKE_SUBSTITUTES += manifest_file

View File

@ -54,7 +54,7 @@ QMAKE_CXXFLAGS_STL_OFF =
QMAKE_CXXFLAGS_RTTI_ON = -GR QMAKE_CXXFLAGS_RTTI_ON = -GR
QMAKE_CXXFLAGS_RTTI_OFF = QMAKE_CXXFLAGS_RTTI_OFF =
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0 QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
QMAKE_INCDIR = QMAKE_INCDIR =

View File

@ -0,0 +1,23 @@
#
# qmake configuration for winphone-arm-msvc2013
#
# Written for Microsoft Visual C++ 2013
#
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800
QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP ARM __ARM__ __ARM__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += WindowsPhoneCore.lib PhoneAppModelHost.lib
VCPROJ_ARCH = ARM
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = WP81
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
WINRT_MANIFEST.architecture = arm

View File

@ -0,0 +1,42 @@
/****************************************************************************
**
** Copyright (C) 2014 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 "../common/winrt_winphone/qplatformdefs.h"

View File

@ -0,0 +1,23 @@
#
# qmake configuration for winphone-x86-msvc2013
#
# Written for Microsoft Visual C++ 2013
#
include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1800
QMAKE_PLATFORM = winphone $$QMAKE_PLATFORM
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP X86 __X86__ __x86__
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
QMAKE_LFLAGS += /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
QMAKE_LIBS += WindowsPhoneCore.lib PhoneAppModelHost.lib
VCPROJ_ARCH = Win32
MSVC_VER = 12.0
WINSDK_VER = 8.1
WINTARGET_VER = WP81
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/8.1_wp/AppxManifest.xml.in
WINRT_MANIFEST.architecture = x86

View File

@ -0,0 +1,42 @@
/****************************************************************************
**
** Copyright (C) 2014 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 "../common/winrt_winphone/qplatformdefs.h"

View File

@ -809,8 +809,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString icon = fileFixify(var("ICON")); QString icon = fileFixify(var("ICON"));
QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
if (bundlePrefix.isEmpty()) if (bundlePrefix.isEmpty())
bundlePrefix = "com.yourcompany."; bundlePrefix = "com.yourcompany";
QString bundleIdentifier = bundlePrefix + var("QMAKE_BUNDLE"); if (bundlePrefix.endsWith("."))
bundlePrefix.chop(1);
QString bundleIdentifier = bundlePrefix + "." + var("QMAKE_BUNDLE");
if (bundleIdentifier.endsWith(".app")) if (bundleIdentifier.endsWith(".app"))
bundleIdentifier.chop(4); bundleIdentifier.chop(4);
t << "@$(DEL_FILE) " << info_plist_out << "\n\t" t << "@$(DEL_FILE) " << info_plist_out << "\n\t"

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the qmake application of the Qt Toolkit. ** This file is part of the qmake application of the Qt Toolkit.
@ -615,7 +615,8 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< attrTag("Label", "ProjectConfigurations"); << attrTag("Label", "ProjectConfigurations");
bool isWinRT = false; bool isWinRT = false;
bool isPhone = false; bool isWinPhone = false;
bool isWinPhone80 = false; // ### Windows Phone 8.0, remove in Qt 5.4
for (int i = 0; i < tool.SingleProjects.count(); ++i) { for (int i = 0; i < tool.SingleProjects.count(); ++i) {
xml << tag("ProjectConfiguration") xml << tag("ProjectConfiguration")
<< attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name) << attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
@ -623,7 +624,8 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("Platform", tool.SingleProjects.at(i).PlatformName) << tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
<< closetag(); << closetag();
isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT; isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
isPhone = isPhone || tool.SingleProjects.at(i).Configuration.WinPhone; isWinPhone = isWinPhone = tool.SingleProjects.at(i).Configuration.WinPhone;
isWinPhone80 = isWinPhone80 || tool.SingleProjects.at(i).Configuration.WinPhone80;
} }
xml << closetag() xml << closetag()
@ -635,7 +637,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
if (isWinRT) { if (isWinRT) {
xml << tagValue("MinimumVisualStudioVersion", tool.Version); xml << tagValue("MinimumVisualStudioVersion", tool.Version);
if (isPhone) { if (isWinPhone80) {
xml << tagValue("WinMDAssembly", "true"); xml << tagValue("WinMDAssembly", "true");
if (tool.SingleProjects.at(0).Configuration.ConfigurationType == typeApplication) { if (tool.SingleProjects.at(0).Configuration.ConfigurationType == typeApplication) {
xml << tagValue("XapOutputs", "true"); xml << tagValue("XapOutputs", "true");
@ -643,7 +645,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
} }
} else { } else {
xml << tagValue("AppContainerApplication", "true") xml << tagValue("AppContainerApplication", "true")
<< tagValue("ApplicationType", "Windows Store") << tagValue("ApplicationType", isWinPhone ? "Windows Phone" : "Windows Store")
<< tagValue("ApplicationTypeRevision", tool.SdkVersion); << tagValue("ApplicationTypeRevision", tool.SdkVersion);
} }
} }
@ -823,7 +825,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
} }
outputFilter(tool, xml, xmlFilter, "Root Files"); outputFilter(tool, xml, xmlFilter, "Root Files");
if (tool.SingleProjects.at(0).Configuration.WinPhone) { if (isWinPhone80) {
xml << tag("ItemGroup") xml << tag("ItemGroup")
<< tag("Reference") << tag("Reference")
<< attrTag("Include", "platform") << attrTag("Include", "platform")
@ -835,7 +837,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
// App manifest // App manifest
if (isWinRT) { if (isWinRT) {
QString manifest = isPhone ? QStringLiteral("WMAppManifest.xml") : QStringLiteral("Package.appxmanifest"); QString manifest = isWinPhone80 ? QStringLiteral("WMAppManifest.xml") : QStringLiteral("Package.appxmanifest");
// Find all icons referenced in the manifest // Find all icons referenced in the manifest
QSet<QString> icons; QSet<QString> icons;
@ -856,7 +858,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
// Write out manifest + icons as content items // Write out manifest + icons as content items
xml << tag(_ItemGroup) xml << tag(_ItemGroup)
<< tag(isPhone ? "Xml" : "AppxManifest") << tag(isWinPhone80 ? "Xml" : "AppxManifest")
<< attrTag("Include", manifest) << attrTag("Include", manifest)
<< closetag(); << closetag();
foreach (const QString &icon, icons) { foreach (const QString &icon, icons) {
@ -869,7 +871,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
if (isPhone) if (isWinPhone80)
xml << import("Project", "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v8.0\\Microsoft.Cpp.WindowsPhone.8.0.targets"); xml << import("Project", "$(MSBuildExtensionsPath)\\Microsoft\\WindowsPhone\\v8.0\\Microsoft.Cpp.WindowsPhone.8.0.targets");
xml << tag("ImportGroup") xml << tag("ImportGroup")

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the qmake application of the Qt Toolkit. ** This file is part of the qmake application of the Qt Toolkit.
@ -166,10 +166,17 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return false; return false;
} }
regKey = regKeyPrefix QString windowsPath;
+ (isPhone ? QStringLiteral("Microsoft\\Microsoft SDKs\\WindowsPhone\\v") if (isPhone) {
: QStringLiteral("Microsoft\\Microsoft SDKs\\Windows\\v")) if (targetVer == "WP80") // ### Windows Phone 8.0, remove in Qt 5.4
+ winsdkVer + QStringLiteral("\\InstallationFolder"); windowsPath = "Microsoft\\Microsoft SDKs\\WindowsPhone\\v";
else
windowsPath = "Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v";
} else {
windowsPath = "Microsoft\\Microsoft SDKs\\Windows\\v";
}
regKey = regKeyPrefix + windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder");
const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey); const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey);
if (kitDir.isEmpty()) { if (kitDir.isEmpty()) {
fprintf(stderr, "Failed to find the Windows Kit installation directory.\n"); fprintf(stderr, "Failed to find the Windows Kit installation directory.\n");
@ -184,7 +191,9 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
QStringList libDirs; QStringList libDirs;
QStringList binDirs; QStringList binDirs;
if (isPhone) { if (isPhone) {
QString sdkDir = vcInstallDir + QStringLiteral("/WPSDK/") + targetVer; QString sdkDir = vcInstallDir;
if (targetVer == "WP80")
sdkDir += QStringLiteral("/WPSDK/") + targetVer;
if (!QDir(sdkDir).exists()) { if (!QDir(sdkDir).exists()) {
fprintf(stderr, "Failed to find the Windows Phone SDK in %s.\n" fprintf(stderr, "Failed to find the Windows Phone SDK in %s.\n"
"Check that it is properly installed.\n", "Check that it is properly installed.\n",
@ -192,7 +201,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return false; return false;
} }
incDirs << sdkDir + QStringLiteral("/include"); incDirs << sdkDir + QStringLiteral("/include");
libDirs << sdkDir + QStringLiteral("/lib/") + compilerArch; libDirs << sdkDir + QStringLiteral("/lib/store/") + compilerArch
<< sdkDir + QStringLiteral("/lib/") + compilerArch;
binDirs << sdkDir + QStringLiteral("/bin/") + compiler; binDirs << sdkDir + QStringLiteral("/bin/") + compiler;
libDirs << kitDir + QStringLiteral("/lib/") + arch; libDirs << kitDir + QStringLiteral("/lib/") + arch;
incDirs << kitDir + QStringLiteral("/include") incDirs << kitDir + QStringLiteral("/include")
@ -260,10 +270,7 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
targetdir += Option::dir_sep; targetdir += Option::dir_sep;
if (project->isActiveConfig("debug_info")) { if (project->isActiveConfig("debug_info")) {
if (t == "dlltarget" if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
|| project->first("TEMPLATE") != "lib"
|| (project->isActiveConfig("shared")
&& project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1)) {
QString pdb_target = getPdbTarget(); QString pdb_target = getPdbTarget();
pdb_target.remove('"'); pdb_target.remove('"');
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target; QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the qmake application of the Qt Toolkit. ** This file is part of the qmake application of the Qt Toolkit.
@ -2129,6 +2129,7 @@ VCPreLinkEventTool::VCPreLinkEventTool()
VCConfiguration::VCConfiguration() VCConfiguration::VCConfiguration()
: WinRT(false), : WinRT(false),
WinPhone(false), WinPhone(false),
WinPhone80(false),
ATLMinimizesCRunTimeLibraryUsage(unset), ATLMinimizesCRunTimeLibraryUsage(unset),
BuildBrowserInformation(unset), BuildBrowserInformation(unset),
CharacterSet(charSetNotSet), CharacterSet(charSetNotSet),

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the qmake application of the Qt Toolkit. ** This file is part of the qmake application of the Qt Toolkit.
@ -886,7 +886,7 @@ public:
~VCConfiguration(){} ~VCConfiguration(){}
DotNET CompilerVersion; DotNET CompilerVersion;
bool WinRT, WinPhone; bool WinRT, WinPhone, WinPhone80;
// Variables // Variables
triState ATLMinimizesCRunTimeLibraryUsage; triState ATLMinimizesCRunTimeLibraryUsage;

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the qmake application of the Qt Toolkit. ** This file is part of the qmake application of the Qt Toolkit.
@ -902,7 +902,7 @@ void VcprojGenerator::initProject()
initResourceFiles(); initResourceFiles();
initExtraCompilerOutputs(); initExtraCompilerOutputs();
if (vcProject.Configuration.WinRT) { if (vcProject.Configuration.WinRT) {
if (vcProject.Configuration.WinPhone if (vcProject.Configuration.WinPhone80
&& vcProject.Configuration.ConfigurationType == typeApplication) && vcProject.Configuration.ConfigurationType == typeApplication)
initWMAppManifest(); initWMAppManifest();
} }
@ -1012,6 +1012,7 @@ void VcprojGenerator::initConfiguration()
conf.WinRT = project->isActiveConfig("winrt"); conf.WinRT = project->isActiveConfig("winrt");
if (conf.WinRT) { if (conf.WinRT) {
conf.WinPhone = project->isActiveConfig("winphone"); conf.WinPhone = project->isActiveConfig("winphone");
conf.WinPhone80 = project->first("WINTARGET_VER") == "WP80";
// Saner defaults // Saner defaults
conf.compiler.UsePrecompiledHeader = pchNone; conf.compiler.UsePrecompiledHeader = pchNone;
conf.compiler.CompileAsWinRT = _False; conf.compiler.CompileAsWinRT = _False;

View File

@ -24,8 +24,83 @@
#include "libEGL/Display.h" #include "libEGL/Display.h"
#if defined(ANGLE_OS_WINRT) #if defined(ANGLE_OS_WINRT)
#include <wrl.h>
#include <windows.foundation.h> #include <windows.foundation.h>
#include <windows.ui.core.h> #include <windows.ui.core.h>
#include <windows.graphics.display.h>
static bool getCoreWindowSize(const EGLNativeWindowType win, int *width, int *height)
{
Microsoft::WRL::ComPtr<ABI::Windows::UI::Core::ICoreWindow> window;
HRESULT hr = win->QueryInterface(IID_PPV_ARGS(&window));
if (FAILED(hr))
{
ERR("Failed to cast native display pointer to ICoreWindow *.");
return false;
}
#if _MSC_VER<=1700
Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayInformation;
hr = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(),
IID_PPV_ARGS(&displayInformation));
#else
Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformationStatics> displayInformationFactory;
hr = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_Graphics_Display_DisplayInformation).Get(),
IID_PPV_ARGS(&displayInformationFactory));
if (FAILED(hr))
{
ERR("Failed to get display information factory.");
return false;
}
Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation> displayInformation;
hr = displayInformationFactory->GetForCurrentView(&displayInformation);
#endif
if (FAILED(hr))
{
ERR("Failed to get display information.");
return false;
}
#if defined(ANGLE_OS_WINPHONE) && _MSC_VER>=1800 // Windows Phone 8.1
Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation2> displayInformation2;
hr = displayInformation.As(&displayInformation2);
if (FAILED(hr))
{
ERR("Failed to get extended display information.");
return false;
}
DOUBLE scaleFactor;
hr = displayInformation2->get_RawPixelsPerViewPixel(&scaleFactor);
if (FAILED(hr))
{
ERR("Failed to get raw pixels per view pixel.");
return false;
}
#else
ABI::Windows::Graphics::Display::ResolutionScale resolutionScale;
hr = displayInformation->get_ResolutionScale(&resolutionScale);
if (FAILED(hr))
{
ERR("Failed to get resolution scale.");
return false;
}
DOUBLE scaleFactor = DOUBLE(resolutionScale) / 100.0;
#endif
ABI::Windows::Foundation::Rect windowRect;
hr = window->get_Bounds(&windowRect);
if (FAILED(hr))
{
ERR("Failed to get ICoreWindow bounds.");
return false;
}
*width = std::floor(windowRect.Width * scaleFactor + 0.5);
*height = std::floor(windowRect.Height * scaleFactor + 0.5);
return true;
}
#endif #endif
namespace egl namespace egl
@ -117,14 +192,10 @@ bool Surface::resetSwapChain()
width = windowRect.right - windowRect.left; width = windowRect.right - windowRect.left;
height = windowRect.bottom - windowRect.top; height = windowRect.bottom - windowRect.top;
#else #else
ABI::Windows::Foundation::Rect windowRect; if (!getCoreWindowSize(mWindow, &width, &height))
ABI::Windows::UI::Core::ICoreWindow *window; {
HRESULT hr = mWindow->QueryInterface(IID_PPV_ARGS(&window));
if (FAILED(hr))
return false; return false;
window->get_Bounds(&windowRect); }
width = windowRect.Width;
height = windowRect.Height;
#endif #endif
} }
else else
@ -336,14 +407,12 @@ bool Surface::checkForOutOfDateSwapChain()
int clientWidth = client.right - client.left; int clientWidth = client.right - client.left;
int clientHeight = client.bottom - client.top; int clientHeight = client.bottom - client.top;
#else #else
ABI::Windows::Foundation::Rect windowRect; int clientWidth;
ABI::Windows::UI::Core::ICoreWindow *window; int clientHeight;
HRESULT hr = mWindow->QueryInterface(IID_PPV_ARGS(&window)); if (!getCoreWindowSize(mWindow, &clientWidth, &clientHeight))
if (FAILED(hr)) {
return false; return false;
window->get_Bounds(&windowRect); }
int clientWidth = windowRect.Width;
int clientHeight = windowRect.Height;
#endif #endif
bool sizeDirty = clientWidth != getWidth() || clientHeight != getHeight(); bool sizeDirty = clientWidth != getWidth() || clientHeight != getHeight();

View File

@ -119,6 +119,7 @@ public class QtActivityDelegate
private InputMethodManager m_imm = null; private InputMethodManager m_imm = null;
private boolean m_quitApp = true; private boolean m_quitApp = true;
private Process m_debuggerProcess = null; // debugger process private Process m_debuggerProcess = null; // debugger process
private View m_dummyView = null;
private boolean m_keyboardIsVisible = false; private boolean m_keyboardIsVisible = false;
public boolean m_backKeyPressedSent = false; public boolean m_backKeyPressedSent = false;
@ -673,7 +674,7 @@ public class QtActivityDelegate
DisplayMetrics metrics = new DisplayMetrics(); DisplayMetrics metrics = new DisplayMetrics();
m_activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); m_activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
QtNative.setApplicationDisplayMetrics(metrics.widthPixels, metrics.heightPixels, QtNative.setApplicationDisplayMetrics(metrics.widthPixels, metrics.heightPixels,
metrics.widthPixels, metrics.heightPixels, 0, 0,
metrics.xdpi, metrics.ydpi, metrics.scaledDensity); metrics.xdpi, metrics.ydpi, metrics.scaledDensity);
} }
m_layout = new QtLayout(m_activity); m_layout = new QtLayout(m_activity);
@ -683,6 +684,10 @@ public class QtActivityDelegate
m_nativeViews = new HashMap<Integer, View>(); m_nativeViews = new HashMap<Integer, View>();
m_activity.registerForContextMenu(m_layout); m_activity.registerForContextMenu(m_layout);
m_activity.setContentView(m_layout,
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
int orientation = m_activity.getResources().getConfiguration().orientation; int orientation = m_activity.getResources().getConfiguration().orientation;
int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation(); int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation();
boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270); boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270);
@ -1007,6 +1012,11 @@ public class QtActivityDelegate
} }
public void insertNativeView(int id, View view, int x, int y, int w, int h) { public void insertNativeView(int id, View view, int x, int y, int w, int h) {
if (m_dummyView != null) {
m_layout.removeView(m_dummyView);
m_dummyView = null;
}
if (m_nativeViews.containsKey(id)) if (m_nativeViews.containsKey(id))
m_layout.removeView(m_nativeViews.remove(id)); m_layout.removeView(m_nativeViews.remove(id));
@ -1032,9 +1042,10 @@ public class QtActivityDelegate
m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId)); m_activity.getWindow().setBackgroundDrawable(m_activity.getResources().getDrawable(attr.resourceId));
} }
m_activity.setContentView(m_layout, if (m_dummyView != null) {
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, m_layout.removeView(m_dummyView);
ViewGroup.LayoutParams.MATCH_PARENT)); m_dummyView = null;
}
} }
if (m_surfaces.containsKey(id)) if (m_surfaces.containsKey(id))
@ -1071,12 +1082,22 @@ public class QtActivityDelegate
} }
public void destroySurface(int id) { public void destroySurface(int id) {
View view = null;
if (m_surfaces.containsKey(id)) { if (m_surfaces.containsKey(id)) {
m_layout.removeView(m_surfaces.remove(id)); view = m_surfaces.remove(id);
} else if (m_nativeViews.containsKey(id)) { } else if (m_nativeViews.containsKey(id)) {
m_layout.removeView(m_nativeViews.remove(id)); view = m_nativeViews.remove(id);
} else { } else {
Log.e(QtNative.QtTAG, "Surface " + id +" not found!"); Log.e(QtNative.QtTAG, "Surface " + id +" not found!");
} }
// Keep last frame in stack until it is replaced to get correct
// shutdown transition
if (m_surfaces.size() == 0 && m_nativeViews.size() == 0) {
m_dummyView = view;
} else if (view != null) {
m_layout.removeView(view);
}
} }
} }

View File

@ -69,6 +69,7 @@ import android.content.res.Resources.Theme;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -889,6 +890,8 @@ public class QtActivity extends Activity
// if splash screen is defined, then show it // if splash screen is defined, then show it
if (m_activityInfo.metaData.containsKey("android.app.splash_screen_drawable")) if (m_activityInfo.metaData.containsKey("android.app.splash_screen_drawable"))
getWindow().setBackgroundDrawableResource(m_activityInfo.metaData.getInt("android.app.splash_screen_drawable")); getWindow().setBackgroundDrawableResource(m_activityInfo.metaData.getInt("android.app.splash_screen_drawable"));
else
getWindow().setBackgroundDrawable(new ColorDrawable(0xff000000));
startApp(true); startApp(true);
} }
} }

View File

@ -0,0 +1,145 @@
From 59c6d4c94acb4735a73f50f46f91a6cce7389f94 Mon Sep 17 00:00:00 2001
From: Andrew Knight <andrew.knight@digia.com>
Date: Wed, 21 May 2014 00:58:21 +0300
Subject: [PATCH] ANGLE WinRT: Create swap chain using physical resolution
ANGLE has been creating the framebuffer in logical pixels instead of
physical pixels, which leads to unexpected results and side effects like
smudged anti-aliased text. This fixes the issue by multiplying the DIP
resolution by the scale factor, making the framebuffer match the physical
pixel resolution of the screen.
Change-Id: I3594995ce8e18a31b47e27165f72bc6a391b97b6
---
src/3rdparty/angle/src/libEGL/Surface.cpp | 97 ++++++++++++++++++++++++++-----
1 file changed, 83 insertions(+), 14 deletions(-)
diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp
index 3443355..a2e2306 100644
--- a/src/3rdparty/angle/src/libEGL/Surface.cpp
+++ b/src/3rdparty/angle/src/libEGL/Surface.cpp
@@ -24,8 +24,83 @@
#include "libEGL/Display.h"
#if defined(ANGLE_OS_WINRT)
+#include <wrl.h>
#include <windows.foundation.h>
#include <windows.ui.core.h>
+#include <windows.graphics.display.h>
+
+static bool getCoreWindowSize(const EGLNativeWindowType win, int *width, int *height)
+{
+ Microsoft::WRL::ComPtr<ABI::Windows::UI::Core::ICoreWindow> window;
+ HRESULT hr = win->QueryInterface(IID_PPV_ARGS(&window));
+ if (FAILED(hr))
+ {
+ ERR("Failed to cast native display pointer to ICoreWindow *.");
+ return false;
+ }
+
+#if _MSC_VER<=1700
+ Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayInformation;
+ hr = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(),
+ IID_PPV_ARGS(&displayInformation));
+#else
+ Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformationStatics> displayInformationFactory;
+ hr = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_Graphics_Display_DisplayInformation).Get(),
+ IID_PPV_ARGS(&displayInformationFactory));
+ if (FAILED(hr))
+ {
+ ERR("Failed to get display information factory.");
+ return false;
+ }
+
+ Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation> displayInformation;
+ hr = displayInformationFactory->GetForCurrentView(&displayInformation);
+#endif
+ if (FAILED(hr))
+ {
+ ERR("Failed to get display information.");
+ return false;
+ }
+
+#if defined(ANGLE_OS_WINPHONE) && _MSC_VER>=1800 // Windows Phone 8.1
+ Microsoft::WRL::ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation2> displayInformation2;
+ hr = displayInformation.As(&displayInformation2);
+ if (FAILED(hr))
+ {
+ ERR("Failed to get extended display information.");
+ return false;
+ }
+
+ DOUBLE scaleFactor;
+ hr = displayInformation2->get_RawPixelsPerViewPixel(&scaleFactor);
+ if (FAILED(hr))
+ {
+ ERR("Failed to get raw pixels per view pixel.");
+ return false;
+ }
+#else
+ ABI::Windows::Graphics::Display::ResolutionScale resolutionScale;
+ hr = displayInformation->get_ResolutionScale(&resolutionScale);
+ if (FAILED(hr))
+ {
+ ERR("Failed to get resolution scale.");
+ return false;
+ }
+ DOUBLE scaleFactor = DOUBLE(resolutionScale) / 100.0;
+#endif
+
+ ABI::Windows::Foundation::Rect windowRect;
+ hr = window->get_Bounds(&windowRect);
+ if (FAILED(hr))
+ {
+ ERR("Failed to get ICoreWindow bounds.");
+ return false;
+ }
+
+ *width = std::floor(windowRect.Width * scaleFactor + 0.5);
+ *height = std::floor(windowRect.Height * scaleFactor + 0.5);
+ return true;
+}
#endif
namespace egl
@@ -117,14 +192,10 @@ bool Surface::resetSwapChain()
width = windowRect.right - windowRect.left;
height = windowRect.bottom - windowRect.top;
#else
- ABI::Windows::Foundation::Rect windowRect;
- ABI::Windows::UI::Core::ICoreWindow *window;
- HRESULT hr = mWindow->QueryInterface(IID_PPV_ARGS(&window));
- if (FAILED(hr))
+ if (!getCoreWindowSize(mWindow, &width, &height))
+ {
return false;
- window->get_Bounds(&windowRect);
- width = windowRect.Width;
- height = windowRect.Height;
+ }
#endif
}
else
@@ -336,14 +407,12 @@ bool Surface::checkForOutOfDateSwapChain()
int clientWidth = client.right - client.left;
int clientHeight = client.bottom - client.top;
#else
- ABI::Windows::Foundation::Rect windowRect;
- ABI::Windows::UI::Core::ICoreWindow *window;
- HRESULT hr = mWindow->QueryInterface(IID_PPV_ARGS(&window));
- if (FAILED(hr))
+ int clientWidth;
+ int clientHeight;
+ if (!getCoreWindowSize(mWindow, &clientWidth, &clientHeight))
+ {
return false;
- window->get_Bounds(&windowRect);
- int clientWidth = windowRect.Width;
- int clientHeight = windowRect.Height;
+ }
#endif
bool sizeDirty = clientWidth != getWidth() || clientHeight != getHeight();
--
1.9.0.msysgit.0

View File

@ -74,25 +74,22 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
__m128i packed = _mm_packus_epi16(data1, data2); __m128i packed = _mm_packus_epi16(data1, data2);
__m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128()); __m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
// store, even if there are non-ASCII characters here
_mm_storeu_si128((__m128i*)dst, packed);
// n will contain 1 bit set per character in [data1, data2] that is non-ASCII (or NUL) // n will contain 1 bit set per character in [data1, data2] that is non-ASCII (or NUL)
ushort n = ~_mm_movemask_epi8(nonAscii); ushort n = ~_mm_movemask_epi8(nonAscii);
if (n) { if (n) {
// copy the front part that is still ASCII
while (!(n & 1)) {
*dst++ = *src++;
n >>= 1;
}
// find the next probable ASCII character // find the next probable ASCII character
// we don't want to load 32 bytes again in this loop if we know there are non-ASCII // we don't want to load 32 bytes again in this loop if we know there are non-ASCII
// characters still coming // characters still coming
n = _bit_scan_reverse(n); nextAscii = src + _bit_scan_reverse(n) + 1;
nextAscii = src + n + 1;
n = _bit_scan_forward(n);
dst += n;
src += n;
return false; return false;
} }
// pack
_mm_storeu_si128((__m128i*)dst, packed);
} }
return src == end; return src == end;
} }

View File

@ -121,7 +121,7 @@ process.start("dir \"My Documents\"");
//! [7] //! [7]
QProcess process; QProcess process;
process.start("dir \"\"\"My Documents\"\"\""); process.start("dir \"Epic 12\"\"\" Singles\"");
//! [7] //! [7]

View File

@ -124,7 +124,7 @@ QMetaMethod::invoke: Unable to handle unregistered datatype 'MyType'
QString retVal; QString retVal;
QByteArray normalizedSignature = QMetaObject::normalizedSignature("compute(QString, int, double)"); QByteArray normalizedSignature = QMetaObject::normalizedSignature("compute(QString, int, double)");
int methodIndex = obj->metaObject()->indexOfMethod(normalizedSignature); int methodIndex = obj->metaObject()->indexOfMethod(normalizedSignature);
QMetaMethod method = metaObject->method(methodIndex); QMetaMethod method = obj->metaObject()->method(methodIndex);
method.invoke(obj, method.invoke(obj,
Qt::DirectConnection, Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal), Q_RETURN_ARG(QString, retVal),

View File

@ -1841,8 +1841,9 @@ QSysInfo::MacVersion QSysInfo::macVersion()
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_OSX)
SInt32 gestalt_version; SInt32 gestalt_version;
if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) { if (Gestalt(gestaltSystemVersionMinor, &gestalt_version) == noErr) {
return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2); // add 2 because OS X 10.0 is 0x02 in the enum
return QSysInfo::MacVersion(gestalt_version + 2);
} }
#elif defined(Q_OS_IOS) #elif defined(Q_OS_IOS)
return qt_ios_version(); // qtcore_mac_objc.mm return qt_ios_version(); // qtcore_mac_objc.mm
@ -1992,6 +1993,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
winver = QSysInfo::WV_WINDOWS7; winver = QSysInfo::WV_WINDOWS7;
else if (override == "WINDOWS8") else if (override == "WINDOWS8")
winver = QSysInfo::WV_WINDOWS8; winver = QSysInfo::WV_WINDOWS8;
else if (override == "WINDOWS8_1")
winver = QSysInfo::WV_WINDOWS8_1;
} }
#endif #endif
#endif // !Q_OS_WINRT #endif // !Q_OS_WINRT

View File

@ -1219,11 +1219,11 @@ QString QFileSystemEngine::rootPath()
if (FAILED(installedLocation.As(&item))) if (FAILED(installedLocation.As(&item)))
return ret; return ret;
HSTRING finalWinPath; HString finalWinPath;
if (FAILED(item->get_Path(&finalWinPath))) if (FAILED(item->get_Path(finalWinPath.GetAddressOf())))
return ret; return ret;
ret = QDir::fromNativeSeparators(QString::fromWCharArray(WindowsGetStringRawBuffer(finalWinPath, nullptr))); ret = QDir::fromNativeSeparators(QString::fromWCharArray(finalWinPath.GetRawBuffer(nullptr)));
#else #else
QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData()); QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData());
@ -1319,10 +1319,10 @@ QString QFileSystemEngine::tempPath()
ComPtr<IStorageItem> tempFolderItem; ComPtr<IStorageItem> tempFolderItem;
if (FAILED(tempFolder.As(&tempFolderItem))) if (FAILED(tempFolder.As(&tempFolderItem)))
return ret; return ret;
HSTRING path; HString path;
if (FAILED(tempFolderItem->get_Path(&path))) if (FAILED(tempFolderItem->get_Path(path.GetAddressOf())))
return ret; return ret;
ret = QDir::fromNativeSeparators(QString::fromWCharArray(WindowsGetStringRawBuffer(path, nullptr))); ret = QDir::fromNativeSeparators(QString::fromWCharArray(path.GetRawBuffer(nullptr)));
#endif // Q_OS_WINRT #endif // Q_OS_WINRT
if (ret.isEmpty()) { if (ret.isEmpty()) {
#if !defined(Q_OS_WINCE) #if !defined(Q_OS_WINCE)

View File

@ -2015,15 +2015,12 @@ QByteArray QProcess::readAllStandardError()
} }
/*! /*!
Starts the given \a program in a new process, if none is already Starts the given \a program in a new process, passing the command line
running, passing the command line arguments in \a arguments. The OpenMode arguments in \a arguments.
is set to \a mode.
The QProcess object will immediately enter the Starting state. If the The QProcess object will immediately enter the Starting state. If the
process starts successfully, QProcess will emit started(); otherwise, process starts successfully, QProcess will emit started(); otherwise,
error() will be emitted. If the QProcess object is already running a error() will be emitted.
process, a warning may be printed at the console, and the existing
process will continue running.
\note Processes are started asynchronously, which means the started() \note Processes are started asynchronously, which means the started()
and error() signals may be delayed. Call waitForStarted() to make and error() signals may be delayed. Call waitForStarted() to make
@ -2032,9 +2029,18 @@ QByteArray QProcess::readAllStandardError()
\note No further splitting of the arguments is performed. \note No further splitting of the arguments is performed.
\b{Windows:} Arguments that contain spaces are wrapped in quotes. \b{Windows:} The arguments are quoted and joined into a command line
that is compatible with the CommandLineToArgvW() Windows function.
For programs that have different command line quoting requirements,
you need to use setNativeArguments().
\sa pid(), started(), waitForStarted() The OpenMode is set to \a mode.
If the QProcess object is already running a process, a warning may be
printed at the console, and the existing process will continue running
unaffected.
\sa pid(), started(), waitForStarted(), setNativeArguments()
*/ */
void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode) void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode)
{ {
@ -2057,8 +2063,6 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM
Starts the program set by setProgram() with arguments set by setArguments(). Starts the program set by setProgram() with arguments set by setArguments().
The OpenMode is set to \a mode. The OpenMode is set to \a mode.
This method is a convenient alias to open().
\sa open(), setProgram(), setArguments() \sa open(), setProgram(), setArguments()
*/ */
void QProcess::start(OpenMode mode) void QProcess::start(OpenMode mode)
@ -2077,22 +2081,13 @@ void QProcess::start(OpenMode mode)
} }
/*! /*!
Starts the program set by setProgram() in a new process, if none is already Starts the program set by setProgram() with arguments set by setArguments().
running, passing the command line arguments set by setArguments(). The OpenMode The OpenMode is set to \a mode.
is set to \a mode.
The QProcess object will immediately enter the Starting state. If the This method is an alias for start(), and exists only to fully implement
process starts successfully, QProcess will emit started(); otherwise, the interface defined by QIODevice.
error() will be emitted. If the QProcess object is already running a
process, a warning may be printed at the console, the function will return false,
and the existing process will continue running.
\note Processes are started asynchronously, which means the started()
and error() signals may be delayed. Call waitForStarted() to make
sure the process has started (or has failed to start) and those signals
have been emitted. In this regard, a true return value merly means the process
was correcty initialized, not that the program was actually started.
\sa start(), setProgram(), setArguments()
*/ */
bool QProcess::open(OpenMode mode) bool QProcess::open(OpenMode mode)
{ {
@ -2185,29 +2180,28 @@ static QStringList parseCombinedArgString(const QString &program)
/*! /*!
\overload \overload
Starts the command \a command in a new process, if one is not already Starts the command \a command in a new process.
running. \a command is a single string of text containing both the The OpenMode is set to \a mode.
program name and its arguments. The arguments are separated by one or
more spaces. For example: \a command is a single string of text containing both the program name
and its arguments. The arguments are separated by one or more spaces.
For example:
\snippet code/src_corelib_io_qprocess.cpp 5 \snippet code/src_corelib_io_qprocess.cpp 5
The \a command string can also contain quotes, to ensure that arguments Arguments containing spaces must be quoted to be correctly supplied to
containing spaces are correctly supplied to the new process. For example: the new process. For example:
\snippet code/src_corelib_io_qprocess.cpp 6 \snippet code/src_corelib_io_qprocess.cpp 6
If the QProcess object is already running a process, a warning may be Literal quotes in the \a command string are represented by triple quotes.
printed at the console, and the existing process will continue running. For example:
Note that, on Windows, quotes need to be both escaped and quoted.
For example, the above code would be specified in the following
way to ensure that \c{"My Documents"} is used as the argument to
the \c dir executable:
\snippet code/src_corelib_io_qprocess.cpp 7 \snippet code/src_corelib_io_qprocess.cpp 7
The OpenMode is set to \a mode. After the \a command string has been split and unquoted, this function
behaves like the overload which takes the arguments as a string list.
*/ */
void QProcess::start(const QString &command, OpenMode mode) void QProcess::start(const QString &command, OpenMode mode)
{ {
@ -2243,7 +2237,7 @@ QString QProcess::program() const
\since 5.1 \since 5.1
Set the \a program to use when starting the process. Set the \a program to use when starting the process.
That function must be call before open() This function must be called before start().
\sa start(), setArguments(), program() \sa start(), setArguments(), program()
*/ */
@ -2274,7 +2268,7 @@ QStringList QProcess::arguments() const
\since 5.1 \since 5.1
Set the \a arguments to pass to the called program when starting the process. Set the \a arguments to pass to the called program when starting the process.
That function must be call before open() This function must be called before start().
\sa start(), setProgram(), arguments() \sa start(), setProgram(), arguments()
*/ */
@ -2359,11 +2353,13 @@ QProcess::ExitStatus QProcess::exitStatus() const
The environment and working directory are inherited from the calling The environment and working directory are inherited from the calling
process. process.
On Windows, arguments that contain spaces are wrapped in quotes. Argument handling is identical to the respective start() overload.
If the process cannot be started, -2 is returned. If the process If the process cannot be started, -2 is returned. If the process
crashes, -1 is returned. Otherwise, the process' exit code is crashes, -1 is returned. Otherwise, the process' exit code is
returned. returned.
\sa start()
*/ */
int QProcess::execute(const QString &program, const QStringList &arguments) int QProcess::execute(const QString &program, const QStringList &arguments)
{ {
@ -2378,15 +2374,21 @@ int QProcess::execute(const QString &program, const QStringList &arguments)
/*! /*!
\overload \overload
Starts the program \a program in a new process. \a program is a Starts the program \a command in a new process, waits for it to finish,
single string of text containing both the program name and its and then returns the exit code.
arguments. The arguments are separated by one or more spaces.
Argument handling is identical to the respective start() overload.
After the \a command string has been split and unquoted, this function
behaves like the overload which takes the arguments as a string list.
\sa start()
*/ */
int QProcess::execute(const QString &program) int QProcess::execute(const QString &command)
{ {
QProcess process; QProcess process;
process.setReadChannelMode(ForwardedChannels); process.setReadChannelMode(ForwardedChannels);
process.start(program); process.start(command);
if (!process.waitForFinished(-1)) if (!process.waitForFinished(-1))
return -2; return -2;
return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1; return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
@ -2396,24 +2398,24 @@ int QProcess::execute(const QString &program)
Starts the program \a program with the arguments \a arguments in a Starts the program \a program with the arguments \a arguments in a
new process, and detaches from it. Returns \c true on success; new process, and detaches from it. Returns \c true on success;
otherwise returns \c false. If the calling process exits, the otherwise returns \c false. If the calling process exits, the
detached process will continue to live. detached process will continue to run unaffected.
Note that arguments that contain spaces are not passed to the Argument handling is identical to the respective start() overload.
process as separate arguments.
\b{Unix:} The started process will run in its own session and act \b{Unix:} The started process will run in its own session and act
like a daemon. like a daemon.
\b{Windows:} Arguments that contain spaces are wrapped in quotes.
The started process will run as a regular standalone process.
The process will be started in the directory \a workingDirectory. The process will be started in the directory \a workingDirectory.
If \a workingDirectory is empty, the working directory is inherited
from the calling process.
\note On QNX, this may cause all application threads to \note On QNX, this may cause all application threads to
temporarily freeze. temporarily freeze.
If the function is successful then *\a pid is set to the process If the function is successful then *\a pid is set to the process
identifier of the started process. identifier of the started process.
\sa start()
*/ */
bool QProcess::startDetached(const QString &program, bool QProcess::startDetached(const QString &program,
const QStringList &arguments, const QStringList &arguments,
@ -2427,19 +2429,7 @@ bool QProcess::startDetached(const QString &program,
} }
/*! /*!
Starts the program \a program with the given \a arguments in a \internal
new process, and detaches from it. Returns \c true on success;
otherwise returns \c false. If the calling process exits, the
detached process will continue to live.
\note Arguments that contain spaces are not passed to the
process as separate arguments.
\b{Unix:} The started process will run in its own session and act
like a daemon.
\b{Windows:} Arguments that contain spaces are wrapped in quotes.
The started process will run as a regular standalone process.
*/ */
bool QProcess::startDetached(const QString &program, bool QProcess::startDetached(const QString &program,
const QStringList &arguments) const QStringList &arguments)
@ -2450,16 +2440,19 @@ bool QProcess::startDetached(const QString &program,
/*! /*!
\overload \overload
Starts the program \a program in a new process. \a program is a Starts the command \a command in a new process, and detaches from it.
single string of text containing both the program name and its Returns \c true on success; otherwise returns \c false.
arguments. The arguments are separated by one or more spaces.
The \a program string can also contain quotes, to ensure that arguments Argument handling is identical to the respective start() overload.
containing spaces are correctly supplied to the new process.
After the \a command string has been split and unquoted, this function
behaves like the overload which takes the arguments as a string list.
\sa start()
*/ */
bool QProcess::startDetached(const QString &program) bool QProcess::startDetached(const QString &command)
{ {
QStringList args = parseCombinedArgString(program); QStringList args = parseCombinedArgString(command);
if (args.isEmpty()) if (args.isEmpty())
return false; return false;

View File

@ -209,12 +209,18 @@ public:
bool atEnd() const; bool atEnd() const;
static int execute(const QString &program, const QStringList &arguments); static int execute(const QString &program, const QStringList &arguments);
static int execute(const QString &program); static int execute(const QString &command);
static bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, static bool startDetached(const QString &program, const QStringList &arguments,
qint64 *pid = 0); const QString &workingDirectory
static bool startDetached(const QString &program, const QStringList &arguments); #if defined(Q_QDOC)
static bool startDetached(const QString &program); = QString()
#endif
, qint64 *pid = 0);
#if !defined(Q_QDOC)
static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
#endif
static bool startDetached(const QString &command);
static QStringList systemEnvironment(); static QStringList systemEnvironment();

View File

@ -696,6 +696,9 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
{ {
bool needsQuotes = false; bool needsQuotes = false;
bool escapeNextIfDigit = false; bool escapeNextIfDigit = false;
bool useCodec = codec && !str.startsWith(QLatin1String("@ByteArray("))
&& !str.startsWith(QLatin1String("@Variant("));
int i; int i;
int startPos = result.size(); int startPos = result.size();
@ -748,12 +751,12 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
result += (char)ch; result += (char)ch;
break; break;
default: default:
if (ch <= 0x1F || (ch >= 0x7F && !codec)) { if (ch <= 0x1F || (ch >= 0x7F && !useCodec)) {
result += "\\x"; result += "\\x";
result += QByteArray::number(ch, 16); result += QByteArray::number(ch, 16);
escapeNextIfDigit = true; escapeNextIfDigit = true;
#ifndef QT_NO_TEXTCODEC #ifndef QT_NO_TEXTCODEC
} else if (codec) { } else if (useCodec) {
// slow // slow
result += codec->fromUnicode(str.at(i)); result += codec->fromUnicode(str.at(i));
#endif #endif
@ -1084,10 +1087,10 @@ static QString windowsConfigPath(int type)
ComPtr<IStorageItem> localFolderItem; ComPtr<IStorageItem> localFolderItem;
if (FAILED(localFolder.As(&localFolderItem))) if (FAILED(localFolder.As(&localFolderItem)))
return result; return result;
HSTRING path; HString path;
if (FAILED(localFolderItem->get_Path(&path))) if (FAILED(localFolderItem->get_Path(path.GetAddressOf())))
return result; return result;
result = QString::fromWCharArray(WindowsGetStringRawBuffer(path, nullptr)); result = QString::fromWCharArray(path.GetRawBuffer(nullptr));
} }
switch (type) { switch (type) {

View File

@ -90,10 +90,10 @@ QString QStandardPaths::writableLocation(StandardLocation type)
ComPtr<IStorageItem> settingsFolderItem; ComPtr<IStorageItem> settingsFolderItem;
if (FAILED(settingsFolder.As(&settingsFolderItem))) if (FAILED(settingsFolder.As(&settingsFolderItem)))
break; break;
HSTRING path; HString path;
if (FAILED(settingsFolderItem->get_Path(&path))) if (FAILED(settingsFolderItem->get_Path(path.GetAddressOf())))
break; break;
result = convertCharArray(WindowsGetStringRawBuffer(path, nullptr)); result = convertCharArray(path.GetRawBuffer(nullptr));
if (isTestModeEnabled()) if (isTestModeEnabled())
result += QLatin1String("/qttest"); result += QLatin1String("/qttest");
break; break;

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the QtCore module of the Qt Toolkit. ** This file is part of the QtCore module of the Qt Toolkit.
@ -1504,10 +1504,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::rowsInserted(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::rowsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after rows have been inserted into the This signal is emitted after rows have been inserted into the
model. The new items are those between \a start and \a end model. The new items are those between \a first and \a last
inclusive, under the given \a parent item. inclusive, under the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the \note Components connected to this signal use it to adapt to changes in the
@ -1532,10 +1532,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after rows have been removed from the model. The This signal is emitted after rows have been removed from the model. The
removed items are those between \a start and \a end inclusive, under the removed items are those between \a first and \a last inclusive, under the
given \a parent item. given \a parent item.
\note Components connected to this signal use it to adapt to changes \note Components connected to this signal use it to adapt to changes
@ -1546,10 +1546,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted just before rows are removed from the model. The This signal is emitted just before rows are removed from the model. The
items that will be removed are those between \a start and \a end inclusive, items that will be removed are those between \a first and \a last inclusive,
under the given \a parent item. under the given \a parent item.
\note Components connected to this signal use it to adapt to changes \note Components connected to this signal use it to adapt to changes
@ -1624,10 +1624,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after columns have been inserted into the model. The This signal is emitted after columns have been inserted into the model. The
new items are those between \a start and \a end inclusive, under the given new items are those between \a first and \a last inclusive, under the given
\a parent item. \a parent item.
\note Components connected to this signal use it to adapt to changes in the \note Components connected to this signal use it to adapt to changes in the
@ -1638,10 +1638,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
This signal is emitted just before columns are inserted into the model. The This signal is emitted just before columns are inserted into the model. The
new items will be positioned between \a start and \a end inclusive, under new items will be positioned between \a first and \a last inclusive, under
the given \a parent item. the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the \note Components connected to this signal use it to adapt to changes in the
@ -1652,10 +1652,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after columns have been removed from the model. This signal is emitted after columns have been removed from the model.
The removed items are those between \a start and \a end inclusive, The removed items are those between \a first and \a last inclusive,
under the given \a parent item. under the given \a parent item.
\note Components connected to this signal use it to adapt to changes in \note Components connected to this signal use it to adapt to changes in
@ -1666,10 +1666,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/ */
/*! /*!
\fn void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end) \fn void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted just before columns are removed from the model. The This signal is emitted just before columns are removed from the model. The
items to be removed are those between \a start and \a end inclusive, under items to be removed are those between \a first and \a last inclusive, under
the given \a parent item. the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the \note Components connected to this signal use it to adapt to changes in the

View File

@ -377,8 +377,7 @@ bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const
*/ */
QModelIndex QAbstractProxyModel::sibling(int row, int column, const QModelIndex &idx) const QModelIndex QAbstractProxyModel::sibling(int row, int column, const QModelIndex &idx) const
{ {
Q_D(const QAbstractProxyModel); return index(row, column, idx.parent());
return mapFromSource(d->model->sibling(row, column, mapToSource(idx)));
} }
/*! /*!

View File

@ -515,7 +515,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
\code \code
const bool wasBlocked = someQObject->blockSignals(true); const bool wasBlocked = someQObject->blockSignals(true);
// no signals here // no signals here
someQObject->blockSignals(false); someQObject->blockSignals(wasBlocked);
\endcode \endcode
except the code using QSignalBlocker is safe in the face of except the code using QSignalBlocker is safe in the face of

View File

@ -148,6 +148,7 @@ bool QSharedMemoryPrivate::create(int size)
// Create the file mapping. // Create the file mapping.
#if defined(Q_OS_WINPHONE) #if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED(); Q_UNIMPLEMENTED();
Q_UNUSED(size)
hand = 0; hand = 0;
#elif defined(Q_OS_WINRT) #elif defined(Q_OS_WINRT)
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16()); hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16());
@ -169,6 +170,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS); int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS);
#if defined(Q_OS_WINPHONE) #if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED(); Q_UNIMPLEMENTED();
Q_UNUSED(mode)
memory = 0; memory = 0;
#elif defined(Q_OS_WINRT) #elif defined(Q_OS_WINRT)
memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0); memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);

View File

@ -92,7 +92,7 @@ public:
bool wait(int timeout = -1); bool wait(int timeout = -1);
void wakeUp() Q_DECL_NOTHROW; void wakeUp() Q_DECL_NOTHROW;
// Conrol the lifetime of the privates // Control the lifetime of the privates
QAtomicInt refCount; QAtomicInt refCount;
int id; int id;

View File

@ -155,6 +155,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
#elif defined(Q_OS_WINPHONE) #elif defined(Q_OS_WINPHONE)
int size = 0; int size = 0;
Q_UNIMPLEMENTED(); Q_UNIMPLEMENTED();
Q_UNUSED(string)
#else // Q_OS_WINPHONE #else // Q_OS_WINPHONE
int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator, int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator,
reinterpret_cast<LPCWSTR>(string.constData()), string.size(), reinterpret_cast<LPCWSTR>(string.constData()), string.size(),

View File

@ -73,7 +73,7 @@ struct QFreeListElement
typedef T &ReferenceType; typedef T &ReferenceType;
T _t; T _t;
int next; QAtomicInt next;
inline ConstReferenceType t() const { return _t; } inline ConstReferenceType t() const { return _t; }
inline ReferenceType t() { return _t; } inline ReferenceType t() { return _t; }
@ -81,7 +81,7 @@ struct QFreeListElement
/*! \internal /*! \internal
Element in a QFreeList without a paylout. ConstReferenceType and Element in a QFreeList without a payload. ConstReferenceType and
ReferenceType are void, the t() functions return void and are empty. ReferenceType are void, the t() functions return void and are empty.
*/ */
template <> template <>
@ -90,7 +90,7 @@ struct QFreeListElement<void>
typedef void ConstReferenceType; typedef void ConstReferenceType;
typedef void ReferenceType; typedef void ReferenceType;
int next; QAtomicInt next;
inline void t() const { } inline void t() const { }
inline void t() { } inline void t() { }
@ -172,7 +172,7 @@ class QFreeList
// qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset); // qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset);
ElementType *v = new ElementType[size]; ElementType *v = new ElementType[size];
for (int i = 0; i < size; ++i) for (int i = 0; i < size; ++i)
v[i].next = offset + i + 1; v[i].next.store(offset + i + 1);
return v; return v;
} }
@ -254,7 +254,7 @@ inline int QFreeList<T, ConstantsType>::next()
} }
} }
newid = v[at].next | (id & ~ConstantsType::IndexMask); newid = v[at].next.load() | (id & ~ConstantsType::IndexMask);
} while (!_next.testAndSetRelaxed(id, newid)); } while (!_next.testAndSetRelaxed(id, newid));
// qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)", // qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)",
// id & ConstantsType::IndexMask, // id & ConstantsType::IndexMask,
@ -273,7 +273,7 @@ inline void QFreeList<T, ConstantsType>::release(int id)
int x, newid; int x, newid;
do { do {
x = _next.loadAcquire(); x = _next.loadAcquire();
v[at].next = x & ConstantsType::IndexMask; v[at].next.store(x & ConstantsType::IndexMask);
newid = incrementserial(x, id); newid = incrementserial(x, id);
} while (!_next.testAndSetRelease(x, newid)); } while (!_next.testAndSetRelease(x, newid));

View File

@ -663,10 +663,10 @@ QVariant QSystemLocalePrivate::uiLanguages()
unsigned int size; unsigned int size;
languageList->get_Size(&size); languageList->get_Size(&size);
for (unsigned int i = 0; i < size; ++i) { for (unsigned int i = 0; i < size; ++i) {
HSTRING language; HString language;
languageList->GetAt(i, &language); languageList->GetAt(i, language.GetAddressOf());
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(language, &length); PCWSTR rawString = language.GetRawBuffer(&length);
result << QString::fromWCharArray(rawString, length); result << QString::fromWCharArray(rawString, length);
} }
#else // !Q_OS_WINPHONE #else // !Q_OS_WINPHONE

View File

@ -102,9 +102,6 @@ struct Q_CORE_EXPORT QMapNodeBase
void setColor(Color c) { if (c == Black) p |= Black; else p &= ~Black; } void setColor(Color c) { if (c == Black) p |= Black; else p &= ~Black; }
QMapNodeBase *parent() const { return reinterpret_cast<QMapNodeBase *>(p & ~Mask); } QMapNodeBase *parent() const { return reinterpret_cast<QMapNodeBase *>(p & ~Mask); }
void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); } void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); }
QMapNodeBase *minimumNode() { QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
const QMapNodeBase *minimumNode() const { const QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
}; };
template <class Key, class T> template <class Key, class T>
@ -121,9 +118,6 @@ struct QMapNode : public QMapNodeBase
inline QMapNode *nextNode() { return static_cast<QMapNode *>(QMapNodeBase::nextNode()); } inline QMapNode *nextNode() { return static_cast<QMapNode *>(QMapNodeBase::nextNode()); }
inline QMapNode *previousNode() { return static_cast<QMapNode *>(QMapNodeBase::previousNode()); } inline QMapNode *previousNode() { return static_cast<QMapNode *>(QMapNodeBase::previousNode()); }
QMapNode *minimumNode() { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
const QMapNode *minimumNode() const { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
QMapNode<Key, T> *copy(QMapData<Key, T> *d) const; QMapNode<Key, T> *copy(QMapData<Key, T> *d) const;
void destroySubTree(); void destroySubTree();

View File

@ -13,7 +13,8 @@ exampledirs += ../../../examples/dbus \
snippets snippets
headerdirs += .. headerdirs += ..
imagedirs += images imagedirs += images \
../../../examples/dbus/doc/images
sourcedirs += .. \ sourcedirs += .. \
../../../examples/dbus/doc/src ../../../examples/dbus/doc/src
excludedirs += ../../../examples/widgets/doc excludedirs += ../../../examples/widgets/doc
@ -44,11 +45,18 @@ qhp.QtDBus.indexTitle = Qt D-Bus
# Only update the name of the project for the next variables. # Only update the name of the project for the next variables.
qhp.QtDBus.virtualFolder = qtdbus qhp.QtDBus.virtualFolder = qtdbus
qhp.QtDBus.subprojects = classes qhp.QtDBus.subprojects = classes examples
qhp.QtDBus.subprojects.classes.title = C++ Classes qhp.QtDBus.subprojects.classes.title = C++ Classes
qhp.QtDBus.subprojects.classes.indexTitle = Qt D-Bus C++ Classes qhp.QtDBus.subprojects.classes.indexTitle = Qt D-Bus C++ Classes
qhp.QtDBus.subprojects.classes.selectors = class fake:headerfile qhp.QtDBus.subprojects.classes.selectors = class fake:headerfile
qhp.QtDBus.subprojects.classes.sortPages = true qhp.QtDBus.subprojects.classes.sortPages = true
qhp.QtDBus.subprojects.examples.title = Examples
qhp.QtDBus.subprojects.examples.indexTitle = Qt D-Bus Examples
qhp.QtDBus.subprojects.examples.selectors = fake:example
navigation.landingpage = "Qt D-Bus" navigation.landingpage = "Qt D-Bus"
navigation.cppclassespage = "Qt D-Bus C++ Classes" navigation.cppclassespage = "Qt D-Bus C++ Classes"
manifestmeta.thumbnail.names = "QtDBus/D-Bus List Names Example" \
"QtDBus/D-Bus Ping Pong Example" \
"QtDBus/D-Bus Complex Ping Pong Example" \

View File

@ -0,0 +1,38 @@
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** 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 Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\group examples-dbus
\title Qt D-Bus Examples
\brief Using D-Bus from Qt applications.
\ingroup all-examples
\l{Qt D-Bus} allows applications to send messages to each other using
D-Bus. This page lists examples which specifically use D-Bus for
inter-process communication (IPC).
*/

View File

@ -211,5 +211,6 @@
\li \l{The Qt D-Bus Type System} \li \l{The Qt D-Bus Type System}
\li \l{Qt D-Bus XML compiler (qdbusxml2cpp)} \li \l{Qt D-Bus XML compiler (qdbusxml2cpp)}
\li \l{Qt D-Bus C++ Classes} \li \l{Qt D-Bus C++ Classes}
\li \l{Qt D-Bus Examples}
\endlist \endlist
*/ */

View File

@ -107,7 +107,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}")
!!ENDIF !!ENDIF
if (WIN32 AND NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) if (WIN32 AND NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn't work for finding # The above find_library call doesn\'t work for finding
# libraries in Windows SDK paths outside of the proper # libraries in Windows SDK paths outside of the proper
# environment. Just add the library name to the result # environment. Just add the library name to the result
# variable instead. # variable instead.

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal ** Contact: http://www.qt-project.org/legal
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
@ -133,6 +133,68 @@ int qt_wince_GetDIBits(HDC /*hdc*/ , HBITMAP hSourceBitmap, uint, uint, LPVOID l
} }
#endif #endif
static inline void initBitMapInfoHeader(int width, int height, bool topToBottom, BITMAPINFOHEADER *bih)
{
memset(bih, 0, sizeof(BITMAPINFOHEADER));
bih->biSize = sizeof(BITMAPINFOHEADER);
bih->biWidth = width;
bih->biHeight = topToBottom ? -height : height;
bih->biPlanes = 1;
bih->biBitCount = 32;
bih->biCompression = BI_RGB;
bih->biSizeImage = width * height * 4;
}
static inline void initBitMapInfo(int width, int height, bool topToBottom, BITMAPINFO *bmi)
{
initBitMapInfoHeader(width, height, topToBottom, &bmi->bmiHeader);
memset(bmi->bmiColors, 0, sizeof(RGBQUAD));
}
static inline uchar *getDiBits(HDC hdc, HBITMAP bitmap, int width, int height, bool topToBottom = true)
{
BITMAPINFO bmi;
initBitMapInfo(width, height, topToBottom, &bmi);
uchar *result = new uchar[bmi.bmiHeader.biSizeImage];
if (!GetDIBits(hdc, bitmap, 0, height, result, &bmi, DIB_RGB_COLORS)) {
delete [] result;
qErrnoWarning("%s: GetDIBits() failed to get bitmap bits.", __FUNCTION__);
return 0;
}
return result;
}
static inline void copyImageDataCreateAlpha(const uchar *data, QImage *target)
{
const uint mask = target->format() == QImage::Format_RGB32 ? 0xff000000 : 0;
const int height = target->height();
const int width = target->width();
const int bytesPerLine = width * int(sizeof(QRgb));
for (int y = 0; y < height; ++y) {
QRgb *dest = reinterpret_cast<QRgb *>(target->scanLine(y));
const QRgb *src = reinterpret_cast<const QRgb *>(data + y * bytesPerLine);
for (int x = 0; x < width; ++x) {
const uint pixel = src[x];
if ((pixel & 0xff000000) == 0 && (pixel & 0x00ffffff) != 0)
dest[x] = pixel | 0xff000000;
else
dest[x] = pixel | mask;
}
}
}
static inline void copyImageData(const uchar *data, QImage *target)
{
const int height = target->height();
const int bytesPerLine = target->bytesPerLine();
for (int y = 0; y < height; ++y) {
void *dest = static_cast<void *>(target->scanLine(y));
const void *src = data + y * bytesPerLine;
memcpy(dest, src, bytesPerLine);
}
}
enum HBitmapFormat enum HBitmapFormat
{ {
HBitmapNoAlpha, HBitmapNoAlpha,
@ -176,14 +238,7 @@ Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat =
// Define the header // Define the header
BITMAPINFO bmi; BITMAPINFO bmi;
memset(&bmi, 0, sizeof(bmi)); initBitMapInfo(w, h, true, &bmi);
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = w;
bmi.bmiHeader.biHeight = -h;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = w * h * 4;
// Create the pixmap // Create the pixmap
uchar *pixels = 0; uchar *pixels = 0;
@ -227,31 +282,16 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat =
const int w = bitmap_info.bmWidth; const int w = bitmap_info.bmWidth;
const int h = bitmap_info.bmHeight; const int h = bitmap_info.bmHeight;
BITMAPINFO bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = w;
bmi.bmiHeader.biHeight = -h;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = w * h * 4;
// Get bitmap bits // Get bitmap bits
QScopedArrayPointer<uchar> data(new uchar[bmi.bmiHeader.biSizeImage]);
HDC display_dc = GetDC(0); HDC display_dc = GetDC(0);
if (!GetDIBits(display_dc, bitmap, 0, h, data.data(), &bmi, DIB_RGB_COLORS)) { QScopedArrayPointer<uchar> data(getDiBits(display_dc, bitmap, w, h, true));
if (data.isNull()) {
ReleaseDC(0, display_dc); ReleaseDC(0, display_dc);
qWarning("%s, failed to get bitmap bits", __FUNCTION__);
return QPixmap(); return QPixmap();
} }
QImage::Format imageFormat = QImage::Format_ARGB32_Premultiplied; const QImage::Format imageFormat = hbitmapFormat == HBitmapNoAlpha ?
uint mask = 0; QImage::Format_RGB32 : QImage::Format_ARGB32_Premultiplied;
if (hbitmapFormat == HBitmapNoAlpha) {
imageFormat = QImage::Format_RGB32;
mask = 0xff000000;
}
// Create image and copy data into image. // Create image and copy data into image.
QImage image(w, h, imageFormat); QImage image(w, h, imageFormat);
@ -260,18 +300,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat =
qWarning("%s, failed create image of %dx%d", __FUNCTION__, w, h); qWarning("%s, failed create image of %dx%d", __FUNCTION__, w, h);
return QPixmap(); return QPixmap();
} }
const int bytes_per_line = w * sizeof(QRgb); copyImageDataCreateAlpha(data.data(), &image);
for (int y = 0; y < h; ++y) {
QRgb *dest = (QRgb *) image.scanLine(y);
const QRgb *src = (const QRgb *) (data.data() + y * bytes_per_line);
for (int x = 0; x < w; ++x) {
const uint pixel = src[x];
if ((pixel & 0xff000000) == 0 && (pixel & 0x00ffffff) != 0)
dest[x] = pixel | 0xff000000;
else
dest[x] = pixel | mask;
}
}
ReleaseDC(0, display_dc); ReleaseDC(0, display_dc);
return QPixmap::fromImage(image); return QPixmap::fromImage(image);
} }
@ -307,32 +336,25 @@ Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p)
Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h) Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
{ {
BITMAPINFO bmi;
memset(&bmi, 0, sizeof(bmi));
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = w;
bmi.bmiHeader.biHeight = -h;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 32;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = w * h * 4;
QImage image(w, h, QImage::Format_ARGB32_Premultiplied); QImage image(w, h, QImage::Format_ARGB32_Premultiplied);
if (image.isNull()) if (image.isNull())
return image; return image;
QScopedArrayPointer<uchar> data(getDiBits(hdc, bitmap, w, h, true));
// Get bitmap bits if (data.isNull())
QScopedArrayPointer<uchar> data(new uchar [bmi.bmiHeader.biSizeImage]);
if (!GetDIBits(hdc, bitmap, 0, h, data.data(), &bmi, DIB_RGB_COLORS)) {
qErrnoWarning("%s: failed to get bitmap bits", __FUNCTION__);
return QImage(); return QImage();
} copyImageDataCreateAlpha(data.data(), &image);
// Create image and copy data into image. return image;
for (int y = 0; y < h; ++y) { }
void *dest = (void *) image.scanLine(y);
void *src = data.data() + y * image.bytesPerLine(); static QImage qt_imageFromWinIconHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
memcpy(dest, src, image.bytesPerLine()); {
} QImage image(w, h, QImage::Format_ARGB32_Premultiplied);
if (image.isNull())
return image;
QScopedArrayPointer<uchar> data(getDiBits(hdc, bitmap, w, h, true));
if (data.isNull())
return QImage();
copyImageData(data.data(), &image);
return image; return image;
} }
@ -354,23 +376,13 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon)
const int h = iconinfo.yHotspot * 2; const int h = iconinfo.yHotspot * 2;
BITMAPINFOHEADER bitmapInfo; BITMAPINFOHEADER bitmapInfo;
bitmapInfo.biSize = sizeof(BITMAPINFOHEADER); initBitMapInfoHeader(w, h, false, &bitmapInfo);
bitmapInfo.biWidth = w;
bitmapInfo.biHeight = h;
bitmapInfo.biPlanes = 1;
bitmapInfo.biBitCount = 32;
bitmapInfo.biCompression = BI_RGB;
bitmapInfo.biSizeImage = 0;
bitmapInfo.biXPelsPerMeter = 0;
bitmapInfo.biYPelsPerMeter = 0;
bitmapInfo.biClrUsed = 0;
bitmapInfo.biClrImportant = 0;
DWORD* bits; DWORD* bits;
HBITMAP winBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bitmapInfo, DIB_RGB_COLORS, (VOID**)&bits, NULL, 0); HBITMAP winBitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bitmapInfo, DIB_RGB_COLORS, (VOID**)&bits, NULL, 0);
HGDIOBJ oldhdc = (HBITMAP)SelectObject(hdc, winBitmap); HGDIOBJ oldhdc = (HBITMAP)SelectObject(hdc, winBitmap);
DrawIconEx( hdc, 0, 0, icon, iconinfo.xHotspot * 2, iconinfo.yHotspot * 2, 0, 0, DI_NORMAL); DrawIconEx( hdc, 0, 0, icon, iconinfo.xHotspot * 2, iconinfo.yHotspot * 2, 0, 0, DI_NORMAL);
QImage image = qt_imageFromWinHBITMAP(hdc, winBitmap, w, h); QImage image = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
for (int y = 0 ; y < h && !foundAlpha ; y++) { for (int y = 0 ; y < h && !foundAlpha ; y++) {
const QRgb *scanLine= reinterpret_cast<const QRgb *>(image.scanLine(y)); const QRgb *scanLine= reinterpret_cast<const QRgb *>(image.scanLine(y));
@ -384,7 +396,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon)
if (!foundAlpha) { if (!foundAlpha) {
//If no alpha was found, we use the mask to set alpha values //If no alpha was found, we use the mask to set alpha values
DrawIconEx( hdc, 0, 0, icon, w, h, 0, 0, DI_MASK); DrawIconEx( hdc, 0, 0, icon, w, h, 0, 0, DI_MASK);
const QImage mask = qt_imageFromWinHBITMAP(hdc, winBitmap, w, h); const QImage mask = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
for (int y = 0 ; y < h ; y++){ for (int y = 0 ; y < h ; y++){
QRgb *scanlineImage = reinterpret_cast<QRgb *>(image.scanLine(y)); QRgb *scanlineImage = reinterpret_cast<QRgb *>(image.scanLine(y));

View File

@ -40,6 +40,7 @@
****************************************************************************/ ****************************************************************************/
#include "qsurface.h" #include "qsurface.h"
#include "qopenglcontext.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -130,6 +131,11 @@ QSurface::QSurface(SurfaceClass type)
*/ */
QSurface::~QSurface() QSurface::~QSurface()
{ {
#ifndef QT_NO_OPENGL
QOpenGLContext *context = QOpenGLContext::currentContext();
if (context && context->surface() == this)
context->doneCurrent();
#endif
} }
/*! /*!

View File

@ -453,10 +453,19 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
if (samples == 0) { if (samples == 0) {
initTexture(texture_target, internal_format, size, mipmap); initTexture(texture_target, internal_format, size, mipmap);
} else { } else {
GLenum storageFormat = internal_format;
#ifdef GL_RGBA8_OES
// Correct the internal format used by the render buffer when using ANGLE
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES && internal_format == GL_RGBA
&& strstr((const char *)funcs.glGetString(GL_RENDERER), "ANGLE") != 0) {
storageFormat = GL_RGBA8_OES;
}
#endif
mipmap = false; mipmap = false;
funcs.glGenRenderbuffers(1, &color_buffer); funcs.glGenRenderbuffers(1, &color_buffer);
funcs.glBindRenderbuffer(GL_RENDERBUFFER, color_buffer); funcs.glBindRenderbuffer(GL_RENDERBUFFER, color_buffer);
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, internal_format, size.width(), size.height()); funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storageFormat, size.width(), size.height());
funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, funcs.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, color_buffer); GL_RENDERBUFFER, color_buffer);
QT_CHECK_GLERROR(); QT_CHECK_GLERROR();

View File

@ -381,6 +381,10 @@ static int qt_gl_resolve_extensions()
// TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing. // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing.
if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888"))
extensions |= QOpenGLExtensions::BGRATextureFormat; extensions |= QOpenGLExtensions::BGRATextureFormat;
if (extensionMatcher.match("GL_ANGLE_framebuffer_blit"))
extensions |= QOpenGLExtensions::FramebufferBlit;
if (extensionMatcher.match("GL_ANGLE_framebuffer_multisample"))
extensions |= QOpenGLExtensions::FramebufferMultisample;
} else { } else {
extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer; extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer;
@ -3150,7 +3154,7 @@ static void QOPENGLF_APIENTRY qopenglfResolveBlitFramebuffer(GLint srcX0, GLint
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter) GLbitfield mask, GLenum filter)
{ {
RESOLVE_FUNC_VOID(ResolveEXT, BlitFramebuffer) RESOLVE_FUNC_VOID_WITH_ALTERNATE(ResolveEXT, BlitFramebuffer, BlitFramebufferANGLE)
(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
} }
@ -3158,7 +3162,7 @@ static void QOPENGLF_APIENTRY qopenglfResolveRenderbufferStorageMultisample(GLen
GLenum internalFormat, GLenum internalFormat,
GLsizei width, GLsizei height) GLsizei width, GLsizei height)
{ {
RESOLVE_FUNC_VOID(ResolveEXT, RenderbufferStorageMultisample) RESOLVE_FUNC_VOID_WITH_ALTERNATE(ResolveEXT, RenderbufferStorageMultisample, RenderbufferStorageMultisampleANGLE)
(target, samples, internalFormat, width, height); (target, samples, internalFormat, width, height);
} }

View File

@ -2447,7 +2447,9 @@ bool QOpenGLTexture::isFixedSamplePositions() const
void QOpenGLTexture::allocateStorage() void QOpenGLTexture::allocateStorage()
{ {
Q_D(QOpenGLTexture); Q_D(QOpenGLTexture);
if (d->create()) {
d->allocateStorage(); d->allocateStorage();
}
} }
/*! /*!
@ -2805,33 +2807,49 @@ bool QOpenGLTexture::hasFeature(Feature feature)
if (!ctx->isOpenGLES()) { if (!ctx->isOpenGLES()) {
switch (feature) { switch (feature) {
case ImmutableMultisampleStorage: case ImmutableMultisampleStorage:
supported = f.version() >= qMakePair(4, 3)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_storage_multisample"));
break;
case TextureBuffer: case TextureBuffer:
supported = f.version() >= qMakePair(4, 3)
|| (ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_buffer_object"))
&& ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_buffer_range")));
break;
case StencilTexturing: case StencilTexturing:
supported = f.version() >= qMakePair(4, 3); supported = f.version() >= qMakePair(4, 3)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_stencil_texturing"));
break; break;
case ImmutableStorage: case ImmutableStorage:
supported = f.version() >= qMakePair(4, 2); supported = f.version() >= qMakePair(4, 2)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_storage"));
break; break;
case TextureCubeMapArrays: case TextureCubeMapArrays:
supported = f.version() >= qMakePair(4, 0); supported = f.version() >= qMakePair(4, 0)
|| ctx->hasExtension(QByteArrayLiteral("ARB_texture_cube_map_array"));
break; break;
case Swizzle: case Swizzle:
supported = f.version() >= qMakePair(3, 3); supported = f.version() >= qMakePair(3, 3)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_swizzle"));
break; break;
case TextureMultisample: case TextureMultisample:
supported = f.version() >= qMakePair(3, 2); supported = f.version() >= qMakePair(3, 2)
|| ctx->hasExtension(QByteArrayLiteral("GL_ARB_texture_multisample"));
break; break;
case TextureArrays: case TextureArrays:
supported = f.version() >= qMakePair(3, 0); supported = f.version() >= qMakePair(3, 0)
|| ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_array"));
break; break;
case TextureRectangle: case TextureRectangle:
supported = f.version() >= qMakePair(2, 1); supported = f.version() >= qMakePair(2, 1)
|| ctx->hasExtension(QByteArrayLiteral("ARB_texture_rectangle"));
break; break;
case Texture3D: case Texture3D:
@ -3162,7 +3180,7 @@ void QOpenGLTexture::setDepthStencilMode(QOpenGLTexture::DepthStencilMode mode)
Q_ASSERT(d->texFuncs); Q_ASSERT(d->texFuncs);
Q_ASSERT(d->textureId); Q_ASSERT(d->textureId);
if (!d->features.testFlag(StencilTexturing)) { if (!d->features.testFlag(StencilTexturing)) {
qWarning("QOpenGLTexture::setDepthStencilMode() requires OpenGL >= 4.3"); qWarning("QOpenGLTexture::setDepthStencilMode() requires OpenGL >= 4.3 or GL_ARB_stencil_texturing");
return; return;
} }
d->depthStencilMode = mode; d->depthStencilMode = mode;

View File

@ -87,6 +87,7 @@ QOpenGLTextureGlyphCache::~QOpenGLTextureGlyphCache()
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG #ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
qDebug(" -> ~QOpenGLTextureGlyphCache() %p.", this); qDebug(" -> ~QOpenGLTextureGlyphCache() %p.", this);
#endif #endif
clear();
} }
static inline bool isCoreProfile() static inline bool isCoreProfile()
@ -447,6 +448,7 @@ int QOpenGLTextureGlyphCache::maxTextureHeight() const
void QOpenGLTextureGlyphCache::clear() void QOpenGLTextureGlyphCache::clear()
{ {
if (m_textureResource)
m_textureResource->free(); m_textureResource->free();
m_textureResource = 0; m_textureResource = 0;

View File

@ -2603,7 +2603,7 @@ void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx
return; return;
} }
} }
} else if (d->deviceDepth == 32 && (depth == 8 || depth == 32)) { } else if (d->deviceDepth == 32 && ((depth == 8 && s->penData.alphamapBlit) || (depth == 32 && s->penData.alphaRGBBlit))) {
// (A)RGB Alpha mask where the alpha component is not used. // (A)RGB Alpha mask where the alpha component is not used.
if (!clip) { if (!clip) {
int nx = qMax(0, rx); int nx = qMax(0, rx);
@ -2626,13 +2626,12 @@ void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx
rx = nx; rx = nx;
ry = ny; ry = ny;
} }
if (depth == 8 && s->penData.alphamapBlit) { if (depth == 8)
s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color, s->penData.alphamapBlit(rb, rx, ry, s->penData.solid.color,
scanline, w, h, bpl, clip); scanline, w, h, bpl, clip);
} else if (depth == 32 && s->penData.alphaRGBBlit) { else if (depth == 32)
s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color, s->penData.alphaRGBBlit(rb, rx, ry, s->penData.solid.color,
(const uint *) scanline, w, h, bpl / 4, clip); (const uint *) scanline, w, h, bpl / 4, clip);
}
return; return;
} }
} }

View File

@ -657,7 +657,8 @@ void QNetworkReply::setSslConfiguration(const QSslConfiguration &config)
If this function is called, the SSL errors given in \a errors If this function is called, the SSL errors given in \a errors
will be ignored. will be ignored.
Note that you can set the expected certificate in the SSL error: \note Because most SSL errors are associated with a certificate, for most
of them you must set the expected certificate this SSL error is related to.
If, for instance, you want to issue a request to a server that uses If, for instance, you want to issue a request to a server that uses
a self-signed certificate, consider the following snippet: a self-signed certificate, consider the following snippet:

View File

@ -98,9 +98,9 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics); GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
IAsyncOperation<IVectorView<EndpointPair*> *> *op; IAsyncOperation<IVectorView<EndpointPair*> *> *op;
HSTRING proto; datagramSocketStatics->GetEndpointPairsAsync(host,
WindowsCreateString(L"0", 1, &proto); HString::MakeReference(L"0").Get(),
datagramSocketStatics->GetEndpointPairsAsync(host, proto, &op); &op);
datagramSocketStatics->Release(); datagramSocketStatics->Release();
host->Release(); host->Release();
@ -134,11 +134,11 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
|| (type == HostNameType_Ipv6 && requestType == QDnsLookup::A)))) || (type == HostNameType_Ipv6 && requestType == QDnsLookup::A))))
continue; continue;
HSTRING name; HString name;
remoteHost->get_CanonicalName(&name); remoteHost->get_CanonicalName(name.GetAddressOf());
remoteHost->Release(); remoteHost->Release();
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(name, &length); PCWSTR rawString = name.GetRawBuffer(&length);
QDnsHostAddressRecord record; QDnsHostAddressRecord record;
record.d->name = aceHostname; record.d->name = aceHostname;
record.d->value = QHostAddress(QString::fromWCharArray(rawString, length)); record.d->value = QHostAddress(QString::fromWCharArray(rawString, length));

View File

@ -453,6 +453,8 @@ QHostAddress::QHostAddress(const struct sockaddr *sockaddr)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr)); setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6) else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr); setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
#else
Q_UNUSED(sockaddr)
#endif #endif
} }
@ -612,6 +614,8 @@ void QHostAddress::setAddress(const struct sockaddr *sockaddr)
setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr)); setAddress(htonl(((sockaddr_in *)sockaddr)->sin_addr.s_addr));
else if (sockaddr->sa_family == AF_INET6) else if (sockaddr->sa_family == AF_INET6)
setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr); setAddress(((qt_sockaddr_in6 *)sockaddr)->sin6_addr.qt_s6_addr);
#else
Q_UNUSED(sockaddr)
#endif #endif
} }

View File

@ -84,7 +84,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
HStringReference classId(RuntimeClass_Windows_Networking_HostName); HStringReference classId(RuntimeClass_Windows_Networking_HostName);
if (FAILED(GetActivationFactory(classId.Get(), &hostnameFactory))) if (FAILED(GetActivationFactory(classId.Get(), &hostnameFactory)))
Q_ASSERT(false, "Could not obtain hostname factory."); Q_ASSERT_X(false, "QHostInfoAgent", "Could not obtain hostname factory.");
IHostName *host; IHostName *host;
HStringReference hostNameRef((const wchar_t*)hostName.utf16()); HStringReference hostNameRef((const wchar_t*)hostName.utf16());
@ -95,9 +95,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics); GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
IAsyncOperation<IVectorView<EndpointPair*> *> *op; IAsyncOperation<IVectorView<EndpointPair*> *> *op;
HSTRING proto; datagramSocketStatics->GetEndpointPairsAsync(host,
WindowsCreateString(L"0", 1, &proto); HString::MakeReference(L"0").Get(),
datagramSocketStatics->GetEndpointPairsAsync(host, proto, &op); &op);
datagramSocketStatics->Release(); datagramSocketStatics->Release();
host->Release(); host->Release();
@ -131,11 +131,11 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
if (type == HostNameType_DomainName) if (type == HostNameType_DomainName)
continue; continue;
HSTRING name; HString name;
remoteHost->get_CanonicalName(&name); remoteHost->get_CanonicalName(name.GetAddressOf());
remoteHost->Release(); remoteHost->Release();
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(name, &length); PCWSTR rawString = name.GetRawBuffer(&length);
QHostAddress addr; QHostAddress addr;
addr.setAddress(QString::fromWCharArray(rawString, length)); addr.setAddress(QString::fromWCharArray(rawString, length));
if (!addresses.contains(addr)) if (!addresses.contains(addr))
@ -170,22 +170,22 @@ QString QHostInfo::localHostName()
if (type != HostNameType_DomainName) if (type != HostNameType_DomainName)
continue; continue;
HSTRING name; HString name;
hostName->get_CanonicalName(&name); hostName->get_CanonicalName(name.GetAddressOf());
hostName->Release(); hostName->Release();
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(name, &length); PCWSTR rawString = name.GetRawBuffer(&length);
return QString::fromWCharArray(rawString, length); return QString::fromWCharArray(rawString, length);
} }
IHostName *firstHost; IHostName *firstHost;
hostNames->GetAt(0, &firstHost); hostNames->GetAt(0, &firstHost);
hostNames->Release(); hostNames->Release();
HSTRING name; HString name;
firstHost->get_CanonicalName(&name); firstHost->get_CanonicalName(name.GetAddressOf());
firstHost->Release(); firstHost->Release();
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(name, &length); PCWSTR rawString = name.GetRawBuffer(&length);
return QString::fromWCharArray(rawString, length); return QString::fromWCharArray(rawString, length);
} }

View File

@ -114,11 +114,11 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
|| (type == HostNameType_Ipv6 && hostInfo.prefixLength > 128)) || (type == HostNameType_Ipv6 && hostInfo.prefixLength > 128))
continue; continue;
HSTRING name; HString name;
hostName->get_CanonicalName(&name); hostName->get_CanonicalName(name.GetAddressOf());
hostName->Release(); hostName->Release();
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(name, &length); PCWSTR rawString = name.GetRawBuffer(&length);
hostInfo.address = QString::fromWCharArray(rawString, length); hostInfo.address = QString::fromWCharArray(rawString, length);
hostList << hostInfo; hostList << hostInfo;

View File

@ -111,6 +111,7 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po
QHostAddress tmpAddress; QHostAddress tmpAddress;
tmpAddress.setAddress(tmp); tmpAddress.setAddress(tmp);
*addr = tmpAddress; *addr = tmpAddress;
if (s->a6.sin6_scope_id) {
#ifndef QT_NO_IPV6IFNAME #ifndef QT_NO_IPV6IFNAME
char scopeid[IFNAMSIZ]; char scopeid[IFNAMSIZ];
if (::if_indextoname(s->a6.sin6_scope_id, scopeid)) { if (::if_indextoname(s->a6.sin6_scope_id, scopeid)) {
@ -119,6 +120,7 @@ static inline void qt_socket_getPortAndAddress(const qt_sockaddr *s, quint16 *po
#endif #endif
addr->setScopeId(QString::number(s->a6.sin6_scope_id)); addr->setScopeId(QString::number(s->a6.sin6_scope_id));
} }
}
if (port) if (port)
*port = ntohs(s->a6.sin6_port); *port = ntohs(s->a6.sin6_port);
return; return;

View File

@ -182,6 +182,7 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt
if (address) { if (address) {
QHostAddress a; QHostAddress a;
a.setAddress(tmp); a.setAddress(tmp);
if (sa6->sin6_scope_id)
a.setScopeId(QString::number(sa6->sin6_scope_id)); a.setScopeId(QString::number(sa6->sin6_scope_id));
*address = a; *address = a;
} }

View File

@ -124,10 +124,10 @@ struct SocketHandler
Q_GLOBAL_STATIC(SocketHandler, gSocketHandler) Q_GLOBAL_STATIC(SocketHandler, gSocketHandler)
QString qt_QStringFromHSTRING(HSTRING string) static inline QString qt_QStringFromHString(const HString &string)
{ {
UINT32 length; UINT32 length;
PCWSTR rawString = WindowsGetStringRawBuffer(string, &length); PCWSTR rawString = string.GetRawBuffer(&length);
return QString::fromWCharArray(rawString, length); return QString::fromWCharArray(rawString, length);
} }
@ -604,13 +604,13 @@ qint64 QNativeSocketEngine::readDatagram(char *data, qint64 maxlen, QHostAddress
for (int i = 0; i < d->pendingDatagrams.size(); ++i) { for (int i = 0; i < d->pendingDatagrams.size(); ++i) {
IDatagramSocketMessageReceivedEventArgs *arg = d->pendingDatagrams.at(i); IDatagramSocketMessageReceivedEventArgs *arg = d->pendingDatagrams.at(i);
ComPtr<IHostName> remoteHost; ComPtr<IHostName> remoteHost;
HSTRING remoteHostString; HString remoteHostString;
HSTRING remotePort; HString remotePort;
arg->get_RemoteAddress(&remoteHost); arg->get_RemoteAddress(&remoteHost);
arg->get_RemotePort(&remotePort); arg->get_RemotePort(remotePort.GetAddressOf());
remoteHost->get_CanonicalName(&remoteHostString); remoteHost->get_CanonicalName(remoteHostString.GetAddressOf());
returnAddress.setAddress(qt_QStringFromHSTRING(remoteHostString)); returnAddress.setAddress(qt_QStringFromHString(remoteHostString));
returnPort = qt_QStringFromHSTRING(remotePort).toInt(); returnPort = qt_QStringFromHString(remotePort).toInt();
ComPtr<IDataReader> reader; ComPtr<IDataReader> reader;
arg->GetDataReader(&reader); arg->GetDataReader(&reader);
if (!reader) if (!reader)
@ -1097,7 +1097,7 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
if (socketType == QAbstractSocket::TcpSocket) { if (socketType == QAbstractSocket::TcpSocket) {
ComPtr<IHostName> hostName; ComPtr<IHostName> hostName;
HSTRING tmpHString; HString tmpHString;
ComPtr<IStreamSocketInformation> info; ComPtr<IStreamSocketInformation> info;
if (FAILED(tcp->get_Information(&info))) { if (FAILED(tcp->get_Information(&info))) {
qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket info"); qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket info");
@ -1105,28 +1105,28 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
} }
info->get_LocalAddress(&hostName); info->get_LocalAddress(&hostName);
if (hostName) { if (hostName) {
hostName->get_CanonicalName(&tmpHString); hostName->get_CanonicalName(tmpHString.GetAddressOf());
localAddress.setAddress(qt_QStringFromHSTRING(tmpHString)); localAddress.setAddress(qt_QStringFromHString(tmpHString));
info->get_LocalPort(&tmpHString); info->get_LocalPort(tmpHString.GetAddressOf());
localPort = qt_QStringFromHSTRING(tmpHString).toInt(); localPort = qt_QStringFromHString(tmpHString).toInt();
} }
if (!localPort && tcpListener) { if (!localPort && tcpListener) {
ComPtr<IStreamSocketListenerInformation> listenerInfo = 0; ComPtr<IStreamSocketListenerInformation> listenerInfo = 0;
tcpListener->get_Information(&listenerInfo); tcpListener->get_Information(&listenerInfo);
listenerInfo->get_LocalPort(&tmpHString); listenerInfo->get_LocalPort(tmpHString.GetAddressOf());
localPort = qt_QStringFromHSTRING(tmpHString).toInt(); localPort = qt_QStringFromHString(tmpHString).toInt();
localAddress == QHostAddress::Any; localAddress == QHostAddress::Any;
} }
info->get_RemoteAddress(&hostName); info->get_RemoteAddress(&hostName);
if (hostName) { if (hostName) {
hostName->get_CanonicalName(&tmpHString); hostName->get_CanonicalName(tmpHString.GetAddressOf());
peerAddress.setAddress(qt_QStringFromHSTRING(tmpHString)); peerAddress.setAddress(qt_QStringFromHString(tmpHString));
info->get_RemotePort(&tmpHString); info->get_RemotePort(tmpHString.GetAddressOf());
peerPort = qt_QStringFromHSTRING(tmpHString).toInt(); peerPort = qt_QStringFromHString(tmpHString).toInt();
} }
} else if (socketType == QAbstractSocket::UdpSocket) { } else if (socketType == QAbstractSocket::UdpSocket) {
ComPtr<IHostName> hostName; ComPtr<IHostName> hostName;
HSTRING tmpHString; HString tmpHString;
ComPtr<IDatagramSocketInformation> info; ComPtr<IDatagramSocketInformation> info;
if (FAILED(udp->get_Information(&info))) { if (FAILED(udp->get_Information(&info))) {
qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket information"); qWarning("QNativeSocketEnginePrivate::fetchConnectionParameters: Could not obtain socket information");
@ -1134,18 +1134,18 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
} }
info->get_LocalAddress(&hostName); info->get_LocalAddress(&hostName);
if (hostName) { if (hostName) {
hostName->get_CanonicalName(&tmpHString); hostName->get_CanonicalName(tmpHString.GetAddressOf());
localAddress.setAddress(qt_QStringFromHSTRING(tmpHString)); localAddress.setAddress(qt_QStringFromHString(tmpHString));
info->get_LocalPort(&tmpHString); info->get_LocalPort(tmpHString.GetAddressOf());
localPort = qt_QStringFromHSTRING(tmpHString).toInt(); localPort = qt_QStringFromHString(tmpHString).toInt();
} }
info->get_RemoteAddress(&hostName); info->get_RemoteAddress(&hostName);
if (hostName) { if (hostName) {
hostName->get_CanonicalName(&tmpHString); hostName->get_CanonicalName(tmpHString.GetAddressOf());
peerAddress.setAddress(qt_QStringFromHSTRING(tmpHString)); peerAddress.setAddress(qt_QStringFromHString(tmpHString));
info->get_RemotePort(&tmpHString); info->get_RemotePort(tmpHString.GetAddressOf());
peerPort = qt_QStringFromHSTRING(tmpHString).toInt(); peerPort = qt_QStringFromHString(tmpHString).toInt();
} }
} }
return true; return true;
@ -1159,7 +1159,7 @@ HRESULT QNativeSocketEnginePrivate::handleBindCompleted(IAsyncAction *, AsyncSta
HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener *listener, IStreamSocketListenerConnectionReceivedEventArgs *args) HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener *listener, IStreamSocketListenerConnectionReceivedEventArgs *args)
{ {
Q_Q(QNativeSocketEngine); Q_Q(QNativeSocketEngine);
Q_ASSERT(tcpListener.Get() == listener); Q_UNUSED(listener)
IStreamSocket *socket; IStreamSocket *socket;
args->get_Socket(&socket); args->get_Socket(&socket);
pendingConnections.append(socket); pendingConnections.append(socket);
@ -1253,7 +1253,7 @@ HRESULT QNativeSocketEnginePrivate::handleWriteCompleted(IAsyncOperationWithProg
HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, IDatagramSocketMessageReceivedEventArgs *args) HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, IDatagramSocketMessageReceivedEventArgs *args)
{ {
Q_Q(QNativeSocketEngine); Q_Q(QNativeSocketEngine);
Q_ASSERT(udp == socket); Q_UNUSED(socket)
pendingDatagrams.append(args); pendingDatagrams.append(args);
emit q->readReady(); emit q->readReady();

View File

@ -777,6 +777,8 @@ void QSslSocket::close()
qDebug() << "QSslSocket::close()"; qDebug() << "QSslSocket::close()";
#endif #endif
Q_D(QSslSocket); Q_D(QSslSocket);
if (encryptedBytesToWrite())
flush();
if (d->plainSocket) if (d->plainSocket)
d->plainSocket->close(); d->plainSocket->close();
QTcpSocket::close(); QTcpSocket::close();
@ -1810,7 +1812,8 @@ void QSslSocket::ignoreSslErrors()
This method tells QSslSocket to ignore only the errors given in \a This method tells QSslSocket to ignore only the errors given in \a
errors. errors.
Note that you can set the expected certificate in the SSL error: \note Because most SSL errors are associated with a certificate, for most
of them you must set the expected certificate this SSL error is related to.
If, for instance, you want to connect to a server that uses If, for instance, you want to connect to a server that uses
a self-signed certificate, consider the following snippet: a self-signed certificate, consider the following snippet:

View File

@ -58,8 +58,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
static QDBusConnection dbusConnection = QDBusConnection::systemBus();
class QNetworkManagerInterfacePrivate class QNetworkManagerInterfacePrivate
{ {
public: public:
@ -74,7 +72,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
QLatin1String(NM_DBUS_PATH), QLatin1String(NM_DBUS_PATH),
QLatin1String(NM_DBUS_INTERFACE), QLatin1String(NM_DBUS_INTERFACE),
dbusConnection); QDBusConnection::systemBus());
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -103,6 +101,9 @@ bool QNetworkManagerInterface::setConnections()
{ {
if(!isValid() ) if(!isValid() )
return false; return false;
QDBusConnection dbusConnection = QDBusConnection::systemBus();
bool allOk = false; bool allOk = false;
if (!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE), if (!dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE),
QLatin1String(NM_DBUS_PATH), QLatin1String(NM_DBUS_PATH),
@ -198,7 +199,7 @@ QNetworkManagerInterfaceAccessPoint::QNetworkManagerInterfaceAccessPoint(const Q
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_ACCESS_POINT), QLatin1String(NM_DBUS_INTERFACE_ACCESS_POINT),
dbusConnection); QDBusConnection::systemBus());
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -229,7 +230,7 @@ bool QNetworkManagerInterfaceAccessPoint::setConnections()
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)), connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>))); this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)));
if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE), if (QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_ACCESS_POINT), QLatin1String(NM_DBUS_INTERFACE_ACCESS_POINT),
QLatin1String("PropertiesChanged"), QLatin1String("PropertiesChanged"),
@ -306,7 +307,7 @@ QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &de
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_DEVICE), QLatin1String(NM_DBUS_INTERFACE_DEVICE),
dbusConnection); QDBusConnection::systemBus());
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -335,7 +336,7 @@ bool QNetworkManagerInterfaceDevice::setConnections()
nmDBusHelper = new QNmDBusHelper(this); nmDBusHelper = new QNmDBusHelper(this);
connect(nmDBusHelper,SIGNAL(pathForStateChanged(QString,quint32)), connect(nmDBusHelper,SIGNAL(pathForStateChanged(QString,quint32)),
this, SIGNAL(stateChanged(QString,quint32))); this, SIGNAL(stateChanged(QString,quint32)));
if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE), if (QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_DEVICE), QLatin1String(NM_DBUS_INTERFACE_DEVICE),
QLatin1String("StateChanged"), QLatin1String("StateChanged"),
@ -397,7 +398,7 @@ QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const Q
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED), QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED),
dbusConnection, parent); QDBusConnection::systemBus(), parent);
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -428,7 +429,7 @@ bool QNetworkManagerInterfaceDeviceWired::setConnections()
nmDBusHelper = new QNmDBusHelper(this); nmDBusHelper = new QNmDBusHelper(this);
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)), connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>))); this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)));
if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE), if (QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED), QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED),
QLatin1String("PropertiesChanged"), QLatin1String("PropertiesChanged"),
@ -474,7 +475,7 @@ QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(c
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRELESS), QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRELESS),
dbusConnection, parent); QDBusConnection::systemBus(), parent);
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -498,6 +499,7 @@ bool QNetworkManagerInterfaceDeviceWireless::setConnections()
if(!isValid() ) if(!isValid() )
return false; return false;
QDBusConnection dbusConnection = QDBusConnection::systemBus();
bool allOk = false; bool allOk = false;
delete nmDBusHelper; delete nmDBusHelper;
nmDBusHelper = new QNmDBusHelper(this); nmDBusHelper = new QNmDBusHelper(this);
@ -591,7 +593,7 @@ QNetworkManagerSettings::QNetworkManagerSettings(const QString &settingsService,
d->connectionInterface = new QDBusInterface(settingsService, d->connectionInterface = new QDBusInterface(settingsService,
QLatin1String(NM_DBUS_PATH_SETTINGS), QLatin1String(NM_DBUS_PATH_SETTINGS),
QLatin1String(NM_DBUS_IFACE_SETTINGS), QLatin1String(NM_DBUS_IFACE_SETTINGS),
dbusConnection); QDBusConnection::systemBus());
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -614,7 +616,7 @@ bool QNetworkManagerSettings::setConnections()
{ {
bool allOk = false; bool allOk = false;
if (!dbusConnection.connect(d->path, QLatin1String(NM_DBUS_PATH_SETTINGS), if (!QDBusConnection::systemBus().connect(d->path, QLatin1String(NM_DBUS_PATH_SETTINGS),
QLatin1String(NM_DBUS_IFACE_SETTINGS), QLatin1String("NewConnection"), QLatin1String(NM_DBUS_IFACE_SETTINGS), QLatin1String("NewConnection"),
this, SIGNAL(newConnection(QDBusObjectPath)))) { this, SIGNAL(newConnection(QDBusObjectPath)))) {
allOk = true; allOk = true;
@ -655,7 +657,7 @@ QNetworkManagerSettingsConnection::QNetworkManagerSettingsConnection(const QStri
d->connectionInterface = new QDBusInterface(settingsService, d->connectionInterface = new QDBusInterface(settingsService,
d->path, d->path,
QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION),
dbusConnection, parent); QDBusConnection::systemBus(), parent);
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -681,6 +683,7 @@ bool QNetworkManagerSettingsConnection::setConnections()
if(!isValid() ) if(!isValid() )
return false; return false;
QDBusConnection dbusConnection = QDBusConnection::systemBus();
bool allOk = false; bool allOk = false;
if(!dbusConnection.connect(d->service, d->path, if(!dbusConnection.connect(d->service, d->path,
QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("Updated"), QLatin1String(NM_DBUS_IFACE_SETTINGS_CONNECTION), QLatin1String("Updated"),
@ -808,7 +811,7 @@ QNetworkManagerConnectionActive::QNetworkManagerConnectionActive( const QString
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION), QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION),
dbusConnection, parent); QDBusConnection::systemBus(), parent);
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;
@ -837,7 +840,7 @@ bool QNetworkManagerConnectionActive::setConnections()
nmDBusHelper = new QNmDBusHelper(this); nmDBusHelper = new QNmDBusHelper(this);
connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)), connect(nmDBusHelper, SIGNAL(pathForPropertiesChanged(QString,QMap<QString,QVariant>)),
this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>))); this,SIGNAL(propertiesChanged(QString,QMap<QString,QVariant>)));
if(dbusConnection.connect(QLatin1String(NM_DBUS_SERVICE), if (QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION), QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION),
QLatin1String("PropertiesChanged"), QLatin1String("PropertiesChanged"),
@ -902,7 +905,7 @@ QNetworkManagerIp4Config::QNetworkManagerIp4Config( const QString &deviceObjectP
d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE), d->connectionInterface = new QDBusInterface(QLatin1String(NM_DBUS_SERVICE),
d->path, d->path,
QLatin1String(NM_DBUS_INTERFACE_IP4_CONFIG), QLatin1String(NM_DBUS_INTERFACE_IP4_CONFIG),
dbusConnection, parent); QDBusConnection::systemBus(), parent);
if (!d->connectionInterface->isValid()) { if (!d->connectionInterface->isValid()) {
d->valid = false; d->valid = false;
return; return;

View File

@ -56,6 +56,18 @@ static const char m_methodErrorMsg[] = "Can't find method \"%s%s\"";
namespace QtAndroidAccessibility namespace QtAndroidAccessibility
{ {
static jmethodID m_addActionMethodID = 0;
static jmethodID m_setCheckableMethodID = 0;
static jmethodID m_setCheckedMethodID = 0;
static jmethodID m_setClickableMethodID = 0;
static jmethodID m_setContentDescriptionMethodID = 0;
static jmethodID m_setEnabledMethodID = 0;
static jmethodID m_setFocusableMethodID = 0;
static jmethodID m_setFocusedMethodID = 0;
static jmethodID m_setTextSelectionMethodID = 0;
static jmethodID m_setVisibleToUserMethodID = 0;
static void setActive(JNIEnv */*env*/, jobject /*thiz*/, jboolean active) static void setActive(JNIEnv */*env*/, jobject /*thiz*/, jboolean active)
{ {
QAndroidPlatformIntegration *platformIntegration = QtAndroid::androidPlatformIntegration(); QAndroidPlatformIntegration *platformIntegration = QtAndroid::androidPlatformIntegration();
@ -164,17 +176,6 @@ if (!clazz) { \
//__android_log_print(ANDROID_LOG_FATAL, m_qtTag, m_methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE); //__android_log_print(ANDROID_LOG_FATAL, m_qtTag, m_methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE);
#define CALL_METHOD(OBJECT, METHOD_NAME, METHOD_SIGNATURE, ...) \
{ \
jclass clazz = env->GetObjectClass(OBJECT); \
jmethodID method = env->GetMethodID(clazz, METHOD_NAME, METHOD_SIGNATURE); \
if (!method) { \
__android_log_print(ANDROID_LOG_WARN, m_qtTag, m_methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE); \
return false; \
} \
env->CallVoidMethod(OBJECT, method, __VA_ARGS__); \
}
static jstring descriptionForAccessibleObject(JNIEnv *env, jobject /*thiz*/, jint objectId) static jstring descriptionForAccessibleObject(JNIEnv *env, jobject /*thiz*/, jint objectId)
{ {
@ -210,30 +211,30 @@ if (!clazz) { \
int startSelection; int startSelection;
int endSelection; int endSelection;
textIface->selection(0, &startSelection, &endSelection); textIface->selection(0, &startSelection, &endSelection);
CALL_METHOD(node, "setTextSelection", "(II)V", startSelection, endSelection) env->CallVoidMethod(node, m_setTextSelectionMethodID, startSelection, endSelection);
} }
} }
CALL_METHOD(node, "setEnabled", "(Z)V", !state.disabled) env->CallVoidMethod(node, m_setEnabledMethodID, !state.disabled);
CALL_METHOD(node, "setFocusable", "(Z)V", (bool)state.focusable) env->CallVoidMethod(node, m_setCheckedMethodID, (bool)state.checked);
CALL_METHOD(node, "setFocused", "(Z)V", (bool)state.focused) env->CallVoidMethod(node, m_setFocusableMethodID, (bool)state.focusable);
CALL_METHOD(node, "setCheckable", "(Z)V", (bool)state.checkable) env->CallVoidMethod(node, m_setFocusedMethodID, (bool)state.focused);
CALL_METHOD(node, "setChecked", "(Z)V", (bool)state.checked) env->CallVoidMethod(node, m_setCheckableMethodID, (bool)state.checkable);
CALL_METHOD(node, "setVisibleToUser", "(Z)V", !state.invisible) env->CallVoidMethod(node, m_setVisibleToUserMethodID, !state.invisible);
if (iface->actionInterface()) { if (iface->actionInterface()) {
QStringList actions = iface->actionInterface()->actionNames(); QStringList actions = iface->actionInterface()->actionNames();
bool clickable = actions.contains(QAccessibleActionInterface::pressAction()); bool clickable = actions.contains(QAccessibleActionInterface::pressAction());
bool toggle = actions.contains(QAccessibleActionInterface::toggleAction()); bool toggle = actions.contains(QAccessibleActionInterface::toggleAction());
if (clickable || toggle) { if (clickable || toggle) {
CALL_METHOD(node, "setClickable", "(Z)V", (bool)clickable) env->CallVoidMethod(node, m_setClickableMethodID, (bool)clickable);
CALL_METHOD(node, "addAction", "(I)V", 16) // ACTION_CLICK defined in AccessibilityNodeInfo env->CallVoidMethod(node, m_addActionMethodID, (int)16); // ACTION_CLICK defined in AccessibilityNodeInfo
} }
} }
jstring jdesc = env->NewString((jchar*) desc.constData(), (jsize) desc.size()); jstring jdesc = env->NewString((jchar*) desc.constData(), (jsize) desc.size());
//CALL_METHOD(node, "setText", "(Ljava/lang/CharSequence;)V", jdesc) //CALL_METHOD(node, "setText", "(Ljava/lang/CharSequence;)V", jdesc)
CALL_METHOD(node, "setContentDescription", "(Ljava/lang/CharSequence;)V", jdesc) env->CallVoidMethod(node, m_setContentDescriptionMethodID, jdesc);
return true; return true;
} }
@ -249,6 +250,13 @@ if (!clazz) { \
{"clickAction", "(I)Z", (void*)clickAction}, {"clickAction", "(I)Z", (void*)clickAction},
}; };
#define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE) \
VAR = env->GetMethodID(CLASS, METHOD_NAME, METHOD_SIGNATURE); \
if (!VAR) { \
__android_log_print(ANDROID_LOG_FATAL, QtAndroid::qtTagText(), QtAndroid::methodErrorMsgFmt(), METHOD_NAME, METHOD_SIGNATURE); \
return false; \
}
bool registerNatives(JNIEnv *env) bool registerNatives(JNIEnv *env)
{ {
jclass clazz; jclass clazz;
@ -260,6 +268,18 @@ if (!clazz) { \
return false; return false;
} }
jclass nodeInfoClass = env->FindClass("android/view/accessibility/AccessibilityNodeInfo");
GET_AND_CHECK_STATIC_METHOD(m_addActionMethodID, nodeInfoClass, "addAction", "(I)V");
GET_AND_CHECK_STATIC_METHOD(m_setCheckableMethodID, nodeInfoClass, "setCheckable", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setCheckedMethodID, nodeInfoClass, "setChecked", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setClickableMethodID, nodeInfoClass, "setClickable", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setContentDescriptionMethodID, nodeInfoClass, "setContentDescription", "(Ljava/lang/CharSequence;)V");
GET_AND_CHECK_STATIC_METHOD(m_setEnabledMethodID, nodeInfoClass, "setEnabled", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setFocusableMethodID, nodeInfoClass, "setFocusable", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setFocusedMethodID, nodeInfoClass, "setFocused", "(Z)V");
GET_AND_CHECK_STATIC_METHOD(m_setTextSelectionMethodID, nodeInfoClass, "setTextSelection", "(II)V");
GET_AND_CHECK_STATIC_METHOD(m_setVisibleToUserMethodID, nodeInfoClass, "setVisibleToUser", "(Z)V");
return true; return true;
} }
} }

View File

@ -573,9 +573,12 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/)
return; return;
if (QGuiApplication::instance() != 0) { if (QGuiApplication::instance() != 0) {
foreach (QWindow *w, QGuiApplication::topLevelWindows()) foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
QRect availableGeometry = w->screen()->availableGeometry();
if (w->geometry().width() > 0 && w->geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
QWindowSystemInterface::handleExposeEvent(w, QRegion(w->geometry())); QWindowSystemInterface::handleExposeEvent(w, QRegion(w->geometry()));
} }
}
QAndroidPlatformScreen *screen = static_cast<QAndroidPlatformScreen *>(m_androidPlatformIntegration->screen()); QAndroidPlatformScreen *screen = static_cast<QAndroidPlatformScreen *>(m_androidPlatformIntegration->screen());
if (screen->rasterSurfaces()) if (screen->rasterSurfaces())

View File

@ -472,12 +472,24 @@ void QAndroidInputContext::updateCursorPosition()
if (m_composingText.isEmpty() != (m_composingTextStart == -1)) if (m_composingText.isEmpty() != (m_composingTextStart == -1))
qWarning() << "Input method out of sync" << m_composingText << m_composingTextStart; qWarning() << "Input method out of sync" << m_composingText << m_composingTextStart;
// Qt's idea of the cursor position is the start of the preedit area, so we have to maintain our own preedit cursor pos
int realCursorPosition = cursorPos; int realCursorPosition = cursorPos;
int realAnchorPosition = cursorPos;
int cpos = query->value(Qt::ImCursorPosition).toInt();
int anchor = query->value(Qt::ImAnchorPosition).toInt();
if (cpos != anchor) {
if (!m_composingText.isEmpty()) {
qWarning("Selecting text while preediting may give unpredictable results.");
finishComposingText();
}
int blockPos = getBlockPosition(query);
realCursorPosition = blockPos + cpos;
realAnchorPosition = blockPos + anchor;
}
// Qt's idea of the cursor position is the start of the preedit area, so we maintain our own preedit cursor pos
if (!m_composingText.isEmpty()) if (!m_composingText.isEmpty())
realCursorPosition = m_composingCursor; realCursorPosition = realAnchorPosition = m_composingCursor;
QtAndroidInput::updateSelection(realCursorPosition, realCursorPosition, //empty selection QtAndroidInput::updateSelection(realCursorPosition, realAnchorPosition,
m_composingTextStart, m_composingTextStart + composeLength); // pre-edit text m_composingTextStart, m_composingTextStart + composeLength); // pre-edit text
} }
} }

View File

@ -45,11 +45,14 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QOpenGLContext> #include <QOpenGLContext>
#include <QThread> #include <QThread>
#include <QOffscreenSurface>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformwindow.h> #include <qpa/qplatformwindow.h>
#include <qpa/qplatformoffscreensurface.h>
#include "androidjnimain.h" #include "androidjnimain.h"
#include "qabstracteventdispatcher.h" #include "qabstracteventdispatcher.h"
@ -207,6 +210,17 @@ QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext
return new QAndroidPlatformOpenGLContext(format, context->shareHandle(), m_eglDisplay); return new QAndroidPlatformOpenGLContext(format, context->shareHandle(), m_eglDisplay);
} }
QPlatformOffscreenSurface *QAndroidPlatformIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
QSurfaceFormat format(surface->requestedFormat());
format.setAlphaBufferSize(8);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
return new QEGLPbuffer(m_eglDisplay, format, surface);
}
QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *window) const QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *window) const
{ {
if (window->type() == Qt::ForeignWindow) if (window->type() == Qt::ForeignWindow)

View File

@ -82,6 +82,7 @@ public:
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
QAbstractEventDispatcher *createEventDispatcher() const; QAbstractEventDispatcher *createEventDispatcher() const;
QAndroidPlatformScreen *screen() { return m_primaryScreen; } QAndroidPlatformScreen *screen() { return m_primaryScreen; }
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const;
virtual void setDesktopSize(int width, int height); virtual void setDesktopSize(int width, int height);
virtual void setDisplayMetrics(int width, int height); virtual void setDisplayMetrics(int width, int height);

View File

@ -44,6 +44,8 @@
#include "qandroidplatformopenglwindow.h" #include "qandroidplatformopenglwindow.h"
#include "qandroidplatformintegration.h" #include "qandroidplatformintegration.h"
#include <QtPlatformSupport/private/qeglpbuffer_p.h>
#include <QSurface> #include <QSurface>
#include <QtGui/private/qopenglcontext_p.h> #include <QtGui/private/qopenglcontext_p.h>
@ -98,7 +100,8 @@ EGLSurface QAndroidPlatformOpenGLContext::eglSurfaceForPlatformSurface(QPlatform
{ {
if (surface->surface()->surfaceClass() == QSurface::Window) if (surface->surface()->surfaceClass() == QSurface::Window)
return static_cast<QAndroidPlatformOpenGLWindow *>(surface)->eglSurface(eglConfig()); return static_cast<QAndroidPlatformOpenGLWindow *>(surface)->eglSurface(eglConfig());
return EGL_NO_SURFACE; else
return static_cast<QEGLPbuffer *>(surface)->pbuffer();
} }
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -47,7 +47,8 @@
#include <QSurfaceFormat> #include <QSurfaceFormat>
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformscreen.h>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include <android/native_window.h> #include <android/native_window.h>
#include <android/native_window_jni.h> #include <android/native_window_jni.h>
@ -77,8 +78,20 @@ void QAndroidPlatformOpenGLWindow::setGeometry(const QRect &rect)
if (rect == geometry()) if (rect == geometry())
return; return;
QRect oldGeometry = geometry();
QAndroidPlatformWindow::setGeometry(rect); QAndroidPlatformWindow::setGeometry(rect);
QtAndroid::setSurfaceGeometry(m_nativeSurfaceId, rect); QtAndroid::setSurfaceGeometry(m_nativeSurfaceId, rect);
QRect availableGeometry = screen()->availableGeometry();
if (oldGeometry.width() == 0
&& oldGeometry.height() == 0
&& rect.width() > 0
&& rect.height() > 0
&& availableGeometry.width() > 0
&& availableGeometry.height() > 0) {
QWindowSystemInterface::handleExposeEvent(window(), QRegion(rect));
}
} }
EGLSurface QAndroidPlatformOpenGLWindow::eglSurface(EGLConfig config) EGLSurface QAndroidPlatformOpenGLWindow::eglSurface(EGLConfig config)
@ -100,7 +113,10 @@ void QAndroidPlatformOpenGLWindow::checkNativeSurface(EGLConfig config)
createEgl(config); createEgl(config);
// we've create another surface, the window should be repainted // we've create another surface, the window should be repainted
QRect availableGeometry = screen()->availableGeometry();
if (geometry().width() > 0 && geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
} }
@ -111,6 +127,7 @@ void QAndroidPlatformOpenGLWindow::createEgl(EGLConfig config)
m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object());
m_androidSurfaceObject = QJNIObjectPrivate(); m_androidSurfaceObject = QJNIObjectPrivate();
m_eglSurface = eglCreateWindowSurface(m_eglDisplay, config, m_nativeWindow, NULL); m_eglSurface = eglCreateWindowSurface(m_eglDisplay, config, m_nativeWindow, NULL);
m_format = q_glFormatFromConfig(m_eglDisplay, config, window()->requestedFormat());
if (m_eglSurface == EGL_NO_SURFACE) { if (m_eglSurface == EGL_NO_SURFACE) {
EGLint error = eglGetError(); EGLint error = eglGetError();
eglTerminate(m_eglDisplay); eglTerminate(m_eglDisplay);
@ -118,6 +135,14 @@ void QAndroidPlatformOpenGLWindow::createEgl(EGLConfig config)
} }
} }
QSurfaceFormat QAndroidPlatformOpenGLWindow::format() const
{
if (m_nativeWindow == 0)
return window()->requestedFormat();
else
return m_format;
}
void QAndroidPlatformOpenGLWindow::clearEgl() void QAndroidPlatformOpenGLWindow::clearEgl()
{ {
eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
@ -143,6 +168,8 @@ void QAndroidPlatformOpenGLWindow::surfaceChanged(JNIEnv *jniEnv, jobject surfac
unlockSurface(); unlockSurface();
// repaint the window // repaint the window
QRect availableGeometry = screen()->availableGeometry();
if (geometry().width() > 0 && geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
} }

View File

@ -60,6 +60,7 @@ public:
void setGeometry(const QRect &rect); void setGeometry(const QRect &rect);
EGLSurface eglSurface(EGLConfig config); EGLSurface eglSurface(EGLConfig config);
QSurfaceFormat format() const;
void checkNativeSurface(EGLConfig config); void checkNativeSurface(EGLConfig config);
@ -76,6 +77,7 @@ private:
int m_nativeSurfaceId = -1; int m_nativeSurfaceId = -1;
QJNIObjectPrivate m_androidSurfaceObject; QJNIObjectPrivate m_androidSurfaceObject;
QWaitCondition m_surfaceWaitCondition; QWaitCondition m_surfaceWaitCondition;
QSurfaceFormat m_format;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -76,6 +76,8 @@ void QAndroidPlatformRasterWindow::setGeometry(const QRect &rect)
{ {
m_oldGeometry = geometry(); m_oldGeometry = geometry();
QAndroidPlatformWindow::setGeometry(rect); QAndroidPlatformWindow::setGeometry(rect);
if (rect.topLeft() != m_oldGeometry.topLeft())
repaint(QRegion(rect));
} }
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -55,6 +55,9 @@
#include <android/bitmap.h> #include <android/bitmap.h>
#include <android/native_window_jni.h> #include <android/native_window_jni.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifdef QANDROIDPLATFORMSCREEN_DEBUG #ifdef QANDROIDPLATFORMSCREEN_DEBUG
@ -217,11 +220,23 @@ void QAndroidPlatformScreen::setGeometry(const QRect &rect)
if (m_geometry == rect) if (m_geometry == rect)
return; return;
QRect oldGeometry = m_geometry;
m_geometry = rect; m_geometry = rect;
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry()); QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry());
QWindowSystemInterface::handleScreenAvailableGeometryChange(QPlatformScreen::screen(), availableGeometry()); QWindowSystemInterface::handleScreenAvailableGeometryChange(QPlatformScreen::screen(), availableGeometry());
resizeMaximizedWindows(); resizeMaximizedWindows();
if (oldGeometry.width() == 0 && oldGeometry.height() == 0 && rect.width() > 0 && rect.height() > 0) {
QList<QWindow *> windows = QGuiApplication::allWindows();
for (int i = 0; i < windows.size(); ++i) {
QWindow *w = windows.at(i);
QRect geometry = w->handle()->geometry();
if (geometry.width() > 0 && geometry.height() > 0)
QWindowSystemInterface::handleExposeEvent(w, QRegion(geometry));
}
}
if (m_id != -1) { if (m_id != -1) {
if (m_nativeSurface) { if (m_nativeSurface) {
ANativeWindow_release(m_nativeSurface); ANativeWindow_release(m_nativeSurface);

View File

@ -88,6 +88,8 @@ void QAndroidPlatformWindow::setVisible(bool visible)
setGeometry(platformScreen()->availableGeometry()); setGeometry(platformScreen()->availableGeometry());
} }
QRect availableGeometry = screen()->availableGeometry();
if (geometry().width() > 0 && geometry().height() > 0 && availableGeometry.width() > 0 && availableGeometry.height() > 0)
QPlatformWindow::setVisible(visible); QPlatformWindow::setVisible(visible);
if (visible) if (visible)

View File

@ -380,7 +380,7 @@
- (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute { - (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute {
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid); QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
if (!iface) if (!iface)
return nil; return NO;
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
return iface->state().focusable ? YES : NO; return iface->state().focusable ? YES : NO;

View File

@ -124,7 +124,7 @@ static void cleanupCocoaApplicationDelegate()
[dockMenu release]; [dockMenu release];
[qtMenuLoader release]; [qtMenuLoader release];
if (reflectionDelegate) { if (reflectionDelegate) {
[NSApp setDelegate:reflectionDelegate]; [[NSApplication sharedApplication] setDelegate:reflectionDelegate];
[reflectionDelegate release]; [reflectionDelegate release];
} }
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];

View File

@ -134,8 +134,6 @@ public:
void interrupt(); void interrupt();
void flush(); void flush();
bool event(QEvent *);
friend void qt_mac_maybeCancelWaitForMoreEventsForwarder(QAbstractEventDispatcher *eventDispatcher); friend void qt_mac_maybeCancelWaitForMoreEventsForwarder(QAbstractEventDispatcher *eventDispatcher);
}; };
@ -180,6 +178,8 @@ public:
void maybeCancelWaitForMoreEvents(); void maybeCancelWaitForMoreEvents();
void ensureNSAppInitialized(); void ensureNSAppInitialized();
void removeQueuedUserInputEvents(int nsWinNumber);
QCFSocketNotifier cfSocketNotifier; QCFSocketNotifier cfSocketNotifier;
QList<void *> queuedUserInputEvents; // NSEvent * QList<void *> queuedUserInputEvents; // NSEvent *
CFRunLoopSourceRef postedEventsSource; CFRunLoopSourceRef postedEventsSource;

View File

@ -415,6 +415,11 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// 'session' as well. As a result, we need to restart all internal sessions: // 'session' as well. As a result, we need to restart all internal sessions:
d->temporarilyStopAllModalSessions(); d->temporarilyStopAllModalSessions();
} }
// Clean up the modal session list, call endModalSession.
if (d->cleanupModalSessionsNeeded)
d->cleanupModalSessions();
} else { } else {
d->nsAppRunCalledByQt = true; d->nsAppRunCalledByQt = true;
QBoolBlocker execGuard(d->currentExecIsNSAppRun, true); QBoolBlocker execGuard(d->currentExecIsNSAppRun, true);
@ -441,6 +446,11 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// 'session' as well. As a result, we need to restart all internal sessions: // 'session' as well. As a result, we need to restart all internal sessions:
d->temporarilyStopAllModalSessions(); d->temporarilyStopAllModalSessions();
} }
// Clean up the modal session list, call endModalSession.
if (d->cleanupModalSessionsNeeded)
d->cleanupModalSessions();
retVal = true; retVal = true;
} else do { } else do {
// Dispatch all non-user events (but que non-user events up for later). In // Dispatch all non-user events (but que non-user events up for later). In
@ -622,7 +632,8 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession()
if (!info.session) { if (!info.session) {
QCocoaAutoReleasePool pool; QCocoaAutoReleasePool pool;
NSWindow *nswindow = static_cast<QCocoaWindow *>(info.window->handle())->nativeWindow(); QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(info.window->handle());
NSWindow *nswindow = cocoaWindow->nativeWindow();
if (!nswindow) if (!nswindow)
continue; continue;
@ -630,7 +641,10 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession()
QBoolBlocker block1(blockSendPostedEvents, true); QBoolBlocker block1(blockSendPostedEvents, true);
info.nswindow = nswindow; info.nswindow = nswindow;
[(NSWindow*) info.nswindow retain]; [(NSWindow*) info.nswindow retain];
QRect rect = cocoaWindow->geometry();
info.session = [NSApp beginModalSessionForWindow:nswindow]; info.session = [NSApp beginModalSessionForWindow:nswindow];
if (rect != cocoaWindow->geometry())
cocoaWindow->setGeometry(rect);
} }
currentModalSessionCached = info.session; currentModalSessionCached = info.session;
cleanupModalSessionsNeeded = false; cleanupModalSessionsNeeded = false;
@ -717,10 +731,9 @@ void QCocoaEventDispatcherPrivate::beginModalSession(QWindow *window)
{ {
// We need to start spinning the modal session. Usually this is done with // We need to start spinning the modal session. Usually this is done with
// QDialog::exec() for Qt Widgets based applications, but for others that // QDialog::exec() for Qt Widgets based applications, but for others that
// just call show(), we need to interrupt(). We call this here, before // just call show(), we need to interrupt().
// setting currentModalSessionCached to zero, so that interrupt() calls
// [NSApp abortModal] if another modal session is currently running
Q_Q(QCocoaEventDispatcher); Q_Q(QCocoaEventDispatcher);
q->interrupt();
// Add a new, empty (null), NSModalSession to the stack. // Add a new, empty (null), NSModalSession to the stack.
// It will become active the next time QEventDispatcher::processEvents is called. // It will become active the next time QEventDispatcher::processEvents is called.
@ -733,24 +746,6 @@ void QCocoaEventDispatcherPrivate::beginModalSession(QWindow *window)
cocoaModalSessionStack.push(info); cocoaModalSessionStack.push(info);
updateChildrenWorksWhenModal(); updateChildrenWorksWhenModal();
currentModalSessionCached = 0; currentModalSessionCached = 0;
if (currentExecIsNSAppRun) {
QEvent *e = new QEvent(QEvent::User);
qApp->postEvent(q, e, Qt::HighEventPriority);
} else {
q->interrupt();
}
}
bool QCocoaEventDispatcher::event(QEvent *e)
{
Q_D(QCocoaEventDispatcher);
if (e->type() == QEvent::User) {
d->q_func()->processEvents(QEventLoop::DialogExec | QEventLoop::EventLoopExec | QEventLoop::WaitForMoreEvents);
return true;
}
return QObject::event(e);
} }
void QCocoaEventDispatcherPrivate::endModalSession(QWindow *window) void QCocoaEventDispatcherPrivate::endModalSession(QWindow *window)
@ -772,10 +767,7 @@ void QCocoaEventDispatcherPrivate::endModalSession(QWindow *window)
info.window = 0; info.window = 0;
if (i + endedSessions == stackSize-1) { if (i + endedSessions == stackSize-1) {
// The top sessions ended. Interrupt the event dispatcher to // The top sessions ended. Interrupt the event dispatcher to
// start spinning the correct session immediately. Like in // start spinning the correct session immediately.
// beginModalSession(), we call interrupt() before clearing
// currentModalSessionCached to make sure we stop any currently
// running modal session with [NSApp abortModal]
q->interrupt(); q->interrupt();
currentModalSessionCached = 0; currentModalSessionCached = 0;
cleanupModalSessionsNeeded = true; cleanupModalSessionsNeeded = true;
@ -878,10 +870,7 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
return; return;
} }
if (cleanupModalSessionsNeeded) if (processEventsCalled > 0 && interrupt) {
cleanupModalSessions();
if (interrupt) {
if (currentExecIsNSAppRun) { if (currentExecIsNSAppRun) {
// The event dispatcher has been interrupted. But since // The event dispatcher has been interrupted. But since
// [NSApplication run] is running the event loop, we // [NSApplication run] is running the event loop, we
@ -903,6 +892,21 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
} }
} }
void QCocoaEventDispatcherPrivate::removeQueuedUserInputEvents(int nsWinNumber)
{
if (nsWinNumber) {
int eventIndex = queuedUserInputEvents.size();
while (--eventIndex >= 0) {
NSEvent * nsevent = static_cast<NSEvent *>(queuedUserInputEvents.at(eventIndex));
if ([nsevent windowNumber] == nsWinNumber) {
queuedUserInputEvents.removeAt(eventIndex);
[nsevent release];
}
}
}
}
void QCocoaEventDispatcherPrivate::firstLoopEntry(CFRunLoopObserverRef ref, void QCocoaEventDispatcherPrivate::firstLoopEntry(CFRunLoopObserverRef ref,
CFRunLoopActivity activity, CFRunLoopActivity activity,
void *info) void *info)
@ -948,12 +952,6 @@ void QCocoaEventDispatcher::interrupt()
{ {
Q_D(QCocoaEventDispatcher); Q_D(QCocoaEventDispatcher);
d->interrupt = true; d->interrupt = true;
if (d->currentModalSessionCached) {
// If a modal session is active, abort it so that we can clean it up
// later. We can't use [NSApp stopModal] here, because we do not know
// where the interrupt() came from.
[NSApp abortModal];
} else {
wakeUp(); wakeUp();
// We do nothing more here than setting d->interrupt = true, and // We do nothing more here than setting d->interrupt = true, and
@ -964,7 +962,6 @@ void QCocoaEventDispatcher::interrupt()
// the last event loop recursion, cocoa will just drop pending posted // the last event loop recursion, cocoa will just drop pending posted
// events on the floor before we get a chance to reestablish a new session. // events on the floor before we get a chance to reestablish a new session.
d->cancelWaitForMoreEvents(); d->cancelWaitForMoreEvents();
}
} }
void QCocoaEventDispatcher::flush() void QCocoaEventDispatcher::flush()

View File

@ -139,8 +139,6 @@ public:
void setToolbar(QWindow *window, NSToolbar *toolbar); void setToolbar(QWindow *window, NSToolbar *toolbar);
NSToolbar *toolbar(QWindow *window) const; NSToolbar *toolbar(QWindow *window) const;
void clearToolbars(); void clearToolbars();
void setWindow(NSWindow* nsWindow, QCocoaWindow *window);
QCocoaWindow *window(NSWindow *window);
private: private:
static QCocoaIntegration *mInstance; static QCocoaIntegration *mInstance;
@ -159,7 +157,6 @@ private:
QScopedPointer<QCocoaKeyMapper> mKeyboardMapper; QScopedPointer<QCocoaKeyMapper> mKeyboardMapper;
QHash<QWindow *, NSToolbar *> mToolbars; QHash<QWindow *, NSToolbar *> mToolbars;
QHash<NSWindow *, QCocoaWindow*> mWindows;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -159,9 +159,12 @@ qreal QCocoaScreen::devicePixelRatio() const
QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const
{ {
// Get a z-ordered list of windows. Iterate through it until // Get a z-ordered list of windows. Iterate through it until
// we find a window which contains the point. // we find a (Qt) window which contains the point.
for (NSWindow *nsWindow in [NSApp orderedWindows]) { for (NSWindow *nsWindow in [NSApp orderedWindows]) {
QCocoaWindow *cocoaWindow = QCocoaIntegration::instance()->window(nsWindow); if (![nsWindow isKindOfClass:[QNSWindow class]])
continue;
QNSWindow *qnsWindow = static_cast<QNSWindow *>(nsWindow);
QCocoaWindow *cocoaWindow = qnsWindow.helper.platformWindow;
if (!cocoaWindow) if (!cocoaWindow)
continue; continue;
QWindow *window = cocoaWindow->window(); QWindow *window = cocoaWindow->window();
@ -517,16 +520,6 @@ NSToolbar *QCocoaIntegration::toolbar(QWindow *window) const
return mToolbars.value(window); return mToolbars.value(window);
} }
void QCocoaIntegration::setWindow(NSWindow* nsWindow, QCocoaWindow *window)
{
mWindows.insert(nsWindow, window);
}
QCocoaWindow *QCocoaIntegration::window(NSWindow *window)
{
return mWindows.value(window);
}
void QCocoaIntegration::clearToolbars() void QCocoaIntegration::clearToolbars()
{ {
QHash<QWindow *, NSToolbar *>::const_iterator it = mToolbars.constBegin(); QHash<QWindow *, NSToolbar *>::const_iterator it = mToolbars.constBegin();

View File

@ -174,7 +174,7 @@ QT_END_NAMESPACE
- (void)removeActionsFromAppMenu - (void)removeActionsFromAppMenu
{ {
for (NSMenuItem *item in [appMenu itemArray]) for (NSMenuItem *item in [appMenu itemArray])
[item setTag:nil]; [item setTag:0];
} }
- (void)dealloc - (void)dealloc

View File

@ -182,13 +182,22 @@ static bool isMouseEvent(NSEvent *ev)
- (void)detachFromPlatformWindow - (void)detachFromPlatformWindow
{ {
_platformWindow = 0;
[self.window.delegate release]; [self.window.delegate release];
self.window.delegate = nil; self.window.delegate = nil;
} }
- (void)clearWindow - (void)clearWindow
{ {
if (_window) {
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());
if (cocoaEventDispatcher) {
QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher));
cocoaEventDispatcherPrivate->removeQueuedUserInputEvents([_window windowNumber]);
}
_window = nil; _window = nil;
}
} }
- (void)dealloc - (void)dealloc
@ -261,8 +270,6 @@ static bool isMouseEvent(NSEvent *ev)
{ {
[self close]; [self close];
QCocoaIntegration::instance()->setWindow(self, 0);
if (self.helper.grabbingMouse) { if (self.helper.grabbingMouse) {
self.helper.releaseOnMouseUp = YES; self.helper.releaseOnMouseUp = YES;
} else { } else {
@ -329,7 +336,6 @@ static bool isMouseEvent(NSEvent *ev)
{ {
[self.helper detachFromPlatformWindow]; [self.helper detachFromPlatformWindow];
[self close]; [self close];
QCocoaIntegration::instance()->setWindow(self, 0);
[self release]; [self release];
} }
@ -1001,9 +1007,14 @@ bool QCocoaWindow::isExposed() const
bool QCocoaWindow::isOpaque() const bool QCocoaWindow::isOpaque() const
{ {
// OpenGL surfaces can be ordered either above(default) or below the NSWindow.
// When ordering below the window must be tranclucent.
static GLint openglSourfaceOrder = qt_mac_resolveOption(1, "QT_MAC_OPENGL_SURFACE_ORDER");
bool translucent = (window()->format().alphaBufferSize() > 0 bool translucent = (window()->format().alphaBufferSize() > 0
|| window()->opacity() < 1 || window()->opacity() < 1
|| (m_qtView && [m_qtView hasMask])); || (m_qtView && [m_qtView hasMask]))
|| (surface()->supportsOpenGL() && openglSourfaceOrder == -1);
return !translucent; return !translucent;
} }
@ -1404,7 +1415,13 @@ QCocoaNSWindow * QCocoaWindow::createNSWindow()
NSInteger level = windowLevel(flags); NSInteger level = windowLevel(flags);
[createdWindow setLevel:level]; [createdWindow setLevel:level];
if (window()->format().alphaBufferSize() > 0) { // OpenGL surfaces can be ordered either above(default) or below the NSWindow.
// When ordering below the window must be tranclucent and have a clear background color.
static GLint openglSourfaceOrder = qt_mac_resolveOption(1, "QT_MAC_OPENGL_SURFACE_ORDER");
bool isTranslucent = window()->format().alphaBufferSize() > 0
|| (surface()->supportsOpenGL() && openglSourfaceOrder == -1);
if (isTranslucent) {
[createdWindow setBackgroundColor:[NSColor clearColor]]; [createdWindow setBackgroundColor:[NSColor clearColor]];
[createdWindow setOpaque:NO]; [createdWindow setOpaque:NO];
} }
@ -1413,8 +1430,6 @@ QCocoaNSWindow * QCocoaWindow::createNSWindow()
applyContentBorderThickness(createdWindow); applyContentBorderThickness(createdWindow);
QCocoaIntegration::instance()->setWindow(createdWindow, this);
return createdWindow; return createdWindow;
} }

View File

@ -64,6 +64,7 @@ public:
} }
Q_ASSERT(deviceContext); Q_ASSERT(deviceContext);
deviceContext->SetUnitMode(D2D1_UNIT_MODE_PIXELS);
} }
void begin() void begin()

View File

@ -211,118 +211,16 @@ private:
bool m_roundCoordinates; bool m_roundCoordinates;
}; };
static ComPtr<ID2D1PathGeometry1> painterPathToID2D1PathGeometry(const QPainterPath &path, bool alias) struct D2DVectorPathCache {
{ ComPtr<ID2D1PathGeometry1> aliased;
Direct2DPathGeometryWriter writer; ComPtr<ID2D1PathGeometry1> antiAliased;
if (!writer.begin())
return NULL;
writer.setWindingFillEnabled(path.fillRule() == Qt::WindingFill); static void cleanup_func(QPaintEngineEx *engine, void *data) {
writer.setAliasingEnabled(alias); Q_UNUSED(engine);
D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(data);
for (int i = 0; i < path.elementCount(); i++) { delete e;
const QPainterPath::Element element = path.elementAt(i);
switch (element.type) {
case QPainterPath::MoveToElement:
writer.moveTo(element);
break;
case QPainterPath::LineToElement:
writer.lineTo(element);
break;
case QPainterPath::CurveToElement:
{
const QPainterPath::Element data1 = path.elementAt(++i);
const QPainterPath::Element data2 = path.elementAt(++i);
Q_ASSERT(i < path.elementCount());
Q_ASSERT(data1.type == QPainterPath::CurveToDataElement);
Q_ASSERT(data2.type == QPainterPath::CurveToDataElement);
writer.curveTo(element, data1, data2);
} }
break; };
case QPainterPath::CurveToDataElement:
qWarning("%s: Unhandled Curve Data Element", __FUNCTION__);
break;
}
}
writer.close();
return writer.geometry();
}
static ComPtr<ID2D1PathGeometry1> vectorPathToID2D1PathGeometry(const QVectorPath &path, bool alias)
{
Direct2DPathGeometryWriter writer;
if (!writer.begin())
return NULL;
writer.setWindingFillEnabled(path.hasWindingFill());
writer.setAliasingEnabled(alias);
const QPainterPath::ElementType *types = path.elements();
const int count = path.elementCount();
const qreal *points = path.points();
Q_ASSERT(points);
if (types) {
qreal x, y;
for (int i = 0; i < count; i++) {
x = points[i * 2];
y = points[i * 2 + 1];
switch (types[i]) {
case QPainterPath::MoveToElement:
writer.moveTo(QPointF(x, y));
break;
case QPainterPath::LineToElement:
writer.lineTo(QPointF(x, y));
break;
case QPainterPath::CurveToElement:
{
Q_ASSERT((i + 2) < count);
Q_ASSERT(types[i+1] == QPainterPath::CurveToDataElement);
Q_ASSERT(types[i+2] == QPainterPath::CurveToDataElement);
i++;
const qreal x2 = points[i * 2];
const qreal y2 = points[i * 2 + 1];
i++;
const qreal x3 = points[i * 2];
const qreal y3 = points[i * 2 + 1];
writer.curveTo(QPointF(x, y), QPointF(x2, y2), QPointF(x3, y3));
}
break;
case QPainterPath::CurveToDataElement:
qWarning("%s: Unhandled Curve Data Element", __FUNCTION__);
break;
}
}
} else {
writer.moveTo(QPointF(points[0], points[1]));
for (int i = 1; i < count; i++)
writer.lineTo(QPointF(points[i * 2], points[i * 2 + 1]));
}
if (writer.isInFigure())
if (path.hasImplicitClose())
writer.lineTo(QPointF(points[0], points[1]));
writer.close();
return writer.geometry();
}
class QWindowsDirect2DPaintEnginePrivate : public QPaintEngineExPrivate class QWindowsDirect2DPaintEnginePrivate : public QPaintEngineExPrivate
{ {
@ -426,7 +324,7 @@ public:
dc()->PushAxisAlignedClip(rect, antialiasMode()); dc()->PushAxisAlignedClip(rect, antialiasMode());
pushedClips.push(AxisAlignedClip); pushedClips.push(AxisAlignedClip);
} else { } else {
ComPtr<ID2D1PathGeometry1> geometry = vectorPathToID2D1PathGeometry(path, antialiasMode() == D2D1_ANTIALIAS_MODE_ALIASED); ComPtr<ID2D1PathGeometry1> geometry = vectorPathToID2D1PathGeometry(path);
if (!geometry) { if (!geometry) {
qWarning("%s: Could not convert vector path to painter path!", __FUNCTION__); qWarning("%s: Could not convert vector path to painter path!", __FUNCTION__);
return; return;
@ -571,6 +469,7 @@ public:
break; break;
case Qt::RoundCap: case Qt::RoundCap:
props.startCap = props.endCap = props.dashCap = D2D1_CAP_STYLE_ROUND; props.startCap = props.endCap = props.dashCap = D2D1_CAP_STYLE_ROUND;
break;
case Qt::FlatCap: case Qt::FlatCap:
default: default:
props.startCap = props.endCap = props.dashCap = D2D1_CAP_STYLE_FLAT; props.startCap = props.endCap = props.dashCap = D2D1_CAP_STYLE_FLAT;
@ -835,6 +734,104 @@ public:
return result; return result;
} }
ComPtr<ID2D1PathGeometry1> vectorPathToID2D1PathGeometry(const QVectorPath &path)
{
Q_Q(QWindowsDirect2DPaintEngine);
const bool alias = !q->antiAliasingEnabled();
QVectorPath::CacheEntry *cacheEntry = path.isCacheable() ? path.lookupCacheData(q)
: Q_NULLPTR;
if (cacheEntry) {
D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
if (alias && e->aliased)
return e->aliased;
else if (!alias && e->antiAliased)
return e->antiAliased;
}
Direct2DPathGeometryWriter writer;
if (!writer.begin())
return NULL;
writer.setWindingFillEnabled(path.hasWindingFill());
writer.setAliasingEnabled(alias);
const QPainterPath::ElementType *types = path.elements();
const int count = path.elementCount();
const qreal *points = path.points();
Q_ASSERT(points);
if (types) {
qreal x, y;
for (int i = 0; i < count; i++) {
x = points[i * 2];
y = points[i * 2 + 1];
switch (types[i]) {
case QPainterPath::MoveToElement:
writer.moveTo(QPointF(x, y));
break;
case QPainterPath::LineToElement:
writer.lineTo(QPointF(x, y));
break;
case QPainterPath::CurveToElement:
{
Q_ASSERT((i + 2) < count);
Q_ASSERT(types[i+1] == QPainterPath::CurveToDataElement);
Q_ASSERT(types[i+2] == QPainterPath::CurveToDataElement);
i++;
const qreal x2 = points[i * 2];
const qreal y2 = points[i * 2 + 1];
i++;
const qreal x3 = points[i * 2];
const qreal y3 = points[i * 2 + 1];
writer.curveTo(QPointF(x, y), QPointF(x2, y2), QPointF(x3, y3));
}
break;
case QPainterPath::CurveToDataElement:
qWarning("%s: Unhandled Curve Data Element", __FUNCTION__);
break;
}
}
} else {
writer.moveTo(QPointF(points[0], points[1]));
for (int i = 1; i < count; i++)
writer.lineTo(QPointF(points[i * 2], points[i * 2 + 1]));
}
if (writer.isInFigure())
if (path.hasImplicitClose())
writer.lineTo(QPointF(points[0], points[1]));
writer.close();
ComPtr<ID2D1PathGeometry1> geometry = writer.geometry();
if (path.isCacheable()) {
if (!cacheEntry)
cacheEntry = path.addCacheData(q, new D2DVectorPathCache, D2DVectorPathCache::cleanup_func);
D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
if (alias)
e->aliased = geometry;
else
e->antiAliased = geometry;
} else {
path.makeCacheable();
}
return geometry;
}
void updateHints() void updateHints()
{ {
dc()->SetAntialiasMode(antialiasMode()); dc()->SetAntialiasMode(antialiasMode());
@ -871,7 +868,7 @@ bool QWindowsDirect2DPaintEngine::begin(QPaintDevice * pdev)
QPainterPath p; QPainterPath p;
p.addRegion(systemClip()); p.addRegion(systemClip());
ComPtr<ID2D1PathGeometry1> geometry = painterPathToID2D1PathGeometry(p, d->antialiasMode() == D2D1_ANTIALIAS_MODE_ALIASED); ComPtr<ID2D1PathGeometry1> geometry = d->vectorPathToID2D1PathGeometry(qtVectorPathForPath(p));
if (!geometry) if (!geometry)
return false; return false;
@ -938,7 +935,7 @@ void QWindowsDirect2DPaintEngine::draw(const QVectorPath &path)
{ {
Q_D(QWindowsDirect2DPaintEngine); Q_D(QWindowsDirect2DPaintEngine);
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path, d->antialiasMode() == D2D1_ANTIALIAS_MODE_ALIASED); ComPtr<ID2D1Geometry> geometry = d->vectorPathToID2D1PathGeometry(path);
if (!geometry) { if (!geometry) {
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__); qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
return; return;
@ -978,7 +975,7 @@ void QWindowsDirect2DPaintEngine::fill(const QVectorPath &path, const QBrush &br
if (!d->brush.brush) if (!d->brush.brush)
return; return;
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path, d->antialiasMode() == D2D1_ANTIALIAS_MODE_ALIASED); ComPtr<ID2D1Geometry> geometry = d->vectorPathToID2D1PathGeometry(path);
if (!geometry) { if (!geometry) {
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__); qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
return; return;
@ -1016,7 +1013,7 @@ void QWindowsDirect2DPaintEngine::stroke(const QVectorPath &path, const QPen &pe
if (!d->pen.brush) if (!d->pen.brush)
return; return;
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path, d->antialiasMode() == D2D1_ANTIALIAS_MODE_ALIASED); ComPtr<ID2D1Geometry> geometry = d->vectorPathToID2D1PathGeometry(path);
if (!geometry) { if (!geometry) {
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__); qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
return; return;
@ -1163,6 +1160,25 @@ void QWindowsDirect2DPaintEngine::drawRects(const QRectF *rects, int rectCount)
} }
} }
static bool isLinePositivelySloped(const QPointF &p1, const QPointF &p2)
{
if (p2.x() > p1.x())
return p2.y() < p1.y();
if (p1.x() > p2.x())
return p1.y() < p2.y();
return false;
}
static void adjustLine(QPointF *p1, QPointF *p2)
{
if (isLinePositivelySloped(*p1, *p2)) {
p1->ry() -= qreal(1.0);
p2->ry() -= qreal(1.0);
}
}
void QWindowsDirect2DPaintEngine::drawLines(const QLine *lines, int lineCount) void QWindowsDirect2DPaintEngine::drawLines(const QLine *lines, int lineCount)
{ {
Q_D(QWindowsDirect2DPaintEngine); Q_D(QWindowsDirect2DPaintEngine);
@ -1184,6 +1200,10 @@ void QWindowsDirect2DPaintEngine::drawLines(const QLine *lines, int lineCount)
continue; continue;
} }
// Match raster engine output
if (!antiAliasingEnabled())
adjustLine(&p1, &p2);
adjustForAliasing(&p1); adjustForAliasing(&p1);
adjustForAliasing(&p2); adjustForAliasing(&p2);
@ -1216,6 +1236,10 @@ void QWindowsDirect2DPaintEngine::drawLines(const QLineF *lines, int lineCount)
continue; continue;
} }
// Match raster engine output
if (!antiAliasingEnabled())
adjustLine(&p1, &p2);
adjustForAliasing(&p1); adjustForAliasing(&p1);
adjustForAliasing(&p2); adjustForAliasing(&p2);
@ -1468,29 +1492,27 @@ void QWindowsDirect2DPaintEngine::drawTextItem(const QPointF &p, const QTextItem
rtl); rtl);
} }
// Points (1/72 inches) to Microsoft's Device Independent Pixels (1/96 inches) inline static FLOAT pointSizeToDIP(qreal pointSize, FLOAT dpiY)
inline static Q_DECL_CONSTEXPR FLOAT pointSizeToDIP(qreal pointSize)
{ {
return pointSize + (pointSize / qreal(3.0)); return (pointSize + (pointSize / qreal(3.0))) * (dpiY / 96.0f);
} }
inline static FLOAT pixelSizeToDIP(int pixelSize) inline static FLOAT pixelSizeToDIP(int pixelSize, FLOAT dpiY)
{ {
FLOAT dpiX, dpiY; return FLOAT(pixelSize) * 96.0f / dpiY;
factory()->GetDesktopDpi(&dpiX, &dpiY);
return FLOAT(pixelSize) / (dpiY / 96.0f);
} }
inline static FLOAT fontSizeInDIP(const QFont &font) inline static FLOAT fontSizeInDIP(const QFont &font)
{ {
// Direct2d wants the font size in DIPs (Device Independent Pixels), each of which is 1/96 inches. FLOAT dpiX, dpiY;
QWindowsDirect2DContext::instance()->d2dFactory()->GetDesktopDpi(&dpiX, &dpiY);
if (font.pixelSize() == -1) { if (font.pixelSize() == -1) {
// font size was set as points // font size was set as points
return pointSizeToDIP(font.pointSizeF()); return pointSizeToDIP(font.pointSizeF(), dpiY);
} else { } else {
// font size was set as pixels // font size was set as pixels
return pixelSizeToDIP(font.pixelSize()); return pixelSizeToDIP(font.pixelSize(), dpiY);
} }
} }

View File

@ -495,14 +495,14 @@ Q_GLOBAL_STATIC(StaticVariables, staticVariables);
return; return;
if ([text isEqualToString:@"\n"]) { if ([text isEqualToString:@"\n"]) {
if (self.returnKeyType == UIReturnKeyDone)
qApp->inputMethod()->hide();
QKeyEvent press(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); QKeyEvent press(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
QKeyEvent release(QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier); QKeyEvent release(QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier);
[self sendEventToFocusObject:press]; [self sendEventToFocusObject:press];
[self sendEventToFocusObject:release]; [self sendEventToFocusObject:release];
if (self.returnKeyType == UIReturnKeyDone)
[self resignFirstResponder];
return; return;
} }

View File

@ -41,7 +41,10 @@
#include "qqnxnativeinterface.h" #include "qqnxnativeinterface.h"
#if !defined(QT_NO_OPENGL)
#include "qqnxglcontext.h" #include "qqnxglcontext.h"
#endif
#include "qqnxscreen.h" #include "qqnxscreen.h"
#include "qqnxwindow.h" #include "qqnxwindow.h"
#if defined(QQNX_IMF) #if defined(QQNX_IMF)
@ -50,7 +53,10 @@
#include "qqnxintegration.h" #include "qqnxintegration.h"
#if !defined(QT_NO_OPENGL)
#include <QtGui/QOpenGLContext> #include <QtGui/QOpenGLContext>
#endif
#include <QtGui/QScreen> #include <QtGui/QScreen>
#include <QtGui/QWindow> #include <QtGui/QWindow>
@ -95,6 +101,7 @@ void *QQnxNativeInterface::nativeResourceForIntegration(const QByteArray &resour
return 0; return 0;
} }
#if !defined(QT_NO_OPENGL)
void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{ {
if (resource == "eglcontext" && context) if (resource == "eglcontext" && context)
@ -102,6 +109,7 @@ void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource,
return 0; return 0;
} }
#endif
void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value)
{ {

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