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

Conflicts:
	src/corelib/kernel/qcoreapplication.cpp
	src/corelib/kernel/qeventdispatcher_blackberry.cpp
	src/network/bearer/qnetworkconfiguration.cpp
	src/plugins/bearer/blackberry/qbbengine.cpp
	src/plugins/platforms/android/androidjnimain.cpp
	src/plugins/platforms/android/qandroidplatformtheme.cpp
	src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
	src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
	src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
	src/plugins/platforms/qnx/qqnxintegration.cpp
	src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
	src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
	src/plugins/platforms/qnx/qqnxwindow.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	src/widgets/styles/qwindowsvistastyle.cpp
	src/widgets/styles/qwindowsxpstyle.cpp
	src/widgets/widgets/qtoolbararealayout.cpp
	tests/auto/corelib/global/qflags/qflags.pro
	tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
	tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
	tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp

Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
This commit is contained in:
Liang Qi 2015-12-02 23:33:06 +01:00
commit 72f5867f14
159 changed files with 1716 additions and 1024 deletions

View File

@ -81,6 +81,8 @@ our @qpa_headers = ();
# will be derived from sync.profile # will be derived from sync.profile
our %reverse_classnames = (); our %reverse_classnames = ();
my %ignore_for_include_check = ();
my %ignore_for_qt_begin_namespace_check = ();
# global variables (modified by options) # global variables (modified by options)
my $isunix = 0; my $isunix = 0;
@ -319,6 +321,75 @@ sub classNames {
return @ret; return @ret;
} }
sub check_header {
my ($lib, $header, $iheader, $public_header, $private_header) = @_;
my $header_skip_qt_begin_namespace_test = 0;
if ($public_header) {
return if ($ignore_for_include_check{$header});
$header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
}
open(F, "<$iheader") or return;
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $qt_namespace_suffix = "";
my $line;
my $stop_processing = 0;
my $we_mean_it = 0;
while ($line = <F>) {
chomp $line;
my $output_line = 1;
if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
last;
}
if ($line =~ /^ *\# *include/) {
my $include = $line;
if ($line =~ /<.*>/) {
$include =~ s,.*<(.*)>.*,$1,;
} elsif ($line =~ /".*"/) {
$include =~ s,.*"(.*)".*,$1,;
} else {
$include = 0;
}
if ($include && $public_header) {
print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/);
for my $trylib (keys(%modules)) {
if (-e "$out_basedir/include/$trylib/$include") {
print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
}
}
}
} elsif (!$private_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
$qt_namespace_suffix = defined($1) ? $1 : "";
$qt_begin_namespace_found = 1;
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
$qt_end_namespace_found = 1;
}
} elsif ($line =~ "^// We mean it.") {
++$we_mean_it;
}
}
if ($public_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) {
if ($qt_begin_namespace_found == 0) {
print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
}
if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
}
}
} elsif ($private_header) {
print "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it);
}
close(F);
}
sub make_path { sub make_path {
my ($dir, $lib, $be_verbose) = @_; my ($dir, $lib, $be_verbose) = @_;
unless(-e $dir) { unless(-e $dir) {
@ -801,6 +872,8 @@ loadSyncProfile(\$basedir, \$out_basedir);
@modules_to_sync = keys(%modules) if($#modules_to_sync == -1); @modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate; my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate;
%ignore_for_include_check = map { $_ => 1 } @ignore_for_include_check;
%ignore_for_qt_begin_namespace_check = map { $_ => 1 } @ignore_for_qt_begin_namespace_check;
$isunix = checkUnix; #cache checkUnix $isunix = checkUnix; #cache checkUnix
@ -931,6 +1004,12 @@ foreach my $lib (@modules_to_sync) {
my $clean_header; my $clean_header;
my $iheader = $subdir . "/" . $header; my $iheader = $subdir . "/" . $header;
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
if ($check_includes) {
# We need both $public_header and $private_header because QPA headers count as neither
my $private_header = !$public_header && !$qpa_header
&& $header =~ /_p\.h$/ && $subdir !~ /3rdparty/;
check_header($lib, $header, $iheader, $public_header, $private_header);
}
my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : (); my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : ();
if($showonly) { if($showonly) {
print "$header [$lib]\n"; print "$header [$lib]\n";
@ -1128,109 +1207,4 @@ foreach my $lib (@modules_to_sync) {
} }
} }
if($check_includes) {
foreach my $lib (@modules_to_sync) {
next if ($modules{$lib} =~ /^!/);
#calc subdirs
my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib}));
foreach my $subdir (@subdirs) {
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
foreach my $header (@headers) {
my $header_skip_qt_begin_namespace_test = 0;
$header = 0 if($header =~ /^ui_.*.h/);
$header = 0 if ($header eq lc($lib)."version.h");
foreach (@ignore_headers) {
$header = 0 if($header eq $_);
}
if($header) {
# We need both $public_header and $private_header because QPA headers count as neither
my $public_header = $header;
my $private_header = 0;
if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
$public_header = 0;
$private_header = $header =~ /_p.h$/ && $subdir !~ /3rdparty/
} elsif (isQpaHeader($public_header)) {
$public_header = 0;
} else {
foreach (@ignore_for_master_contents) {
$public_header = 0 if($header eq $_);
}
if($public_header) {
foreach (@ignore_for_include_check) {
$public_header = 0 if($header eq $_);
}
foreach(@ignore_for_qt_begin_namespace_check) {
$header_skip_qt_begin_namespace_test = 1 if ($header eq $_);
}
}
}
my $iheader = $subdir . "/" . $header;
if (open(F, "<$iheader")) {
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $qt_namespace_suffix = "";
my $line;
my $stop_processing = 0;
my $we_mean_it = 0;
while ($line = <F>) {
chomp $line;
my $output_line = 1;
if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
last;
} elsif ($line =~ /^ *\# *include/) {
my $include = $line;
if ($line =~ /<.*>/) {
$include =~ s,.*<(.*)>.*,$1,;
} elsif ($line =~ /".*"/) {
$include =~ s,.*"(.*)".*,$1,;
} else {
$include = 0;
}
if ($include) {
if ($public_header) {
print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/);
for my $trylib (keys(%modules)) {
if(-e "$out_basedir/include/$trylib/$include") {
print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
}
}
}
}
} elsif (!$private_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
$qt_namespace_suffix = defined($1) ? $1 : "";
$qt_begin_namespace_found = 1;
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
$qt_end_namespace_found = 1;
}
} elsif ($line =~ "^// We mean it.") {
++$we_mean_it;
}
}
if ($public_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) {
if ($qt_begin_namespace_found == 0) {
print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
}
if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
}
}
} elsif ($private_header) {
print "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it);
}
close(F);
}
}
}
}
}
}
exit 0; exit 0;

View File

@ -43,16 +43,21 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Clocks" \ "QtQuick/Qt Quick Demo - Clocks" \
"QtQuick/Qt Quick Examples - Shader Effects" \ "QtQuick/Qt Quick Examples - Shader Effects" \
"QtQuickExtras/Qt Quick Extras - Dashboard" \ "QtQuickExtras/Qt Quick Extras - Dashboard" \
"QtQuickExtras/Qt Quick Extras - Flat" \
"QtQuickExtras/Qt Quick Extras - Gallery" \ "QtQuickExtras/Qt Quick Extras - Gallery" \
"QtQuickControls/Qt Quick Controls - Gallery" \ "QtQuickControls/Qt Quick Controls - Gallery" \
"QtQuickControls/Qt Quick Controls - Text Editor Example" \ "QtQuickControls/Qt Quick Controls - Text Editor Example" \
"QtQuickControls/Qt Quick Controls - Table View Example" \ "QtQuickControls/Qt Quick Controls - Table View Example" \
"QtQuickControls/Qt Quick Controls - Calendar Example" \ "QtQuickControls/Qt Quick Controls - Calendar Example" \
"QtQuickControls/Qt Quick Controls - File System Browser Example" \
"QtQuickDialogs/Qt Quick System Dialog Examples" \ "QtQuickDialogs/Qt Quick System Dialog Examples" \
"QtWinExtras/Quick Player" \ "QtWinExtras/Quick Player" \
"QtMultimedia/QML Video Shader Effects Example" \ "QtMultimedia/QML Video Shader Effects Example" \
"QtCanvas3D/Planets Example" \ "QtCanvas3D/Planets Example" \
"QtLocation/Map Viewer (QML)" "QtCanvas3D/Interactive Mobile Phone Example" \
"QtLocation/Map Viewer (QML)" \
"QtWebEngine/WebEngine Quick Nano Browser" \
"QtWebEngine/Markdown Editor Example"
manifestmeta.highlighted.attributes = isHighlighted:true manifestmeta.highlighted.attributes = isHighlighted:true

View File

@ -39,6 +39,7 @@ Cpp.ignoretokens += \
Q_DECL_UNUSED \ Q_DECL_UNUSED \
Q_DECL_CF_RETURNS_RETAINED \ Q_DECL_CF_RETURNS_RETAINED \
Q_DECL_NS_RETURNS_AUTORELEASED \ Q_DECL_NS_RETURNS_AUTORELEASED \
Q_DECL_EQ_DEFAULT \
Q_DECLARATIVE_EXPORT \ Q_DECLARATIVE_EXPORT \
Q_EXPLICIT \ Q_EXPLICIT \
Q_EXPORT \ Q_EXPORT \
@ -78,6 +79,7 @@ Cpp.ignoretokens += \
Q_REQUIRED_RESULT \ Q_REQUIRED_RESULT \
Q_SCRIPT_EXPORT \ Q_SCRIPT_EXPORT \
Q_SCRIPTTOOLS_EXPORT \ Q_SCRIPTTOOLS_EXPORT \
Q_SERIALBUS_EXPORT \
Q_SQL_EXPORT \ Q_SQL_EXPORT \
Q_SVG_EXPORT \ Q_SVG_EXPORT \
Q_TESTLIB_EXPORT \ Q_TESTLIB_EXPORT \

View File

@ -515,15 +515,26 @@ li {
margin-bottom: 10px; margin-bottom: 10px;
padding-left: 8px; padding-left: 8px;
list-style: outside; list-style: outside;
list-style-type: square;
text-align: left; text-align: left;
} }
ul > li {
list-style-type: square;
}
ol { ol {
margin: 10px; margin: 10px;
padding: 0; padding: 0;
} }
ol.A > li {
list-style-type: upper-alpha;
}
ol.a > li{
list-style-type: lower-alpha;
}
ol > li { ol > li {
margin-left: 30px; margin-left: 30px;
padding-left: 8px; padding-left: 8px;

View File

@ -975,9 +975,23 @@ ol,ul {
margin-top:0.75em; margin-top:0.75em;
margin-left:20px margin-left:20px
} }
.mainContent ol>li {
list-style-type:decimal .context ol > li {
margin-left: 20px
} }
.mainContent ol>li {
list-style-type: decimal;
}
.mainContent ol.a >li {
list-style-type: lower-alpha;
}
.mainContent ol.A >li {
list-style-type: upper-alpha;
}
blockquote,q { blockquote,q {
quotes:none quotes:none
} }

View File

@ -87,7 +87,7 @@
\snippet fortuneserver/server.cpp 7 \snippet fortuneserver/server.cpp 7
We then call QTcpServer::newPendingConnection(), which returns the We then call QTcpServer::nextPendingConnection(), which returns the
QTcpSocket representing the server side of the connection. By connecting QTcpSocket representing the server side of the connection. By connecting
QTcpSocket::disconnected() to QObject::deleteLater(), we ensure that the QTcpSocket::disconnected() to QObject::deleteLater(), we ensure that the
socket will be deleted after disconnecting. socket will be deleted after disconnecting.

View File

@ -0,0 +1,9 @@
# Renaming these files requires that the LIBRARY entry of their corresponding
# def files are also updated to reflect the name.
# The .def files are found in the angle directories:
#
# qtbase\src\3rdparty\angle\src\libEGL\libEGL[d?].def
# qtbase\src\3rdparty\angle\src\libEGL\libGLESv2[d?].def
LIBEGL_NAME="libEGL"
LIBGLESV2_NAME="libGLESv2"

View File

@ -0,0 +1,56 @@
#
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
# This mkspec is used for all win32-msvcXXXX, winrt-XXX-msvcXXX
# and winphone-XXX-msvcXXX specs
#
#
# Version-specific changes
#
greaterThan(MSC_VER, 1499) {
# Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
QMAKE_CFLAGS_MP = -MP
QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
}
greaterThan(MSC_VER, 1599) {
# Visual Studio 2010 (10.0) / Visual C++ 16.0 and up
MAKEFILE_GENERATOR = MSBUILD
QMAKE_CFLAGS_AVX = -arch:AVX
QMAKE_CFLAGS_AVX2 = -arch:AVX
VCPROJ_EXTENSION = .vcxproj
}
greaterThan(MSC_VER, 1699) {
# Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
QT_CONFIG += c++11
CONFIG += c++11
}
greaterThan(MSC_VER, 1799) {
# Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
equals(MSC_VER, 1800) {
QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
}
}
greaterThan(MSC_VER, 1899) {
# Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
QMAKE_CFLAGS += -Zc:strictStrings
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
}

View File

@ -9,6 +9,8 @@ isEmpty(MSC_VER)|isEmpty(MSVC_VER): error("Source mkspec must set both MSC_VER a
# Baseline: Visual Studio 2005 (8.0), VC++ 14.0 # Baseline: Visual Studio 2005 (8.0), VC++ 14.0
# #
include(angle.conf)
MAKEFILE_GENERATOR = MSVC.NET MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM = win32 QMAKE_PLATFORM = win32
QMAKE_COMPILER = msvc QMAKE_COMPILER = msvc
@ -83,8 +85,8 @@ QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
QMAKE_LIBS_NETWORK = ws2_32.lib QMAKE_LIBS_NETWORK = ws2_32.lib
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib gdi32.lib user32.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib gdi32.lib user32.lib
QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib gdi32.lib user32.lib
QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain QMAKE_LIBS_QT_ENTRY = -lqtmain
@ -97,54 +99,6 @@ VCPROJ_EXTENSION = .vcproj
VCSOLUTION_EXTENSION = .sln VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0 VCPROJ_KEYWORD = Qt4VSv1.0
# include(msvc-base.conf)
# Version-specific changes
#
greaterThan(MSC_VER, 1499) {
# Visual Studio 2008 (9.0) / Visual C++ 15.0 and up
QMAKE_CFLAGS_MP = -MP
QMAKE_CXXFLAGS_MP = $$QMAKE_CFLAGS_MP
}
greaterThan(MSC_VER, 1599) {
# Visual Studio 2010 (10.0) / Visual C++ 16.0 and up
MAKEFILE_GENERATOR = MSBUILD
QMAKE_CFLAGS_AVX = -arch:AVX
QMAKE_CFLAGS_AVX2 = -arch:AVX
VCPROJ_EXTENSION = .vcxproj
}
greaterThan(MSC_VER, 1699) {
# Visual Studio 2012 (11.0) / Visual C++ 17.0 and up
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE@QMAKE_SUBSYSTEM_SUFFIX@
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS@QMAKE_SUBSYSTEM_SUFFIX@
QT_CONFIG += c++11
CONFIG += c++11
}
greaterThan(MSC_VER, 1799) {
# Visual Studio 2013 (12.0) / Visual C++ 18.0 and up
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
equals(MSC_VER, 1800) {
QMAKE_CFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += -Zc:strictStrings
}
}
greaterThan(MSC_VER, 1899) {
# Visual Studio 2015 (14.0) / Visual C++ 19.0 and up
QMAKE_CFLAGS += -Zc:strictStrings
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
}
unset(MSC_VER) unset(MSC_VER)

View File

@ -2,6 +2,8 @@
# qmake configuration for common Windows CE # qmake configuration for common Windows CE
# #
include(../angle.conf)
MAKEFILE_GENERATOR = MSVC.NET MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM += wince win32 QMAKE_PLATFORM += wince win32
CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target CONFIG += incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target
@ -67,8 +69,8 @@ QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_EGL = libEGL.lib QMAKE_LIBS_EGL = $${LIBEGL_NAME}.lib
QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBGLESV2_NAME}.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain QMAKE_LIBS_QT_ENTRY = -lqtmain

View File

@ -4,6 +4,8 @@
# Written for Microsoft Visual C++ # Written for Microsoft Visual C++
# #
include(../angle.conf)
MAKEFILE_GENERATOR = MSBUILD MAKEFILE_GENERATOR = MSBUILD
QMAKE_COMPILER = msvc QMAKE_COMPILER = msvc
QMAKE_PLATFORM = winrt win32 QMAKE_PLATFORM = winrt win32
@ -79,8 +81,8 @@ QMAKE_LIBS += runtimeobject.lib
QMAKE_LIBS_CORE = QMAKE_LIBS_CORE =
QMAKE_LIBS_GUI = QMAKE_LIBS_GUI =
QMAKE_LIBS_NETWORK = QMAKE_LIBS_NETWORK =
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
QMAKE_LIBS_OPENGL_ES2_DEBUG = libEGLd.lib libGLESv2d.lib QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain QMAKE_LIBS_QT_ENTRY = -lqtmain
@ -92,4 +94,9 @@ VCPROJ_EXTENSION = .vcxproj
VCSOLUTION_EXTENSION = .sln VCSOLUTION_EXTENSION = .sln
VCPROJ_KEYWORD = Qt4VSv1.0 VCPROJ_KEYWORD = Qt4VSv1.0
WINRT_ASSETS_PATH = $$PWD/assets WINRT_ASSETS_PATH = $$PWD/assets
include(../msvc-base.conf)
unset(MSC_VER)
load(qt_config) load(qt_config)

View File

@ -20,10 +20,9 @@ isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR
exists($$MODULE_BASE_INDIR/.git): \ exists($$MODULE_BASE_INDIR/.git): \
CONFIG += git_build CONFIG += git_build
!prefix_build { !force_independent {
QTDIR = $$[QT_HOST_PREFIX] # If the module is not built independently, everything ends up in qtbase.
# Permit modules to enforce being built outside QTDIR ... # This is the case in non-prefix builds, except for selected modules.
!force_independent: MODULE_BASE_OUTDIR = $$QTDIR MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
# ... though this sort of breaks the idea. MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
MODULE_QMAKE_OUTDIR = $$QTDIR
} }

View File

@ -93,7 +93,7 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu
contains(QT_CONFIG, build_all):CONFIG += build_all contains(QT_CONFIG, build_all):CONFIG += build_all
} }
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
QT += $$QT_FOR_PRIVATE QT += $$QT_FOR_PRIVATE
unset(QT_FOR_PRIVATE) unset(QT_FOR_PRIVATE)

View File

@ -8,6 +8,7 @@
# #
load(device_config) load(device_config)
include(../common/angle.conf)
MAKEFILE_GENERATOR = MINGW MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw QMAKE_PLATFORM = win32 mingw
@ -98,8 +99,8 @@ QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
QMAKE_LIBS_NETWORK = -lws2_32 QMAKE_LIBS_NETWORK = -lws2_32
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32 QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
QMAKE_LIBS_OPENGL_ES2 = -llibEGL -llibGLESv2 -lgdi32 -luser32 QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32
QMAKE_LIBS_OPENGL_ES2_DEBUG = -llibEGLd -llibGLESv2d -lgdi32 -luser32 QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32 QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain

View File

@ -21,7 +21,7 @@ QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI
QMAKE_LIBS_OPENGL = QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT = QMAKE_LIBS_COMPAT =
QMAKE_LIBS_OPENVG = libopenvg.lib QMAKE_LIBS_OPENVG = libopenvg.lib
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
QMAKE_RC = rc QMAKE_RC = rc

View File

@ -36,7 +36,7 @@ QMAKE_LIBS_NETWORK = ws2.lib $$QMAKE_LIBS_GUI
QMAKE_LIBS_OPENGL = QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT = QMAKE_LIBS_COMPAT =
QMAKE_LIBS_OPENVG = QMAKE_LIBS_OPENVG =
QMAKE_LIBS_OPENGL_ES2 = libEGL.lib libGLESv2.lib QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
QMAKE_LIBDIR_OPENGL_ES2 = $$(NV_WINCE_T2_PLAT)/lib/Test QMAKE_LIBDIR_OPENGL_ES2 = $$(NV_WINCE_T2_PLAT)/lib/Test
QMAKE_INCDIR_EGL = $$(NV_WINCE_T2_PLAT)/include QMAKE_INCDIR_EGL = $$(NV_WINCE_T2_PLAT)/include
QMAKE_LIBDIR_EGL = $$(NV_WINCE_T2_PLAT)/lib/Test QMAKE_LIBDIR_EGL = $$(NV_WINCE_T2_PLAT)/lib/Test

View File

@ -4,6 +4,7 @@
# Written for Microsoft Visual C++ 2015 # Written for Microsoft Visual C++ 2015
# #
MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf) include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900 QMAKE_COMPILER_DEFINES += _MSC_VER=1900
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__ DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__

View File

@ -4,6 +4,7 @@
# Written for Microsoft Visual C++ 2015 # Written for Microsoft Visual C++ 2015
# #
MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf) include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32 QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__ DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__

View File

@ -4,6 +4,7 @@
# Written for Microsoft Visual C++ 2015 # Written for Microsoft Visual C++ 2015
# #
MSC_VER = 1900
include(../common/winrt_winphone/qmake.conf) include(../common/winrt_winphone/qmake.conf)
QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32 QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__ DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__

View File

@ -532,31 +532,13 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj // We assume project filename is [QMAKE_PROJECT_NAME].vcproj
QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"); QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
QString vcprojDir = qmake_getpwd(); QString vcprojDir = Option::output_dir;
// If file doesn't exsist, then maybe the users configuration // If file doesn't exsist, then maybe the users configuration
// doesn't allow it to be created. Skip to next... // doesn't allow it to be created. Skip to next...
if (!exists(vcprojDir + Option::dir_sep + vcproj)) { if (!exists(vcprojDir + Option::dir_sep + vcproj)) {
// Try to find the directory which fits relative warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
// to the output path, which represents the shadow goto nextfile; // # Dirty!
// path in case we are shadow building
QStringList list = fi.path().split(QLatin1Char('/'));
QString tmpDir = QFileInfo(Option::output).path() + Option::dir_sep;
bool found = false;
for (int i = list.size() - 1; i >= 0; --i) {
QString curr;
for (int j = i; j < list.size(); ++j)
curr += list.at(j) + Option::dir_sep;
if (exists(tmpDir + curr + vcproj)) {
vcprojDir = QDir::cleanPath(tmpDir + curr);
found = true;
break;
}
}
if (!found) {
warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
goto nextfile; // # Dirty!
}
} }
VcsolutionDepend *newDep = new VcsolutionDepend; VcsolutionDepend *newDep = new VcsolutionDepend;

View File

@ -64,7 +64,13 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory
swapChainDesc.Windowed = TRUE; swapChainDesc.Windowed = TRUE;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
return factory->CreateSwapChain(device, &swapChainDesc, swapChain); const HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
if (SUCCEEDED(result))
{
const HRESULT makeWindowAssociationResult = factory->MakeWindowAssociation(mWindow, DXGI_MWA_NO_ALT_ENTER);
UNUSED_TRACE_VARIABLE(makeWindowAssociationResult);
}
return result;
} }
#endif #endif
} }

View File

@ -41,6 +41,7 @@ import java.util.concurrent.Semaphore;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
@ -53,6 +54,7 @@ import android.view.Menu;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import java.lang.reflect.Method;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.util.Iterator; import java.util.Iterator;
@ -81,6 +83,7 @@ public class QtNative
private static int m_oldx, m_oldy; private static int m_oldx, m_oldy;
private static final int m_moveThreshold = 0; private static final int m_moveThreshold = 0;
private static ClipboardManager m_clipboardManager = null; private static ClipboardManager m_clipboardManager = null;
private static Method m_checkSelfPermissionMethod = null;
private static ClassLoader m_classLoader = null; private static ClassLoader m_classLoader = null;
public static ClassLoader classLoader() public static ClassLoader classLoader()
@ -393,6 +396,29 @@ public class QtNative
} }
} }
public static int checkSelfPermission(final String permission)
{
int perm = PackageManager.PERMISSION_DENIED;
synchronized (m_mainActivityMutex) {
if (m_activity == null)
return perm;
try {
if (Build.VERSION.SDK_INT >= 23) {
if (m_checkSelfPermissionMethod == null)
m_checkSelfPermissionMethod = Context.class.getMethod("checkSelfPermission", String.class);
perm = (Integer)m_checkSelfPermissionMethod.invoke(m_activity, permission);
} else {
final PackageManager pm = m_activity.getPackageManager();
perm = pm.checkPermission(permission, m_activity.getPackageName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
return perm;
}
private static void updateSelection(final int selStart, private static void updateSelection(final int selStart,
final int selEnd, final int selEnd,
final int candidatesStart, final int candidatesStart,

View File

@ -0,0 +1,36 @@
From 00f0a46199b622b05619f56e29f172fb61fe6e82 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Date: Mon, 23 Nov 2015 14:00:02 +0100
Subject: [PATCH] ANGLE/D3D11: Suppress keyboard handling of DXGI.
Set the DXGI_MWA_NO_ALT_ENTER to suppress the Alt-Enter shortcut
causing the window to become full screen.
Task-number: QTBUG-44904
Change-Id: Ia4156ddee37a8a3da6e9e3130022c63a674f4429
---
.../angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
index 0a4f45b..696dfd7 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
@@ -64,7 +64,13 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory
swapChainDesc.Windowed = TRUE;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
- return factory->CreateSwapChain(device, &swapChainDesc, swapChain);
+ const HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain);
+ if (SUCCEEDED(result))
+ {
+ const HRESULT makeWindowAssociationResult = factory->MakeWindowAssociation(mWindow, DXGI_MWA_NO_ALT_ENTER);
+ UNUSED_TRACE_VARIABLE(makeWindowAssociationResult);
+ }
+ return result;
}
#endif
}
--
2.5.0.windows.1

View File

@ -1,9 +1,10 @@
CONFIG += installed CONFIG += installed
include(../common/common.pri) include(../common/common.pri)
DEF_FILE_TARGET=$${TARGET}
TARGET=$$qtLibraryTarget($${LIBEGL_NAME})
winrt: LIBS_PRIVATE += -ld3d11 winrt: LIBS_PRIVATE += -ld3d11
LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget(libGLESv2) LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME})
DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION
@ -14,8 +15,8 @@ SOURCES += \
$$ANGLE_DIR/src/libEGL/libEGL.cpp $$ANGLE_DIR/src/libEGL/libEGL.cpp
!static { !static {
DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}.def
mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw32.def mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${DEF_FILE_TARGET}_mingw32.def
} }
egl_headers.files = \ egl_headers.files = \

View File

@ -1,5 +1,7 @@
CONFIG += simd installed CONFIG += simd installed
include(../common/common.pri) include(../common/common.pri)
DEF_FILE_TARGET=$${TARGET}
TARGET=$$qtLibraryTarget($${LIBGLESV2_NAME})
INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libANGLE INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libANGLE
@ -327,8 +329,8 @@ angle_d3d11 {
} }
!static { !static {
DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}.def
mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw32.def mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${DEF_FILE_TARGET}_mingw32.def
} else { } else {
DEFINES += DllMain=DllMain_ANGLE # prevent symbol from conflicting with the user's DllMain DEFINES += DllMain=DllMain_ANGLE # prevent symbol from conflicting with the user's DllMain
} }

View File

@ -6,7 +6,6 @@ HEADERS += \
arch/qatomic_armv7.h \ arch/qatomic_armv7.h \
arch/qatomic_bootstrap.h \ arch/qatomic_bootstrap.h \
arch/qatomic_ia64.h \ arch/qatomic_ia64.h \
arch/qatomic_mips.h \
arch/qatomic_x86.h \ arch/qatomic_x86.h \
arch/qatomic_gcc.h \ arch/qatomic_gcc.h \
arch/qatomic_cxx11.h arch/qatomic_cxx11.h

View File

@ -145,7 +145,7 @@
attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey
will also flip accordingly (i.e., QKeySequence::Copy will be will also flip accordingly (i.e., QKeySequence::Copy will be
Command+C on the keyboard regardless of the value set, though what is output for Command+C on the keyboard regardless of the value set, though what is output for
QKeySequence::toString(QKeySequence::PortableText) will be different). QKeySequence::toString() will be different).
\value AA_Use96Dpi Assume the screen has a resolution of 96 DPI rather \value AA_Use96Dpi Assume the screen has a resolution of 96 DPI rather
than using the OS-provided resolution. This will cause font rendering than using the OS-provided resolution. This will cause font rendering

View File

@ -50,7 +50,7 @@
#include <cmath> #include <cmath>
#include <limits> #include <limits>
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) #if defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)
# include <intrin.h> # include <intrin.h>
#elif defined(Q_CC_INTEL) #elif defined(Q_CC_INTEL)
# include <immintrin.h> // for _addcarry_u<nn> # include <immintrin.h> // for _addcarry_u<nn>

View File

@ -177,7 +177,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
\note The act of monitoring files and directories for \note The act of monitoring files and directories for
modifications consumes system resources. This implies there is a modifications consumes system resources. This implies there is a
limit to the number of files and directories your process can limit to the number of files and directories your process can
monitor simultaneously. On Mac OS X 10.4 and all BSD variants, for monitor simultaneously. On all BSD variants, for
example, an open file descriptor is required for each monitored example, an open file descriptor is required for each monitored
file. Some system limits the number of open file descriptors to 256 file. Some system limits the number of open file descriptors to 256
by default. This means that addPath() and addPaths() will fail if by default. This means that addPath() and addPaths() will fail if
@ -185,7 +185,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
the file system monitor. Also note that your process may have the file system monitor. Also note that your process may have
other file descriptors open in addition to the ones for files other file descriptors open in addition to the ones for files
being monitored, and these other open descriptors also count in being monitored, and these other open descriptors also count in
the total. Mac OS X 10.5 and up use a different backend and do not the total. OS X uses a different backend and does not
suffer from this issue. suffer from this issue.

View File

@ -2098,7 +2098,9 @@ QByteArray QProcess::readAllStandardError()
\b{Windows:} The arguments are quoted and joined into a command line \b{Windows:} The arguments are quoted and joined into a command line
that is compatible with the \c CommandLineToArgvW() Windows function. that is compatible with the \c CommandLineToArgvW() Windows function.
For programs that have different command line quoting requirements, For programs that have different command line quoting requirements,
you need to use setNativeArguments(). you need to use setNativeArguments(). One notable program that does
not follow the \c CommandLineToArgvW() rules is cmd.exe and, by
consequence, all batch scripts.
The OpenMode is set to \a mode. The OpenMode is set to \a mode.

View File

@ -229,7 +229,7 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
CFRelease(bundleUrl); CFRelease(bundleUrl);
CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle); CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle);
CFStringRef cfResourcesPath = CFURLCopyPath(bundleUrl); CFStringRef cfResourcesPath = CFURLCopyPath(resourcesUrl);
QString resourcesPath = QCFString::toQString(cfResourcesPath); QString resourcesPath = QCFString::toQString(cfResourcesPath);
CFRelease(cfResourcesPath); CFRelease(cfResourcesPath);
CFRelease(resourcesUrl); CFRelease(resourcesUrl);

View File

@ -219,7 +219,7 @@ QT_BEGIN_NAMESPACE
\value TouchEnd End of touch-event sequence (QTouchEvent). \value TouchEnd End of touch-event sequence (QTouchEvent).
\value TouchUpdate Touch-screen event (QTouchEvent). \value TouchUpdate Touch-screen event (QTouchEvent).
\value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only). \value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only).
\value UngrabMouse Item loses mouse grab (QGraphicsItem only). \value UngrabMouse Item loses mouse grab (QGraphicsItem, QQuickItem).
\value UpdateLater The widget should be queued to be repainted at a later time. \value UpdateLater The widget should be queued to be repainted at a later time.
\value UpdateRequest The widget should be repainted. \value UpdateRequest The widget should be repainted.
\value WhatsThis The widget should reveal "What's This?" help (QHelpEvent). \value WhatsThis The widget should reveal "What's This?" help (QHelpEvent).

View File

@ -513,7 +513,7 @@ QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext()
wc.lpszClassName = className; wc.lpszClassName = className;
atom = RegisterClass(&wc); atom = RegisterClass(&wc);
if (!atom) { if (!atom) {
qErrnoWarning("%s: RegisterClass() failed", Q_FUNC_INFO, qPrintable(qClassName)); qErrnoWarning("%s RegisterClass() failed", qPrintable(qClassName));
delete [] className; delete [] className;
className = 0; className = 0;
} }
@ -549,7 +549,7 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch
0); // windows creation data. 0); // windows creation data.
if (!wnd) { if (!wnd) {
qErrnoWarning("%s: CreateWindow() for QEventDispatcherWin32 internal window failed", Q_FUNC_INFO); qErrnoWarning("CreateWindow() for QEventDispatcherWin32 internal window failed");
return 0; return 0;
} }

View File

@ -568,9 +568,9 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3 mimeFiles = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QString::fromLatin1("mime/") + file); // pre-1.3
} }
if (mimeFiles.isEmpty()) { if (mimeFiles.isEmpty()) {
qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist."; qWarning() << "No file found for" << file << ", even though update-mime-info said it would exist.\n"
qWarning() << "Either it was just removed, or the directory doesn't have executable permission..."; "Either it was just removed, or the directory doesn't have executable permission..."
qWarning() << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory); << QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QLatin1String("mime"), QStandardPaths::LocateDirectory);
return; return;
} }
@ -756,7 +756,7 @@ void QMimeXMLProvider::ensureLoaded()
foreach (const QString &packageDir, packageDirs) { foreach (const QString &packageDir, packageDirs) {
QDir dir(packageDir); QDir dir(packageDir);
const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot); const QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);
//qDebug() << static_cast<const void *>(this) << Q_FUNC_INFO << packageDir << files; //qDebug() << static_cast<const void *>(this) << packageDir << files;
if (!fdoXmlFound) if (!fdoXmlFound)
fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml")); fdoXmlFound = files.contains(QLatin1String("freedesktop.org.xml"));
QStringList::const_iterator endIt(files.constEnd()); QStringList::const_iterator endIt(files.constEnd());

View File

@ -147,8 +147,8 @@ void QFactoryLoader::update()
library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath()); library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath());
if (!library->isPlugin()) { if (!library->isPlugin()) {
if (qt_debug_component()) { if (qt_debug_component()) {
qDebug() << library->errorString; qDebug() << library->errorString << endl
qDebug() << " not a plugin"; << " not a plugin";
} }
library->release(); library->release();
continue; continue;

View File

@ -337,12 +337,10 @@ static void installCoverageTool(QLibraryPrivate *libPrivate)
if (qt_debug_component()) { if (qt_debug_component()) {
if (ret >= 0) { if (ret >= 0) {
qDebug("%s: coverage data for %s registered", qDebug("coverage data for %s registered",
Q_FUNC_INFO,
qPrintable(libPrivate->fileName)); qPrintable(libPrivate->fileName));
} else { } else {
qWarning("%s: could not register %s: error %d; coverage data may be incomplete", qWarning("could not register %s: error %d; coverage data may be incomplete",
Q_FUNC_INFO,
qPrintable(libPrivate->fileName), qPrintable(libPrivate->fileName),
ret); ret);
} }

View File

@ -248,6 +248,8 @@ bool QCollator::numericMode() const
The default is locale dependent. The default is locale dependent.
\note This method is not currently supported on Apple platforms or if Qt is configured to not use ICU on Linux.
\sa ignorePunctuation() \sa ignorePunctuation()
*/ */
void QCollator::setIgnorePunctuation(bool on) void QCollator::setIgnorePunctuation(bool on)

View File

@ -820,8 +820,8 @@ void **QListData::erase(void **xi)
/*! \fn void QList::insert(int i, const T &value) /*! \fn void QList::insert(int i, const T &value)
Inserts \a value at index position \a i in the list. If \a i Inserts \a value at index position \a i in the list. If \a i <= 0,
is 0, the value is prepended to the list. If \a i is size(), the the value is prepended to the list. If \a i >= size(), the
value is appended to the list. value is appended to the list.
Example: Example:

View File

@ -384,6 +384,9 @@
initialized with a \l{default-constructed value}. If \a size is less initialized with a \l{default-constructed value}. If \a size is less
than the current size, elements are removed from the end. than the current size, elements are removed from the end.
Since Qt 5.6, resize() doesn't shrink the capacity anymore.
To shed excess capacity, use squeeze().
\sa size() \sa size()
*/ */

View File

@ -406,9 +406,6 @@ void QVector<T>::resize(int asize)
if (asize > oldAlloc) { // there is not enough space if (asize > oldAlloc) { // there is not enough space
newAlloc = asize; newAlloc = asize;
opt = QArrayData::Grow; opt = QArrayData::Grow;
} else if (!d->capacityReserved && asize < d->size && asize < (oldAlloc >> 1)) { // we want to shrink
newAlloc = asize;
opt = QArrayData::Grow;
} else { } else {
newAlloc = oldAlloc; newAlloc = oldAlloc;
} }

View File

@ -1228,6 +1228,12 @@ bool QIcon::hasThemeIcon(const QString &name)
*/ */
void QIcon::setIsMask(bool isMask) void QIcon::setIsMask(bool isMask)
{ {
if (!d) {
d = new QIconPrivate;
d->engine = new QPixmapIconEngine;
} else {
detach();
}
d->is_mask = isMask; d->is_mask = isMask;
} }
@ -1242,6 +1248,8 @@ void QIcon::setIsMask(bool isMask)
*/ */
bool QIcon::isMask() const bool QIcon::isMask() const
{ {
if (!d)
return false;
return d->is_mask; return d->is_mask;
} }

View File

@ -907,7 +907,7 @@ void QPixmap::fill(const QPaintDevice *device, const QPoint &p)
{ {
Q_UNUSED(device) Q_UNUSED(device)
Q_UNUSED(p) Q_UNUSED(p)
qWarning("%s is deprecated, ignored", Q_FUNC_INFO); qWarning("this function is deprecated, ignored");
} }
@ -1703,8 +1703,8 @@ QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionF
QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
{ {
qWarning("%s is deprecated, use QScreen::grabWindow() instead." qWarning("this function is deprecated, use QScreen::grabWindow() instead."
" Defaulting to primary screen.", Q_FUNC_INFO); " Defaulting to primary screen.");
return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h); return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h);
} }

View File

@ -165,7 +165,7 @@ int QGuiApplicationPrivate::mouse_double_click_distance = -1;
QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0; QWindow *QGuiApplicationPrivate::currentMousePressWindow = 0;
static Qt::LayoutDirection layout_direction = Qt::LeftToRight; static Qt::LayoutDirection layout_direction = Qt::LayoutDirectionAuto;
static bool force_reverse = false; static bool force_reverse = false;
QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0; QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0;
@ -1305,7 +1305,6 @@ void QGuiApplicationPrivate::init()
pluginList << argv[i]; pluginList << argv[i];
} else if (arg == "-reverse") { } else if (arg == "-reverse") {
force_reverse = true; force_reverse = true;
QGuiApplication::setLayoutDirection(Qt::RightToLeft);
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
} else if (arg.startsWith("-psn_")) { } else if (arg.startsWith("-psn_")) {
// eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder. // eat "-psn_xxxx" on Mac, which is passed when starting an app from Finder.
@ -1429,6 +1428,9 @@ void QGuiApplicationPrivate::init()
#else #else
Q_UNUSED(loadTestability); Q_UNUSED(loadTestability);
#endif // QT_NO_LIBRARY #endif // QT_NO_LIBRARY
if (layout_direction == Qt::LayoutDirectionAuto || force_reverse)
QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);
} }
extern void qt_cleanupFontDatabase(); extern void qt_cleanupFontDatabase();
@ -3300,7 +3302,10 @@ void QGuiApplication::setLayoutDirection(Qt::LayoutDirection direction)
Qt::LayoutDirection QGuiApplication::layoutDirection() Qt::LayoutDirection QGuiApplication::layoutDirection()
{ {
return layout_direction; // layout_direction is only ever Qt::LayoutDirectionAuto if setLayoutDirection
// was never called, or called with Qt::LayoutDirectionAuto (which is a no-op).
// In that case we return the default LeftToRight.
return layout_direction == Qt::LayoutDirectionAuto ? Qt::LeftToRight : layout_direction;
} }
/*! /*!

View File

@ -175,7 +175,8 @@ static bool convert(const QVariant::Private *d, int t,
switch (t) { switch (t) {
case QVariant::ByteArray: case QVariant::ByteArray:
if (d->type == QVariant::Color) { if (d->type == QVariant::Color) {
*static_cast<QByteArray *>(result) = v_cast<QColor>(d)->name().toLatin1(); const QColor *c = v_cast<QColor>(d);
*static_cast<QByteArray *>(result) = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb).toLatin1();
return true; return true;
} }
break; break;
@ -190,9 +191,11 @@ static bool convert(const QVariant::Private *d, int t,
case QVariant::Font: case QVariant::Font:
*str = v_cast<QFont>(d)->toString(); *str = v_cast<QFont>(d)->toString();
return true; return true;
case QVariant::Color: case QVariant::Color: {
*str = v_cast<QColor>(d)->name(); const QColor *c = v_cast<QColor>(d);
*str = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb);
return true; return true;
}
default: default:
break; break;
} }

View File

@ -94,32 +94,121 @@ static inline qreal initialGlobalScaleFactor()
plugin interfacing parts of QtGui, for example the QWindow, QScreen and plugin interfacing parts of QtGui, for example the QWindow, QScreen and
QWindowSystemInterface implementation. QWindowSystemInterface implementation.
The coordinate system scaling is enabled by setting one or more scale There are now up to three active coordinate systems in Qt:
factors. These will then be factored into the value returned by the
devicePixelRatio() accessors (any native scale factor will also be
included in this value). Several setters are available:
- A process-global scale factor ---------------------------------------------------
- QT_SCALE_FACTOR (environment variable) | Application Device Independent Pixels | devicePixelRatio
- QHighDpiScaling::setGlobalFactor() | Qt Widgets | =
| Qt Gui |
|---------------------------------------------------| Qt Scale Factor
| Qt Gui QPlatform* Native Pixels | *
| Qt platform plugin |
|---------------------------------------------------| OS Scale Factor
| Display Device Pixels |
| (Graphics Buffers) |
-----------------------------------------------------
- A per-screen scale factor This is an simplification and shows the main coordinate system. All layers
- QT_AUTO_SCALE_FACTOR (environment variable) may work with device pixels in specific cases: OpenGL, creating the backing
Setting this to a true-ish value will make QHighDpiScaling store, and QPixmap management. The "Native Pixels" coordinate system is
call QPlatformScreen::pixelDensity() internal to Qt and should not be exposed to Qt users: Seen from the outside
- QHighDpiScaling::setScreenFactor(screen, factor); there are only two coordinate systems: device independent pixels and device
- QT_SCREEN_SCALE_FACTORS (environment variable) pixels.
Set this to a semicolon-separated list of scale factors
(matching the order of QGuiApplications::screens()),
or to a list of name=value pairs (where name matches
QScreen::name()).
All scale factors are of type qreal. The devicePixelRatio seen by applications is the product of the Qt scale
factor and the OS scale factor. The value of the scale factors may be 1,
in which case two or more of the coordinate systems are equivalent. Platforms
that (may) have an OS scale factor include OS X, iOS and Wayland.
The main scaling functions for use in QtGui are: Note that the functions in this file do not work with the OS scale factor
directly and are limited to converting between device independent and native
pixels. The OS scale factor is accunted for by QWindow::devicePixelRatio()
and similar functions.
Configuration Examples:
'Classic': Device Independent Pixels = Native Pixels = Device Pixels
--------------------------------------------------- devicePixelRatio: 1
| Application / Qt Gui 100 x 100 |
| | Qt Scale Factor: 1
| Qt Platform / OS 100 x 100 |
| | OS Scale Factor: 1
| Display 100 x 100 |
-----------------------------------------------------
'Retina Device': Device Independent Pixels = Native Pixels
--------------------------------------------------- devicePixelRatio: 2
| Application / Qt Gui 100 x 100 |
| | Qt Scale Factor: 1
| Qt Platform / OS 100 x 100 |
|---------------------------------------------------| OS Scale Factor: 2
| Display 200 x 200 |
-----------------------------------------------------
'2x Qt Scaling': Native Pixels = Device Pixels
--------------------------------------------------- devicePixelRatio: 2
| Application / Qt Gui 100 x 100 |
|---------------------------------------------------| Qt Scale Factor: 2
| Qt Platform / OS 200 x 200 |
| | OS Scale Factor: 1
| Display 200 x 200 |
-----------------------------------------------------
The Qt Scale Factor is the product of two sub-scale factors, which
are independently either set or determined by the platform plugin.
Several APIs are offered for this, targeting both developers and
end users. All scale factors are of type qreal.
1) A global scale factor
The QT_SCALE_FACTOR environment variable can be used to set
a global scale factor for all windows in the processs. This
is useful for testing and debugging (you can simulate any
devicePixelRatio without needing access to sepcial hardware),
and perhaps also for targeting a specific application to
a specific display type (embedded use cases).
2) A per-screen scale factors
Some platform plugins support providing a per-screen scale
factor based on display density information. These platforms
include X11, Windows, and Android.
There are two APIs for enabling or disabling this behavior:
- The QT_AUTO_SCALE_FACTOR environment variable.
- The AA_EnableHighDpiScaling and AA_DisableHighDpiScaling
application attributes
Enabling either will make QHighDpiScaling call QPlatformScreen::pixelDensity()
and use the value provided as the scale factor for the screen in
question. Disabling is done on a 'veto' basis where either the
environment or the application source can disable. The intended use
cases are 'My system is not providing correct display density
information' and 'My application needs to work in display pixels',
respectively.
The QT_SCREEN_SCALE_FACTORS environment variable can be used to set the screen
scale factors manually.Set this to a semicolon-separated
list of scale factors (matching the order of QGuiApplications::screens()),
or to a list of name=value pairs (where name matches QScreen::name()).
Coordinate conversion functions must be used when writing code that passes
geometry across the Qt Gui / Platform plugin boundary. The main conversion
functions are:
T toNativePixels(T, QWindow *) T toNativePixels(T, QWindow *)
T fromNativePixels(T, QWindow*) T fromNativePixels(T, QWindow*)
Where T is QPoint, QSize, QRect etc.
The following classes in QtGui use native pixels, for the convenience of the
plataform plugins:
QPlatformWindow
QPlatformScreen
QWindowSystemInterface (API only - Events are in device independent pixels)
As a special consideration platform plugin code should be careful about
calling QtGui geometry accessor functions:
QRect r = window->geometry();
Here the returned geometry is in device independent pixels. Add a conversion call:
QRect r = QHighDpi::toNativePixels(window->geometry());
(Avoiding calling QWindow and instead using the QPlatformWindow geometry
might be a better course of action in this case.)
*/ */
qreal QHighDpiScaling::m_factor = 1.0; qreal QHighDpiScaling::m_factor = 1.0;
@ -227,7 +316,7 @@ void QHighDpiScaling::setGlobalFactor(qreal factor)
if (qFuzzyCompare(factor, m_factor)) if (qFuzzyCompare(factor, m_factor))
return; return;
if (!QGuiApplication::allWindows().isEmpty()) if (!QGuiApplication::allWindows().isEmpty())
qWarning() << Q_FUNC_INFO << "QHighDpiScaling::setFactor: Should only be called when no windows exist."; qWarning("QHighDpiScaling::setFactor: Should only be called when no windows exist.");
m_globalScalingActive = !qFuzzyCompare(factor, qreal(1)); m_globalScalingActive = !qFuzzyCompare(factor, qreal(1));
m_factor = m_globalScalingActive ? factor : qreal(1); m_factor = m_globalScalingActive ? factor : qreal(1);

View File

@ -69,18 +69,18 @@ bool QPlatformGraphicsBufferHelper::lockAndBindToTexture(QPlatformGraphicsBuffer
{ {
if (graphicsBuffer->lock(QPlatformGraphicsBuffer::TextureAccess)) { if (graphicsBuffer->lock(QPlatformGraphicsBuffer::TextureAccess)) {
if (!graphicsBuffer->bindToTexture(rect)) { if (!graphicsBuffer->bindToTexture(rect)) {
qWarning() << Q_FUNC_INFO << "Failed to bind graphicsbuffer to texture"; qWarning("Failed to bind %sgraphicsbuffer to texture", "");
return false; return false;
} }
if (swizzle) if (swizzle)
*swizzle = false; *swizzle = false;
} else if (graphicsBuffer->lock(QPlatformGraphicsBuffer::SWReadAccess)) { } else if (graphicsBuffer->lock(QPlatformGraphicsBuffer::SWReadAccess)) {
if (!bindSWToTexture(graphicsBuffer, swizzle, rect)) { if (!bindSWToTexture(graphicsBuffer, swizzle, rect)) {
qWarning() << Q_FUNC_INFO << "Failed to bind SW graphcisbuffer to texture"; qWarning("Failed to bind %sgraphicsbuffer to texture", "SW ");
return false; return false;
} }
} else { } else {
qWarning() << Q_FUNC_INFO << "Failed to lock"; qWarning("Failed to lock");
return false; return false;
} }
return true; return true;

View File

@ -91,7 +91,8 @@ public:
SyncState, SyncState,
RasterGLSurface, RasterGLSurface,
AllGLFunctionsQueryable, AllGLFunctionsQueryable,
ApplicationIcon ApplicationIcon,
SwitchableWidgetComposition
}; };
virtual ~QPlatformIntegration() { } virtual ~QPlatformIntegration() { }

View File

@ -362,7 +362,7 @@ static int log2(uint i)
int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
{ {
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "angle");
return 0; return 0;
} }
@ -384,7 +384,7 @@ int QPlatformScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation
QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target)
{ {
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "transform");
return QTransform(); return QTransform();
} }
@ -415,7 +415,7 @@ QTransform QPlatformScreen::transformBetween(Qt::ScreenOrientation a, Qt::Screen
QRect QPlatformScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) QRect QPlatformScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect)
{ {
if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) { if (a == Qt::PrimaryOrientation || b == Qt::PrimaryOrientation) {
qWarning() << "Use QScreen version of" << __FUNCTION__ << "when passing Qt::PrimaryOrientation"; qWarning("Use QScreen version of %sBetween() when passing Qt::PrimaryOrientation", "map");
return rect; return rect;
} }

View File

@ -680,7 +680,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height)
{ {
const QPlatformScreen *platformScreen = handle(); const QPlatformScreen *platformScreen = handle();
if (!platformScreen) { if (!platformScreen) {
qWarning("%s invoked with handle==0", Q_FUNC_INFO); qWarning("invoked with handle==0");
return QPixmap(); return QPixmap();
} }
return platformScreen->grabWindow(window, x, y, width, height); return platformScreen->grabWindow(window, x, y, width, height);

View File

@ -369,7 +369,7 @@ void QWindowPrivate::setTopLevelScreen(QScreen *newScreen, bool recreate)
{ {
Q_Q(QWindow); Q_Q(QWindow);
if (parentWindow) { if (parentWindow) {
qWarning() << this << Q_FUNC_INFO << '(' << newScreen << "): Attempt to set a screen on a child window."; qWarning() << this << '(' << newScreen << "): Attempt to set a screen on a child window.";
return; return;
} }
if (newScreen != topLevelScreen) { if (newScreen != topLevelScreen) {
@ -625,7 +625,7 @@ void QWindow::setParent(QWindow *parent)
QScreen *newScreen = parent ? parent->screen() : screen(); QScreen *newScreen = parent ? parent->screen() : screen();
if (d->windowRecreationRequired(newScreen)) { if (d->windowRecreationRequired(newScreen)) {
qWarning() << this << Q_FUNC_INFO << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')'; qWarning() << this << '(' << parent << "): Cannot change screens (" << screen() << newScreen << ')';
return; return;
} }
@ -1186,7 +1186,7 @@ void QWindow::setTransientParent(QWindow *parent)
{ {
Q_D(QWindow); Q_D(QWindow);
if (parent && !parent->isTopLevel()) { if (parent && !parent->isTopLevel()) {
qWarning() << Q_FUNC_INFO << parent << "must be a top level window."; qWarning() << parent << "must be a top level window.";
return; return;
} }

View File

@ -184,7 +184,7 @@ struct VersionTerm {
bool VersionTerm::matches(const QVersionNumber &other) const bool VersionTerm::matches(const QVersionNumber &other) const
{ {
if (isNull() || other.isNull()) { if (isNull() || other.isNull()) {
qWarning() << Q_FUNC_INFO << "called with invalid parameters"; qWarning("called with invalid parameters");
return false; return false;
} }
switch (op) { switch (op) {
@ -262,7 +262,7 @@ struct OsTypeTerm
bool matches(const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease) const bool matches(const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease) const
{ {
if (isNull() || osName.isEmpty() || kernelVersion.isNull()) { if (isNull() || osName.isEmpty() || kernelVersion.isNull()) {
qWarning() << Q_FUNC_INFO << "called with invalid parameters"; qWarning("called with invalid parameters");
return false; return false;
} }
if (type != osName) if (type != osName)

View File

@ -285,7 +285,7 @@ bool QOpenGLTextureBlitterPrivate::buildProgram(ProgramIndex idx, const char *vs
p->glProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fs); p->glProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fs);
p->glProgram->link(); p->glProgram->link();
if (!p->glProgram->isLinked()) { if (!p->glProgram->isLinked()) {
qWarning() << Q_FUNC_INFO << "Could not link shader program:\n" << p->glProgram->log(); qWarning() << "Could not link shader program:\n" << p->glProgram->log();
return false; return false;
} }

View File

@ -101,11 +101,11 @@ SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \
painting/qimagescale_sse4.cpp painting/qimagescale_sse4.cpp
AVX2_SOURCES += painting/qdrawhelper_avx2.cpp AVX2_SOURCES += painting/qdrawhelper_avx2.cpp
!ios:!contains(QT_ARCH, "arm64") { !ios {
CONFIG += no_clang_integrated_as CONFIG += no_clang_integrated_as
NEON_SOURCES += painting/qdrawhelper_neon.cpp NEON_SOURCES += painting/qdrawhelper_neon.cpp
NEON_HEADERS += painting/qdrawhelper_neon_p.h NEON_HEADERS += painting/qdrawhelper_neon_p.h
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S !contains(QT_ARCH, "arm64"): NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
} }
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp

View File

@ -3885,7 +3885,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
QSpanData *data = reinterpret_cast<QSpanData *>(userData); QSpanData *data = reinterpret_cast<QSpanData *>(userData);
Operator op = getOperator(data, spans, count); Operator op = getOperator(data, spans, count);
if (!op.funcSolid64) { if (!op.funcSolid64) {
qDebug() << Q_FUNC_INFO << "unsupported 64bit blend attempted"; qDebug("unsupported 64bit blend attempted");
return blend_color_generic(count, spans, userData); return blend_color_generic(count, spans, userData);
} }
@ -4180,7 +4180,7 @@ static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, voi
Operator op = getOperator(data, spans, count); Operator op = getOperator(data, spans, count);
if (!op.func64) { if (!op.func64) {
qWarning() << Q_FUNC_INFO << "Unsupported blend"; qWarning("Unsupported blend");
return blend_untransformed_generic(count, spans, userData); return blend_untransformed_generic(count, spans, userData);
} }
QRgba64 buffer[buffer_size]; QRgba64 buffer[buffer_size];
@ -6309,7 +6309,7 @@ void qt_memfill16(quint16 *dest, quint16 color, int count)
qt_memfill_template<quint16>(dest, color, count); qt_memfill_template<quint16>(dest, color, count);
} }
#endif #endif
#if !defined(__SSE2__) && (!defined(__ARM_NEON__) || defined(Q_PROCESSOR_ARM_64)) #if !defined(__SSE2__) && !defined(__ARM_NEON__)
# ifdef QT_COMPILER_SUPPORTS_MIPS_DSP # ifdef QT_COMPILER_SUPPORTS_MIPS_DSP
extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int); extern "C" void qt_memfill32_asm_mips_dsp(quint32 *, quint32, int);
# endif # endif
@ -6425,14 +6425,11 @@ void qInitDrawhelperAsm()
#endif // SSE2 #endif // SSE2
#if defined(__ARM_NEON__) && !defined(Q_OS_IOS) && !defined(Q_PROCESSOR_ARM_64) #if defined(__ARM_NEON__) && !defined(Q_OS_IOS)
qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon; qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon; qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_neon;
qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon; qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32_neon;
@ -6440,6 +6437,21 @@ void qInitDrawhelperAsm()
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon; qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_neon;
#endif #endif
qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length);
qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;
#if !defined(Q_PROCESSOR_ARM_64)
// The RGB16 helpers are using Arm32 assemblythat has not been ported to AArch64
qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16_neon;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB16] = qt_blend_rgb16_on_argb32_neon;
qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16_neon;
qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon; qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16_neon;
qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon; qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16_neon;
@ -6448,19 +6460,13 @@ void qInitDrawhelperAsm()
qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon; qDrawHelper[QImage::Format_RGB16].alphamapBlit = qt_alphamapblit_quint16_neon;
qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = qt_blend_argb32_on_argb32_scanline_neon;
qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_neon;
qt_functionForMode_C[QPainter::CompositionMode_Plus] = comp_func_Plus_neon;
destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon; destFetchProc[QImage::Format_RGB16] = qt_destFetchRGB16_neon;
destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon; destStoreProc[QImage::Format_RGB16] = qt_destStoreRGB16_neon;
qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon; qMemRotateFunctions[QImage::Format_RGB16][0] = qt_memrotate90_16_neon;
qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon; qMemRotateFunctions[QImage::Format_RGB16][2] = qt_memrotate270_16_neon;
#endif
extern const uint * QT_FASTCALL qt_fetch_radial_gradient_neon(uint *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length);
qt_fetch_radial_gradient = qt_fetch_radial_gradient_neon;
#endif #endif
#if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP) #if defined(Q_PROCESSOR_MIPS_32) && defined(QT_COMPILER_SUPPORTS_MIPS_DSP)

View File

@ -44,6 +44,7 @@ QT_BEGIN_NAMESPACE
void qt_memfill32(quint32 *dest, quint32 value, int count) void qt_memfill32(quint32 *dest, quint32 value, int count)
{ {
const int epilogueSize = count % 16; const int epilogueSize = count % 16;
#if !defined(Q_PROCESSOR_ARM_64)
if (count >= 16) { if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize; quint32 *const neonEnd = dest + count - epilogueSize;
register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value); register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value);
@ -58,6 +59,22 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
); );
} }
} }
#else
if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize;
register uint32x4_t valueVector1 asm ("v0") = vdupq_n_u32(value);
register uint32x4_t valueVector2 asm ("v1") = valueVector1;
while (dest != neonEnd) {
asm volatile (
"st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t"
"st2 { v0.4s, v1.4s }, [%[DST]], #32 \n\t"
: [DST]"+r" (dest)
: [VALUE1]"w"(valueVector1), [VALUE2]"w"(valueVector2)
: "memory"
);
}
}
#endif
switch (epilogueSize) switch (epilogueSize)
{ {
@ -118,6 +135,7 @@ static inline uint16x8_t qvsource_over_u16(uint16x8_t src16, uint16x8_t dst16, u
return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half)); return vaddq_u16(src16, qvbyte_mul_u16(dst16, alpha16, half));
} }
#if !defined(Q_PROCESSOR_ARM_64)
extern "C" void extern "C" void
pixman_composite_over_8888_0565_asm_neon (int32_t w, pixman_composite_over_8888_0565_asm_neon (int32_t w,
int32_t h, int32_t h,
@ -164,7 +182,6 @@ pixman_composite_src_0565_0565_asm_neon (int32_t w,
int32_t dst_stride, int32_t dst_stride,
uint16_t *src, uint16_t *src,
int32_t src_stride); int32_t src_stride);
// qblendfunctions.cpp // qblendfunctions.cpp
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
const uchar *srcPixels, int sbpl, const uchar *srcPixels, int sbpl,
@ -204,6 +221,7 @@ void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl,
int w, int h, int w, int h,
int const_alpha); int const_alpha);
template <int N> template <int N>
static inline void scanLineBlit16(quint16 *dst, quint16 *src, int dstride) static inline void scanLineBlit16(quint16 *dst, quint16 *src, int dstride)
{ {
@ -329,11 +347,16 @@ void qt_blend_argb32_on_rgb16_neon(uchar *destPixels, int dbpl,
pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4); pixman_composite_over_8888_0565_asm_neon(w, h, dst, dbpl / 2, src, sbpl / 4);
} }
#endif
void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha) void qt_blend_argb32_on_argb32_scanline_neon(uint *dest, const uint *src, int length, uint const_alpha)
{ {
if (const_alpha == 255) { if (const_alpha == 255) {
#if !defined(Q_PROCESSOR_ARM_64)
pixman_composite_scanline_over_asm_neon(length, dest, src); pixman_composite_scanline_over_asm_neon(length, dest, src);
#else
qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, 256);
#endif
} else { } else {
qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, (const_alpha * 256) / 255); qt_blend_argb32_on_argb32_neon((uchar *)dest, 4 * length, (uchar *)src, 4 * length, length, 1, (const_alpha * 256) / 255);
} }
@ -349,7 +372,51 @@ void qt_blend_argb32_on_argb32_neon(uchar *destPixels, int dbpl,
uint16x8_t half = vdupq_n_u16(0x80); uint16x8_t half = vdupq_n_u16(0x80);
uint16x8_t full = vdupq_n_u16(0xff); uint16x8_t full = vdupq_n_u16(0xff);
if (const_alpha == 256) { if (const_alpha == 256) {
#if !defined(Q_PROCESSOR_ARM_64)
pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4); pixman_composite_over_8888_8888_asm_neon(w, h, (uint32_t *)destPixels, dbpl / 4, (uint32_t *)srcPixels, sbpl / 4);
#else
for (int y=0; y<h; ++y) {
int x = 0;
for (; x < w-3; x += 4) {
if (src[x] | src[x+1] | src[x+2] | src[x+3]) {
uint32x4_t src32 = vld1q_u32((uint32_t *)&src[x]);
uint32x4_t dst32 = vld1q_u32((uint32_t *)&dst[x]);
const uint8x16_t src8 = vreinterpretq_u8_u32(src32);
const uint8x16_t dst8 = vreinterpretq_u8_u32(dst32);
const uint8x8_t src8_low = vget_low_u8(src8);
const uint8x8_t dst8_low = vget_low_u8(dst8);
const uint8x8_t src8_high = vget_high_u8(src8);
const uint8x8_t dst8_high = vget_high_u8(dst8);
const uint16x8_t src16_low = vmovl_u8(src8_low);
const uint16x8_t dst16_low = vmovl_u8(dst8_low);
const uint16x8_t src16_high = vmovl_u8(src8_high);
const uint16x8_t dst16_high = vmovl_u8(dst8_high);
const uint16x8_t result16_low = qvsource_over_u16(src16_low, dst16_low, half, full);
const uint16x8_t result16_high = qvsource_over_u16(src16_high, dst16_high, half, full);
const uint32x2_t result32_low = vreinterpret_u32_u8(vmovn_u16(result16_low));
const uint32x2_t result32_high = vreinterpret_u32_u8(vmovn_u16(result16_high));
vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
}
}
for (; x<w; ++x) {
uint s = src[x];
if (s >= 0xff000000)
dst[x] = s;
else if (s != 0)
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
}
dst = (quint32 *)(((uchar *) dst) + dbpl);
src = (const quint32 *)(((const uchar *) src) + sbpl);
}
#endif
} else if (const_alpha != 0) { } else if (const_alpha != 0) {
const_alpha = (const_alpha * 255) >> 8; const_alpha = (const_alpha * 255) >> 8;
uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha); uint16x8_t const_alpha16 = vdupq_n_u16(const_alpha);
@ -463,6 +530,7 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
} }
} }
#if !defined(Q_PROCESSOR_ARM_64)
void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer, void qt_alphamapblit_quint16_neon(QRasterBuffer *rasterBuffer,
int x, int y, const QRgba64 &color, int x, int y, const QRgba64 &color,
const uchar *bitmap, const uchar *bitmap,
@ -703,6 +771,7 @@ void QT_FASTCALL qt_destStoreRGB16_neon(QRasterBuffer *rasterBuffer, int x, int
data[i + j] = dstBuffer[j]; data[i + j] = dstBuffer[j];
} }
} }
#endif
void QT_FASTCALL comp_func_solid_SourceOver_neon(uint *destPixels, int length, uint color, uint const_alpha) void QT_FASTCALL comp_func_solid_SourceOver_neon(uint *destPixels, int length, uint color, uint const_alpha)
{ {
@ -754,16 +823,13 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin
uint *const neonEnd = end - 3; uint *const neonEnd = end - 3;
while (dst < neonEnd) { while (dst < neonEnd) {
asm volatile ( uint8x16_t vs = vld1q_u8((const uint8_t*)src);
"vld2.8 { d0, d1 }, [%[SRC]] !\n\t" const uint8x16_t vd = vld1q_u8((uint8_t*)dst);
"vld2.8 { d2, d3 }, [%[DST]]\n\t" vs = vqaddq_u8(vs, vd);
"vqadd.u8 q0, q0, q1\n\t" vst1q_u8((uint8_t*)dst, vs);
"vst2.8 { d0, d1 }, [%[DST]] !\n\t" src += 4;
: [DST]"+r" (dst), [SRC]"+r" (src) dst += 4;
: };
: "memory", "d0", "d1", "d2", "d3", "q0", "q1"
);
}
while (dst != end) { while (dst != end) {
*dst = comp_func_Plus_one_pixel(*dst, *src); *dst = comp_func_Plus_one_pixel(*dst, *src);
@ -802,6 +868,7 @@ void QT_FASTCALL comp_func_Plus_neon(uint *dst, const uint *src, int length, uin
} }
} }
#if !defined(Q_PROCESSOR_ARM_64)
static const int tileSize = 32; static const int tileSize = 32;
extern "C" void qt_rotate90_16_neon(quint16 *dst, const quint16 *src, int sstride, int dstride, int count); extern "C" void qt_rotate90_16_neon(quint16 *dst, const quint16 *src, int sstride, int dstride, int count);
@ -945,6 +1012,7 @@ void qt_memrotate270_16_neon(const uchar *srcPixels, int w, int h,
} }
} }
} }
#endif
class QSimdNeon class QSimdNeon
{ {

View File

@ -75,8 +75,15 @@ public:
~QPlatformBackingStorePrivate() ~QPlatformBackingStorePrivate()
{ {
#ifndef QT_NO_OPENGL #ifndef QT_NO_OPENGL
if (blitter) QOpenGLContext *ctx = QOpenGLContext::currentContext();
blitter->destroy(); if (ctx) {
if (textureId)
ctx->functions()->glDeleteTextures(1, &textureId);
if (blitter)
blitter->destroy();
} else if (textureId || blitter) {
qWarning("No context current during QPlatformBackingStore destruction, OpenGL resources not released");
}
delete blitter; delete blitter;
#endif #endif
} }

View File

@ -1277,14 +1277,14 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
for (uint i = 0; i < num_glyphs; ++i) for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] *= stretch; g.advances[i] *= stretch;
} }
if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] = g.advances[i].round();
}
} }
#endif #endif
if (!actualFontEngine->supportsSubPixelPositions() || (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics)) {
for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] = g.advances[i].round();
}
glyphs_shaped += num_glyphs; glyphs_shaped += num_glyphs;
} }

View File

@ -279,6 +279,12 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1") writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1")
.arg(block.blockFormatIndex())); .arg(block.blockFormatIndex()));
for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) { for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) {
bool isHyperlink = frag.fragment().charFormat().hasProperty(QTextFormat::AnchorHref);
if (isHyperlink) {
QString value = frag.fragment().charFormat().property(QTextFormat::AnchorHref).toString();
writer.writeStartElement(textNS, QString::fromLatin1("a"));
writer.writeAttribute(xlinkNS, QString::fromLatin1("href"), value);
}
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it. writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it.
writer.writeStartElement(textNS, QString::fromLatin1("span")); writer.writeStartElement(textNS, QString::fromLatin1("span"));
@ -335,6 +341,9 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc
writer.writeCharacters(fragmentText.mid(exportedIndex)); writer.writeCharacters(fragmentText.mid(exportedIndex));
writer.writeEndElement(); // span writer.writeEndElement(); // span
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it.
if (isHyperlink)
writer.writeEndElement(); // a
} }
writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it. writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it.
writer.writeEndElement(); // p writer.writeEndElement(); // p

View File

@ -197,7 +197,7 @@ bool QDesktopServices::openUrl(const QUrl &url)
QPlatformServices *platformServices = platformIntegration->services(); QPlatformServices *platformServices = platformIntegration->services();
if (!platformServices) { if (!platformServices) {
qWarning("%s: The platform plugin does not support services.", Q_FUNC_INFO); qWarning("The platform plugin does not support services.");
return false; return false;
} }
return url.scheme() == QLatin1String("file") ? return url.scheme() == QLatin1String("file") ?

View File

@ -492,7 +492,7 @@ void QHttpThreadDelegate::finishedSlot()
if (httpReply->statusCode() >= 400) { if (httpReply->statusCode() >= 400) {
// it's an error reply // it's an error reply
QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply", QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
"Error downloading %1 - server replied: %2")); "Error transferring %1 - server replied: %2"));
msg = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase()); msg = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());
emit error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg); emit error(statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()), msg);
} }
@ -518,7 +518,7 @@ void QHttpThreadDelegate::synchronousFinishedSlot()
if (httpReply->statusCode() >= 400) { if (httpReply->statusCode() >= 400) {
// it's an error reply // it's an error reply
QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply", QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
"Error downloading %1 - server replied: %2")); "Error transferring %1 - server replied: %2"));
incomingErrorDetail = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase()); incomingErrorDetail = msg.arg(httpRequest.url().toString(), httpReply->reasonPhrase());
incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url()); incomingErrorCode = statusCodeFromHttp(httpReply->statusCode(), httpRequest.url());
} }

View File

@ -127,8 +127,10 @@ void QNetworkReplyImplPrivate::_q_startOperation()
return; return;
} else { } else {
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)), if (session) {
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection); QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)), Qt::QueuedConnection);
}
#endif #endif
} }

View File

@ -452,7 +452,7 @@ bool QSpdyProtocolHandler::uncompressHeader(const QByteArray &input, QByteArray
break; break;
} }
default: { default: {
qWarning() << Q_FUNC_INFO << "got unexpected zlib return value:" << zlibRet; qWarning() << "got unexpected zlib return value:" << zlibRet;
return false; return false;
} }
} }
@ -688,7 +688,7 @@ bool QSpdyProtocolHandler::uploadData(qint32 streamID)
Q_ASSERT(replyPrivate); Q_ASSERT(replyPrivate);
if (reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYHalfClosed || reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYClosed) { if (reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYHalfClosed || reply->d_func()->state == QHttpNetworkReplyPrivate::SPDYClosed) {
qWarning() << Q_FUNC_INFO << "Trying to upload to closed stream"; qWarning("Trying to upload to closed stream");
return false; return false;
} }
@ -843,7 +843,7 @@ void QSpdyProtocolHandler::handleControlFrame(const QByteArray &frameHeaders) //
break; break;
} }
default: default:
qWarning() << Q_FUNC_INFO << "cannot handle frame of type" << type; qWarning() << "cannot handle frame of type" << type;
} }
} }
@ -887,13 +887,13 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray uncompressedHeader; QByteArray uncompressedHeader;
if (!uncompressHeader(headerValuePairs, &uncompressedHeader)) { if (!uncompressHeader(headerValuePairs, &uncompressedHeader)) {
qWarning() << Q_FUNC_INFO << "error reading header from SYN_REPLY message"; qWarning("error reading header from SYN_REPLY message");
return; return;
} }
qint32 headerCount = fourBytesToInt(uncompressedHeader.constData()); qint32 headerCount = fourBytesToInt(uncompressedHeader.constData());
if (headerCount * 8 > uncompressedHeader.size()) { if (headerCount * 8 > uncompressedHeader.size()) {
qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return; return;
} }
@ -904,7 +904,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray name = uncompressedHeader.mid(readPointer, count); QByteArray name = uncompressedHeader.mid(readPointer, count);
readPointer += count; readPointer += count;
if (readPointer > uncompressedHeader.size()) { if (readPointer > uncompressedHeader.size()) {
qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return; return;
} }
@ -913,7 +913,7 @@ void QSpdyProtocolHandler::parseHttpHeaders(char flags, const QByteArray &frameD
QByteArray value = uncompressedHeader.mid(readPointer, count); QByteArray value = uncompressedHeader.mid(readPointer, count);
readPointer += count; readPointer += count;
if (readPointer > uncompressedHeader.size()) { if (readPointer > uncompressedHeader.size()) {
qWarning() << Q_FUNC_INFO << "error parsing header from SYN_REPLY message"; qWarning("error parsing header from SYN_REPLY message");
sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR); sendRST_STREAM(streamID, RST_STREAM_PROTOCOL_ERROR);
return; return;
} }
@ -1014,7 +1014,7 @@ void QSpdyProtocolHandler::handleRST_STREAM(char /*flags*/, quint32 length,
errorMessage = "server cannot process the frame because it is too large"; errorMessage = "server cannot process the frame because it is too large";
break; break;
default: default:
qWarning() << Q_FUNC_INFO << "could not understand servers RST_STREAM status code"; qWarning("could not understand servers RST_STREAM status code");
errorCode = QNetworkReply::ProtocolFailure; errorCode = QNetworkReply::ProtocolFailure;
errorMessage = "got SPDY RST_STREAM message with unknown error code"; errorMessage = "got SPDY RST_STREAM message with unknown error code";
} }
@ -1078,7 +1078,7 @@ void QSpdyProtocolHandler::handleSETTINGS(char flags, quint32 /*length*/, const
break; break;
} }
default: default:
qWarning() << Q_FUNC_INFO << "found unknown settings value" << value; qWarning() << "found unknown settings value" << value;
} }
} }
} }
@ -1117,7 +1117,7 @@ void QSpdyProtocolHandler::handleGOAWAY(char /*flags*/, quint32 /*length*/,
break; break;
} }
default: default:
qWarning() << Q_FUNC_INFO << "unexpected status code" << statusCode; qWarning() << "unexpected status code" << statusCode;
errorCode = QNetworkReply::ProtocolUnknownError; errorCode = QNetworkReply::ProtocolUnknownError;
} }
@ -1252,7 +1252,7 @@ void QSpdyProtocolHandler::handleDataFrame(const QByteArray &frameHeaders)
} }
if (flag_compress) { if (flag_compress) {
qWarning() << Q_FUNC_INFO << "SPDY level compression is not supported"; qWarning("SPDY level compression is not supported");
} }
if (flag_fin) { if (flag_fin) {

View File

@ -41,7 +41,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
Q_UNUSED(requestName); Q_UNUSED(requestName);
Q_UNUSED(nameserver); Q_UNUSED(nameserver);
Q_UNUSED(reply); Q_UNUSED(reply);
qWarning() << Q_FUNC_INFO << "Not yet supported on Android"; qWarning("Not yet supported on Android");
reply->error = QDnsLookup::ResolverError; reply->error = QDnsLookup::ResolverError;
reply->errorString = tr("Not yet supported on Android"); reply->errorString = tr("Not yet supported on Android");
return; return;

View File

@ -166,7 +166,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
ns->sin6_addr.s6_addr[i] = ipv6Address[i]; ns->sin6_addr.s6_addr[i] = ipv6Address[i];
} }
#else #else
qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported"; qWarning("IPv6 addresses for nameservers is currently not supported");
reply->error = QDnsLookup::ResolverError; reply->error = QDnsLookup::ResolverError;
reply->errorString = tr("IPv6 addresses for nameservers is currently not supported"); reply->errorString = tr("IPv6 addresses for nameservers is currently not supported");
return; return;

View File

@ -60,9 +60,9 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
// For supoprting IPv6 nameserver addresses, we'll need to switch // For supoprting IPv6 nameserver addresses, we'll need to switch
// from DnsQuey() to DnsQueryEx() as it supports passing an IPv6 // from DnsQuey() to DnsQueryEx() as it supports passing an IPv6
// address in the nameserver list // address in the nameserver list
qWarning() << Q_FUNC_INFO << "IPv6 addresses for nameservers is currently not supported"; qWarning("IPv6 addresses for nameservers are currently not supported");
reply->error = QDnsLookup::ResolverError; reply->error = QDnsLookup::ResolverError;
reply->errorString = tr("IPv6 addresses for nameservers is currently not supported"); reply->errorString = tr("IPv6 addresses for nameservers are currently not supported");
return; return;
} }
} }

View File

@ -672,6 +672,24 @@ int QNativeSocketEngine::accept()
return d->nativeAccept(); return d->nativeAccept();
} }
/*!
Returns the number of bytes that are currently available for
reading. On error, -1 is returned.
For UDP sockets, this function returns the accumulated size of all
pending datagrams, and it is therefore more useful for UDP sockets
to call hasPendingDatagrams() and pendingDatagramSize().
*/
qint64 QNativeSocketEngine::bytesAvailable() const
{
Q_D(const QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1);
Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1);
return d->nativeBytesAvailable();
}
#ifndef QT_NO_UDPSOCKET
#ifndef QT_NO_NETWORKINTERFACE #ifndef QT_NO_NETWORKINTERFACE
/*! /*!
@ -733,23 +751,6 @@ bool QNativeSocketEngine::setMulticastInterface(const QNetworkInterface &iface)
#endif // QT_NO_NETWORKINTERFACE #endif // QT_NO_NETWORKINTERFACE
/*!
Returns the number of bytes that are currently available for
reading. On error, -1 is returned.
For UDP sockets, this function returns the accumulated size of all
pending datagrams, and it is therefore more useful for UDP sockets
to call hasPendingDatagrams() and pendingDatagramSize().
*/
qint64 QNativeSocketEngine::bytesAvailable() const
{
Q_D(const QNativeSocketEngine);
Q_CHECK_VALID_SOCKETLAYER(QNativeSocketEngine::bytesAvailable(), -1);
Q_CHECK_NOT_STATE(QNativeSocketEngine::bytesAvailable(), QAbstractSocket::UnconnectedState, -1);
return d->nativeBytesAvailable();
}
/*! /*!
Returns \c true if there is at least one datagram pending. This Returns \c true if there is at least one datagram pending. This
function is only called by UDP sockets, where a datagram can have function is only called by UDP sockets, where a datagram can have
@ -834,6 +835,7 @@ qint64 QNativeSocketEngine::writeDatagram(const char *data, qint64 size, const Q
return d->nativeSendDatagram(data, size, header); return d->nativeSendDatagram(data, size, header);
} }
#endif // QT_NO_UDPSOCKET
/*! /*!
Writes a block of \a size bytes from \a data to the socket. Writes a block of \a size bytes from \a data to the socket.

View File

@ -125,6 +125,12 @@ public:
int accept() Q_DECL_OVERRIDE; int accept() Q_DECL_OVERRIDE;
void close() Q_DECL_OVERRIDE; void close() Q_DECL_OVERRIDE;
qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
#ifndef QT_NO_UDPSOCKET
#ifndef QT_NO_NETWORKINTERFACE #ifndef QT_NO_NETWORKINTERFACE
bool joinMulticastGroup(const QHostAddress &groupAddress, bool joinMulticastGroup(const QHostAddress &groupAddress,
const QNetworkInterface &iface) Q_DECL_OVERRIDE; const QNetworkInterface &iface) Q_DECL_OVERRIDE;
@ -134,16 +140,12 @@ public:
bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE; bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
#endif #endif
qint64 bytesAvailable() const Q_DECL_OVERRIDE;
qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0, qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE; PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE;
qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE; qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
bool hasPendingDatagrams() const Q_DECL_OVERRIDE; bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
qint64 pendingDatagramSize() const Q_DECL_OVERRIDE; qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
#endif // QT_NO_UDPSOCKET
qint64 bytesToWrite() const Q_DECL_OVERRIDE; qint64 bytesToWrite() const Q_DECL_OVERRIDE;

View File

@ -78,6 +78,21 @@ typedef IAsyncOperationWithProgress<IBuffer *, UINT32> IAsyncBufferOperation;
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
static QByteArray socketDescription(const QAbstractSocketEngine *s)
{
QByteArray result;
if (const QObject *o = s->parent()) {
const QString name = o->objectName();
if (!name.isEmpty()) {
result += '"';
result += name.toLocal8Bit();
result += "\"/";
}
result += o->metaObject()->className();
}
return result;
}
// Common constructs // Common constructs
#define Q_CHECK_VALID_SOCKETLAYER(function, returnValue) do { \ #define Q_CHECK_VALID_SOCKETLAYER(function, returnValue) do { \
if (!isValid()) { \ if (!isValid()) { \
@ -275,8 +290,9 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
else if (d->socketType == QAbstractSocket::UdpSocket) else if (d->socketType == QAbstractSocket::UdpSocket)
hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp); hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp);
if (hr == E_ACCESSDENIED) { if (hr == E_ACCESSDENIED) {
qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host. \ qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host (%s:%hu/%s). "
Please check your manifest capabilities."); "Please check your manifest capabilities.",
qPrintable(name), port, socketDescription(this).constData());
return false; return false;
} }
Q_ASSERT_SUCCEEDED(hr); Q_ASSERT_SUCCEEDED(hr);
@ -328,7 +344,8 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op); hr = d->udpSocket()->BindEndpointAsync(hostAddress.Get(), portString.Get(), &op);
} }
if (hr == E_ACCESSDENIED) { if (hr == E_ACCESSDENIED) {
qErrnoWarning(hr, "Unable to bind socket. Please check your manifest capabilities."); qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
qPrintable(address.toString()), port, socketDescription(this).constData());
return false; return false;
} }
Q_ASSERT_SUCCEEDED(hr); Q_ASSERT_SUCCEEDED(hr);
@ -381,12 +398,14 @@ int QNativeSocketEngine::accept()
ComPtr<IAsyncBufferOperation> op; ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op); hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, &op);
if (FAILED(hr)) { if (FAILED(hr)) {
qErrnoWarning(hr, "Faild to read from the socket buffer."); qErrnoWarning(hr, "accept(): Failed to read from the socket buffer (%s).",
socketDescription(this).constData());
return -1; return -1;
} }
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get()); hr = op->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
if (FAILED(hr)) { if (FAILED(hr)) {
qErrnoWarning(hr, "Failed to set socket read callback."); qErrnoWarning(hr, "accept(): Failed to set socket read callback (%s).",
socketDescription(this).constData());
return -1; return -1;
} }
d->currentConnections.append(socket); d->currentConnections.append(socket);
@ -1272,12 +1291,14 @@ HRESULT QNativeSocketEnginePrivate::handleReadyRead(IAsyncBufferOperation *async
ComPtr<IAsyncBufferOperation> op; ComPtr<IAsyncBufferOperation> op;
hr = stream->ReadAsync(buffer.Get(), bufferLength, InputStreamOptions_Partial, &op); hr = stream->ReadAsync(buffer.Get(), bufferLength, InputStreamOptions_Partial, &op);
if (FAILED(hr)) { if (FAILED(hr)) {
qErrnoWarning(hr, "Could not read into socket stream buffer."); qErrnoWarning(hr, "handleReadyRead(): Could not read into socket stream buffer (%s).",
socketDescription(q).constData());
return S_OK; return S_OK;
} }
hr = op->put_Completed(Callback<SocketReadCompletedHandler>(this, &QNativeSocketEnginePrivate::handleReadyRead).Get()); hr = op->put_Completed(Callback<SocketReadCompletedHandler>(this, &QNativeSocketEnginePrivate::handleReadyRead).Get());
if (FAILED(hr)) { if (FAILED(hr)) {
qErrnoWarning(hr, "Failed to set socket read callback."); qErrnoWarning(hr, "handleReadyRead(): Failed to set socket read callback (%s).",
socketDescription(q).constData());
return S_OK; return S_OK;
} }
return S_OK; return S_OK;

View File

@ -51,12 +51,291 @@
#include <algorithm> #include <algorithm>
#include <cstddef> #include <cstddef>
#include <QtCore/private/qcore_mac_p.h>
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
static SSLContextRef qt_createSecureTransportContext(QSslSocket::SslMode mode)
{
const bool isServer = mode == QSslSocket::SslServerMode;
SSLContextRef context = Q_NULLPTR;
#ifndef Q_OS_OSX
const SSLProtocolSide side = isServer ? kSSLServerSide : kSSLClientSide;
// We never use kSSLDatagramType, so it's kSSLStreamType unconditionally.
context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType);
if (!context)
qCWarning(lcSsl) << "SSLCreateContext failed";
#else // Q_OS_OSX
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
const SSLProtocolSide side = isServer ? kSSLServerSide : kSSLClientSide;
// We never use kSSLDatagramType, so it's kSSLStreamType unconditionally.
context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType);
if (!context)
qCWarning(lcSsl) << "SSLCreateContext failed";
} else {
#else
{
#endif
const OSStatus errCode = SSLNewContext(isServer, &context);
if (errCode != noErr || !context)
qCWarning(lcSsl) << "SSLNewContext failed with error:" << errCode;
}
#endif // !Q_OS_OSX
return context;
}
static void qt_releaseSecureTransportContext(SSLContextRef context)
{
if (!context)
return;
#ifndef Q_OS_OSX
CFRelease(context);
#else
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
CFRelease(context);
} else {
#else
{
#endif // QT_MAC_PLATFORM_...
const OSStatus errCode = SSLDisposeContext(context);
if (errCode != noErr)
qCWarning(lcSsl) << "SSLDisposeContext failed with error:" << errCode;
}
#endif // !Q_OS_OSX
}
static bool qt_setSessionProtocol(SSLContextRef context, const QSslConfigurationPrivate &configuration,
QTcpSocket *plainSocket)
{
Q_ASSERT(context);
#ifndef QSSLSOCKET_DEBUG
Q_UNUSED(plainSocket)
#endif
OSStatus err = noErr;
#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_5_0)
if (configuration.protocol == QSsl::SslV3) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3";
#endif
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kSSLProtocol3);
} else if (configuration.protocol == QSsl::TlsV1_0) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol1);
} else if (configuration.protocol == QSsl::TlsV1_1) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol11);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol11);
} else if (configuration.protocol == QSsl::TlsV1_2) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol12);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::AnyProtocol) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : any";
#endif
// kSSLProtocol3, since kSSLProtocol2 is disabled:
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1SslV3) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::SecureProtocols) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_0OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_1OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol11);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_2OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol12);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration";
#endif
return false;
}
#endif
return err == noErr;
}
#ifdef Q_OS_OSX
static bool qt_setSessionProtocolOSX(SSLContextRef context, const QSslConfigurationPrivate &configuration,
QTcpSocket *plainSocket)
{
// This function works with (now) deprecated API that does not even exist on
// iOS but is the only API we have on OS X below 10.8
// Without SSLSetProtocolVersionMin/Max functions it's quite difficult
// to have the required result:
// If we use SSLSetProtocolVersion - any constant except the ones with 'Only' suffix -
// allows a negotiation and we can not set the lower limit.
// SSLSetProtocolVersionEnabled supports only a limited subset of constants, if you believe their docs:
// kSSLProtocol2
// kSSLProtocol3
// kTLSProtocol1
// kSSLProtocolAll
// Here we can only have a look into the SecureTransport's code and hope that what we see there
// and what we have on 10.7 is similar:
// SSLSetProtocoLVersionEnabled actually accepts other constants also,
// called twice with two different protocols it sets a range,
// called once with a protocol (when all protocols were disabled)
// - only this protocol is enabled (without a lower limit negotiation).
Q_ASSERT(context);
#ifndef QSSLSOCKET_DEBUG
Q_UNUSED(plainSocket)
#endif
OSStatus err = noErr;
// First, disable ALL:
if (SSLSetProtocolVersionEnabled(context, kSSLProtocolAll, false) != noErr)
return false;
if (configuration.protocol == QSsl::SslV3) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3";
#endif
err = SSLSetProtocolVersion(context, kSSLProtocol3Only);
} else if (configuration.protocol == QSsl::TlsV1_0) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0";
#endif
err = SSLSetProtocolVersion(context, kTLSProtocol1Only);
} else if (configuration.protocol == QSsl::TlsV1_1) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol11, true);
} else if (configuration.protocol == QSsl::TlsV1_2) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
} else if (configuration.protocol == QSsl::AnyProtocol) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : any";
#endif
err = SSLSetProtocolVersionEnabled(context, kSSLProtocolAll, true);
} else if (configuration.protocol == QSsl::TlsV1SslV3) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
if (err == noErr)
err = SSLSetProtocolVersionEnabled(context, kSSLProtocol3, true);
} else if (configuration.protocol == QSsl::SecureProtocols) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
if (err == noErr)
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol1, true);
} else if (configuration.protocol == QSsl::TlsV1_0OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
if (err == noErr)
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol1, true);
} else if (configuration.protocol == QSsl::TlsV1_1OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
if (err == noErr)
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol11, true);
} else if (configuration.protocol == QSsl::TlsV1_2OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionEnabled(context, kTLSProtocol12, true);
} else {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration";
#endif
return false;
}
return err == noErr;
}
#endif // Q_OS_OSX
QSecureTransportContext::QSecureTransportContext(SSLContextRef c)
: context(c)
{
}
QSecureTransportContext::~QSecureTransportContext()
{
qt_releaseSecureTransportContext(context);
}
QSecureTransportContext::operator SSLContextRef()const
{
return context;
}
void QSecureTransportContext::reset(SSLContextRef newContext)
{
qt_releaseSecureTransportContext(context);
context = newContext;
}
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_securetransport_mutex, (QMutex::Recursive)) Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_securetransport_mutex, (QMutex::Recursive))
//#define QSSLSOCKET_DEBUG //#define QSSLSOCKET_DEBUG
@ -144,7 +423,7 @@ void QSslSocketPrivate::ensureInitialized()
// from QSslCertificatePrivate's ctor. // from QSslCertificatePrivate's ctor.
s_loadedCiphersAndCerts = true; s_loadedCiphersAndCerts = true;
QCFType<SSLContextRef> context(SSLCreateContext(Q_NULLPTR, kSSLClientSide, kSSLStreamType)); const QSecureTransportContext context(qt_createSecureTransportContext(QSslSocket::SslClientMode));
if (context) { if (context) {
QList<QSslCipher> ciphers; QList<QSslCipher> ciphers;
QList<QSslCipher> defaultCiphers; QList<QSslCipher> defaultCiphers;
@ -171,7 +450,6 @@ void QSslSocketPrivate::ensureInitialized()
if (!s_loadRootCertsOnDemand) if (!s_loadRootCertsOnDemand)
setDefaultCaCertificates(systemCaCertificates()); setDefaultCaCertificates(systemCaCertificates());
} else { } else {
qCWarning(lcSsl) << "SSLCreateContext failed";
s_loadedCiphersAndCerts = false; s_loadedCiphersAndCerts = false;
} }
@ -640,11 +918,7 @@ bool QSslSocketBackendPrivate::initSslContext()
Q_ASSERT_X(!context, Q_FUNC_INFO, "invalid socket state, context is not null"); Q_ASSERT_X(!context, Q_FUNC_INFO, "invalid socket state, context is not null");
Q_ASSERT(plainSocket); Q_ASSERT(plainSocket);
SSLProtocolSide side = kSSLClientSide; context.reset(qt_createSecureTransportContext(mode));
if (mode == QSslSocket::SslServerMode)
side = kSSLServerSide;
context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType);
if (!context) { if (!context) {
setErrorAndEmit(QAbstractSocket::SslInternalError, "SSLCreateContext failed"); setErrorAndEmit(QAbstractSocket::SslInternalError, "SSLCreateContext failed");
return false; return false;
@ -740,7 +1014,7 @@ bool QSslSocketBackendPrivate::initSslContext()
void QSslSocketBackendPrivate::destroySslContext() void QSslSocketBackendPrivate::destroySslContext()
{ {
context = Q_NULLPTR; context.reset(Q_NULLPTR);
} }
static QByteArray _q_makePkcs12(const QList<QSslCertificate> &certs, const QSslKey &key, const QString &passPhrase); static QByteArray _q_makePkcs12(const QList<QSslCertificate> &certs, const QSslKey &key, const QString &passPhrase);
@ -837,8 +1111,6 @@ bool QSslSocketBackendPrivate::setSessionProtocol()
{ {
Q_ASSERT_X(context, Q_FUNC_INFO, "invalid SSL context (null)"); Q_ASSERT_X(context, Q_FUNC_INFO, "invalid SSL context (null)");
OSStatus err = noErr;
// QSsl::SslV2 == kSSLProtocol2 is disabled in secure transport and // QSsl::SslV2 == kSSLProtocol2 is disabled in secure transport and
// always fails with errSSLIllegalParam: // always fails with errSSLIllegalParam:
// if (version < MINIMUM_STREAM_VERSION || version > MAXIMUM_STREAM_VERSION) // if (version < MINIMUM_STREAM_VERSION || version > MAXIMUM_STREAM_VERSION)
@ -849,85 +1121,20 @@ bool QSslSocketBackendPrivate::setSessionProtocol()
return false; return false;
} }
if (configuration.protocol == QSsl::SslV3) { #ifndef Q_OS_OSX
#ifdef QSSLSOCKET_DEBUG return qt_setSessionProtocol(context, configuration, plainSocket);
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3"; #else
#endif
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kSSLProtocol3);
} else if (configuration.protocol == QSsl::TlsV1_0) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.0";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol1);
} else if (configuration.protocol == QSsl::TlsV1_1) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol11);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol11);
} else if (configuration.protocol == QSsl::TlsV1_2) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol12);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::AnyProtocol) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : any";
#endif
// kSSLProtocol3, since kSSLProtocol2 is disabled:
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1SslV3) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : SSLv3 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kSSLProtocol3);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::SecureProtocols) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_0OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol1);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_1OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.1 - TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol11);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else if (configuration.protocol == QSsl::TlsV1_2OrLater) {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "requesting : TLSv1.2";
#endif
err = SSLSetProtocolVersionMin(context, kTLSProtocol12);
if (err == noErr)
err = SSLSetProtocolVersionMax(context, kTLSProtocol12);
} else {
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << plainSocket << "no protocol version found in the configuration";
#endif
return false;
}
return err == noErr; #if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_NA)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_8) {
return qt_setSessionProtocol(context, configuration, plainSocket);
} else {
#else
{
#endif
return qt_setSessionProtocolOSX(context, configuration, plainSocket);
}
#endif
} }
bool QSslSocketBackendPrivate::canIgnoreTrustVerificationFailure() const bool QSslSocketBackendPrivate::canIgnoreTrustVerificationFailure() const

View File

@ -45,8 +45,6 @@
// We mean it. // We mean it.
// //
#include <QtCore/private/qcore_mac_p.h>
#include <QtCore/qstring.h> #include <QtCore/qstring.h>
#include <QtCore/qglobal.h> #include <QtCore/qglobal.h>
#include <QtCore/qlist.h> #include <QtCore/qlist.h>
@ -59,6 +57,20 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QSecureTransportContext
{
public:
explicit QSecureTransportContext(SSLContextRef context);
~QSecureTransportContext();
operator SSLContextRef () const;
void reset(SSLContextRef newContext);
private:
SSLContextRef context;
Q_DISABLE_COPY(QSecureTransportContext);
};
class QSslSocketBackendPrivate : public QSslSocketPrivate class QSslSocketBackendPrivate : public QSslSocketPrivate
{ {
Q_DECLARE_PUBLIC(QSslSocket) Q_DECLARE_PUBLIC(QSslSocket)
@ -76,8 +88,8 @@ public:
void startServerEncryption() Q_DECL_OVERRIDE; void startServerEncryption() Q_DECL_OVERRIDE;
void transmit() Q_DECL_OVERRIDE; void transmit() Q_DECL_OVERRIDE;
static QList<QSslError> (verify)(QList<QSslCertificate> certificateChain, static QList<QSslError> verify(QList<QSslCertificate> certificateChain,
const QString &hostName); const QString &hostName);
static bool importPkcs12(QIODevice *device, static bool importPkcs12(QIODevice *device,
QSslKey *key, QSslCertificate *cert, QSslKey *key, QSslCertificate *cert,
@ -101,7 +113,7 @@ private:
bool checkSslErrors(); bool checkSslErrors();
bool startHandshake(); bool startHandshake();
mutable QCFType<SSLContextRef> context; QSecureTransportContext context;
Q_DISABLE_COPY(QSslSocketBackendPrivate); Q_DISABLE_COPY(QSslSocketBackendPrivate);
}; };

View File

@ -246,8 +246,7 @@ bool QGLShaderPrivate::create()
else else
shader = glfuncs->glCreateShader(GL_FRAGMENT_SHADER); shader = glfuncs->glCreateShader(GL_FRAGMENT_SHADER);
if (!shader) { if (!shader) {
qWarning("%s: Could not create shader of type %d.", qWarning("Could not create shader of type %d.", int(shaderType));
Q_FUNC_INFO, int(shaderType));
return false; return false;
} }
shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc); shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc);

View File

@ -71,6 +71,7 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
: QPlatformBackingStore(window), : QPlatformBackingStore(window),
m_window(window), m_window(window),
m_bsTexture(0), m_bsTexture(0),
m_bsTextureContext(0),
m_textures(new QPlatformTextureList), m_textures(new QPlatformTextureList),
m_lockedWidgetTextures(0) m_lockedWidgetTextures(0)
{ {
@ -78,6 +79,14 @@ QOpenGLCompositorBackingStore::QOpenGLCompositorBackingStore(QWindow *window)
QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore() QOpenGLCompositorBackingStore::~QOpenGLCompositorBackingStore()
{ {
if (m_bsTexture) {
QOpenGLContext *ctx = QOpenGLContext::currentContext();
if (ctx && m_bsTextureContext && ctx->shareGroup() == m_bsTextureContext->shareGroup())
glDeleteTextures(1, &m_bsTexture);
else
qWarning("QOpenGLCompositorBackingStore: Texture is not valid in the current context");
}
delete m_textures; delete m_textures;
} }
@ -89,6 +98,8 @@ QPaintDevice *QOpenGLCompositorBackingStore::paintDevice()
void QOpenGLCompositorBackingStore::updateTexture() void QOpenGLCompositorBackingStore::updateTexture()
{ {
if (!m_bsTexture) { if (!m_bsTexture) {
m_bsTextureContext = QOpenGLContext::currentContext();
Q_ASSERT(m_bsTextureContext);
glGenTextures(1, &m_bsTexture); glGenTextures(1, &m_bsTexture);
glBindTexture(GL_TEXTURE_2D, m_bsTexture); glBindTexture(GL_TEXTURE_2D, m_bsTexture);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

View File

@ -83,6 +83,7 @@ private:
QImage m_image; QImage m_image;
QRegion m_dirty; QRegion m_dirty;
uint m_bsTexture; uint m_bsTexture;
QOpenGLContext *m_bsTextureContext;
QPlatformTextureList *m_textures; QPlatformTextureList *m_textures;
QPlatformTextureList *m_lockedWidgetTextures; QPlatformTextureList *m_lockedWidgetTextures;
}; };

View File

@ -134,7 +134,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
return openDocument(url); return openDocument(url);
if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) { if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
qWarning("%s: Unable to detect a web browser to launch '%s'", Q_FUNC_INFO, qPrintable(url.toString())); qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
return false; return false;
} }
return launch(m_webBrowser, url); return launch(m_webBrowser, url);
@ -143,7 +143,7 @@ bool QGenericUnixServices::openUrl(const QUrl &url)
bool QGenericUnixServices::openDocument(const QUrl &url) bool QGenericUnixServices::openDocument(const QUrl &url)
{ {
if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) { if (m_documentLauncher.isEmpty() && !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) {
qWarning("%s: Unable to detect a launcher for '%s'", Q_FUNC_INFO, qPrintable(url.toString())); qWarning("Unable to detect a launcher for '%s'", qPrintable(url.toString()));
return false; return false;
} }
return launch(m_documentLauncher, url); return launch(m_documentLauncher, url);

View File

@ -546,7 +546,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
kdeDirs.removeDuplicates(); kdeDirs.removeDuplicates();
if (kdeDirs.isEmpty()) { if (kdeDirs.isEmpty()) {
qWarning("%s: Unable to determine KDE dirs", Q_FUNC_INFO); qWarning("Unable to determine KDE dirs");
return 0; return 0;
} }

View File

@ -74,7 +74,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
if (!propsReply.isError()) { if (!propsReply.isError()) {
propertyMap = propsReply.value(); propertyMap = propsReply.value();
} else { } else {
qWarning() << Q_FUNC_INFO << "propsReply"<<propsReply.error().message(); qWarning() << "propsReply" << propsReply.error().message();
} }
QDBusPendingReply<QList <QDBusObjectPath> > nmReply QDBusPendingReply<QList <QDBusObjectPath> > nmReply
@ -83,7 +83,7 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
if (!nmReply.isError()) { if (!nmReply.isError()) {
devicesPathList = nmReply.value(); devicesPathList = nmReply.value();
} else { } else {
qWarning() << Q_FUNC_INFO <<"nmReply"<<nmReply.error().message(); qWarning() << "nmReply" << nmReply.error().message();
} }
QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE), QDBusConnection::systemBus().connect(QLatin1String(NM_DBUS_SERVICE),
@ -789,7 +789,7 @@ bool QNetworkManagerSettings::setConnections()
QLatin1String("NewConnection"), QLatin1String("NewConnection"),
this, SIGNAL(newConnection(QDBusObjectPath)))) { this, SIGNAL(newConnection(QDBusObjectPath)))) {
allOk = false; allOk = false;
qWarning() << Q_FUNC_INFO << "NewConnection could not be connected"; qWarning("NewConnection could not be connected");
} }
return allOk; return allOk;

View File

@ -69,39 +69,39 @@ QWindowsSockInit2::~QWindowsSockInit2()
#ifdef BEARER_MANAGEMENT_DEBUG #ifdef BEARER_MANAGEMENT_DEBUG
static void printBlob(NLA_BLOB *blob) static void printBlob(NLA_BLOB *blob)
{ {
qDebug() << "==== BEGIN NLA_BLOB ===="; qDebug() << "==== BEGIN NLA_BLOB ====" << endl
qDebug() << "type:" << blob->header.type; << "type:" << blob->header.type << endl
qDebug() << "size:" << blob->header.dwSize; << "size:" << blob->header.dwSize << endl
qDebug() << "next offset:" << blob->header.nextOffset; << "next offset:" << blob->header.nextOffset;
switch (blob->header.type) { switch (blob->header.type) {
case NLA_RAW_DATA: case NLA_RAW_DATA:
qDebug() << "Raw Data"; qDebug() << "Raw Data" << endl
qDebug() << '\t' << blob->data.rawData; << '\t' << blob->data.rawData;
break; break;
case NLA_INTERFACE: case NLA_INTERFACE:
qDebug() << "Interface"; qDebug() << "Interface" << endl
qDebug() << "\ttype:" << blob->data.interfaceData.dwType; << "\ttype:" << blob->data.interfaceData.dwType << endl
qDebug() << "\tspeed:" << blob->data.interfaceData.dwSpeed; << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl
qDebug() << "\tadapter:" << blob->data.interfaceData.adapterName; << "\tadapter:" << blob->data.interfaceData.adapterName;
break; break;
case NLA_802_1X_LOCATION: case NLA_802_1X_LOCATION:
qDebug() << "802.1x Location"; qDebug() << "802.1x Location" << endl
qDebug() << '\t' << blob->data.locationData.information; << '\t' << blob->data.locationData.information;
break; break;
case NLA_CONNECTIVITY: case NLA_CONNECTIVITY:
qDebug() << "Connectivity"; qDebug() << "Connectivity" << endl
qDebug() << "\ttype:" << blob->data.connectivity.type; << "\ttype:" << blob->data.connectivity.type << endl
qDebug() << "\tinternet:" << blob->data.connectivity.internet; << "\tinternet:" << blob->data.connectivity.internet;
break; break;
case NLA_ICS: case NLA_ICS:
qDebug() << "ICS"; qDebug() << "ICS" << endl
qDebug() << "\tspeed:" << blob->data.ICS.remote.speed; << "\tspeed:" << blob->data.ICS.remote.speed << endl
qDebug() << "\ttype:" << blob->data.ICS.remote.type; << "\ttype:" << blob->data.ICS.remote.type << endl
qDebug() << "\tstate:" << blob->data.ICS.remote.state; << "\tstate:" << blob->data.ICS.remote.state << endl
qDebug() << "\tmachine name:" << blob->data.ICS.remote.machineName; << "\tmachine name:" << blob->data.ICS.remote.machineName << endl
qDebug() << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName; << "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
break; break;
default: default:
qDebug() << "UNKNOWN BLOB TYPE"; qDebug() << "UNKNOWN BLOB TYPE";

View File

@ -1,5 +1,7 @@
TEMPLATE = subdirs TEMPLATE = subdirs
load(qfeatures)
contains(QT_CONFIG, evdev) { contains(QT_CONFIG, evdev) {
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
} }
@ -8,7 +10,9 @@ contains(QT_CONFIG, tslib) {
SUBDIRS += tslib SUBDIRS += tslib
} }
SUBDIRS += tuiotouch !contains(QT_DISABLED_FEATURES, udpsocket) {
SUBDIRS += tuiotouch
}
contains(QT_CONFIG, libinput) { contains(QT_CONFIG, libinput) {
SUBDIRS += libinput SUBDIRS += libinput

View File

@ -498,8 +498,8 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
} }
if (Q_UNLIKELY(!m_main)) { if (Q_UNLIKELY(!m_main)) {
qCritical() << "dlsym failed:" << dlerror(); qCritical() << "dlsym failed:" << dlerror() << endl
qCritical() << "Could not find main method"; << "Could not find main method";
return false; return false;
} }

View File

@ -46,6 +46,7 @@
#include <QVariant> #include <QVariant>
#include <private/qguiapplication_p.h> #include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <qandroidplatformintegration.h> #include <qandroidplatformintegration.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -217,7 +218,7 @@ QJsonObject AndroidStyle::loadStyleData()
static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette) static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette)
{ {
double pixelDensity = qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") ? QtAndroid::pixelDensity() : 1.0; double pixelDensity = QHighDpiScaling::isActive() ? QtAndroid::pixelDensity() : 1.0;
std::shared_ptr<AndroidStyle> style = std::make_shared<AndroidStyle>(); std::shared_ptr<AndroidStyle> style = std::make_shared<AndroidStyle>();
style->m_styleData = AndroidStyle::loadStyleData(); style->m_styleData = AndroidStyle::loadStyleData();
if (style->m_styleData.isEmpty()) if (style->m_styleData.isEmpty())

View File

@ -294,7 +294,7 @@ void QCocoaMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *
int index = m_menuItems.indexOf(beforeItem); int index = m_menuItems.indexOf(beforeItem);
// if a before item is supplied, it should be in the menu // if a before item is supplied, it should be in the menu
if (index < 0) { if (index < 0) {
qWarning() << Q_FUNC_INFO << "Before menu item not found"; qWarning("Before menu item not found");
return; return;
} }
m_menuItems.insert(index, cocoaItem); m_menuItems.insert(index, cocoaItem);
@ -315,7 +315,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
return; return;
if ([item->nsItem() menu]) { if ([item->nsItem() menu]) {
qWarning() << Q_FUNC_INFO << "Menu item is already in a menu, remove it from the other menu first before inserting"; qWarning("Menu item is already in a menu, remove it from the other menu first before inserting");
return; return;
} }
// if the item we're inserting before is merged, skip along until // if the item we're inserting before is merged, skip along until
@ -326,7 +326,7 @@ void QCocoaMenu::insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem)
if (beforeItem) { if (beforeItem) {
if (beforeItem->isMerged()) { if (beforeItem->isMerged()) {
qWarning() << Q_FUNC_INFO << "No non-merged before menu item found"; qWarning("No non-merged before menu item found");
return; return;
} }
NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeItem->nsItem()]; NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeItem->nsItem()];
@ -342,7 +342,7 @@ void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem)
QMacAutoReleasePool pool; QMacAutoReleasePool pool;
QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem); QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem);
if (!m_menuItems.contains(cocoaItem)) { if (!m_menuItems.contains(cocoaItem)) {
qWarning() << Q_FUNC_INFO << "Menu does not contain the item to be removed"; qWarning("Menu does not contain the item to be removed");
return; return;
} }
@ -352,7 +352,7 @@ void QCocoaMenu::removeMenuItem(QPlatformMenuItem *menuItem)
m_menuItems.removeOne(cocoaItem); m_menuItems.removeOne(cocoaItem);
if (!cocoaItem->isMerged()) { if (!cocoaItem->isMerged()) {
if (m_nativeMenu != [cocoaItem->nsItem() menu]) { if (m_nativeMenu != [cocoaItem->nsItem() menu]) {
qWarning() << Q_FUNC_INFO << "Item to remove does not belong to this menu"; qWarning("Item to remove does not belong to this menu");
return; return;
} }
[m_nativeMenu removeItem: cocoaItem->nsItem()]; [m_nativeMenu removeItem: cocoaItem->nsItem()];
@ -372,7 +372,7 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem)
QMacAutoReleasePool pool; QMacAutoReleasePool pool;
QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem); QCocoaMenuItem *cocoaItem = static_cast<QCocoaMenuItem *>(menuItem);
if (!m_menuItems.contains(cocoaItem)) { if (!m_menuItems.contains(cocoaItem)) {
qWarning() << Q_FUNC_INFO << "Item does not belong to this menu"; qWarning("Item does not belong to this menu");
return; return;
} }

View File

@ -108,12 +108,12 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor
#endif #endif
if (m_menus.contains(menu)) { if (m_menus.contains(menu)) {
qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; qWarning("This menu already belongs to the menubar, remove it first");
return; return;
} }
if (beforeMenu && !m_menus.contains(beforeMenu)) { if (beforeMenu && !m_menus.contains(beforeMenu)) {
qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; qWarning("The before menu does not belong to the menubar");
return; return;
} }
@ -138,7 +138,7 @@ void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
{ {
QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu); QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu);
if (!m_menus.contains(menu)) { if (!m_menus.contains(menu)) {
qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; qWarning("Trying to remove a menu that does not belong to the menubar");
return; return;
} }
m_menus.removeOne(menu); m_menus.removeOne(menu);

View File

@ -283,7 +283,7 @@ NSMenuItem *QCocoaMenuItem::sync()
} }
default: default:
qWarning() << Q_FUNC_INFO << "menu item" << m_text << "has unsupported role" << (int)m_role; qWarning() << "menu item" << m_text << "has unsupported role" << (int)m_role;
} }
if (mergeItem) { if (mergeItem) {
@ -400,7 +400,7 @@ QKeySequence QCocoaMenuItem::mergeAccel()
void QCocoaMenuItem::syncMerged() void QCocoaMenuItem::syncMerged()
{ {
if (!m_merged) { if (!m_merged) {
qWarning() << Q_FUNC_INFO << "Trying to sync a non-merged item"; qWarning("Trying to sync a non-merged item");
return; return;
} }
[m_native setTag:reinterpret_cast<NSInteger>(this)]; [m_native setTag:reinterpret_cast<NSInteger>(this)];

View File

@ -1534,7 +1534,7 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState)
// do nothing except set the new state // do nothing except set the new state
NSRect contentRect = [contentView() frame]; NSRect contentRect = [contentView() frame];
if (contentRect.size.width <= 0 || contentRect.size.height <= 0) { if (contentRect.size.width <= 0 || contentRect.size.height <= 0) {
qWarning() << Q_FUNC_INFO << "invalid window content view size, check your window geometry"; qWarning("invalid window content view size, check your window geometry");
m_synchedWindowState = newState; m_synchedWindowState = newState;
return; return;
} }

View File

@ -351,6 +351,7 @@
{ {
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers); QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers);
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers); QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers);
QWindowSystemInterface::flushWindowSystemEvents();
} }
#ifndef QT_NO_SHORTCUT #ifndef QT_NO_SHORTCUT
@ -898,7 +899,6 @@
// UITextInput selects the text to be deleted before calling this method. To avoid // UITextInput selects the text to be deleted before calling this method. To avoid
// drawing the selection, we flush after posting the key press/release. // drawing the selection, we flush after posting the key press/release.
[self sendKeyPressRelease:Qt::Key_Backspace modifiers:Qt::NoModifier]; [self sendKeyPressRelease:Qt::Key_Backspace modifiers:Qt::NoModifier];
QWindowSystemInterface::flushWindowSystemEvents();
} }
@end @end

View File

@ -62,7 +62,7 @@ bool QQnxAbstractNavigator::invokeUrl(const QUrl &url)
// which is not recognized by the navigator anymore // which is not recognized by the navigator anymore
const bool result = requestInvokeUrl(url.toString().toUtf8()); const bool result = requestInvokeUrl(url.toString().toUtf8());
qNavigatorDebug() << Q_FUNC_INFO << "url=" << url << "result=" << result; qNavigatorDebug() << "url=" << url << "result=" << result;
return result; return result;
} }

View File

@ -51,13 +51,13 @@ QT_BEGIN_NAMESPACE
QQnxBuffer::QQnxBuffer() QQnxBuffer::QQnxBuffer()
: m_buffer(0) : m_buffer(0)
{ {
qBufferDebug() << Q_FUNC_INFO << "empty"; qBufferDebug("empty");
} }
QQnxBuffer::QQnxBuffer(screen_buffer_t buffer) QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
: m_buffer(buffer) : m_buffer(buffer)
{ {
qBufferDebug() << Q_FUNC_INFO << "normal"; qBufferDebug("normal");
// Get size of buffer // Get size of buffer
int size[2]; int size[2];
@ -118,17 +118,17 @@ QQnxBuffer::QQnxBuffer(const QQnxBuffer &other)
: m_buffer(other.m_buffer), : m_buffer(other.m_buffer),
m_image(other.m_image) m_image(other.m_image)
{ {
qBufferDebug() << Q_FUNC_INFO << "copy"; qBufferDebug("copy");
} }
QQnxBuffer::~QQnxBuffer() QQnxBuffer::~QQnxBuffer()
{ {
qBufferDebug() << Q_FUNC_INFO; qBufferDebug();
} }
void QQnxBuffer::invalidateInCache() void QQnxBuffer::invalidateInCache()
{ {
qBufferDebug() << Q_FUNC_INFO; qBufferDebug();
// Verify native buffer exists // Verify native buffer exists
if (Q_UNLIKELY(!m_buffer)) if (Q_UNLIKELY(!m_buffer))

View File

@ -74,7 +74,7 @@ QQnxButtonEventNotifier::~QQnxButtonEventNotifier()
void QQnxButtonEventNotifier::start() void QQnxButtonEventNotifier::start()
{ {
qButtonDebug() << Q_FUNC_INFO << "starting hardware button event processing"; qButtonDebug("starting hardware button event processing");
if (m_fd != -1) if (m_fd != -1)
return; return;
@ -91,7 +91,7 @@ void QQnxButtonEventNotifier::start()
m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read);
QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates())); QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(updateButtonStates()));
qButtonDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd =" << m_fd; qButtonDebug() << "successfully connected to Navigator. fd =" << m_fd;
} }
void QQnxButtonEventNotifier::updateButtonStates() void QQnxButtonEventNotifier::updateButtonStates()
@ -115,7 +115,7 @@ void QQnxButtonEventNotifier::updateButtonStates()
// Ensure data is null terminated // Ensure data is null terminated
buffer[bytes] = '\0'; buffer[bytes] = '\0';
qButtonDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer; qButtonDebug() << "received PPS message:\n" << buffer;
// Process received message // Process received message
QByteArray ppsData = QByteArray::fromRawData(buffer, bytes); QByteArray ppsData = QByteArray::fromRawData(buffer, bytes);
@ -197,7 +197,7 @@ bool QQnxButtonEventNotifier::parsePPS(const QByteArray &ppsData, QHash<QByteArr
// tokenize current attribute // tokenize current attribute
const QByteArray &attr = lines.at(i); const QByteArray &attr = lines.at(i);
qButtonDebug() << Q_FUNC_INFO << "attr=" << attr; qButtonDebug() << "attr=" << attr;
int doubleColon = attr.indexOf(QByteArrayLiteral("::")); int doubleColon = attr.indexOf(QByteArrayLiteral("::"));
if (doubleColon == -1) { if (doubleColon == -1) {

View File

@ -94,13 +94,13 @@ public:
void addFormatToCheck(const QString &format) { void addFormatToCheck(const QString &format) {
m_formatsToCheck << format; m_formatsToCheck << format;
qClipboardDebug() << Q_FUNC_INFO << "formats=" << m_formatsToCheck; qClipboardDebug() << "formats=" << m_formatsToCheck;
} }
bool hasFormat(const QString &mimetype) const bool hasFormat(const QString &mimetype) const
{ {
const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0; const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0;
qClipboardDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "result=" << result; qClipboardDebug() << "mimetype=" << mimetype << "result=" << result;
return result; return result;
} }
@ -113,7 +113,7 @@ public:
result << format; result << format;
} }
qClipboardDebug() << Q_FUNC_INFO << "result=" << result; qClipboardDebug() << "result=" << result;
return result; return result;
} }
@ -137,7 +137,7 @@ public:
protected: protected:
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
{ {
qClipboardDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "preferredType=" << preferredType; qClipboardDebug() << "mimetype=" << mimetype << "preferredType=" << preferredType;
if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0) if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0)
return QMimeData::retrieveData(mimetype, preferredType); return QMimeData::retrieveData(mimetype, preferredType);
@ -149,7 +149,7 @@ private Q_SLOTS:
void releaseOwnership() void releaseOwnership()
{ {
if (m_userMimeData) { if (m_userMimeData) {
qClipboardDebug() << Q_FUNC_INFO << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats(); qClipboardDebug() << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats();
delete m_userMimeData; delete m_userMimeData;
m_userMimeData = 0; m_userMimeData = 0;
m_clipboard->emitChanged(QClipboard::Clipboard); m_clipboard->emitChanged(QClipboard::Clipboard);
@ -195,7 +195,7 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
} }
const QStringList formats = data->formats(); const QStringList formats = data->formats();
qClipboardDebug() << Q_FUNC_INFO << "formats=" << formats; qClipboardDebug() << "formats=" << formats;
Q_FOREACH (const QString &format, formats) { Q_FOREACH (const QString &format, formats) {
const QByteArray buf = data->data(format); const QByteArray buf = data->data(format);
@ -204,7 +204,7 @@ void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
continue; continue;
int ret = set_clipboard_data(format.toUtf8().data(), buf.size(), buf.data()); int ret = set_clipboard_data(format.toUtf8().data(), buf.size(), buf.data());
qClipboardDebug() << Q_FUNC_INFO << "set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret; qClipboardDebug() << "set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
if (ret) if (ret)
m_mimeData->addFormatToCheck(format); m_mimeData->addFormatToCheck(format);
} }

View File

@ -115,7 +115,7 @@ void QQnxEglWindow::destroyEGLSurface()
void QQnxEglWindow::swapEGLBuffers() void QQnxEglWindow::swapEGLBuffers()
{ {
qEglWindowDebug() << Q_FUNC_INFO; qEglWindowDebug();
// Set current rendering API // Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE)) if (Q_UNLIKELY(eglResult != EGL_TRUE))

View File

@ -56,7 +56,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
m_glContext(glContext), m_glContext(glContext),
m_currentEglSurface(EGL_NO_SURFACE) m_currentEglSurface(EGL_NO_SURFACE)
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
QSurfaceFormat format = m_glContext->format(); QSurfaceFormat format = m_glContext->format();
// Set current rendering API // Set current rendering API
@ -132,7 +132,7 @@ QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
QQnxGLContext::~QQnxGLContext() QQnxGLContext::~QQnxGLContext()
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// Cleanup EGL context if it exists // Cleanup EGL context if it exists
if (m_eglContext != EGL_NO_CONTEXT) if (m_eglContext != EGL_NO_CONTEXT)
@ -166,7 +166,7 @@ EGLenum QQnxGLContext::checkEGLError(const char *msg)
void QQnxGLContext::initializeContext() void QQnxGLContext::initializeContext()
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// Initialize connection to EGL // Initialize connection to EGL
ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@ -184,7 +184,7 @@ void QQnxGLContext::initializeContext()
void QQnxGLContext::shutdownContext() void QQnxGLContext::shutdownContext()
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// Close connection to EGL // Close connection to EGL
eglTerminate(ms_eglDisplay); eglTerminate(ms_eglDisplay);
@ -192,7 +192,7 @@ void QQnxGLContext::shutdownContext()
bool QQnxGLContext::makeCurrent(QPlatformSurface *surface) bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface); Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
@ -223,7 +223,7 @@ bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
void QQnxGLContext::doneCurrent() void QQnxGLContext::doneCurrent()
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// set current rendering API // set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
@ -238,7 +238,7 @@ void QQnxGLContext::doneCurrent()
void QQnxGLContext::swapBuffers(QPlatformSurface *surface) void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface); QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface);
if (!platformWindow) if (!platformWindow)
return; return;
@ -248,7 +248,7 @@ void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName) QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName)
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// Set current rendering API // Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API); EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
@ -270,7 +270,7 @@ EGLDisplay QQnxGLContext::getEglDisplay() {
EGLint *QQnxGLContext::contextAttrs(const QSurfaceFormat &format) EGLint *QQnxGLContext::contextAttrs(const QSurfaceFormat &format)
{ {
qGLContextDebug() << Q_FUNC_INFO; qGLContextDebug();
// Choose EGL settings based on OpenGL version // Choose EGL settings based on OpenGL version
#if defined(QT_OPENGL_ES_2) #if defined(QT_OPENGL_ES_2)

View File

@ -191,7 +191,7 @@ static int32_t ic_begin_batch_edit(input_session_t *ic)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_commit_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position) static int32_t ic_commit_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfCommitText); QQnxImfRequest event(ic, ImfCommitText);
event.ct.text = text; event.ct.text = text;
@ -206,7 +206,7 @@ static int32_t ic_commit_text(input_session_t *ic, spannable_string_t *text, int
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_delete_surrounding_text(input_session_t *ic, int32_t left_length, int32_t right_length) static int32_t ic_delete_surrounding_text(input_session_t *ic, int32_t left_length, int32_t right_length)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfDeleteSurroundingText); QQnxImfRequest event(ic, ImfDeleteSurroundingText);
event.dst.left_length = left_length; event.dst.left_length = left_length;
@ -230,7 +230,7 @@ static int32_t ic_end_batch_edit(input_session_t *ic)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_finish_composing_text(input_session_t *ic) static int32_t ic_finish_composing_text(input_session_t *ic)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfFinishComposingText); QQnxImfRequest event(ic, ImfFinishComposingText);
event.fct.result = -1; event.fct.result = -1;
@ -243,7 +243,7 @@ static int32_t ic_finish_composing_text(input_session_t *ic)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_get_cursor_position(input_session_t *ic) static int32_t ic_get_cursor_position(input_session_t *ic)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetCursorPosition); QQnxImfRequest event(ic, ImfGetCursorPosition);
event.gcp.result = -1; event.gcp.result = -1;
@ -256,7 +256,7 @@ static int32_t ic_get_cursor_position(input_session_t *ic)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static spannable_string_t *ic_get_text_after_cursor(input_session_t *ic, int32_t n, int32_t flags) static spannable_string_t *ic_get_text_after_cursor(input_session_t *ic, int32_t n, int32_t flags)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetTextAfterCursor); QQnxImfRequest event(ic, ImfGetTextAfterCursor);
event.gtac.n = n; event.gtac.n = n;
@ -271,7 +271,7 @@ static spannable_string_t *ic_get_text_after_cursor(input_session_t *ic, int32_t
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static spannable_string_t *ic_get_text_before_cursor(input_session_t *ic, int32_t n, int32_t flags) static spannable_string_t *ic_get_text_before_cursor(input_session_t *ic, int32_t n, int32_t flags)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfGetTextBeforeCursor); QQnxImfRequest event(ic, ImfGetTextBeforeCursor);
event.gtac.n = n; event.gtac.n = n;
@ -286,7 +286,7 @@ static spannable_string_t *ic_get_text_before_cursor(input_session_t *ic, int32_
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_send_event(input_session_t *ic, event_t *event) static int32_t ic_send_event(input_session_t *ic, event_t *event)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest imfEvent(ic, ImfSendEvent); QQnxImfRequest imfEvent(ic, ImfSendEvent);
imfEvent.sae.event = event; imfEvent.sae.event = event;
@ -300,7 +300,7 @@ static int32_t ic_send_event(input_session_t *ic, event_t *event)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_send_async_event(input_session_t *ic, event_t *event) static int32_t ic_send_async_event(input_session_t *ic, event_t *event)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
// There's no difference from our point of view between ic_send_event & ic_send_async_event // There's no difference from our point of view between ic_send_event & ic_send_async_event
QQnxImfRequest imfEvent(ic, ImfSendEvent); QQnxImfRequest imfEvent(ic, ImfSendEvent);
@ -315,7 +315,7 @@ static int32_t ic_send_async_event(input_session_t *ic, event_t *event)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_set_composing_region(input_session_t *ic, int32_t start, int32_t end) static int32_t ic_set_composing_region(input_session_t *ic, int32_t start, int32_t end)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfSetComposingRegion); QQnxImfRequest event(ic, ImfSetComposingRegion);
event.scr.start = start; event.scr.start = start;
@ -331,7 +331,7 @@ static int32_t ic_set_composing_region(input_session_t *ic, int32_t start, int32
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_set_composing_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position) static int32_t ic_set_composing_text(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfSetComposingText); QQnxImfRequest event(ic, ImfSetComposingText);
event.sct.text = text; event.sct.text = text;
@ -346,7 +346,7 @@ static int32_t ic_set_composing_text(input_session_t *ic, spannable_string_t *te
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_is_text_selected(input_session_t* ic, int32_t* pIsSelected) static int32_t ic_is_text_selected(input_session_t* ic, int32_t* pIsSelected)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfIsTextSelected); QQnxImfRequest event(ic, ImfIsTextSelected);
event.its.pIsSelected = pIsSelected; event.its.pIsSelected = pIsSelected;
@ -360,7 +360,7 @@ static int32_t ic_is_text_selected(input_session_t* ic, int32_t* pIsSelected)
// See comment at beginning of namespace declaration for general information // See comment at beginning of namespace declaration for general information
static int32_t ic_is_all_text_selected(input_session_t* ic, int32_t* pIsSelected) static int32_t ic_is_all_text_selected(input_session_t* ic, int32_t* pIsSelected)
{ {
qInputContextIMFRequestDebug() << Q_FUNC_INFO; qInputContextIMFRequestDebug();
QQnxImfRequest event(ic, ImfIsAllTextSelected); QQnxImfRequest event(ic, ImfIsAllTextSelected);
event.its.pIsSelected = pIsSelected; event.its.pIsSelected = pIsSelected;
@ -496,7 +496,7 @@ initEvent(event_t *pEvent, const input_session_t *pSession, EventType eventType,
static spannable_string_t *toSpannableString(const QString &text) static spannable_string_t *toSpannableString(const QString &text)
{ {
qInputContextDebug() << Q_FUNC_INFO << text; qInputContextDebug() << text;
spannable_string_t *pString = static_cast<spannable_string_t *>(malloc(sizeof(spannable_string_t))); spannable_string_t *pString = static_cast<spannable_string_t *>(malloc(sizeof(spannable_string_t)));
pString->str = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * text.length() + 1)); pString->str = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * text.length() + 1));
@ -531,7 +531,7 @@ static bool imfAvailable()
if ( p_imf_client_init == 0 ) { if ( p_imf_client_init == 0 ) {
void *handle = dlopen("libinput_client.so.1", 0); void *handle = dlopen("libinput_client.so.1", 0);
if (Q_UNLIKELY(!handle)) { if (Q_UNLIKELY(!handle)) {
qCritical() << Q_FUNC_INFO << "libinput_client.so.1 is not present - IMF services are disabled."; qCritical("libinput_client.so.1 is not present - IMF services are disabled.");
s_imfDisabled = true; s_imfDisabled = true;
return false; return false;
} }
@ -547,7 +547,7 @@ static bool imfAvailable()
p_ictrl_open_session = 0; p_ictrl_open_session = 0;
p_ictrl_dispatch_event = 0; p_ictrl_dispatch_event = 0;
s_imfDisabled = true; s_imfDisabled = true;
qCritical() << Q_FUNC_INFO << "libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled."; qCritical("libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled.");
return false; return false;
} }
@ -570,7 +570,7 @@ QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVir
m_integration(integration), m_integration(integration),
m_virtualKeyboard(keyboard) m_virtualKeyboard(keyboard)
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
if (!imfAvailable()) if (!imfAvailable())
return; return;
@ -593,7 +593,7 @@ QQnxInputContext::QQnxInputContext(QQnxIntegration *integration, QQnxAbstractVir
QQnxInputContext::~QQnxInputContext() QQnxInputContext::~QQnxInputContext()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
Q_ASSERT(sInputContextInstance == this); Q_ASSERT(sInputContextInstance == this);
sInputContextInstance = 0; sInputContextInstance = 0;
@ -668,7 +668,7 @@ void QQnxInputContext::processImfEvent(QQnxImfRequest *imfEvent)
bool QQnxInputContext::filterEvent( const QEvent *event ) bool QQnxInputContext::filterEvent( const QEvent *event )
{ {
qInputContextDebug() << Q_FUNC_INFO << event; qInputContextDebug() << event;
switch (event->type()) { switch (event->type()) {
case QEvent::CloseSoftwareInputPanel: case QEvent::CloseSoftwareInputPanel:
@ -691,19 +691,19 @@ QRectF QQnxInputContext::keyboardRect() const
void QQnxInputContext::reset() void QQnxInputContext::reset()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
endComposition(); endComposition();
} }
void QQnxInputContext::commit() void QQnxInputContext::commit()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
endComposition(); endComposition();
} }
void QQnxInputContext::update(Qt::InputMethodQueries queries) void QQnxInputContext::update(Qt::InputMethodQueries queries)
{ {
qInputContextDebug() << Q_FUNC_INFO << queries; qInputContextDebug() << queries;
if (queries & Qt::ImCursorPosition) { if (queries & Qt::ImCursorPosition) {
int lastCaret = m_caretPosition; int lastCaret = m_caretPosition;
@ -715,7 +715,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries)
initEvent(&caretEvent.event, sInputSession, EVENT_CARET, CARET_POS_CHANGED, sizeof(caretEvent)); initEvent(&caretEvent.event, sInputSession, EVENT_CARET, CARET_POS_CHANGED, sizeof(caretEvent));
caretEvent.old_pos = lastCaret; caretEvent.old_pos = lastCaret;
caretEvent.new_pos = m_caretPosition; caretEvent.new_pos = m_caretPosition;
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition; qInputContextDebug() << "ictrl_dispatch_event caret changed" << lastCaret << m_caretPosition;
p_ictrl_dispatch_event(&caretEvent.event); p_ictrl_dispatch_event(&caretEvent.event);
} }
} }
@ -723,7 +723,7 @@ void QQnxInputContext::update(Qt::InputMethodQueries queries)
void QQnxInputContext::closeSession() void QQnxInputContext::closeSession()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
if (!imfAvailable()) if (!imfAvailable())
return; return;
@ -745,7 +745,7 @@ bool QQnxInputContext::openSession()
closeSession(); closeSession();
sInputSession = p_ictrl_open_session(&ic_funcs); sInputSession = p_ictrl_open_session(&ic_funcs);
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
return sInputSession != 0; return sInputSession != 0;
} }
@ -769,7 +769,7 @@ bool QQnxInputContext::hasSelectedText()
bool QQnxInputContext::dispatchRequestSoftwareInputPanel() bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO << "requesting keyboard" << m_inputPanelVisible; qInputContextDebug() << "requesting keyboard" << m_inputPanelVisible;
m_virtualKeyboard.showKeyboard(); m_virtualKeyboard.showKeyboard();
return true; return true;
@ -777,7 +777,7 @@ bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
bool QQnxInputContext::dispatchCloseSoftwareInputPanel() bool QQnxInputContext::dispatchCloseSoftwareInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO << "hiding keyboard" << m_inputPanelVisible; qInputContextDebug() << "hiding keyboard" << m_inputPanelVisible;
m_virtualKeyboard.hideKeyboard(); m_virtualKeyboard.hideKeyboard();
return true; return true;
@ -823,7 +823,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints)
focusEvent.style |= IMF_EMAIL_TYPE; focusEvent.style |= IMF_EMAIL_TYPE;
} }
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus gain style:" << focusEvent.style; qInputContextDebug() << "ictrl_dispatch_event focus gain style:" << focusEvent.style;
p_ictrl_dispatch_event((event_t *)&focusEvent); p_ictrl_dispatch_event((event_t *)&focusEvent);
@ -833,7 +833,7 @@ bool QQnxInputContext::dispatchFocusGainEvent(int inputHints)
void QQnxInputContext::dispatchFocusLossEvent() void QQnxInputContext::dispatchFocusLossEvent()
{ {
if (hasSession()) { if (hasSession()) {
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_event focus lost"; qInputContextDebug("ictrl_dispatch_event focus lost");
focus_event_t focusEvent; focus_event_t focusEvent;
initEvent(&focusEvent.event, sInputSession, EVENT_FOCUS, FOCUS_LOST, sizeof(focusEvent)); initEvent(&focusEvent.event, sInputSession, EVENT_FOCUS, FOCUS_LOST, sizeof(focusEvent));
@ -908,7 +908,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
navigation_event_t navEvent; navigation_event_t navEvent;
initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key, sizeof(navEvent)); initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key, sizeof(navEvent));
navEvent.magnitude = 1; navEvent.magnitude = 1;
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even navigation" << key; qInputContextDebug() << "ictrl_dispatch_even navigation" << key;
p_ictrl_dispatch_event(&navEvent.event); p_ictrl_dispatch_event(&navEvent.event);
} }
} else { } else {
@ -921,7 +921,7 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
keyEvent.sequence_id = sequenceId; keyEvent.sequence_id = sequenceId;
p_ictrl_dispatch_event(&keyEvent.event); p_ictrl_dispatch_event(&keyEvent.event);
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even key" << key; qInputContextDebug() << "ictrl_dispatch_even key" << key;
} }
return true; return true;
@ -937,7 +937,7 @@ void QQnxInputContext::updateCursorPosition()
QCoreApplication::sendEvent(input, &query); QCoreApplication::sendEvent(input, &query);
m_caretPosition = query.value(Qt::ImCursorPosition).toInt(); m_caretPosition = query.value(Qt::ImCursorPosition).toInt();
qInputContextDebug() << Q_FUNC_INFO << m_caretPosition; qInputContextDebug() << m_caretPosition;
} }
void QQnxInputContext::endComposition() void QQnxInputContext::endComposition()
@ -950,7 +950,7 @@ void QQnxInputContext::endComposition()
if (hasSession()) { if (hasSession()) {
action_event_t actionEvent; action_event_t actionEvent;
initEvent(&actionEvent.event, sInputSession, EVENT_ACTION, ACTION_END_COMPOSITION, sizeof(actionEvent)); initEvent(&actionEvent.event, sInputSession, EVENT_ACTION, ACTION_END_COMPOSITION, sizeof(actionEvent));
qInputContextDebug() << Q_FUNC_INFO << "ictrl_dispatch_even end composition"; qInputContextDebug("ictrl_dispatch_even end composition");
p_ictrl_dispatch_event(&actionEvent.event); p_ictrl_dispatch_event(&actionEvent.event);
} }
} }
@ -967,7 +967,7 @@ void QQnxInputContext::updateComposition(spannable_string_t *text, int32_t new_c
m_composingText = QString::fromWCharArray(text->str, text->length); m_composingText = QString::fromWCharArray(text->str, text->length);
m_isComposing = true; m_isComposing = true;
qInputContextDebug() << Q_FUNC_INFO << m_composingText << new_cursor_position; qInputContextDebug() << m_composingText << new_cursor_position;
QList<QInputMethodEvent::Attribute> attributes; QList<QInputMethodEvent::Attribute> attributes;
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor,
@ -1016,7 +1016,7 @@ void QQnxInputContext::finishComposingText()
QObject *input = qGuiApp->focusObject(); QObject *input = qGuiApp->focusObject();
if (input) { if (input) {
qInputContextDebug() << Q_FUNC_INFO << m_composingText; qInputContextDebug() << m_composingText;
QInputMethodEvent event; QInputMethodEvent event;
event.setCommitString(m_composingText); event.setCommitString(m_composingText);
@ -1081,13 +1081,13 @@ int32_t QQnxInputContext::processEvent(event_t *event)
int32_t result = -1; int32_t result = -1;
switch (event->event_type) { switch (event->event_type) {
case EVENT_SPELL_CHECK: { case EVENT_SPELL_CHECK: {
qInputContextDebug() << Q_FUNC_INFO << "EVENT_SPELL_CHECK"; qInputContextDebug("EVENT_SPELL_CHECK");
result = handleSpellCheck(reinterpret_cast<spell_check_event_t *>(event)); result = handleSpellCheck(reinterpret_cast<spell_check_event_t *>(event));
break; break;
} }
case EVENT_NAVIGATION: { case EVENT_NAVIGATION: {
qInputContextDebug() << Q_FUNC_INFO << "EVENT_NAVIGATION"; qInputContextDebug("EVENT_NAVIGATION");
int key = event->event_id == NAVIGATE_UP ? KEYCODE_UP : int key = event->event_id == NAVIGATE_UP ? KEYCODE_UP :
event->event_id == NAVIGATE_DOWN ? KEYCODE_DOWN : event->event_id == NAVIGATE_DOWN ? KEYCODE_DOWN :
@ -1110,7 +1110,7 @@ int32_t QQnxInputContext::processEvent(event_t *event)
int flags = KEY_SYM_VALID | KEY_CAP_VALID; int flags = KEY_SYM_VALID | KEY_CAP_VALID;
if (event->event_id == IMF_KEY_DOWN) if (event->event_id == IMF_KEY_DOWN)
flags |= KEY_DOWN; flags |= KEY_DOWN;
qInputContextDebug() << Q_FUNC_INFO << "EVENT_KEY" << flags << keySym; qInputContextDebug() << "EVENT_KEY" << flags << keySym;
QQnxScreenEventHandler::injectKeyboardEvent(flags, keySym, modifiers, 0, keyCap); QQnxScreenEventHandler::injectKeyboardEvent(flags, keySym, modifiers, 0, keyCap);
result = 0; result = 0;
break; break;
@ -1126,10 +1126,10 @@ int32_t QQnxInputContext::processEvent(event_t *event)
case EVENT_USER_ACTION: case EVENT_USER_ACTION:
case EVENT_STROKE: case EVENT_STROKE:
case EVENT_INVOKE_LATER: case EVENT_INVOKE_LATER:
qCritical() << Q_FUNC_INFO << "Unsupported event type: " << event->event_type; qCritical() << "Unsupported event type: " << event->event_type;
break; break;
default: default:
qCritical() << Q_FUNC_INFO << "Unknown event type: " << event->event_type; qCritical() << "Unknown event type: " << event->event_type;
} }
return result; return result;
} }
@ -1150,7 +1150,7 @@ int32_t QQnxInputContext::onCommitText(spannable_string_t *text, int32_t new_cur
int32_t QQnxInputContext::onDeleteSurroundingText(int32_t left_length, int32_t right_length) int32_t QQnxInputContext::onDeleteSurroundingText(int32_t left_length, int32_t right_length)
{ {
qInputContextDebug() << Q_FUNC_INFO << "L:" << left_length << " R:" << right_length; qInputContextDebug() << "L:" << left_length << " R:" << right_length;
QObject *input = qGuiApp->focusObject(); QObject *input = qGuiApp->focusObject();
if (!input) if (!input)
@ -1181,7 +1181,7 @@ int32_t QQnxInputContext::onFinishComposingText()
int32_t QQnxInputContext::onGetCursorPosition() int32_t QQnxInputContext::onGetCursorPosition()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
QObject *input = qGuiApp->focusObject(); QObject *input = qGuiApp->focusObject();
if (!input) if (!input)
@ -1195,7 +1195,7 @@ int32_t QQnxInputContext::onGetCursorPosition()
spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t flags) spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t flags)
{ {
Q_UNUSED(flags); Q_UNUSED(flags);
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
QObject *input = qGuiApp->focusObject(); QObject *input = qGuiApp->focusObject();
if (!input) if (!input)
@ -1212,7 +1212,7 @@ spannable_string_t *QQnxInputContext::onGetTextAfterCursor(int32_t n, int32_t fl
spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t flags) spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t flags)
{ {
Q_UNUSED(flags); Q_UNUSED(flags);
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
QObject *input = qGuiApp->focusObject(); QObject *input = qGuiApp->focusObject();
if (!input) if (!input)
@ -1231,7 +1231,7 @@ spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(int32_t n, int32_t f
int32_t QQnxInputContext::onSendEvent(event_t *event) int32_t QQnxInputContext::onSendEvent(event_t *event)
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
return processEvent(event); return processEvent(event);
} }
@ -1247,7 +1247,7 @@ int32_t QQnxInputContext::onSetComposingRegion(int32_t start, int32_t end)
QString text = query.value(Qt::ImSurroundingText).toString(); QString text = query.value(Qt::ImSurroundingText).toString();
m_caretPosition = query.value(Qt::ImCursorPosition).toInt(); m_caretPosition = query.value(Qt::ImCursorPosition).toInt();
qInputContextDebug() << Q_FUNC_INFO << text; qInputContextDebug() << text;
m_isUpdatingText = true; m_isUpdatingText = true;
@ -1290,7 +1290,7 @@ int32_t QQnxInputContext::onIsTextSelected(int32_t* pIsSelected)
{ {
*pIsSelected = hasSelectedText(); *pIsSelected = hasSelectedText();
qInputContextDebug() << Q_FUNC_INFO << *pIsSelected; qInputContextDebug() << *pIsSelected;
return 0; return 0;
} }
@ -1306,20 +1306,20 @@ int32_t QQnxInputContext::onIsAllTextSelected(int32_t* pIsSelected)
*pIsSelected = query.value(Qt::ImSurroundingText).toString().length() == query.value(Qt::ImCurrentSelection).toString().length(); *pIsSelected = query.value(Qt::ImSurroundingText).toString().length() == query.value(Qt::ImCurrentSelection).toString().length();
qInputContextDebug() << Q_FUNC_INFO << *pIsSelected; qInputContextDebug() << *pIsSelected;
return 0; return 0;
} }
void QQnxInputContext::showInputPanel() void QQnxInputContext::showInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
dispatchRequestSoftwareInputPanel(); dispatchRequestSoftwareInputPanel();
} }
void QQnxInputContext::hideInputPanel() void QQnxInputContext::hideInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
dispatchCloseSoftwareInputPanel(); dispatchCloseSoftwareInputPanel();
} }
@ -1335,7 +1335,7 @@ QLocale QQnxInputContext::locale() const
void QQnxInputContext::keyboardVisibilityChanged(bool visible) void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{ {
qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible; qInputContextDebug() << "visible=" << visible;
if (m_inputPanelVisible != visible) { if (m_inputPanelVisible != visible) {
m_inputPanelVisible = visible; m_inputPanelVisible = visible;
emitInputPanelVisibleChanged(); emitInputPanelVisibleChanged();
@ -1344,7 +1344,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible)
void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{ {
qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale; qInputContextDebug() << "locale=" << locale;
if (m_inputPanelLocale != locale) { if (m_inputPanelLocale != locale) {
m_inputPanelLocale = locale; m_inputPanelLocale = locale;
emitLocaleChanged(); emitLocaleChanged();
@ -1353,7 +1353,7 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
void QQnxInputContext::setHighlightColor(int index, const QColor &color) void QQnxInputContext::setHighlightColor(int index, const QColor &color)
{ {
qInputContextDebug() << Q_FUNC_INFO << "setHighlightColor" << index << color << qGuiApp->focusObject(); qInputContextDebug() << "setHighlightColor" << index << color << qGuiApp->focusObject();
if (!sInputContextInstance) if (!sInputContextInstance)
return; return;
@ -1372,7 +1372,7 @@ void QQnxInputContext::setHighlightColor(int index, const QColor &color)
void QQnxInputContext::setFocusObject(QObject *object) void QQnxInputContext::setFocusObject(QObject *object)
{ {
qInputContextDebug() << Q_FUNC_INFO << "input item=" << object; qInputContextDebug() << "input item=" << object;
// Ensure the colors are reset if we've a change in focus object // Ensure the colors are reset if we've a change in focus object
setHighlightColor(-1, QColor()); setHighlightColor(-1, QColor());
@ -1402,7 +1402,7 @@ void QQnxInputContext::setFocusObject(QObject *object)
bool QQnxInputContext::checkSpelling(const QString &text, void *context, void (*spellCheckDone)(void *context, const QString &text, const QList<int> &indices)) bool QQnxInputContext::checkSpelling(const QString &text, void *context, void (*spellCheckDone)(void *context, const QString &text, const QList<int> &indices))
{ {
qInputContextDebug() << Q_FUNC_INFO << "text" << text; qInputContextDebug() << "text" << text;
if (!imfAvailable()) if (!imfAvailable())
return false; return false;

View File

@ -88,13 +88,13 @@ bool QQnxInputContext::filterEvent( const QEvent *event )
if (event->type() == QEvent::CloseSoftwareInputPanel) { if (event->type() == QEvent::CloseSoftwareInputPanel) {
m_virtualKeyboard.hideKeyboard(); m_virtualKeyboard.hideKeyboard();
qInputContextDebug() << Q_FUNC_INFO << "hiding virtual keyboard"; qInputContextDebug("hiding virtual keyboard");
return false; return false;
} }
if (event->type() == QEvent::RequestSoftwareInputPanel) { if (event->type() == QEvent::RequestSoftwareInputPanel) {
m_virtualKeyboard.showKeyboard(); m_virtualKeyboard.showKeyboard();
qInputContextDebug() << Q_FUNC_INFO << "requesting virtual keyboard"; qInputContextDebug("requesting virtual keyboard");
return false; return false;
} }
@ -121,13 +121,13 @@ bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan
void QQnxInputContext::showInputPanel() void QQnxInputContext::showInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
m_virtualKeyboard.showKeyboard(); m_virtualKeyboard.showKeyboard();
} }
void QQnxInputContext::hideInputPanel() void QQnxInputContext::hideInputPanel()
{ {
qInputContextDebug() << Q_FUNC_INFO; qInputContextDebug();
m_virtualKeyboard.hideKeyboard(); m_virtualKeyboard.hideKeyboard();
} }
@ -148,7 +148,7 @@ void QQnxInputContext::keyboardHeightChanged()
void QQnxInputContext::keyboardVisibilityChanged(bool visible) void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{ {
qInputContextDebug() << Q_FUNC_INFO << "visible=" << visible; qInputContextDebug() << "visible=" << visible;
if (m_inputPanelVisible != visible) { if (m_inputPanelVisible != visible) {
m_inputPanelVisible = visible; m_inputPanelVisible = visible;
emitInputPanelVisibleChanged(); emitInputPanelVisibleChanged();
@ -157,7 +157,7 @@ void QQnxInputContext::keyboardVisibilityChanged(bool visible)
void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale) void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{ {
qInputContextDebug() << Q_FUNC_INFO << "locale=" << locale; qInputContextDebug() << "locale=" << locale;
if (m_inputPanelLocale != locale) { if (m_inputPanelLocale != locale) {
m_inputPanelLocale = locale; m_inputPanelLocale = locale;
emitLocaleChanged(); emitLocaleChanged();
@ -166,7 +166,7 @@ void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
void QQnxInputContext::setFocusObject(QObject *object) void QQnxInputContext::setFocusObject(QObject *object)
{ {
qInputContextDebug() << Q_FUNC_INFO << "input item=" << object; qInputContextDebug() << "input item=" << object;
if (!inputMethodAccepted()) { if (!inputMethodAccepted()) {
if (m_inputPanelVisible) if (m_inputPanelVisible)

View File

@ -143,7 +143,7 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
#endif #endif
{ {
ms_options = parseOptions(paramList); ms_options = parseOptions(paramList);
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
// Open connection to QNX composition manager // Open connection to QNX composition manager
Q_SCREEN_CRITICALERROR(screen_create_context(&ms_screenContext, SCREEN_APPLICATION_CONTEXT), Q_SCREEN_CRITICALERROR(screen_create_context(&ms_screenContext, SCREEN_APPLICATION_CONTEXT),
"Failed to create screen context"); "Failed to create screen context");
@ -210,7 +210,7 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
QQnxIntegration::~QQnxIntegration() QQnxIntegration::~QQnxIntegration()
{ {
qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown begin"; qIntegrationDebug("platform plugin shutdown begin");
delete m_nativeInterface; delete m_nativeInterface;
#if !defined(QT_NO_DRAGANDDROP) #if !defined(QT_NO_DRAGANDDROP)
@ -267,12 +267,12 @@ QQnxIntegration::~QQnxIntegration()
// Destroy navigator interface // Destroy navigator interface
delete m_navigator; delete m_navigator;
qIntegrationDebug() << Q_FUNC_INFO << "platform plugin shutdown end"; qIntegrationDebug("platform plugin shutdown end");
} }
bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
switch (cap) { switch (cap) {
case MultipleWindows: case MultipleWindows:
case ThreadedPixmaps: case ThreadedPixmaps:
@ -290,7 +290,7 @@ bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
QSurface::SurfaceType surfaceType = window->surfaceType(); QSurface::SurfaceType surfaceType = window->surfaceType();
const bool needRootWindow = options() & RootWindow; const bool needRootWindow = options() & RootWindow;
switch (surfaceType) { switch (surfaceType) {
@ -308,14 +308,14 @@ QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
return new QQnxRasterBackingStore(window); return new QQnxRasterBackingStore(window);
} }
#if !defined(QT_NO_OPENGL) #if !defined(QT_NO_OPENGL)
QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
return new QQnxGLContext(context); return new QQnxGLContext(context);
} }
#endif #endif
@ -323,14 +323,14 @@ QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLCont
#if defined(QQNX_PPS) #if defined(QQNX_PPS)
QPlatformInputContext *QQnxIntegration::inputContext() const QPlatformInputContext *QQnxIntegration::inputContext() const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
return m_inputContext; return m_inputContext;
} }
#endif #endif
void QQnxIntegration::moveToScreen(QWindow *window, int screen) void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{ {
qIntegrationDebug() << Q_FUNC_INFO << "w =" << window << ", s =" << screen; qIntegrationDebug() << "w =" << window << ", s =" << screen;
// get platform window used by widget // get platform window used by widget
QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle()); QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
@ -344,7 +344,7 @@ void QQnxIntegration::moveToScreen(QWindow *window, int screen)
QAbstractEventDispatcher *QQnxIntegration::createEventDispatcher() const QAbstractEventDispatcher *QQnxIntegration::createEventDispatcher() const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
// We transfer ownersip of the event-dispatcher to QtCoreApplication // We transfer ownersip of the event-dispatcher to QtCoreApplication
QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher; QAbstractEventDispatcher *eventDispatcher = m_eventDispatcher;
@ -361,7 +361,7 @@ QPlatformNativeInterface *QQnxIntegration::nativeInterface() const
#if !defined(QT_NO_CLIPBOARD) #if !defined(QT_NO_CLIPBOARD)
QPlatformClipboard *QQnxIntegration::clipboard() const QPlatformClipboard *QQnxIntegration::clipboard() const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
#if defined(QQNX_PPS) #if defined(QQNX_PPS)
if (!m_clipboard) if (!m_clipboard)
@ -380,7 +380,7 @@ QPlatformDrag *QQnxIntegration::drag() const
QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
if ((hint == ShowIsFullScreen) && (ms_options & FullScreenApplication)) if ((hint == ShowIsFullScreen) && (ms_options & FullScreenApplication))
return true; return true;
@ -394,7 +394,7 @@ QPlatformServices * QQnxIntegration::services() const
QWindow *QQnxIntegration::window(screen_window_t qnxWindow) QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex); QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker); Q_UNUSED(locker);
return ms_windowMapper.value(qnxWindow, 0); return ms_windowMapper.value(qnxWindow, 0);
@ -402,7 +402,7 @@ QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window) void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex); QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker); Q_UNUSED(locker);
ms_windowMapper.insert(qnxWindow, window); ms_windowMapper.insert(qnxWindow, window);
@ -410,7 +410,7 @@ void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
void QQnxIntegration::removeWindow(screen_window_t qnxWindow) void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
QMutexLocker locker(&ms_windowMapperMutex); QMutexLocker locker(&ms_windowMapperMutex);
Q_UNUSED(locker); Q_UNUSED(locker);
ms_windowMapper.remove(qnxWindow); ms_windowMapper.remove(qnxWindow);
@ -418,7 +418,7 @@ void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
void QQnxIntegration::createDisplays() void QQnxIntegration::createDisplays()
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
// Query number of displays // Query number of displays
int displayCount = 0; int displayCount = 0;
int result = screen_get_context_property_iv(ms_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT, int result = screen_get_context_property_iv(ms_screenContext, SCREEN_PROPERTY_DISPLAY_COUNT,
@ -447,11 +447,11 @@ void QQnxIntegration::createDisplays()
Q_SCREEN_CHECKERROR(result, "Failed to query display attachment"); Q_SCREEN_CHECKERROR(result, "Failed to query display attachment");
if (!isAttached) { if (!isAttached) {
qIntegrationDebug() << Q_FUNC_INFO << "Skipping non-attached display" << i; qIntegrationDebug() << "Skipping non-attached display" << i;
continue; continue;
} }
qIntegrationDebug() << Q_FUNC_INFO << "Creating screen for display" << i; qIntegrationDebug() << "Creating screen for display" << i;
createDisplay(displays[i], /*isPrimary=*/false); createDisplay(displays[i], /*isPrimary=*/false);
} // of displays iteration } // of displays iteration
} }
@ -485,7 +485,7 @@ void QQnxIntegration::removeDisplay(QQnxScreen *screen)
void QQnxIntegration::destroyDisplays() void QQnxIntegration::destroyDisplays()
{ {
qIntegrationDebug() << Q_FUNC_INFO; qIntegrationDebug();
Q_FOREACH (QQnxScreen *screen, m_screens) { Q_FOREACH (QQnxScreen *screen, m_screens) {
QPlatformIntegration::destroyScreen(screen); QPlatformIntegration::destroyScreen(screen);
} }

View File

@ -57,20 +57,20 @@ bool QQnxNavigatorEventHandler::handleOrientationCheck(int angle)
{ {
// reply to navigator that (any) orientation is acceptable // reply to navigator that (any) orientation is acceptable
// TODO: check if top window flags prohibit orientation change // TODO: check if top window flags prohibit orientation change
qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle; qNavigatorEventHandlerDebug() << "angle=" << angle;
return true; return true;
} }
void QQnxNavigatorEventHandler::handleOrientationChange(int angle) void QQnxNavigatorEventHandler::handleOrientationChange(int angle)
{ {
// update screen geometry and reply to navigator that we're ready // update screen geometry and reply to navigator that we're ready
qNavigatorEventHandlerDebug() << Q_FUNC_INFO << "angle=" << angle; qNavigatorEventHandlerDebug() << "angle=" << angle;
emit rotationChanged(angle); emit rotationChanged(angle);
} }
void QQnxNavigatorEventHandler::handleSwipeDown() void QQnxNavigatorEventHandler::handleSwipeDown()
{ {
qNavigatorEventHandlerDebug() << Q_FUNC_INFO; qNavigatorEventHandlerDebug();
Q_EMIT swipeDown(); Q_EMIT swipeDown();
} }
@ -78,25 +78,25 @@ void QQnxNavigatorEventHandler::handleSwipeDown()
void QQnxNavigatorEventHandler::handleExit() void QQnxNavigatorEventHandler::handleExit()
{ {
// shutdown everything // shutdown everything
qNavigatorEventHandlerDebug() << Q_FUNC_INFO; qNavigatorEventHandlerDebug();
QCoreApplication::quit(); QCoreApplication::quit();
} }
void QQnxNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id) void QQnxNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id)
{ {
qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupActivated(id); Q_EMIT windowGroupActivated(id);
} }
void QQnxNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id) void QQnxNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id)
{ {
qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupDeactivated(id); Q_EMIT windowGroupDeactivated(id);
} }
void QQnxNavigatorEventHandler::handleWindowGroupStateChanged(const QByteArray &id, Qt::WindowState state) void QQnxNavigatorEventHandler::handleWindowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
{ {
qNavigatorEventHandlerDebug() << Q_FUNC_INFO << id; qNavigatorEventHandlerDebug() << id;
Q_EMIT windowGroupStateChanged(id, state); Q_EMIT windowGroupStateChanged(id, state);
} }

View File

@ -74,18 +74,18 @@ QQnxNavigatorEventNotifier::~QQnxNavigatorEventNotifier()
if (m_fd != -1) if (m_fd != -1)
close(m_fd); close(m_fd);
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier stopped"; qNavigatorEventNotifierDebug("navigator event notifier stopped");
} }
void QQnxNavigatorEventNotifier::start() void QQnxNavigatorEventNotifier::start()
{ {
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "navigator event notifier started"; qNavigatorEventNotifierDebug("navigator event notifier started");
// open connection to navigator // open connection to navigator
errno = 0; errno = 0;
m_fd = open(navigatorControlPath, O_RDWR); m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) { if (m_fd == -1) {
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << ": failed to open navigator pps:" qNavigatorEventNotifierDebug() << "failed to open navigator pps:"
<< strerror(errno); << strerror(errno);
return; return;
} }
@ -96,7 +96,7 @@ void QQnxNavigatorEventNotifier::start()
void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
{ {
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "data=" << ppsData; qNavigatorEventNotifierDebug() << "data=" << ppsData;
// tokenize pps data into lines // tokenize pps data into lines
QList<QByteArray> lines = ppsData.split('\n'); QList<QByteArray> lines = ppsData.split('\n');
@ -110,7 +110,7 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray
// tokenize current attribute // tokenize current attribute
const QByteArray &attr = lines.at(i); const QByteArray &attr = lines.at(i);
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "attr=" << attr; qNavigatorEventNotifierDebug() << "attr=" << attr;
int firstColon = attr.indexOf(':'); int firstColon = attr.indexOf(':');
if (firstColon == -1) { if (firstColon == -1) {
@ -127,8 +127,8 @@ void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray
QByteArray key = attr.left(firstColon); QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1); QByteArray value = attr.mid(secondColon + 1);
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "key=" << key; qNavigatorEventNotifierDebug() << "key=" << key;
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "val=" << value; qNavigatorEventNotifierDebug() << "val=" << value;
// save attribute value // save attribute value
if (key == "msg") if (key == "msg")
@ -155,7 +155,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra
} }
ppsData += "\n"; ppsData += "\n";
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reply=" << ppsData; qNavigatorEventNotifierDebug() << "reply=" << ppsData;
// send pps message to navigator // send pps message to navigator
errno = 0; errno = 0;
@ -166,7 +166,7 @@ void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArra
void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
{ {
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "msg=" << msg << ", dat=" << dat << ", id=" << id; qNavigatorEventNotifierDebug() << "msg=" << msg << ", dat=" << dat << ", id=" << id;
// check message type // check message type
if (msg == "orientationCheck") { if (msg == "orientationCheck") {
@ -190,7 +190,7 @@ void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByt
void QQnxNavigatorEventNotifier::readData() void QQnxNavigatorEventNotifier::readData()
{ {
qNavigatorEventNotifierDebug() << Q_FUNC_INFO << "reading navigator data"; qNavigatorEventNotifierDebug("reading navigator data");
// allocate buffer for pps data // allocate buffer for pps data
char buffer[ppsBufferSize]; char buffer[ppsBufferSize];

View File

@ -73,7 +73,7 @@ bool QQnxNavigatorPps::openPpsConnection()
return false; return false;
} }
qNavigatorDebug() << Q_FUNC_INFO << "successfully connected to Navigator. fd=" << m_fd; qNavigatorDebug() << "successfully connected to Navigator. fd=" << m_fd;
return true; return true;
} }
@ -95,7 +95,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
ppsMessage += "\n"; ppsMessage += "\n";
qNavigatorDebug() << Q_FUNC_INFO << "sending PPS message:\n" << ppsMessage; qNavigatorDebug() << "sending PPS message:\n" << ppsMessage;
// send pps message to navigator // send pps message to navigator
errno = 0; errno = 0;
@ -117,7 +117,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
// ensure data is null terminated // ensure data is null terminated
buffer[bytes] = '\0'; buffer[bytes] = '\0';
qNavigatorDebug() << Q_FUNC_INFO << "received PPS message:\n" << buffer; qNavigatorDebug() << "received PPS message:\n" << buffer;
// process received message // process received message
QByteArray ppsData(buffer); QByteArray ppsData(buffer);
@ -136,7 +136,7 @@ bool QQnxNavigatorPps::sendPpsMessage(const QByteArray &message, const QByteArra
void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QByteArray> &messageFields) void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QByteArray> &messageFields)
{ {
qNavigatorDebug() << Q_FUNC_INFO << "data=" << ppsData; qNavigatorDebug() << "data=" << ppsData;
// tokenize pps data into lines // tokenize pps data into lines
QList<QByteArray> lines = ppsData.split('\n'); QList<QByteArray> lines = ppsData.split('\n');
@ -151,7 +151,7 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy
// tokenize current attribute // tokenize current attribute
const QByteArray &attr = lines.at(i); const QByteArray &attr = lines.at(i);
qNavigatorDebug() << Q_FUNC_INFO << "attr=" << attr; qNavigatorDebug() << "attr=" << attr;
int firstColon = attr.indexOf(':'); int firstColon = attr.indexOf(':');
if (firstColon == -1) { if (firstColon == -1) {
@ -168,8 +168,8 @@ void QQnxNavigatorPps::parsePPS(const QByteArray &ppsData, QHash<QByteArray, QBy
QByteArray key = attr.left(firstColon); QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1); QByteArray value = attr.mid(secondColon + 1);
qNavigatorDebug() << Q_FUNC_INFO << "key=" << key; qNavigatorDebug() << "key=" << key;
qNavigatorDebug() << Q_FUNC_INFO << "val=" << value; qNavigatorDebug() << "val=" << value;
messageFields[key] = value; messageFields[key] = value;
} }
} }

View File

@ -53,14 +53,14 @@ QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
m_needsPosting(false), m_needsPosting(false),
m_scrolled(false) m_scrolled(false)
{ {
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window; qRasterBackingStoreDebug() << "w =" << window;
m_window = window; m_window = window;
} }
QQnxRasterBackingStore::~QQnxRasterBackingStore() QQnxRasterBackingStore::~QQnxRasterBackingStore()
{ {
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); qRasterBackingStoreDebug() << "w =" << window();
} }
QPaintDevice *QQnxRasterBackingStore::paintDevice() QPaintDevice *QQnxRasterBackingStore::paintDevice()
@ -75,7 +75,7 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const
{ {
Q_UNUSED(offset) Q_UNUSED(offset)
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); qRasterBackingStoreDebug() << "w =" << this->window();
// Sometimes this method is called even though there is nothing to be // Sometimes this method is called even though there is nothing to be
// flushed (posted in "screen" parlance), for instance, after an expose // flushed (posted in "screen" parlance), for instance, after an expose
@ -103,7 +103,7 @@ void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticCont
{ {
Q_UNUSED(size); Q_UNUSED(size);
Q_UNUSED(staticContents); Q_UNUSED(staticContents);
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window() << ", s =" << size; qRasterBackingStoreDebug() << "w =" << window() << ", s =" << size;
// NOTE: defer resizing window buffers until next paint as // NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs // resize() can be called multiple times before a paint occurs
@ -111,7 +111,7 @@ void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticCont
bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy) bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{ {
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); qRasterBackingStoreDebug() << "w =" << window();
m_needsPosting = true; m_needsPosting = true;
@ -127,7 +127,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
{ {
Q_UNUSED(region); Q_UNUSED(region);
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); qRasterBackingStoreDebug() << "w =" << window();
m_needsPosting = true; m_needsPosting = true;
platformWindow()->adjustBufferSize(); platformWindow()->adjustBufferSize();
@ -154,7 +154,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
void QQnxRasterBackingStore::endPaint() void QQnxRasterBackingStore::endPaint()
{ {
qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); qRasterBackingStoreDebug() << "w =" << window();
} }
QQnxRasterWindow *QQnxRasterBackingStore::platformWindow() const QQnxRasterWindow *QQnxRasterBackingStore::platformWindow() const

View File

@ -91,7 +91,7 @@ void QQnxRasterWindow::post(const QRegion &dirty)
// Check if render buffer exists and something was rendered // Check if render buffer exists and something was rendered
if (m_currentBufferIndex != -1 && !dirty.isEmpty()) { if (m_currentBufferIndex != -1 && !dirty.isEmpty()) {
qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window(); qRasterWindowDebug() << "window =" << window();
QQnxBuffer &currentBuffer = m_buffers[m_currentBufferIndex]; QQnxBuffer &currentBuffer = m_buffers[m_currentBufferIndex];
// Copy unmodified region from old render buffer to new render buffer; // Copy unmodified region from old render buffer to new render buffer;
@ -124,14 +124,14 @@ void QQnxRasterWindow::post(const QRegion &dirty)
void QQnxRasterWindow::scroll(const QRegion &region, int dx, int dy, bool flush) void QQnxRasterWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
{ {
qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window(); qRasterWindowDebug() << "window =" << window();
blitPreviousToCurrent(region, dx, dy, flush); blitPreviousToCurrent(region, dx, dy, flush);
m_scrolled += region; m_scrolled += region;
} }
QQnxBuffer &QQnxRasterWindow::renderBuffer() QQnxBuffer &QQnxRasterWindow::renderBuffer()
{ {
qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window(); qRasterWindowDebug() << "window =" << window();
// Check if render buffer is invalid // Check if render buffer is invalid
if (m_currentBufferIndex == -1) { if (m_currentBufferIndex == -1) {
@ -192,7 +192,7 @@ void QQnxRasterWindow::resetBuffers()
void QQnxRasterWindow::blitPreviousToCurrent(const QRegion &region, int dx, int dy, bool flush) void QQnxRasterWindow::blitPreviousToCurrent(const QRegion &region, int dx, int dy, bool flush)
{ {
qRasterWindowDebug() << Q_FUNC_INFO << "window =" << window(); qRasterWindowDebug() << "window =" << window();
// Abort if previous buffer is invalid or if nothing to copy // Abort if previous buffer is invalid or if nothing to copy
if (m_previousBufferIndex == -1 || region.isEmpty()) if (m_previousBufferIndex == -1 || region.isEmpty())

View File

@ -154,7 +154,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
m_coverWindow(0), m_coverWindow(0),
m_cursor(new QQnxCursor()) m_cursor(new QQnxCursor())
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
// Cache initial orientation of this display // Cache initial orientation of this display
int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION, int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION,
&m_initialRotation); &m_initialRotation);
@ -191,7 +191,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
QQnxScreen::~QQnxScreen() QQnxScreen::~QQnxScreen()
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
Q_FOREACH (QQnxWindow *childWindow, m_childWindows) Q_FOREACH (QQnxWindow *childWindow, m_childWindows)
childWindow->setScreen(0); childWindow->setScreen(0);
@ -300,7 +300,7 @@ QPixmap QQnxScreen::grabWindow(WId window, int x, int y, int width, int height)
static int defaultDepth() static int defaultDepth()
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
static int defaultDepth = 0; static int defaultDepth = 0;
if (defaultDepth == 0) { if (defaultDepth == 0) {
// check if display depth was specified in environment variable; // check if display depth was specified in environment variable;
@ -314,7 +314,7 @@ static int defaultDepth()
QRect QQnxScreen::availableGeometry() const QRect QQnxScreen::availableGeometry() const
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
// available geometry = total geometry - keyboard // available geometry = total geometry - keyboard
return QRect(m_currentGeometry.x(), m_currentGeometry.y(), return QRect(m_currentGeometry.x(), m_currentGeometry.y(),
m_currentGeometry.width(), m_currentGeometry.height() - m_keyboardHeight); m_currentGeometry.width(), m_currentGeometry.height() - m_keyboardHeight);
@ -334,7 +334,7 @@ qreal QQnxScreen::refreshRate() const
qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz"); qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz");
return 60.0; return 60.0;
} }
qScreenDebug() << Q_FUNC_INFO << "screen mode:" << endl qScreenDebug() << "screen mode:" << endl
<< " width =" << displayMode.width << endl << " width =" << displayMode.width << endl
<< " height =" << displayMode.height << endl << " height =" << displayMode.height << endl
<< " refresh =" << displayMode.refresh << endl << " refresh =" << displayMode.refresh << endl
@ -372,7 +372,7 @@ Qt::ScreenOrientation QQnxScreen::orientation() const
else else
orient = Qt::InvertedLandscapeOrientation; orient = Qt::InvertedLandscapeOrientation;
} }
qScreenDebug() << Q_FUNC_INFO << "orientation =" << orient; qScreenDebug() << "orientation =" << orient;
return orient; return orient;
} }
@ -398,7 +398,7 @@ static bool isOrthogonal(int angle1, int angle2)
void QQnxScreen::setRotation(int rotation) void QQnxScreen::setRotation(int rotation)
{ {
qScreenDebug() << Q_FUNC_INFO << "orientation =" << rotation; qScreenDebug() << "orientation =" << rotation;
// Check if rotation changed // Check if rotation changed
// We only want to rotate if we are the primary screen // We only want to rotate if we are the primary screen
if (m_currentRotation != rotation && isPrimaryScreen()) { if (m_currentRotation != rotation && isPrimaryScreen()) {
@ -419,7 +419,7 @@ void QQnxScreen::setRotation(int rotation)
// Resize root window if we've rotated 90 or 270 from previous orientation // Resize root window if we've rotated 90 or 270 from previous orientation
if (isOrthogonal(m_currentRotation, rotation)) { if (isOrthogonal(m_currentRotation, rotation)) {
qScreenDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size(); qScreenDebug() << "resize, size =" << m_currentGeometry.size();
if (rootWindow()) if (rootWindow())
rootWindow()->setGeometry(QRect(QPoint(0,0), m_currentGeometry.size())); rootWindow()->setGeometry(QRect(QPoint(0,0), m_currentGeometry.size()));
@ -566,7 +566,7 @@ QQnxWindow *QQnxScreen::findWindow(screen_window_t windowHandle) const
void QQnxScreen::addWindow(QQnxWindow *window) void QQnxScreen::addWindow(QQnxWindow *window)
{ {
qScreenDebug() << Q_FUNC_INFO << "window =" << window; qScreenDebug() << "window =" << window;
if (m_childWindows.contains(window)) if (m_childWindows.contains(window))
return; return;
@ -589,7 +589,7 @@ void QQnxScreen::addWindow(QQnxWindow *window)
void QQnxScreen::removeWindow(QQnxWindow *window) void QQnxScreen::removeWindow(QQnxWindow *window)
{ {
qScreenDebug() << Q_FUNC_INFO << "window =" << window; qScreenDebug() << "window =" << window;
if (window != m_coverWindow) { if (window != m_coverWindow) {
const int numWindowsRemoved = m_childWindows.removeAll(window); const int numWindowsRemoved = m_childWindows.removeAll(window);
@ -604,7 +604,7 @@ void QQnxScreen::removeWindow(QQnxWindow *window)
void QQnxScreen::raiseWindow(QQnxWindow *window) void QQnxScreen::raiseWindow(QQnxWindow *window)
{ {
qScreenDebug() << Q_FUNC_INFO << "window =" << window; qScreenDebug() << "window =" << window;
if (window != m_coverWindow) { if (window != m_coverWindow) {
removeWindow(window); removeWindow(window);
@ -614,7 +614,7 @@ void QQnxScreen::raiseWindow(QQnxWindow *window)
void QQnxScreen::lowerWindow(QQnxWindow *window) void QQnxScreen::lowerWindow(QQnxWindow *window)
{ {
qScreenDebug() << Q_FUNC_INFO << "window =" << window; qScreenDebug() << "window =" << window;
if (window != m_coverWindow) { if (window != m_coverWindow) {
removeWindow(window); removeWindow(window);
@ -624,7 +624,7 @@ void QQnxScreen::lowerWindow(QQnxWindow *window)
void QQnxScreen::updateHierarchy() void QQnxScreen::updateHierarchy()
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
QList<QQnxWindow*>::const_iterator it; QList<QQnxWindow*>::const_iterator it;
int result; int result;
@ -800,7 +800,7 @@ void QQnxScreen::windowClosed(void *window)
void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState state) void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState state)
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName()) if (!rootWindow() || id != rootWindow()->groupName())
return; return;
@ -815,7 +815,7 @@ void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState s
void QQnxScreen::activateWindowGroup(const QByteArray &id) void QQnxScreen::activateWindowGroup(const QByteArray &id)
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName()) if (!rootWindow() || id != rootWindow()->groupName())
return; return;
@ -834,7 +834,7 @@ void QQnxScreen::activateWindowGroup(const QByteArray &id)
void QQnxScreen::deactivateWindowGroup(const QByteArray &id) void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
{ {
qScreenDebug() << Q_FUNC_INFO; qScreenDebug();
if (!rootWindow() || id != rootWindow()->groupName()) if (!rootWindow() || id != rootWindow()->groupName())
return; return;

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