summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/syncqt6
-rwxr-xr-xconfigure8
-rw-r--r--examples/opengl/paintedwindow/main.cpp2
-rw-r--r--examples/webkit/webkit-guide/_copyright.txt8
-rw-r--r--examples/webkit/webkit-guide/_image_assets.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_accord.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_demo-rotate.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_demo-scale.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_demo-skew.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_gallery.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_panel.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_pulse.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_skew.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_slide1.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_slide2.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_slide3.htm5
-rw-r--r--examples/webkit/webkit-guide/anim_tabbedSkew.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_backgrounds.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_border-img.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_grad-radial.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBack.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_gradientBackStop.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_gradientButton.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_mask-grad.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_mask-img.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_multicol.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_reflect.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_scroll.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_sel-nth.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_shadow.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_text-overflow.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_text-shadow.htm5
-rw-r--r--examples/webkit/webkit-guide/css3_text-stroke.htm5
-rw-r--r--examples/webkit/webkit-guide/form_tapper.htm5
-rw-r--r--examples/webkit/webkit-guide/form_toggler.htm5
-rw-r--r--examples/webkit/webkit-guide/layout_link-fmt.htm5
-rw-r--r--examples/webkit/webkit-guide/layout_tbl-keyhole.htm5
-rw-r--r--examples/webkit/webkit-guide/mob_condjs.htm5
-rw-r--r--examples/webkit/webkit-guide/mob_layout.htm5
-rw-r--r--examples/webkit/webkit-guide/mob_mediaquery.htm5
-rw-r--r--examples/webkit/webkit-guide/storage.htm5
-rw-r--r--examples/widgets/doc/src/editabletreemodel.qdoc6
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.cpp4
-rw-r--r--examples/xml/saxbookmarks/xbelgenerator.h4
-rw-r--r--mkspecs/features/create_cmake.prf2
-rw-r--r--mkspecs/features/qt_module.prf15
-rw-r--r--mkspecs/features/qt_module_fwdpri.prf3
-rw-r--r--mkspecs/linux-icc/qmake.conf2
-rw-r--r--mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp69
-rw-r--r--mkspecs/unsupported/android-g++/qmake.conf9
-rw-r--r--mkspecs/win32-g++/qmake.conf1
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in4
-rw-r--r--src/corelib/global/qconfig-nacl.h4
-rw-r--r--src/corelib/global/qfeatures.h5
-rw-r--r--src/corelib/global/qfeatures.txt20
-rw-r--r--src/corelib/io/qprocess_unix.cpp15
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp65
-rw-r--r--src/corelib/kernel/qcoreapplication.h1
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp37
-rw-r--r--src/corelib/thread/qmutex.cpp12
-rw-r--r--src/corelib/thread/qthread.cpp14
-rw-r--r--src/gui/accessible/qaccessible2.cpp288
-rw-r--r--src/gui/accessible/qaccessible2.h8
-rw-r--r--src/gui/kernel/qguiapplication.cpp19
-rw-r--r--src/gui/kernel/qkeymapper_qpa.cpp7
-rw-r--r--src/gui/kernel/qkeysequence.h5
-rw-r--r--src/gui/kernel/qplatformintegration.cpp14
-rw-r--r--src/gui/kernel/qplatformintegration.h2
-rw-r--r--src/gui/kernel/qplatformwindow.cpp9
-rw-r--r--src/gui/kernel/qplatformwindow.h2
-rw-r--r--src/gui/kernel/qscreen.h33
-rw-r--r--src/gui/kernel/qwindow.cpp5
-rw-r--r--src/gui/opengl/qopengl.h4
-rw-r--r--src/gui/opengl/qopengles2ext.h1
-rw-r--r--src/gui/opengl/qopenglext.h1
-rw-r--r--src/gui/opengl/qopenglfunctions.h2
-rw-r--r--src/gui/painting/qt_mips_asm_dsp.h4
-rw-r--r--src/gui/text/qfont.cpp60
-rw-r--r--src/gui/text/qglyphrun.cpp10
-rw-r--r--src/gui/text/qrawfont.cpp70
-rw-r--r--src/gui/text/qrawfont.h10
-rw-r--r--src/gui/text/qtextengine.cpp26
-rw-r--r--src/gui/text/qtextformat.cpp4
-rw-r--r--src/gui/text/qtextobject.cpp11
-rw-r--r--src/network/access/qnetworkdiskcache.cpp2
-rw-r--r--src/network/kernel/qnetworkfunctions_wince.h4
-rw-r--r--src/opengl/qglfunctions.h5
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow.cpp3
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp14
-rw-r--r--src/plugins/accessible/widgets/itemviews.cpp2
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp2
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp13
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm24
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm3
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.cpp3
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp10
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp4
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h6
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp7
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp5
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h1
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp53
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp63
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h7
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h2
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h1
-rw-r--r--src/printsupport/kernel/qcups.cpp2
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp17
-rw-r--r--src/sql/kernel/qsql.qdoc12
-rw-r--r--src/sql/models/qsqltablemodel.h6
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc8
-rw-r--r--src/tools/moc/preprocessor.cpp21
-rw-r--r--src/tools/qdoc/location.cpp5
-rw-r--r--src/tools/uic/qclass_lib_map.h4
-rw-r--r--src/widgets/dialogs/qfiledialog.ui184
-rw-r--r--src/widgets/doc/src/modelview.qdoc23
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp70
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp7
-rw-r--r--src/widgets/kernel/qwidget.cpp4
-rw-r--r--src/widgets/styles/qcommonstyle.cpp62
-rw-r--r--src/widgets/styles/qgtkstyle.cpp1
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm26
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h8
-rw-r--r--src/widgets/widgets/qcombobox.cpp9
-rw-r--r--src/widgets/widgets/qdockwidget.cpp2
-rw-r--r--tests/auto/cmake/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/io.pro1
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp26
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp46
-rw-r--r--tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro5
-rw-r--r--tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp84
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp2
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp6
-rw-r--r--tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp9
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp46
-rw-r--r--tests/auto/gui/text/qrawfont/tst_qrawfont.cpp45
-rw-r--r--tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp2
-rw-r--r--tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp2
-rw-r--r--tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp16
-rw-r--r--tests/auto/other/networkselftest/networkselftest.pro1
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp7
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp12
-rw-r--r--tests/auto/qtest-config.h (renamed from tests/auto/platformquirks.h)28
-rw-r--r--tests/auto/tools/moc/parse-defines.h12
-rw-r--r--tests/auto/tools/moc/pp-dollar-signs.h (renamed from src/widgets/styles/qmotifstyle_p.h)44
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp27
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp19
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp27
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp55
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp5
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro1
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp6
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp5
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp141
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp10
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp5
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp6
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp9
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp8
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp7
182 files changed, 1688 insertions, 923 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 4d3ae59bdd..bbbbe33d50 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -1206,10 +1206,12 @@ if($check_includes) {
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $line;
+ my $stop_processing = 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;
@@ -1237,7 +1239,7 @@ if($check_includes) {
$qt_end_namespace_found = 1;
}
}
- if ($header_skip_qt_begin_header_test == 0) {
+ if ($header_skip_qt_begin_header_test == 0 and $stop_processing == 0) {
if ($qt_begin_header_found == 0) {
print "$lib: WARNING: $iheader does not include QT_BEGIN_HEADER\n";
}
@@ -1247,7 +1249,7 @@ if($check_includes) {
}
}
- if ($header_skip_qt_begin_namespace_test == 0) {
+ 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";
}
diff --git a/configure b/configure
index 205cbde2d3..ef6014144c 100755
--- a/configure
+++ b/configure
@@ -2311,12 +2311,10 @@ if [ -z "$PLATFORM" ]; then
PLATFORM=macx-clang
elif [ "$OSX_VERSION" -eq 11 ]; then
# We're on Lion. Check if we have a supported Clang version
- case "$(clang -v 2>&1 | grep -Po '(?<=version )\d[\d.]+')" in
- 3.*)
+ if [ "$(clang -v 2>&1 | grep -Po '(?<=version )[\d]')" -ge 3 ]; then
PLATFORM=macx-clang
PLATFORM_NOTES="\n - Also available for Mac OS X: macx-g++\n"
- ;;
- esac
+ fi
fi
;;
AIX:*)
@@ -6122,7 +6120,7 @@ QT_SOURCE_TREE = \$\$quote($relpath)
QT_BUILD_TREE = \$\$quote($outpath)
include(\$\$PWD/mkspecs/qmodule.pri)
-CONFIG += dylib fix_output_dirs no_private_qt_headers_warning QTDIR_build
+CONFIG += fix_output_dirs no_private_qt_headers_warning QTDIR_build
EOF
diff --git a/examples/opengl/paintedwindow/main.cpp b/examples/opengl/paintedwindow/main.cpp
index 270b0b162a..b0c0060338 100644
--- a/examples/opengl/paintedwindow/main.cpp
+++ b/examples/opengl/paintedwindow/main.cpp
@@ -50,6 +50,6 @@ int main(int argc, char **argv)
PaintedWindow window;
window.show();
- app.exec();
+ return app.exec();
}
diff --git a/examples/webkit/webkit-guide/_copyright.txt b/examples/webkit/webkit-guide/_copyright.txt
index 198140cdeb..b90716cf3a 100644
--- a/examples/webkit/webkit-guide/_copyright.txt
+++ b/examples/webkit/webkit-guide/_copyright.txt
@@ -1,8 +1,10 @@
<!--
-This file is part of _PACKAGE_NAME_
+This file is part of QtWebKit
+
+Copyright (c) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
-Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +19,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/_image_assets.htm b/examples/webkit/webkit-guide/_image_assets.htm
index 5f27cfa7e8..26f148f8a9 100644
--- a/examples/webkit/webkit-guide/_image_assets.htm
+++ b/examples/webkit/webkit-guide/_image_assets.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_accord.htm b/examples/webkit/webkit-guide/anim_accord.htm
index 5d6f388198..9a8fc50e3f 100644
--- a/examples/webkit/webkit-guide/anim_accord.htm
+++ b/examples/webkit/webkit-guide/anim_accord.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_demo-rotate.htm b/examples/webkit/webkit-guide/anim_demo-rotate.htm
index 5231432f10..c78a6a6c0d 100644
--- a/examples/webkit/webkit-guide/anim_demo-rotate.htm
+++ b/examples/webkit/webkit-guide/anim_demo-rotate.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_demo-scale.htm b/examples/webkit/webkit-guide/anim_demo-scale.htm
index 67465055dd..bc84c5e247 100644
--- a/examples/webkit/webkit-guide/anim_demo-scale.htm
+++ b/examples/webkit/webkit-guide/anim_demo-scale.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_demo-skew.htm b/examples/webkit/webkit-guide/anim_demo-skew.htm
index cb61e48f1e..4e56e2ef77 100644
--- a/examples/webkit/webkit-guide/anim_demo-skew.htm
+++ b/examples/webkit/webkit-guide/anim_demo-skew.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_gallery.htm b/examples/webkit/webkit-guide/anim_gallery.htm
index 2bfc798ff3..b230f39c99 100644
--- a/examples/webkit/webkit-guide/anim_gallery.htm
+++ b/examples/webkit/webkit-guide/anim_gallery.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_panel.htm b/examples/webkit/webkit-guide/anim_panel.htm
index 3d55a28abd..2616d2ac34 100644
--- a/examples/webkit/webkit-guide/anim_panel.htm
+++ b/examples/webkit/webkit-guide/anim_panel.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_pulse.htm b/examples/webkit/webkit-guide/anim_pulse.htm
index 548a8e7690..8450804e5d 100644
--- a/examples/webkit/webkit-guide/anim_pulse.htm
+++ b/examples/webkit/webkit-guide/anim_pulse.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_skew.htm b/examples/webkit/webkit-guide/anim_skew.htm
index 5121bfefbd..ae510e6437 100644
--- a/examples/webkit/webkit-guide/anim_skew.htm
+++ b/examples/webkit/webkit-guide/anim_skew.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_slide1.htm b/examples/webkit/webkit-guide/anim_slide1.htm
index 028ee04014..2959c29ddb 100644
--- a/examples/webkit/webkit-guide/anim_slide1.htm
+++ b/examples/webkit/webkit-guide/anim_slide1.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_slide2.htm b/examples/webkit/webkit-guide/anim_slide2.htm
index cc2080f7ad..37af0b191b 100644
--- a/examples/webkit/webkit-guide/anim_slide2.htm
+++ b/examples/webkit/webkit-guide/anim_slide2.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_slide3.htm b/examples/webkit/webkit-guide/anim_slide3.htm
index 4808a2d5a2..f779b3da19 100644
--- a/examples/webkit/webkit-guide/anim_slide3.htm
+++ b/examples/webkit/webkit-guide/anim_slide3.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/anim_tabbedSkew.htm b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
index 7c59a4fef0..9f06a81e59 100644
--- a/examples/webkit/webkit-guide/anim_tabbedSkew.htm
+++ b/examples/webkit/webkit-guide/anim_tabbedSkew.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_backgrounds.htm b/examples/webkit/webkit-guide/css3_backgrounds.htm
index 6a927527c5..2f7da7abfa 100644
--- a/examples/webkit/webkit-guide/css3_backgrounds.htm
+++ b/examples/webkit/webkit-guide/css3_backgrounds.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_border-img.htm b/examples/webkit/webkit-guide/css3_border-img.htm
index 3a1679033e..2f5a0e4826 100644
--- a/examples/webkit/webkit-guide/css3_border-img.htm
+++ b/examples/webkit/webkit-guide/css3_border-img.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_grad-radial.htm b/examples/webkit/webkit-guide/css3_grad-radial.htm
index 59e1fb5fa3..b4fadb6ab7 100644
--- a/examples/webkit/webkit-guide/css3_grad-radial.htm
+++ b/examples/webkit/webkit-guide/css3_grad-radial.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_gradientBack.htm b/examples/webkit/webkit-guide/css3_gradientBack.htm
index 08d70816ed..07a784ee4d 100644
--- a/examples/webkit/webkit-guide/css3_gradientBack.htm
+++ b/examples/webkit/webkit-guide/css3_gradientBack.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_gradientBackStop.htm b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
index 0475444ecd..ee7fc6728b 100644
--- a/examples/webkit/webkit-guide/css3_gradientBackStop.htm
+++ b/examples/webkit/webkit-guide/css3_gradientBackStop.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_gradientButton.htm b/examples/webkit/webkit-guide/css3_gradientButton.htm
index efa7312ee3..630854e1ca 100644
--- a/examples/webkit/webkit-guide/css3_gradientButton.htm
+++ b/examples/webkit/webkit-guide/css3_gradientButton.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_mask-grad.htm b/examples/webkit/webkit-guide/css3_mask-grad.htm
index 6c92b0d4ec..179e589918 100644
--- a/examples/webkit/webkit-guide/css3_mask-grad.htm
+++ b/examples/webkit/webkit-guide/css3_mask-grad.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_mask-img.htm b/examples/webkit/webkit-guide/css3_mask-img.htm
index 0036673c9a..6f7078ca86 100644
--- a/examples/webkit/webkit-guide/css3_mask-img.htm
+++ b/examples/webkit/webkit-guide/css3_mask-img.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_multicol.htm b/examples/webkit/webkit-guide/css3_multicol.htm
index 8fead4f88d..1a3feeca05 100644
--- a/examples/webkit/webkit-guide/css3_multicol.htm
+++ b/examples/webkit/webkit-guide/css3_multicol.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_reflect.htm b/examples/webkit/webkit-guide/css3_reflect.htm
index 70a148f4a3..fdd67711ed 100644
--- a/examples/webkit/webkit-guide/css3_reflect.htm
+++ b/examples/webkit/webkit-guide/css3_reflect.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_scroll.htm b/examples/webkit/webkit-guide/css3_scroll.htm
index 95ce3d3f06..f1b02e7e34 100644
--- a/examples/webkit/webkit-guide/css3_scroll.htm
+++ b/examples/webkit/webkit-guide/css3_scroll.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_sel-nth.htm b/examples/webkit/webkit-guide/css3_sel-nth.htm
index 30d441bcb6..bd197b675f 100644
--- a/examples/webkit/webkit-guide/css3_sel-nth.htm
+++ b/examples/webkit/webkit-guide/css3_sel-nth.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_shadow.htm b/examples/webkit/webkit-guide/css3_shadow.htm
index 0661a21caa..ed40ea4d86 100644
--- a/examples/webkit/webkit-guide/css3_shadow.htm
+++ b/examples/webkit/webkit-guide/css3_shadow.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_text-overflow.htm b/examples/webkit/webkit-guide/css3_text-overflow.htm
index e4663abdf0..39e82fa0cf 100644
--- a/examples/webkit/webkit-guide/css3_text-overflow.htm
+++ b/examples/webkit/webkit-guide/css3_text-overflow.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_text-shadow.htm b/examples/webkit/webkit-guide/css3_text-shadow.htm
index f579eb1234..a2e248beeb 100644
--- a/examples/webkit/webkit-guide/css3_text-shadow.htm
+++ b/examples/webkit/webkit-guide/css3_text-shadow.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/css3_text-stroke.htm b/examples/webkit/webkit-guide/css3_text-stroke.htm
index 67453e0c03..012dd2c901 100644
--- a/examples/webkit/webkit-guide/css3_text-stroke.htm
+++ b/examples/webkit/webkit-guide/css3_text-stroke.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/form_tapper.htm b/examples/webkit/webkit-guide/form_tapper.htm
index b82c7fbc00..35f2dbfaff 100644
--- a/examples/webkit/webkit-guide/form_tapper.htm
+++ b/examples/webkit/webkit-guide/form_tapper.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/form_toggler.htm b/examples/webkit/webkit-guide/form_toggler.htm
index 0f4ee4803f..c29d1aef50 100644
--- a/examples/webkit/webkit-guide/form_toggler.htm
+++ b/examples/webkit/webkit-guide/form_toggler.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/layout_link-fmt.htm b/examples/webkit/webkit-guide/layout_link-fmt.htm
index e3a5c419c4..683366a625 100644
--- a/examples/webkit/webkit-guide/layout_link-fmt.htm
+++ b/examples/webkit/webkit-guide/layout_link-fmt.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
index 6826f7e940..005f7ffb5e 100644
--- a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
+++ b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/mob_condjs.htm b/examples/webkit/webkit-guide/mob_condjs.htm
index 3d48168801..283a73dffb 100644
--- a/examples/webkit/webkit-guide/mob_condjs.htm
+++ b/examples/webkit/webkit-guide/mob_condjs.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/mob_layout.htm b/examples/webkit/webkit-guide/mob_layout.htm
index dea52e2a02..9f383e0ee7 100644
--- a/examples/webkit/webkit-guide/mob_layout.htm
+++ b/examples/webkit/webkit-guide/mob_layout.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). All
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal All
rights reserved.
You may use this file under the terms of the BSD license as follows:
@@ -18,7 +19,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/mob_mediaquery.htm b/examples/webkit/webkit-guide/mob_mediaquery.htm
index 29f98bf50e..ceac269a40 100644
--- a/examples/webkit/webkit-guide/mob_mediaquery.htm
+++ b/examples/webkit/webkit-guide/mob_mediaquery.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/webkit/webkit-guide/storage.htm b/examples/webkit/webkit-guide/storage.htm
index 8d99a10a7d..829b800bac 100644
--- a/examples/webkit/webkit-guide/storage.htm
+++ b/examples/webkit/webkit-guide/storage.htm
@@ -2,7 +2,8 @@
This file is part of QtWebKit
-Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+Contact: http://www.qt-project.org/legal
You may use this file under the terms of the BSD license as follows:
@@ -17,7 +18,7 @@ o Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-o Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+o Neither the name of Digia Plc and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/examples/widgets/doc/src/editabletreemodel.qdoc b/examples/widgets/doc/src/editabletreemodel.qdoc
index f0b10eff2b..7d30a8eed3 100644
--- a/examples/widgets/doc/src/editabletreemodel.qdoc
+++ b/examples/widgets/doc/src/editabletreemodel.qdoc
@@ -39,10 +39,6 @@
possible to insert new child items, and this is shown in the supporting
example code.
- \note The model only shows the basic principles used when creating an
- editable, hierarchical model. You may wish to use the \l{ModelTest}
- project to test production models.
-
\section1 Overview
As described in the \l{Model Subclassing Reference}, models must
@@ -212,7 +208,7 @@
As with the \l{itemviews/simpletreemodel}{Simple Tree Model} example,
the \c TreeModel needs to be able to take a model index, find the
corresponding \c TreeItem, and return model indexes that correspond to
- its parents and children.
+ its parents and children.
In the diagram, we show how the model's \l{TreeModel::parent}{parent()}
implementation obtains the model index corresponding to the parent of
diff --git a/examples/xml/saxbookmarks/xbelgenerator.cpp b/examples/xml/saxbookmarks/xbelgenerator.cpp
index aeb955acae..c3fe046c6c 100644
--- a/examples/xml/saxbookmarks/xbelgenerator.cpp
+++ b/examples/xml/saxbookmarks/xbelgenerator.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
diff --git a/examples/xml/saxbookmarks/xbelgenerator.h b/examples/xml/saxbookmarks/xbelgenerator.h
index e1f454cf26..051cdb96c1 100644
--- a/examples/xml/saxbookmarks/xbelgenerator.h
+++ b/examples/xml/saxbookmarks/xbelgenerator.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 7253bca315..b168dad9f2 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -60,6 +60,8 @@ static|staticlib:CMAKE_STATIC_TYPE = true
contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"
+CMAKE_MKSPEC = $$relative_path($$QMAKESPEC, $$[QT_HOST_DATA/get]/mkspecs)
+
macx {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}_debug.a
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index ee5215dff3..23541930e3 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -89,7 +89,6 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_$${MODULE}.pri
"QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \
"QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
"QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE$$MODULE_IMPORT_SUFFIX" \
- "QT.$${MODULE}.docs = \$\$QT_MODULE_DOC_BASE" \
"QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_privdep \
$$module_build_type \
@@ -122,7 +121,19 @@ CONFIG += qmake_cache target_qt
CONFIG -= fix_output_dirs
!isEmpty(QMAKE_DOCS) {
- QMAKE_DOCS_OUTPUTDIR = $$eval(QT.$${MODULE}.docs)/qt$${MODULE}
+ doc_subdir = doc
+
+ QTDIR = $$[QT_HOST_PREFIX]
+ !force_independent:exists($$QTDIR/.qmake.cache): \
+ mod_component_base = $$QTDIR
+ else: \
+ mod_component_base = $$MODULE_BASE_OUTDIR
+
+ unset(QMAKE_DOCS_INDEX)
+ QMAKE_DOCS_OUTPUTDIR = $$mod_component_base/$$doc_subdir/qt$${MODULE}
+ for(qmod, QMAKEMODULES): \
+ QMAKE_DOCS_INDEX += $$section(qmod, /, 0, -3)/$$doc_subdir
+
CONFIG += qt_install_module_docs
}
diff --git a/mkspecs/features/qt_module_fwdpri.prf b/mkspecs/features/qt_module_fwdpri.prf
index 0bf5a7c883..5dc63ebdfd 100644
--- a/mkspecs/features/qt_module_fwdpri.prf
+++ b/mkspecs/features/qt_module_fwdpri.prf
@@ -68,7 +68,6 @@
"QT_MODULE_IMPORT_BASE = $$mod_component_base/imports" \
"QT_MODULE_LIB_BASE = $$mod_component_base/lib" \
"QT_MODULE_PLUGIN_BASE = $$mod_component_base/plugins" \
- "QT_MODULE_DOC_BASE = $$mod_component_base/doc" \
$$module_rpathlink \
$$module_rpathlink_priv \
"QT.$${MODULE}.rpath = $$MODULE_INSTALL_LIBS" \
@@ -86,7 +85,7 @@
include($$MODULE_FWD_PRI)
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
name depends private_depends module_config CONFIG DEFINES sources \
- includes private_includes bins libs plugins imports docs \
+ includes private_includes bins libs plugins imports \
)):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient)
cache(QT_CONFIG, transient)
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index d7fe808a01..540069499b 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -12,7 +12,7 @@ QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
-QMAKE_CFLAGS = -falign-stack=maintain-16-byte
+QMAKE_CFLAGS =
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259,2261
QMAKE_CFLAGS_WARN_OFF = -w
diff --git a/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp b/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp
index bb751eb98d..cef1d1ccbe 100644
--- a/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp
+++ b/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp
@@ -44,6 +44,10 @@
#include <ui/DisplayInfo.h>
#include <ui/FramebufferNativeWindow.h>
#include <gui/SurfaceComposerClient.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <linux/fb.h>
+#include <sys/ioctl.h>
using namespace android;
@@ -53,6 +57,8 @@ class QEglFSPandaHooks : public QEglFSHooks
{
public:
virtual EGLNativeWindowType createNativeWindow(const QSize &size, const QSurfaceFormat &format);
+ virtual QSize screenSize() const;
+ virtual int screenDepth() const;
private:
// androidy things
sp<android::SurfaceComposerClient> mSession;
@@ -72,13 +78,74 @@ EGLNativeWindowType QEglFSPandaHooks::createNativeWindow(const QSize &size, cons
0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_888);
SurfaceComposerClient::openGlobalTransaction();
mControl->setLayer(0x40000000);
- mControl->setAlpha(0.4);
+// mControl->setAlpha(1);
SurfaceComposerClient::closeGlobalTransaction();
mAndroidSurface = mControl->getSurface();
EGLNativeWindowType eglWindow = mAndroidSurface.get();
return eglWindow;
}
+QSize QEglFSPandaHooks::screenSize() const
+{
+ static QSize size;
+
+ if (size.isEmpty()) {
+ int width = qgetenv("QT_QPA_EGLFS_WIDTH").toInt();
+ int height = qgetenv("QT_QPA_EGLFS_HEIGHT").toInt();
+
+ if (width && height) {
+ // no need to read fb0
+ size.setWidth(width);
+ size.setHeight(height);
+ return size;
+ }
+
+ struct fb_var_screeninfo vinfo;
+ int fd = open("/dev/graphics/fb0", O_RDONLY);
+
+ if (fd != -1) {
+ if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1)
+ qWarning("Could not query variable screen info.");
+ else
+ size = QSize(vinfo.xres, vinfo.yres);
+
+ close(fd);
+ } else {
+ qWarning("Failed to open /dev/graphics/fb0 to detect screen resolution.");
+ }
+
+ // override fb0 from environment var setting
+ if (width)
+ size.setWidth(width);
+ if (height)
+ size.setHeight(height);
+ }
+
+ return size;
+}
+
+int QEglFSPandaHooks::screenDepth() const
+{
+ static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
+
+ if (depth == 0) {
+ struct fb_var_screeninfo vinfo;
+ int fd = open("/dev/graphics/fb0", O_RDONLY);
+
+ if (fd != -1) {
+ if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1)
+ qWarning("Could not query variable screen info.");
+ else
+ depth = vinfo.bits_per_pixel;
+
+ close(fd);
+ } else {
+ qWarning("Failed to open /dev/graphics/fb0 to detect screen depth.");
+ }
+ }
+
+ return depth == 0 ? 32 : depth;
+}
static QEglFSPandaHooks eglFSPandaHooks;
QEglFSHooks *platformHooks = &eglFSPandaHooks;
diff --git a/mkspecs/unsupported/android-g++/qmake.conf b/mkspecs/unsupported/android-g++/qmake.conf
index 54e6d61cee..8e0af9268d 100644
--- a/mkspecs/unsupported/android-g++/qmake.conf
+++ b/mkspecs/unsupported/android-g++/qmake.conf
@@ -25,13 +25,14 @@ defineReplace(getAndroidBuildVar) {
write_file(android_build_vars, store_ANDROID_TARGET_ARCH, append)
}
-warning(using android build env from cache in $$PWD/android_build_vars . delete this file if you changed your build env )
+info(using android build env from cache in $$PWD/android_build_vars . delete this file if you changed your build env )
exists($$PWD/android_build_vars) {
include($$PWD/android_build_vars)
}
MAKEFILE_GENERATOR = UNIX
+QMAKE_COMPILER = gcc
TARGET_PLATFORM = unix
TEMPLATE = app
QMAKE_INCREMENTAL_STYLE = sublib
@@ -41,9 +42,11 @@ include(../../common/gcc-base-unix.conf)
CONFIG = qt warn_on release link_prl
QT = core gui
-DEFINES += Q_OS_LINUX_ANDROID ANDROID HAVE_ANDROID_OS
+DEFINES += Q_OS_LINUX_ANDROID HAVE_ANDROID_OS
DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG QT_NO_EXCEPTIONS
+#note: -DANDROID results in weird behaviour of math.h
+DEFINES += ANDROID
QT_QPA_DEFAULT_PLATFORM = eglfs
EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_surfaceflinger.cpp
@@ -53,6 +56,8 @@ EGLFS_PLATFORM_HOOKS_LIBS += -lgui -lutils
QMAKE_CC = $${ANDROID_TOOLCHAIN_PREFIX}gcc
QMAKE_CFLAGS = $${ANDROID_TARGET_CFLAGS}
+QMAKE_CFLAGS -= -Werror=non-virtual-dtor
+QMAKE_CFLAGS -= -DNDEBUG
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CFLAGS_WARN_OFF = -Wno-psabi
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 697c62b73d..596e6d8302 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -85,6 +85,7 @@ QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
QMAKE_LIBS_NETWORK = -lws2_32
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
+QMAKE_LIBS_OPENGL_ES2 = -llibEGL -llibGLESv2 -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 27f67be525..59825f29f1 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -335,7 +335,7 @@ static QStringList unquote(const QStringList &values)
{
QStringList result;
result.reserve(values.size());
- for (int i = values.count(); --i >= 0;)
+ for (int i = 0; i < values.count(); ++i)
result << unquote(values.at(i));
return result;
}
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index e5f7e14d82..0df27039d0 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -44,9 +44,9 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
-list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/default\")
+list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
-list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/default\")
+list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h
index d62b12fba5..d5172aac29 100644
--- a/src/corelib/global/qconfig-nacl.h
+++ b/src/corelib/global/qconfig-nacl.h
@@ -39,6 +39,10 @@
**
****************************************************************************/
+#if 0
+#pragma qt_sync_stop_processing
+#endif
+
#define QT_FONTS_ARE_RESOURCES
/* Data structures */
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index 160063fa67..90ef47cf5b 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -306,6 +306,11 @@
#define QT_NO_NETWORKDISKCACHE
#endif
+// QLocalServer
+#if !defined(QT_NO_LOCALSERVER) && (defined(QT_NO_TEMPORARYFILE))
+#define QT_NO_LOCALSERVER
+#endif
+
// QProgressDialog
#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_PROGRESSBAR))
#define QT_NO_PROGRESSDIALOG
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 1a721e78b0..3b3af8a3fc 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -727,20 +727,6 @@ Requires:
Name: QWindowsStyle
SeeAlso: ???
-Feature: STYLE_MOTIF
-Description: Supports a Motif look and feel.
-Section: Styles
-Requires:
-Name: QMotifStyle
-SeeAlso: ???
-
-Feature: STYLE_CDE
-Description: Supports a CDE look and feel.
-Section: Styles
-Requires: STYLE_MOTIF
-Name: QCDEStyle
-SeeAlso: ???
-
Feature: STYLE_PLASTIQUE
Description: Supports a widget style similar to the Plastik style available in KDE.
Section: Styles
@@ -1025,6 +1011,12 @@ Requires: LIBRARY NETWORKINTERFACE PROPERTIES
Name: Bearer Management
SeeAlso: ???
+Feature: LOCALSERVER
+Description: Supports a local socket based server
+Section: Networking
+Requires: TEMPORARYFILE
+Name: QLocalServer
+SeeAlso: ???
# Utilities
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 1ef7af586f..0a928e4603 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -177,7 +177,7 @@ static QProcessManager *processManager()
QMutexLocker locker(&processManagerGlobalMutex);
if (!processManagerInstance)
- QProcessPrivate::initializeProcessManager();
+ new QProcessManager;
Q_ASSERT(processManagerInstance);
return processManagerInstance;
@@ -185,9 +185,6 @@ static QProcessManager *processManager()
QProcessManager::QProcessManager()
{
- // can only be called from main thread
- Q_ASSERT(!qApp || qApp->thread() == QThread::currentThread());
-
#if defined (QPROCESS_DEBUG)
qDebug() << "QProcessManager::QProcessManager()";
#endif
@@ -1434,15 +1431,7 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
void QProcessPrivate::initializeProcessManager()
{
- if (qApp && qApp->thread() != QThread::currentThread()) {
- // The process manager must be initialized in the main thread
- // Note: The call below will re-enter this function, but in the right thread,
- // so the else statement below will be executed.
- QMetaObject::invokeMethod(qApp, "_q_initializeProcessManager", Qt::BlockingQueuedConnection);
- } else {
- static QProcessManager processManager;
- Q_UNUSED(processManager);
- }
+ (void) processManager();
}
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index fd423d4479..df0ffce12d 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -264,6 +264,35 @@ struct QCoreApplicationData {
data->deref(); // deletes the data and the adopted thread
}
}
+
+#ifdef Q_OS_BLACKBERRY
+ //The QCoreApplicationData struct is only populated on demand, because it is rarely needed and would
+ //affect startup time
+ void loadManifest() {
+ static bool manifestLoadAttempt = false;
+ if (manifestLoadAttempt)
+ return;
+
+ manifestLoadAttempt = true;
+
+ QFile metafile(QStringLiteral("app/META-INF/MANIFEST.MF"));
+ if (!metafile.open(QIODevice::ReadOnly)) {
+ qWarning() << Q_FUNC_INFO << "Could not open application metafile for reading";
+ } else {
+ while (!metafile.atEnd() && (application.isEmpty() || applicationVersion.isEmpty() || orgName.isEmpty())) {
+ QByteArray line = metafile.readLine();
+ if (line.startsWith("Application-Name:"))
+ application = QString::fromUtf8(line.mid(18).trimmed());
+ else if (line.startsWith("Application-Version:"))
+ applicationVersion = QString::fromUtf8(line.mid(21).trimmed());
+ else if (line.startsWith("Package-Author:"))
+ orgName = QString::fromUtf8(line.mid(16).trimmed());
+ }
+ metafile.close();
+ }
+ }
+#endif
+
QString orgName, orgDomain, application;
QString applicationVersion;
@@ -363,16 +392,6 @@ void QCoreApplicationPrivate::createEventDispatcher()
#endif
}
-void QCoreApplicationPrivate::_q_initializeProcessManager()
-{
-#ifndef QT_NO_PROCESS
-# ifdef Q_OS_UNIX
- QProcessPrivate::initializeProcessManager();
-# endif
-#endif
-}
-
-
QThread *QCoreApplicationPrivate::theMainThread = 0;
QThread *QCoreApplicationPrivate::mainThread()
{
@@ -596,6 +615,12 @@ void QCoreApplication::init()
d->appendApplicationPathToLibraryPaths();
#endif
+#if defined(Q_OS_UNIX) && !(defined(QT_NO_PROCESS))
+ // Make sure the process manager thread object is created in the main
+ // thread.
+ QProcessPrivate::initializeProcessManager();
+#endif
+
#ifdef QT_EVAL
extern void qt_core_eval_init(uint);
qt_core_eval_init(d->application_type);
@@ -1765,6 +1790,15 @@ QString QCoreApplication::applicationFilePath()
#if defined(Q_OS_WIN)
d->cachedApplicationFilePath = QFileInfo(qAppFileName()).filePath();
return d->cachedApplicationFilePath;
+#elif defined(Q_OS_BLACKBERRY)
+ QDir dir(QStringLiteral("./app/native/"));
+ QStringList executables = dir.entryList(QDir::Executable | QDir::Files);
+ if (!executables.empty()) {
+ //We assume that there is only one executable in the folder
+ return dir.absoluteFilePath(executables.first());
+ } else {
+ return QString();
+ }
#elif defined(Q_OS_MAC)
QString qAppFileName_str = qAppFileName();
if(!qAppFileName_str.isEmpty()) {
@@ -1930,6 +1964,9 @@ void QCoreApplication::setOrganizationName(const QString &orgName)
QString QCoreApplication::organizationName()
{
+#ifdef Q_OS_BLACKBERRY
+ coreappdata()->loadManifest();
+#endif
return coreappdata()->orgName;
}
@@ -1977,6 +2014,9 @@ void QCoreApplication::setApplicationName(const QString &application)
QString QCoreApplication::applicationName()
{
+#ifdef Q_OS_BLACKBERRY
+ coreappdata()->loadManifest();
+#endif
QString appname = coreappdata() ? coreappdata()->application : QString();
if (appname.isEmpty() && QCoreApplication::self)
appname = QCoreApplication::self->d_func()->appName();
@@ -2003,6 +2043,9 @@ void QCoreApplication::setApplicationVersion(const QString &version)
QString QCoreApplication::applicationVersion()
{
+#ifdef Q_OS_BLACKBERRY
+ coreappdata()->loadManifest();
+#endif
return coreappdata()->applicationVersion;
}
@@ -2317,5 +2360,3 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
*/
QT_END_NAMESPACE
-
-#include "moc_qcoreapplication.cpp"
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 388877cbec..622139e6f8 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -178,7 +178,6 @@ protected:
QCoreApplication(QCoreApplicationPrivate &p);
private:
- Q_PRIVATE_SLOT(d_func(), void _q_initializeProcessManager())
static bool sendSpontaneousEvent(QObject *receiver, QEvent *event);
bool notifyInternal(QObject *receiver, QEvent *event);
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index 393ae1c55a..321f6905a4 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -76,8 +76,6 @@ public:
bool sendThroughObjectEventFilters(QObject *, QEvent *);
bool notify_helper(QObject *, QEvent *);
- void _q_initializeProcessManager();
-
QString appName() const;
virtual void createEventDispatcher();
static void removePostedEvent(QEvent *);
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index a553999121..33ca1023dd 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -295,14 +295,35 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
if (timeout)
timeout_bps = (timeout->tv_sec * 1000) + (timeout->tv_usec / 1000);
+ bool hasProcessedEventsOnce = false;
+ bps_event_t *event = 0;
+
// This loop exists such that we can drain the bps event queue of all native events
// more efficiently than if we were to return control to Qt after each event. This
// is important for handling touch events which can come in rapidly.
forever {
+ Q_ASSERT(!hasProcessedEventsOnce || event);
+
+ // Only emit the awake() and aboutToBlock() signals in the second iteration. For the first
+ // iteration, the UNIX event dispatcher will have taken care of that already.
+ if (hasProcessedEventsOnce)
+ emit awake();
+
+ // Filtering the native event should happen between the awake() and aboutToBlock() signal
+ // emissions. The calls awake() - filterNativeEvent() - aboutToBlock() - bps_get_event()
+ // need not to be interrupted by a break or return statement.
+ //
+ // Because of this, the native event is actually processed one loop iteration
+ // after it was retrieved with bps_get_event().
+ if (event)
+ filterNativeEvent(QByteArrayLiteral("bps_event_t"), static_cast<void*>(event), 0);
+
+ if (hasProcessedEventsOnce)
+ emit aboutToBlock();
+
// Wait for event or file to be ready
- bps_event_t *event = NULL;
+ event = 0;
const int result = bps_get_event(&event, timeout_bps);
-
if (result != BPS_SUCCESS)
qWarning("QEventDispatcherBlackberry::select: bps_get_event() failed");
@@ -314,14 +335,16 @@ int QEventDispatcherBlackberry::select(int nfds, fd_set *readfds, fd_set *writef
if (!event || bps_event_get_domain(event) == bpsIOReadyDomain)
break;
- // Any other events must be bps native events so we pass all such received
- // events through the native event filter chain
- filterNativeEvent(QByteArrayLiteral("bps_event_t"), static_cast<void*>(event), 0);
-
// Update the timeout. If this fails we have exceeded our alloted time or the system
// clock has changed time and we cannot calculate a new timeout so we bail out.
- if (!updateTimeout(&timeout_bps, startTime))
+ if (!updateTimeout(&timeout_bps, startTime)) {
+
+ // No more loop iteration, so we need to filter the event here.
+ filterNativeEvent(QByteArrayLiteral("bps_event_t"), static_cast<void*>(event), 0);
break;
+ }
+
+ hasProcessedEventsOnce = true;
}
// the number of bits set in the file sets
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index ee1037d4f4..3815ce16a7 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -162,8 +162,9 @@ public:
If \a mode is QMutex::Recursive, a thread can lock the same mutex
multiple times and the mutex won't be unlocked until a
- corresponding number of unlock() calls have been made. The
- default is QMutex::NonRecursive.
+ corresponding number of unlock() calls have been made. Otherwise
+ a thread may only lock a mutex once. The default is
+ QMutex::NonRecursive.
\sa lock(), unlock()
*/
@@ -371,6 +372,13 @@ bool QBasicMutex::isRecursive()
\sa unlock()
*/
+/*!
+ \fn QMutex *QMutexLocker::mutex()
+
+ Returns the mutex on which the QMutexLocker is operating.
+
+*/
+
#ifndef QT_LINUX_FUTEX //linux implementation is in qmutex_linux.cpp
/*
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 5949f9aefe..72bae48eba 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -323,7 +323,8 @@ QThreadPrivate::~QThreadPrivate()
/*!
\fn void QThread::started()
- This signal is emitted when the thread starts executing.
+ This signal is emitted from the associated thread when it starts executing,
+ before the run() function is called.
\sa finished(), terminated()
*/
@@ -331,7 +332,14 @@ QThreadPrivate::~QThreadPrivate()
/*!
\fn void QThread::finished()
- This signal is emitted when the thread has finished executing.
+ This signal is emitted from the associated thread right before it finishes executing.
+
+ When this signal is emitted, the event loop has already stopped running.
+ No more events will be processed in the thread, except for deferred deletion events.
+ This signal can be connected to QObject::deleteLater(), to free objects in that thread.
+
+ \note If the associated thread was terminated using terminate(), it is undefined from
+ which thread this signal is emitted.
\sa started(), terminated()
*/
@@ -341,6 +349,8 @@ QThreadPrivate::~QThreadPrivate()
This signal is emitted when the thread is terminated.
+ It is undefined from which thread this signal is emitted.
+
\sa started(), finished()
*/
diff --git a/src/gui/accessible/qaccessible2.cpp b/src/gui/accessible/qaccessible2.cpp
index e3402ef2e5..7f871f9c5a 100644
--- a/src/gui/accessible/qaccessible2.cpp
+++ b/src/gui/accessible/qaccessible2.cpp
@@ -134,19 +134,184 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn QString QAccessibleTextInterface::textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const
+ Returns the text item of type \a boundaryType that is close to offset \a offset
+ and sets \a startOffset and \a endOffset values to the start and end positions
+ of that item; returns an empty string if there is no such an item.
+ Sets \a startOffset and \a endOffset values to -1 on error.
*/
+QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset) const
+{
+ const QString txt = text(0, characterCount());
+
+ if (txt.isEmpty() || offset < 0 || offset > txt.length()) {
+ *startOffset = *endOffset = -1;
+ return QString();
+ }
+ if (offset == 0) {
+ *startOffset = *endOffset = offset;
+ return QString();
+ }
+
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = txt.length();
+ return txt;
+ }
+
+ // keep behavior in sync with QTextCursor::movePosition()!
+
+ QTextBoundaryFinder boundary(type, txt);
+ boundary.setPosition(offset);
+
+ do {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ } while (boundary.toPreviousBoundary() > 0);
+ Q_ASSERT(boundary.position() >= 0);
+ *endOffset = boundary.position();
+
+ while (boundary.toPreviousBoundary() > 0) {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ }
+ Q_ASSERT(boundary.position() >= 0);
+ *startOffset = boundary.position();
+
+ return txt.mid(*startOffset, *endOffset - *startOffset);
+}
/*!
- \fn QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const
+ Returns the text item of type \a boundaryType that is right after offset \a offset
+ and sets \a startOffset and \a endOffset values to the start and end positions
+ of that item; returns an empty string if there is no such an item.
+ Sets \a startOffset and \a endOffset values to -1 on error.
*/
+QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset) const
+{
+ const QString txt = text(0, characterCount());
+
+ if (txt.isEmpty() || offset < 0 || offset > txt.length()) {
+ *startOffset = *endOffset = -1;
+ return QString();
+ }
+ if (offset == txt.length()) {
+ *startOffset = *endOffset = offset;
+ return QString();
+ }
+
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = txt.length();
+ return txt;
+ }
+
+ // keep behavior in sync with QTextCursor::movePosition()!
+
+ QTextBoundaryFinder boundary(type, txt);
+ boundary.setPosition(offset);
+
+ while (boundary.toNextBoundary() < txt.length()) {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ }
+ Q_ASSERT(boundary.position() <= txt.length());
+ *startOffset = boundary.position();
+
+ while (boundary.toNextBoundary() < txt.length()) {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ }
+ Q_ASSERT(boundary.position() <= txt.length());
+ *endOffset = boundary.position();
+
+ return txt.mid(*startOffset, *endOffset - *startOffset);
+}
/*!
- \fn QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const
+ Returns the text item of type \a boundaryType at offset \a offset
+ and sets \a startOffset and \a endOffset values to the start and end positions
+ of that item; returns an empty string if there is no such an item.
+ Sets \a startOffset and \a endOffset values to -1 on error.
*/
+QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset) const
+{
+ const QString txt = text(0, characterCount());
+
+ if (txt.isEmpty() || offset < 0 || offset > txt.length()) {
+ *startOffset = *endOffset = -1;
+ return QString();
+ }
+ if (offset == txt.length()) {
+ *startOffset = *endOffset = offset;
+ return QString();
+ }
+
+ QTextBoundaryFinder::BoundaryType type;
+ switch (boundaryType) {
+ case QAccessible2::CharBoundary:
+ type = QTextBoundaryFinder::Grapheme;
+ break;
+ case QAccessible2::WordBoundary:
+ type = QTextBoundaryFinder::Word;
+ break;
+ case QAccessible2::SentenceBoundary:
+ type = QTextBoundaryFinder::Sentence;
+ break;
+ default:
+ // in any other case return the whole line
+ *startOffset = 0;
+ *endOffset = txt.length();
+ return txt;
+ }
+
+ // keep behavior in sync with QTextCursor::movePosition()!
+
+ QTextBoundaryFinder boundary(type, txt);
+ boundary.setPosition(offset);
+
+ do {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ } while (boundary.toPreviousBoundary() > 0);
+ Q_ASSERT(boundary.position() >= 0);
+ *startOffset = boundary.position();
+
+ while (boundary.toNextBoundary() < txt.length()) {
+ if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
+ break;
+ }
+ Q_ASSERT(boundary.position() <= txt.length());
+ *endOffset = boundary.position();
+
+ return txt.mid(*startOffset, *endOffset - *startOffset);
+}
/*!
\fn void QAccessibleTextInterface::removeSelection(int selectionIndex)
@@ -512,117 +677,6 @@ const QString &QAccessibleActionInterface::toggleAction()
return accessibleActionStrings()->toggleAction;
}
-
-/*!
- \internal
-*/
-QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text)
-{
- QTextBoundaryFinder::BoundaryType type;
- switch (boundaryType) {
- case QAccessible2::CharBoundary:
- type = QTextBoundaryFinder::Grapheme;
- break;
- case QAccessible2::WordBoundary:
- type = QTextBoundaryFinder::Word;
- break;
- case QAccessible2::SentenceBoundary:
- type = QTextBoundaryFinder::Sentence;
- break;
- default:
- // in any other case return the whole line
- *startOffset = 0;
- *endOffset = text.length();
- return text;
- }
-
- QTextBoundaryFinder boundary(type, text);
- boundary.setPosition(offset);
-
- if (!boundary.isAtBoundary()) {
- boundary.toPreviousBoundary();
- }
- boundary.toPreviousBoundary();
- *startOffset = boundary.position();
- boundary.toNextBoundary();
- *endOffset = boundary.position();
-
- return text.mid(*startOffset, *endOffset - *startOffset);
-}
-
-/*!
- \internal
-*/
-QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text)
-{
- QTextBoundaryFinder::BoundaryType type;
- switch (boundaryType) {
- case QAccessible2::CharBoundary:
- type = QTextBoundaryFinder::Grapheme;
- break;
- case QAccessible2::WordBoundary:
- type = QTextBoundaryFinder::Word;
- break;
- case QAccessible2::SentenceBoundary:
- type = QTextBoundaryFinder::Sentence;
- break;
- default:
- // in any other case return the whole line
- *startOffset = 0;
- *endOffset = text.length();
- return text;
- }
-
- QTextBoundaryFinder boundary(type, text);
- boundary.setPosition(offset);
-
- boundary.toNextBoundary();
- *startOffset = boundary.position();
- boundary.toNextBoundary();
- *endOffset = boundary.position();
-
- return text.mid(*startOffset, *endOffset - *startOffset);
-}
-
-/*!
- \internal
-*/
-QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text)
-{
- QTextBoundaryFinder::BoundaryType type;
- switch (boundaryType) {
- case QAccessible2::CharBoundary:
- type = QTextBoundaryFinder::Grapheme;
- break;
- case QAccessible2::WordBoundary:
- type = QTextBoundaryFinder::Word;
- break;
- case QAccessible2::SentenceBoundary:
- type = QTextBoundaryFinder::Sentence;
- break;
- default:
- // in any other case return the whole line
- *startOffset = 0;
- *endOffset = text.length();
- return text;
- }
-
- QTextBoundaryFinder boundary(type, text);
- boundary.setPosition(offset);
-
- if (!boundary.isAtBoundary()) {
- boundary.toPreviousBoundary();
- }
- *startOffset = boundary.position();
- boundary.toNextBoundary();
- *endOffset = boundary.position();
-
- return text.mid(*startOffset, *endOffset - *startOffset);
-}
-
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index ee0215ecf3..c1e7b8b5a2 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -83,12 +83,12 @@ public:
// text
virtual QString text(int startOffset, int endOffset) const = 0;
- virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const = 0;
+ virtual QString textBeforeOffset(int offset, QAccessible2::BoundaryType boundaryType,
+ int *startOffset, int *endOffset) const;
virtual QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const = 0;
+ int *startOffset, int *endOffset) const;
virtual QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset) const = 0;
+ int *startOffset, int *endOffset) const;
virtual int characterCount() const = 0;
// character <-> geometry
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 84f22de322..a67917ca3b 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1207,6 +1207,10 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QGuiApplicationPrivate::processPlatformPanelEvent(
static_cast<QWindowSystemInterfacePrivate::PlatformPanelEvent *>(e));
break;
+ case QWindowSystemInterfacePrivate::FileOpen:
+ QGuiApplicationPrivate::processFileOpenEvent(
+ static_cast<QWindowSystemInterfacePrivate::FileOpenEvent *>(e));
+ break;
default:
qWarning() << "Unknown user input event type:" << e->type;
break;
@@ -1942,13 +1946,12 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate:
Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();
s->d_func()->updatePrimaryOrientation();
- emit s->sizeChanged(s->size());
emit s->geometryChanged(s->geometry());
- emit s->physicalDotsPerInchXChanged(s->physicalDotsPerInchX());
- emit s->physicalDotsPerInchYChanged(s->physicalDotsPerInchY());
+ emit s->physicalSizeChanged(s->physicalSize());
emit s->physicalDotsPerInchChanged(s->physicalDotsPerInch());
- emit s->availableSizeChanged(s->availableSize());
- emit s->availableGeometryChanged(s->availableGeometry());
+ emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
+ foreach (QScreen* sibling, s->virtualSiblings())
+ emit sibling->virtualGeometryChanged(sibling->virtualGeometry());
if (s->primaryOrientation() != primaryOrientation)
emit s->primaryOrientationChanged(s->primaryOrientation());
@@ -1970,8 +1973,8 @@ void QGuiApplicationPrivate::reportAvailableGeometryChange(
QScreen *s = e->screen.data();
s->d_func()->availableGeometry = e->availableGeometry;
- emit s->availableSizeChanged(s->availableSize());
- emit s->availableGeometryChanged(s->availableGeometry());
+ foreach (QScreen* sibling, s->virtualSiblings())
+ emit sibling->virtualGeometryChanged(sibling->virtualGeometry());
}
void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e)
@@ -1986,8 +1989,6 @@ void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfa
QScreen *s = e->screen.data();
s->d_func()->logicalDpi = QDpi(e->dpiX, e->dpiY);
- emit s->logicalDotsPerInchXChanged(s->logicalDotsPerInchX());
- emit s->logicalDotsPerInchYChanged(s->logicalDotsPerInchY());
emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
}
diff --git a/src/gui/kernel/qkeymapper_qpa.cpp b/src/gui/kernel/qkeymapper_qpa.cpp
index 5073720ed8..0c225a4c91 100644
--- a/src/gui/kernel/qkeymapper_qpa.cpp
+++ b/src/gui/kernel/qkeymapper_qpa.cpp
@@ -43,6 +43,8 @@
#include <qdebug.h>
#include <private/qevent_p.h>
#include <private/qlocale_p.h>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
@@ -66,7 +68,10 @@ void QKeyMapperPrivate::clearMappings()
QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
{
- QList<int> result;
+ QList<int> result = QGuiApplicationPrivate::platformIntegration()->possibleKeys(e);
+ if (!result.isEmpty())
+ return result;
+
if (e->key() && (e->key() != Qt::Key_unknown))
result << int(e->key() + e->modifiers());
else if (!e->text().isEmpty())
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index a8b71645b0..2bb0c73119 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -227,11 +227,6 @@ public:
QKeySequence(int) {}
};
-#ifndef QT_NO_DATASTREAM
-Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks) {}
-Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks) {}
-#endif /* #ifndef QT_NO_DATASTREAM */
-
#endif // QT_NO_SHORTCUT
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 631f392284..cf55c59bab 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -313,6 +313,20 @@ Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const
}
/*!
+ Should be used to obtain a list of possible shortcuts for the given key
+ event. As that needs system functionality it cannot be done in qkeymapper.
+
+ One example for more than 1 possibility is the key combination of Shift+5.
+ That one might trigger a shortcut which is set as "Shift+5" as well as one
+ using %. These combinations depend on the currently set keyboard layout
+ which cannot be obtained by Qt functionality.
+*/
+QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const
+{
+ return QList<int>();
+}
+
+/*!
Should be called by the implementation whenever a new screen is added.
The first screen added will be the primary screen, used for default-created
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 7bc6c276c0..7e8888407c 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -76,6 +76,7 @@ class QPlatformTheme;
class QPlatformDialogHelper;
class QPlatformSharedGraphicsCache;
class QPlatformServices;
+class QKeyEvent;
class Q_GUI_EXPORT QPlatformIntegration
{
@@ -141,6 +142,7 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
+ virtual QList<int> possibleKeys(const QKeyEvent *) const;
virtual QStringList themeNames() const;
virtual QPlatformTheme *createPlatformTheme(const QString &name) const;
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 755fd8a652..27dfd7cf40 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -142,17 +142,16 @@ void QPlatformWindow::setVisible(bool visible)
QWindowSystemInterface::handleExposeEvent(window(), rect);
QWindowSystemInterface::flushWindowSystemEvents();
}
+
/*!
Requests setting the window flags of this surface
- to \a type. Returns the actual flags set.
+ to \a flags.
*/
-Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
+void QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
{
- return flags;
+ Q_UNUSED(flags);
}
-
-
/*!
Returns if this window is exposed in the windowing system.
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 7ea17d05aa..2b2d227fcf 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -90,7 +90,7 @@ public:
virtual QMargins frameMargins() const;
virtual void setVisible(bool visible);
- virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ virtual void setWindowFlags(Qt::WindowFlags flags);
virtual Qt::WindowState setWindowState(Qt::WindowState state);
virtual WId winId() const;
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 6a47a7be9c..48eaad94f7 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -70,20 +70,20 @@ class Q_GUI_EXPORT QScreen : public QObject
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(int depth READ depth CONSTANT)
- Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
- Q_PROPERTY(QSize availableSize READ availableSize NOTIFY availableSizeChanged)
- Q_PROPERTY(QSize virtualSize READ virtualSize NOTIFY sizeChanged)
- Q_PROPERTY(QSize availableVirtualSize READ availableVirtualSize NOTIFY availableSizeChanged)
+ Q_PROPERTY(QSize size READ size NOTIFY geometryChanged)
+ Q_PROPERTY(QSize availableSize READ availableSize NOTIFY virtualGeometryChanged)
+ Q_PROPERTY(QSize virtualSize READ virtualSize NOTIFY virtualGeometryChanged)
+ Q_PROPERTY(QSize availableVirtualSize READ availableVirtualSize NOTIFY virtualGeometryChanged)
Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)
- Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
- Q_PROPERTY(QRect virtualGeometry READ virtualGeometry NOTIFY sizeChanged)
- Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry NOTIFY availableGeometryChanged)
- Q_PROPERTY(QSizeF physicalSize READ physicalSize CONSTANT)
- Q_PROPERTY(qreal physicalDotsPerInchX READ physicalDotsPerInchX NOTIFY physicalDotsPerInchXChanged)
- Q_PROPERTY(qreal physicalDotsPerInchY READ physicalDotsPerInchY NOTIFY physicalDotsPerInchYChanged)
+ Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY virtualGeometryChanged)
+ Q_PROPERTY(QRect virtualGeometry READ virtualGeometry NOTIFY virtualGeometryChanged)
+ Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry NOTIFY virtualGeometryChanged)
+ Q_PROPERTY(QSizeF physicalSize READ physicalSize NOTIFY physicalSizeChanged)
+ Q_PROPERTY(qreal physicalDotsPerInchX READ physicalDotsPerInchX NOTIFY physicalDotsPerInchChanged)
+ Q_PROPERTY(qreal physicalDotsPerInchY READ physicalDotsPerInchY NOTIFY physicalDotsPerInchChanged)
Q_PROPERTY(qreal physicalDotsPerInch READ physicalDotsPerInch NOTIFY physicalDotsPerInchChanged)
- Q_PROPERTY(qreal logicalDotsPerInchX READ logicalDotsPerInchX NOTIFY logicalDotsPerInchXChanged)
- Q_PROPERTY(qreal logicalDotsPerInchY READ logicalDotsPerInchY NOTIFY logicalDotsPerInchYChanged)
+ Q_PROPERTY(qreal logicalDotsPerInchX READ logicalDotsPerInchX NOTIFY logicalDotsPerInchChanged)
+ Q_PROPERTY(qreal logicalDotsPerInchY READ logicalDotsPerInchY NOTIFY logicalDotsPerInchChanged)
Q_PROPERTY(qreal logicalDotsPerInch READ logicalDotsPerInch NOTIFY logicalDotsPerInchChanged)
Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged)
Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
@@ -138,16 +138,11 @@ public:
qreal refreshRate() const;
Q_SIGNALS:
- void sizeChanged(const QSize &size);
void geometryChanged(const QRect &geometry);
- void physicalDotsPerInchXChanged(qreal dpi);
- void physicalDotsPerInchYChanged(qreal dpi);
+ void physicalSizeChanged(const QSizeF &size);
void physicalDotsPerInchChanged(qreal dpi);
- void logicalDotsPerInchXChanged(qreal dpi);
- void logicalDotsPerInchYChanged(qreal dpi);
void logicalDotsPerInchChanged(qreal dpi);
- void availableSizeChanged(const QSize &size);
- void availableGeometryChanged(const QRect &rect);
+ void virtualGeometryChanged(const QRect &rect);
void primaryOrientationChanged(Qt::ScreenOrientation orientation);
void orientationChanged(Qt::ScreenOrientation orientation);
void refreshRateChanged(qreal refreshRate);
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 79927cbc71..27e1571184 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -514,9 +514,8 @@ void QWindow::setWindowFlags(Qt::WindowFlags flags)
{
Q_D(QWindow);
if (d->platformWindow)
- d->windowFlags = d->platformWindow->setWindowFlags(flags);
- else
- d->windowFlags = flags;
+ d->platformWindow->setWindowFlags(flags);
+ d->windowFlags = flags;
}
/*!
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index 291c23b85f..5928b0be2f 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -63,7 +63,7 @@ QT_BEGIN_HEADER
*/
typedef char GLchar;
-# include "qopengles2ext.h"
+# include <QtGui/qopengles2ext.h>
# ifndef GL_DOUBLE
# define GL_DOUBLE GL_FLOAT
# endif
@@ -96,7 +96,7 @@ typedef GLfloat GLdouble;
# include <QtCore/qt_windows.h>
# endif
# include <GL/gl.h>
-# include "qopenglext.h"
+# include <QtGui/qopenglext.h>
# endif // Q_OS_MAC
#endif
diff --git a/src/gui/opengl/qopengles2ext.h b/src/gui/opengl/qopengles2ext.h
index 564bbc8484..61bfb595cc 100644
--- a/src/gui/opengl/qopengles2ext.h
+++ b/src/gui/opengl/qopengles2ext.h
@@ -3,6 +3,7 @@
#if 0
#pragma qt_no_master_include
+#pragma qt_sync_stop_processing
#endif
/* $Revision: 18481 $ on $Date:: 2012-07-11 18:07:26 -0700 #$ */
diff --git a/src/gui/opengl/qopenglext.h b/src/gui/opengl/qopenglext.h
index 070dd993d9..5d21cb6eea 100644
--- a/src/gui/opengl/qopenglext.h
+++ b/src/gui/opengl/qopenglext.h
@@ -3,6 +3,7 @@
#if 0
#pragma qt_no_master_include
+#pragma qt_sync_stop_processing
#endif
#ifdef __cplusplus
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index 54633ff208..f035e26d81 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -83,6 +83,8 @@ typedef ptrdiff_t qopengl_GLsizeiptr;
#if defined(APIENTRY) && !defined(QOPENGLF_APIENTRY)
# define QOPENGLF_APIENTRY APIENTRY
+#elif defined(GL_APIENTRY) && !defined(QOPENGLF_APIENTRY)
+# define QOPENGLF_APIENTRY GL_APIENTRY
#endif
# ifndef QOPENGLF_APIENTRYP
diff --git a/src/gui/painting/qt_mips_asm_dsp.h b/src/gui/painting/qt_mips_asm_dsp.h
index af724bf7bb..c2fd234d08 100644
--- a/src/gui/painting/qt_mips_asm_dsp.h
+++ b/src/gui/painting/qt_mips_asm_dsp.h
@@ -42,6 +42,10 @@
#ifndef QT_MIPS_ASM_DSP_H
#define QT_MIPS_ASM_DSP_H
+#if 0
+#pragma qt_sync_stop_processing
+#endif
+
#define zero $0
#define AT $1
#define v0 $2
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 65368fd9d8..995d48d450 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -760,6 +760,9 @@ QString QFont::family() const
*/
void QFont::setFamily(const QString &family)
{
+ if ((resolve_mask & QFont::FamilyResolved) && d->request.family == family)
+ return;
+
detach();
d->request.family = family;
@@ -793,6 +796,9 @@ QString QFont::styleName() const
*/
void QFont::setStyleName(const QString &styleName)
{
+ if ((resolve_mask & QFont::StyleNameResolved) && d->request.styleName == styleName)
+ return;
+
detach();
d->request.styleName = styleName;
@@ -892,6 +898,9 @@ int QFont::pointSize() const
*/
void QFont::setHintingPreference(HintingPreference hintingPreference)
{
+ if ((resolve_mask & QFont::HintingPreferenceResolved) && d->request.hintingPreference == hintingPreference)
+ return;
+
detach();
d->request.hintingPreference = hintingPreference;
@@ -922,6 +931,9 @@ void QFont::setPointSize(int pointSize)
return;
}
+ if ((resolve_mask & QFont::SizeResolved) && d->request.pointSize == qreal(pointSize))
+ return;
+
detach();
d->request.pointSize = qreal(pointSize);
@@ -944,6 +956,9 @@ void QFont::setPointSizeF(qreal pointSize)
return;
}
+ if ((resolve_mask & QFont::SizeResolved) && d->request.pointSize == pointSize)
+ return;
+
detach();
d->request.pointSize = pointSize;
@@ -979,6 +994,9 @@ void QFont::setPixelSize(int pixelSize)
return;
}
+ if ((resolve_mask & QFont::SizeResolved) && d->request.pixelSize == qreal(pixelSize))
+ return;
+
detach();
d->request.pixelSize = pixelSize;
@@ -1034,6 +1052,9 @@ QFont::Style QFont::style() const
*/
void QFont::setStyle(Style style)
{
+ if ((resolve_mask & QFont::StyleResolved) && d->request.style == style)
+ return;
+
detach();
d->request.style = style;
@@ -1077,6 +1098,9 @@ void QFont::setWeight(int weight)
{
Q_ASSERT_X(weight >= 0 && weight <= 99, "QFont::setWeight", "Weight must be between 0 and 99");
+ if ((resolve_mask & QFont::WeightResolved) && d->request.weight == weight)
+ return;
+
detach();
d->request.weight = weight;
@@ -1122,6 +1146,9 @@ bool QFont::underline() const
*/
void QFont::setUnderline(bool enable)
{
+ if ((resolve_mask & QFont::UnderlineResolved) && d->underline == enable)
+ return;
+
detach();
d->underline = enable;
@@ -1145,6 +1172,9 @@ bool QFont::overline() const
*/
void QFont::setOverline(bool enable)
{
+ if ((resolve_mask & QFont::OverlineResolved) && d->overline == enable)
+ return;
+
detach();
d->overline = enable;
@@ -1169,6 +1199,9 @@ bool QFont::strikeOut() const
*/
void QFont::setStrikeOut(bool enable)
{
+ if ((resolve_mask & QFont::StrikeOutResolved) && d->strikeOut == enable)
+ return;
+
detach();
d->strikeOut = enable;
@@ -1193,6 +1226,9 @@ bool QFont::fixedPitch() const
*/
void QFont::setFixedPitch(bool enable)
{
+ if ((resolve_mask & QFont::FixedPitchResolved) && d->request.fixedPitch == enable)
+ return;
+
detach();
d->request.fixedPitch = enable;
@@ -1223,7 +1259,11 @@ bool QFont::kerning() const
*/
void QFont::setKerning(bool enable)
{
+ if ((resolve_mask & QFont::KerningResolved) && d->kerning == enable)
+ return;
+
detach();
+
d->kerning = enable;
resolve_mask |= QFont::KerningResolved;
}
@@ -1339,13 +1379,13 @@ QFont::StyleHint QFont::styleHint() const
*/
void QFont::setStyleHint(StyleHint hint, StyleStrategy strategy)
{
- detach();
-
if ((resolve_mask & (QFont::StyleHintResolved | QFont::StyleStrategyResolved)) &&
(StyleHint) d->request.styleHint == hint &&
(StyleStrategy) d->request.styleStrategy == strategy)
return;
+ detach();
+
d->request.styleHint = hint;
d->request.styleStrategy = strategy;
resolve_mask |= QFont::StyleHintResolved;
@@ -1360,12 +1400,12 @@ void QFont::setStyleHint(StyleHint hint, StyleStrategy strategy)
*/
void QFont::setStyleStrategy(StyleStrategy s)
{
- detach();
-
if ((resolve_mask & QFont::StyleStrategyResolved) &&
s == (StyleStrategy)d->request.styleStrategy)
return;
+ detach();
+
d->request.styleStrategy = s;
resolve_mask |= QFont::StyleStrategyResolved;
}
@@ -1593,10 +1633,10 @@ QFont::Capitalization QFont::capitalization() const
*/
void QFont::setRawMode(bool enable)
{
- detach();
-
if ((bool) d->rawMode == enable) return;
+ detach();
+
d->rawMode = enable;
}
@@ -2648,9 +2688,9 @@ void QFontCache::clear()
QFontEngineData *QFontCache::findEngineData(const QFontDef &def) const
{
- EngineDataCache::ConstIterator it = engineDataCache.find(def),
- end = engineDataCache.end();
- if (it == end) return 0;
+ EngineDataCache::ConstIterator it = engineDataCache.constFind(def);
+ if (it == engineDataCache.constEnd())
+ return 0;
// found
return it.value();
@@ -2768,7 +2808,7 @@ void QFontCache::timerEvent(QTimerEvent *)
end = engineDataCache.constEnd();
for (; it != end; ++it) {
#ifdef QFONTCACHE_DEBUG
- FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref));
+ FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref.load()));
#endif // QFONTCACHE_DEBUG
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index 48e0b15c85..f46e86e88c 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -473,15 +473,15 @@ void QGlyphRun::setBoundingRect(const QRectF &boundingRect)
*/
QRectF QGlyphRun::boundingRect() const
{
- if (!d->boundingRect.isEmpty())
+ if (!d->boundingRect.isEmpty() || !d->rawFont.isValid())
return d->boundingRect;
qreal minX, minY, maxX, maxY;
minX = minY = maxX = maxY = 0;
- for (int i=0; i<qMin(d->glyphPositions.size(), d->glyphIndexes.size()); ++i) {
- QRectF glyphRect = d->rawFont.boundingRect(d->glyphIndexes.at(i));
- glyphRect.translate(d->glyphPositions.at(i));
+ for (int i = 0, n = qMin(d->glyphIndexDataSize, d->glyphPositionDataSize); i < n; ++i) {
+ QRectF glyphRect = d->rawFont.boundingRect(d->glyphIndexData[i]);
+ glyphRect.translate(d->glyphPositionData[i]);
if (i == 0) {
minX = glyphRect.left();
@@ -506,7 +506,7 @@ QRectF QGlyphRun::boundingRect() const
*/
bool QGlyphRun::isEmpty() const
{
- return d->glyphIndexes.isEmpty();
+ return d->glyphIndexDataSize == 0;
}
QT_END_NAMESPACE
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index dee1abcfbc..f1191bc4b9 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -388,10 +388,7 @@ qreal QRawFont::unitsPerEm() const
*/
qreal QRawFont::lineThickness() const
{
- if (!isValid())
- return 0.0;
-
- return d->fontEngine->lineThickness().toReal();
+ return d->isValid() ? d->fontEngine->lineThickness().toReal() : 0.0;
}
/*!
@@ -400,10 +397,7 @@ qreal QRawFont::lineThickness() const
*/
qreal QRawFont::underlinePosition() const
{
- if (!isValid())
- return 0.0;
-
- return d->fontEngine->underlinePosition().toReal();
+ return d->isValid() ? d->fontEngine->underlinePosition().toReal() : 0.0;
}
/*!
@@ -459,23 +453,28 @@ int QRawFont::weight() const
*/
QVector<quint32> QRawFont::glyphIndexesForString(const QString &text) const
{
- if (!d->isValid())
- return QVector<quint32>();
+ QVector<quint32> glyphIndexes;
+ if (!d->isValid() || text.isEmpty())
+ return glyphIndexes;
+
+ int numGlyphs = text.size();
+ glyphIndexes.resize(numGlyphs);
- int nglyphs = text.size();
- QVarLengthGlyphLayoutArray glyphs(nglyphs);
- if (!glyphIndexesForChars(text.data(), text.size(), glyphs.glyphs, &nglyphs)) {
- glyphs.resize(nglyphs);
- if (!glyphIndexesForChars(text.data(), text.size(), glyphs.glyphs, &nglyphs)) {
+ QGlyphLayout glyphs;
+ glyphs.numGlyphs = numGlyphs;
+ glyphs.glyphs = glyphIndexes.data();
+ if (!d->fontEngine->stringToCMap(text.data(), text.size(), &glyphs, &numGlyphs, QFontEngine::GlyphIndicesOnly)) {
+ glyphIndexes.resize(numGlyphs);
+
+ glyphs.numGlyphs = numGlyphs;
+ glyphs.glyphs = glyphIndexes.data();
+ if (!d->fontEngine->stringToCMap(text.data(), text.size(), &glyphs, &numGlyphs, QFontEngine::GlyphIndicesOnly)) {
Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice");
return QVector<quint32>();
}
}
- QVector<quint32> glyphIndexes;
- for (int i=0; i<nglyphs; ++i)
- glyphIndexes.append(glyphs.glyphs[i]);
-
+ glyphIndexes.resize(numGlyphs);
return glyphIndexes;
}
@@ -491,38 +490,32 @@ QVector<quint32> QRawFont::glyphIndexesForString(const QString &text) const
*/
bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const
{
- if (!d->isValid())
+ Q_ASSERT(numGlyphs);
+ if (!d->isValid() || numChars <= 0) {
+ *numGlyphs = 0;
+ return false;
+ }
+
+ if (*numGlyphs <= 0 || !glyphIndexes) {
+ *numGlyphs = numChars;
return false;
+ }
QGlyphLayout glyphs;
+ glyphs.numGlyphs = *numGlyphs;
glyphs.glyphs = glyphIndexes;
return d->fontEngine->stringToCMap(chars, numChars, &glyphs, numGlyphs, QFontEngine::GlyphIndicesOnly);
}
/*!
+ \fn QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes) const
+
Returns the QRawFont's advances for each of the \a glyphIndexes in pixel units. The advances
give the distance from the position of a given glyph to where the next glyph should be drawn
to make it appear as if the two glyphs are unspaced.
\sa QTextLine::horizontalAdvance(), QFontMetricsF::width()
*/
-QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes) const
-{
- if (!d->isValid())
- return QVector<QPointF>();
-
- int numGlyphs = glyphIndexes.size();
- QVarLengthGlyphLayoutArray glyphs(numGlyphs);
- memcpy(glyphs.glyphs, glyphIndexes.data(), numGlyphs * sizeof(quint32));
-
- d->fontEngine->recalcAdvances(&glyphs, 0);
-
- QVector<QPointF> advances;
- for (int i=0; i<numGlyphs; ++i)
- advances.append(QPointF(glyphs.advances_x[i].toReal(), glyphs.advances_y[i].toReal()));
-
- return advances;
-}
/*!
Returns the QRawFont's advances for each of the \a glyphIndexes in pixel units. The advances
@@ -535,7 +528,8 @@ QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyph
*/
bool QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs) const
{
- if (!d->isValid())
+ Q_ASSERT(glyphIndexes && advances);
+ if (!d->isValid() || numGlyphs <= 0)
return false;
QGlyphLayout glyphs;
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 1dbde27c73..98314809e8 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -94,7 +94,7 @@ public:
int weight() const;
QVector<quint32> glyphIndexesForString(const QString &text) const;
- QVector<QPointF> advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes) const;
+ inline QVector<QPointF> advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes) const;
bool glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const;
bool advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs) const;
@@ -147,6 +147,14 @@ private:
Q_DECLARE_SHARED(QRawFont)
+inline QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes) const
+{
+ QVector<QPointF> advances(glyphIndexes.size());
+ if (advancesForGlyphIndexes(glyphIndexes.constData(), advances.data(), glyphIndexes.size()))
+ return advances;
+ return QVector<QPointF>();
+}
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 8527a85369..38fe2f8140 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -157,27 +157,27 @@ private:
m_splitter->setPosition(start);
QScriptAnalysis itemAnalysis = m_analysis[start];
- if (m_splitter->boundaryReasons() & QTextBoundaryFinder::StartWord) {
+ if (m_splitter->boundaryReasons() & QTextBoundaryFinder::StartOfItem)
itemAnalysis.flags = QScriptAnalysis::Uppercase;
- m_splitter->toNextBoundary();
- }
+
+ m_splitter->toNextBoundary();
const int end = start + length;
for (int i = start + 1; i < end; ++i) {
-
- bool atWordBoundary = false;
+ bool atWordStart = false;
if (i == m_splitter->position()) {
- if (m_splitter->boundaryReasons() & QTextBoundaryFinder::StartWord
- && m_analysis[i].flags < QScriptAnalysis::TabOrObject)
- atWordBoundary = true;
+ if (m_splitter->boundaryReasons() & QTextBoundaryFinder::StartOfItem) {
+ Q_ASSERT(m_analysis[i].flags < QScriptAnalysis::TabOrObject);
+ atWordStart = true;
+ }
m_splitter->toNextBoundary();
}
if (m_analysis[i] == itemAnalysis
&& m_analysis[i].flags < QScriptAnalysis::TabOrObject
- && !atWordBoundary
+ && !atWordStart
&& i - start < MaxItemLength)
continue;
@@ -185,7 +185,7 @@ private:
start = i;
itemAnalysis = m_analysis[start];
- if (atWordBoundary)
+ if (atWordStart)
itemAnalysis.flags = QScriptAnalysis::Uppercase;
}
m_items.append(QScriptItem(start, itemAnalysis));
@@ -1799,7 +1799,6 @@ struct QJustificationPoint {
int type;
QFixed kashidaWidth;
QGlyphLayout glyph;
- QFontEngine *fontEngine;
};
Q_DECLARE_TYPEINFO(QJustificationPoint, Q_PRIMITIVE_TYPE);
@@ -1808,7 +1807,6 @@ static void set(QJustificationPoint *point, int type, const QGlyphLayout &glyph,
{
point->type = type;
point->glyph = glyph;
- point->fontEngine = fe;
if (type >= HB_Arabic_Normal) {
QChar ch(0x640); // Kashida character
@@ -2741,13 +2739,13 @@ void QTextEngine::resolveAdditionalFormats() const
const QScriptItem *si = &layoutData->items.at(i);
int end = si->position + length(si);
- while (startIt != addFormatSortedByStart.end() &&
+ while (startIt != addFormatSortedByStart.constEnd() &&
specialData->addFormats.at(*startIt).start <= si->position) {
currentFormats.insert(std::upper_bound(currentFormats.begin(), currentFormats.end(), *startIt),
*startIt);
++startIt;
}
- while (endIt != addFormatSortedByEnd.end() &&
+ while (endIt != addFormatSortedByEnd.constEnd() &&
specialData->addFormats.at(*endIt).start + specialData->addFormats.at(*endIt).length < end) {
currentFormats.remove(qBinaryFind(currentFormats, *endIt) - currentFormats.begin());
++endIt;
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 6607c427f5..90cdd7e072 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -3358,8 +3358,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format)
bool QTextFormatCollection::hasFormatCached(const QTextFormat &format) const
{
uint hash = getHash(format.d, format.format_type);
- QMultiHash<uint, int>::const_iterator i = hashes.find(hash);
- while (i != hashes.end() && i.key() == hash) {
+ QMultiHash<uint, int>::const_iterator i = hashes.constFind(hash);
+ while (i != hashes.constEnd() && i.key() == hash) {
if (formats.value(i.value()) == format) {
return true;
}
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index abe1035cd1..349f8869fd 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1185,8 +1185,15 @@ Qt::LayoutDirection QTextBlock::textDirection() const
const QChar *p = buffer.constData() + frag->stringPosition;
const QChar * const end = p + frag->size_array[0];
while (p < end) {
- switch(QChar::direction(p->unicode()))
- {
+ uint ucs4 = p->unicode();
+ if (QChar::isHighSurrogate(ucs4) && p + 1 < end) {
+ ushort low = p[1].unicode();
+ if (QChar::isLowSurrogate(low)) {
+ ucs4 = QChar::surrogateToUcs4(ucs4, low);
+ ++p;
+ }
+ }
+ switch (QChar::direction(ucs4)) {
case QChar::DirL:
return Qt::LeftToRight;
case QChar::DirR:
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 04ba45e90e..86dd57b353 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE
and ends in ".cache". Data is written to disk only in insert()
and updateMetaData().
- Currently you can not share the same cache files with more then
+ Currently you cannot share the same cache files with more than
one disk cache.
QNetworkDiskCache by default limits the amount of space that the cache will
diff --git a/src/network/kernel/qnetworkfunctions_wince.h b/src/network/kernel/qnetworkfunctions_wince.h
index ebbdebb2f1..09caab06eb 100644
--- a/src/network/kernel/qnetworkfunctions_wince.h
+++ b/src/network/kernel/qnetworkfunctions_wince.h
@@ -42,6 +42,10 @@
#ifndef QNETWORKFUNCTIONS_WINCE_H
#define QNETWORKFUNCTIONS_WINCE_H
+#if 0
+#pragma qt_sync_stop_processing
+#endif
+
#ifdef Q_OS_WINCE
#include <qt_windows.h>
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index 3989063f96..3d49b3ea3b 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -61,6 +61,11 @@ QT_BEGIN_NAMESPACE
typedef ptrdiff_t qgl_GLintptr;
typedef ptrdiff_t qgl_GLsizeiptr;
+#if defined(APIENTRY) && !defined(QGLF_APIENTRY)
+# define QGLF_APIENTRY APIENTRY
+#elif defined(GL_APIENTRY) && !defined(QGLF_APIENTRY)
+# define QGLF_APIENTRY GL_APIENTRY
+#endif
# ifndef QGLF_APIENTRYP
# ifdef QGLF_APIENTRY
diff --git a/src/platformsupport/fbconvenience/qfbwindow.cpp b/src/platformsupport/fbconvenience/qfbwindow.cpp
index fd89e1b559..598e96886d 100644
--- a/src/platformsupport/fbconvenience/qfbwindow.cpp
+++ b/src/platformsupport/fbconvenience/qfbwindow.cpp
@@ -76,11 +76,10 @@ void QFbWindow::setGeometry(const QRect &rect)
QPlatformWindow::setGeometry(rect);
}
-Qt::WindowFlags QFbWindow::setWindowFlags(Qt::WindowFlags flags)
+void QFbWindow::setWindowFlags(Qt::WindowFlags flags)
{
mWindowFlags = flags;
platformScreen()->invalidateRectCache();
- return mWindowFlags;
}
Qt::WindowFlags QFbWindow::windowFlags() const
diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h
index 67b2ef87cd..e440e04e39 100644
--- a/src/platformsupport/fbconvenience/qfbwindow_p.h
+++ b/src/platformsupport/fbconvenience/qfbwindow_p.h
@@ -60,7 +60,7 @@ public:
void setGeometry(const QRect &rect);
- virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type);
+ virtual void setWindowFlags(Qt::WindowFlags type);
virtual Qt::WindowFlags windowFlags() const;
WId winId() const { return mWindowId; }
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index a4a4d66012..33c0750263 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -707,7 +707,8 @@ void AtSpiAdaptor::setBitFlag(const QString &flag)
sendObject_text_selection_changed = 1;
} else if (right.startsWith(QLatin1String("ValueChanged"))) {
sendObject_value_changed = 1;
- } else if (right.startsWith(QLatin1String("VisibleDataChanged"))) {
+ } else if (right.startsWith(QLatin1String("VisibleDataChanged"))
+ || right.startsWith(QLatin1String("VisibledataChanged"))) { // typo in libatspi
sendObject_visible_data_changed = 1;
} else {
qAtspiDebug() << "WARNING: subscription string not handled:" << flag;
@@ -1277,7 +1278,16 @@ bool AtSpiAdaptor::applicationInterface(const QAIPointer &interface, const QStri
QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String("Qt"))));
return connection.send(reply);
}
-
+ if (function == QLatin1String("GetVersion")) {
+ Q_ASSERT(message.signature() == QLatin1String("ss"));
+ QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(QLatin1String(qVersion()))));
+ return connection.send(reply);
+ }
+ if (function == QLatin1String("GetLocale")) {
+ Q_ASSERT(message.signature() == QLatin1String("u"));
+ QDBusMessage reply = message.createReply(QVariant::fromValue(QLocale().name()));
+ return connection.send(reply);
+ }
qAtspiDebug() << "AtSpiAdaptor::applicationInterface " << message.path() << interface << function;
return false;
}
diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp
index a8c42c9f59..649863ed84 100644
--- a/src/plugins/accessible/widgets/itemviews.cpp
+++ b/src/plugins/accessible/widgets/itemviews.cpp
@@ -407,7 +407,7 @@ QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const
return QModelIndex();
const QTreeView *treeView = qobject_cast<const QTreeView*>(view());
- if (treeView->d_func()->viewItems.count() <= row) {
+ if ((row < 0) || (column < 0) || (treeView->d_func()->viewItems.count() <= row)) {
qWarning() << "QAccessibleTree::indexFromLogical: invalid index: " << row << column << " for " << treeView;
return QModelIndex();
}
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 5f3f0bc3de..ad5ef69da4 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -949,7 +949,7 @@ QPair< int, int > QAccessibleTextWidget::getBoundaries(int offset, BoundaryType
sentenceFinder.setPosition(offsetWithinBlockText);
int prevBoundary = offsetWithinBlockText;
int nextBoundary = offsetWithinBlockText;
- if (!sentenceFinder.isAtBoundary())
+ if (!(sentenceFinder.boundaryReasons() & QTextBoundaryFinder::StartOfItem))
prevBoundary = sentenceFinder.toPreviousBoundary();
nextBoundary = sentenceFinder.toNextBoundary();
if (nextBoundary != -1)
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index 2015929010..bb90061a7e 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -72,13 +72,6 @@ extern QList<QWidget*> childWidgets(const QWidget *widget, bool includeTopLevel
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text);
QString Q_GUI_EXPORT qt_accHotKey(const QString &text);
-QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-
/*!
\class QAccessibleButton
\brief The QAccessibleButton class implements the QAccessibleInterface for button type widgets.
@@ -725,7 +718,7 @@ QString QAccessibleLineEdit::textBeforeOffset(int offset, BoundaryType boundaryT
*startOffset = *endOffset = -1;
return QString();
}
- return qTextBeforeOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
+ return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);
}
QString QAccessibleLineEdit::textAfterOffset(int offset, BoundaryType boundaryType,
@@ -735,7 +728,7 @@ QString QAccessibleLineEdit::textAfterOffset(int offset, BoundaryType boundaryTy
*startOffset = *endOffset = -1;
return QString();
}
- return qTextAfterOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
+ return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);
}
QString QAccessibleLineEdit::textAtOffset(int offset, BoundaryType boundaryType,
@@ -745,7 +738,7 @@ QString QAccessibleLineEdit::textAtOffset(int offset, BoundaryType boundaryType,
*startOffset = *endOffset = -1;
return QString();
}
- return qTextAtOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
+ return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);
}
void QAccessibleLineEdit::removeSelection(int selectionIndex)
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
index 6f99dc458a..e4b52b9454 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
@@ -56,8 +56,11 @@ class QCocoaNativeInterface : public QPlatformNativeInterface
public:
QCocoaNativeInterface();
+ void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context);
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
+ static void *cglContextForContext(QOpenGLContext *context);
+
public Q_SLOTS:
void onAppFocusWindowChanged(QWindow *window);
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index e5040080ed..7f37b971d7 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -65,6 +65,17 @@ QCocoaNativeInterface::QCocoaNativeInterface()
{
}
+void *QCocoaNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context)
+{
+ if (!context)
+ return 0;
+
+ if (resourceString.toLower() == "cglcontextobj")
+ return cglContextForContext(context);
+
+ return 0;
+}
+
void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
if (!window->handle()) {
@@ -109,4 +120,17 @@ void QCocoaNativeInterface::onAppFocusWindowChanged(QWindow *window)
QCocoaMenuBar::updateMenuBarImmediately();
}
+void *QCocoaNativeInterface::cglContextForContext(QOpenGLContext* context)
+{
+ if (context) {
+ QCocoaGLContext *cocoaGLContext = static_cast<QCocoaGLContext *>(context->handle());
+ if (cocoaGLContext) {
+ NSOpenGLContext *nsOpenGLContext = cocoaGLContext->nsOpenGLContext();
+ if (nsOpenGLContext)
+ return [nsOpenGLContext CGLContextObj];
+ }
+ }
+ return 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 4a146767d5..014db378e7 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -98,7 +98,7 @@ public:
void setGeometry(const QRect &rect);
void setCocoaGeometry(const QRect &rect);
void setVisible(bool visible);
- Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ void setWindowFlags(Qt::WindowFlags flags);
Qt::WindowState setWindowState(Qt::WindowState state);
void setWindowTitle(const QString &title);
void setWindowFilePath(const QString &filePath);
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 26161b106e..f4a4936c28 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -387,7 +387,7 @@ void QCocoaWindow::setWindowShadow(Qt::WindowFlags flags)
[m_nsWindow setHasShadow:(keepShadow ? YES : NO)];
}
-Qt::WindowFlags QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
+void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
{
if (m_nsWindow) {
NSUInteger styleMask = windowStyleMask(flags);
@@ -398,7 +398,6 @@ Qt::WindowFlags QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
}
m_windowFlags = flags;
- return m_windowFlags;
}
Qt::WindowState QCocoaWindow::setWindowState(Qt::WindowState state)
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
index 8b108eeaa2..630e4fd7a2 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
@@ -140,7 +140,7 @@ void QDirectFbWindow::setVisible(bool visible)
QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
}
-Qt::WindowFlags QDirectFbWindow::setWindowFlags(Qt::WindowFlags flags)
+void QDirectFbWindow::setWindowFlags(Qt::WindowFlags flags)
{
switch (flags & Qt::WindowType_Mask) {
case Qt::ToolTip: {
@@ -154,7 +154,6 @@ Qt::WindowFlags QDirectFbWindow::setWindowFlags(Qt::WindowFlags flags)
}
m_dfbWindow->SetStackingClass(m_dfbWindow.data(), flags & Qt::WindowStaysOnTopHint ? DWSC_UPPER : DWSC_MIDDLE);
- return flags;
}
void QDirectFbWindow::raise()
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h
index cedd140809..3edee7c6b2 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.h
@@ -60,7 +60,7 @@ public:
void setVisible(bool visible);
- Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ void setWindowFlags(Qt::WindowFlags flags);
bool setKeyboardGrabEnabled(bool grab);
bool setMouseGrabEnabled(bool grab);
void raise();
diff --git a/src/plugins/platforms/qnx/qqnxbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp
index ed3ea49d44..9007af7f70 100644
--- a/src/plugins/platforms/qnx/qqnxbuffer.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp
@@ -88,7 +88,7 @@ QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
if (result != 0) {
qFatal("QQNX: failed to query buffer pointer, errno=%d", errno);
}
- if (dataPtr == NULL) {
+ if (dataPtr == 0) {
qFatal("QQNX: buffer pointer is NULL, errno=%d", errno);
}
diff --git a/src/plugins/platforms/qnx/qqnxbuffer.h b/src/plugins/platforms/qnx/qqnxbuffer.h
index 7788778a4a..d5adeb8d8b 100644
--- a/src/plugins/platforms/qnx/qqnxbuffer.h
+++ b/src/plugins/platforms/qnx/qqnxbuffer.h
@@ -57,8 +57,8 @@ public:
virtual ~QQnxBuffer();
screen_buffer_t nativeBuffer() const { return m_buffer; }
- const QImage *image() const { return (m_buffer != NULL) ? &m_image : NULL; }
- QImage *image() { return (m_buffer != NULL) ? &m_image : NULL; }
+ const QImage *image() const { return (m_buffer != 0) ? &m_image : 0; }
+ QImage *image() { return (m_buffer != 0) ? &m_image : 0; }
QRect rect() const { return m_image.rect(); }
diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
index 72a967d5e5..30ca8a5c48 100644
--- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
@@ -571,7 +571,7 @@ spannable_string_t *toSpannableString(const QString &text)
spannable_string_t *pString = reinterpret_cast<spannable_string_t *>(malloc(sizeof(spannable_string_t)));
pString->str = (wchar_t *)malloc(sizeof(wchar_t) * text.length() + 1);
pString->length = text.length();
- pString->spans = NULL;
+ pString->spans = 0;
pString->spans_count = 0;
const QChar *pData = text.constData();
@@ -601,7 +601,7 @@ static bool s_imfInitFailed = false;
static bool imfAvailable()
{
- static bool s_imfDisabled = getenv("DISABLE_IMF") != NULL;
+ static bool s_imfDisabled = getenv("DISABLE_IMF") != 0;
static bool s_imfReady = false;
if ( s_imfInitFailed || s_imfDisabled) {
@@ -611,7 +611,7 @@ static bool imfAvailable()
return true;
}
- if ( p_imf_client_init == NULL ) {
+ if ( p_imf_client_init == 0 ) {
void *handle = dlopen("libinput_client.so.1", 0);
if ( handle ) {
p_imf_client_init = (int32_t (*)()) dlsym(handle, "imf_client_init");
@@ -632,8 +632,8 @@ static bool imfAvailable()
s_imfReady = true;
}
else {
- p_ictrl_open_session = NULL;
- p_ictrl_dispatch_event = NULL;
+ p_ictrl_open_session = 0;
+ p_ictrl_dispatch_event = 0;
s_imfDisabled = true;
qCritical() << Q_FUNC_INFO << "libinput_client.so.1 did not contain the correct symbols, library mismatch? IMF services are disabled.";
return false;
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 6a092f01a0..593bec8458 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -524,7 +524,7 @@ void QQnxScreen::newWindowCreated(void *window)
{
Q_ASSERT(thread() == QThread::currentThread());
const screen_window_t windowHandle = reinterpret_cast<screen_window_t>(window);
- screen_display_t display = NULL;
+ screen_display_t display = 0;
if (screen_get_window_property_pv(windowHandle, SCREEN_PROPERTY_DISPLAY, (void**)&display) != 0) {
qWarning("QQnx: Failed to get screen for window, errno=%d", errno);
return;
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
index 621440ed53..d8712bf569 100644
--- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
@@ -462,7 +462,7 @@ void QQnxScreenEventHandler::handleCreateEvent(screen_event_t event)
void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event)
{
- screen_display_t nativeDisplay = NULL;
+ screen_display_t nativeDisplay = 0;
if (screen_get_event_property_pv(event, SCREEN_PROPERTY_DISPLAY, (void **)&nativeDisplay) != 0) {
qWarning("QQnx: failed to query display property, errno=%d", errno);
return;
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
index 4618b90f81..ab912927bb 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
@@ -130,7 +130,7 @@ bool QQnxVirtualKeyboardPps::connect()
m_decoder = new pps_decoder_t;
pps_encoder_initialize(m_encoder, false);
- pps_decoder_initialize(m_decoder, NULL);
+ pps_decoder_initialize(m_decoder, 0);
errno = 0;
m_fd = ::open(ms_PPSPath, O_RDWR);
@@ -197,7 +197,7 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
m_buffer[nread] = 0;
pps_decoder_parse_pps_str(m_decoder, m_buffer);
- pps_decoder_push(m_decoder, NULL);
+ pps_decoder_push(m_decoder, 0);
#if defined(QQNXVIRTUALKEYBOARD_DEBUG)
pps_decoder_dump_tree(m_decoder, stderr);
#endif
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 6eb3bdee10..73f963b6b8 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -104,6 +104,7 @@ enum WindowsEventType // Simplify event types
InputMethodRequest = InputMethodEventFlag + 6,
ThemeChanged = ThemingEventFlag + 1,
DisplayChangedEvent = 437,
+ SettingChangedEvent = DisplayChangedEvent + 1,
UnknownEvent = 542
};
@@ -184,6 +185,11 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
return QtWindows::FocusInEvent;
case WM_KILLFOCUS:
return QtWindows::FocusOutEvent;
+ // Among other things, WM_SETTINGCHANGE happens when the taskbar is moved
+ // and therefore the "working area" changes.
+ // http://msdn.microsoft.com/en-us/library/ms695534(v=vs.85).aspx
+ case WM_SETTINGCHANGE:
+ return QtWindows::SettingChangedEvent;
case WM_DISPLAYCHANGE:
return QtWindows::DisplayChangedEvent;
case WM_THEMECHANGED:
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 0dade2c49b..98c17deba9 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -331,6 +331,11 @@ bool QWindowsContext::useRTLExtensions() const
return d->m_keyMapper.useRTLExtensions();
}
+QList<int> QWindowsContext::possibleKeys(const QKeyEvent *e) const
+{
+ return d->m_keyMapper.possibleKeys(e);
+}
+
void QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx)
{
d->m_creationContext = ctx;
@@ -749,6 +754,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
#endif
case QtWindows::DisplayChangedEvent:
return d->m_screenManager.handleDisplayChange(wParam, lParam);
+ case QtWindows::SettingChangedEvent:
+ return d->m_screenManager.handleScreenChanges();
default:
break;
}
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 3f08a742f8..450d6c8f4b 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -60,6 +60,7 @@ class QWindowsMimeConverter;
struct QWindowCreationContext;
struct QWindowsContextPrivate;
class QPoint;
+class QKeyEvent;
#ifndef Q_OS_WINCE
struct QWindowsUser32DLL
@@ -170,6 +171,7 @@ public:
unsigned systemInfo() const;
bool useRTLExtensions() const;
+ QList<int> possibleKeys(const QKeyEvent *e) const;
QWindowsMimeConverter &mimeConverter() const;
QWindowsScreenManager &screenManager();
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 8b3d6749a0..11fd740009 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -560,12 +560,8 @@ int QWindowsInputContext::reconvertString(RECONVERTSTRING *reconv)
// Find the word in the surrounding text.
QTextBoundaryFinder bounds(QTextBoundaryFinder::Word, surroundingText);
bounds.setPosition(pos);
- if (bounds.isAtBoundary()) {
- if (QTextBoundaryFinder::EndWord == bounds.boundaryReasons())
- bounds.toPreviousBoundary();
- } else {
+ if (bounds.position() > 0 && !(bounds.boundaryReasons() & QTextBoundaryFinder::StartOfItem))
bounds.toPreviousBoundary();
- }
const int startPos = bounds.position();
bounds.toNextBoundary();
const int endPos = bounds.position();
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 463e01246b..1f26ec5bab 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -447,6 +447,11 @@ Qt::KeyboardModifiers QWindowsIntegration::queryKeyboardModifiers() const
return QWindowsKeyMapper::queryKeyboardModifiers();
}
+QList<int> QWindowsIntegration::possibleKeys(const QKeyEvent *e) const
+{
+ return d->m_context.possibleKeys(e);
+}
+
QPlatformNativeInterface *QWindowsIntegration::nativeInterface() const
{
return &d->m_nativeInterface;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index fe095cf5d3..49780566dd 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -81,6 +81,7 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
+ virtual QList<int> possibleKeys(const QKeyEvent *e) const;
static QWindowsIntegration *instance();
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 322d66836a..b57a27acb4 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -1119,4 +1119,30 @@ Qt::KeyboardModifiers QWindowsKeyMapper::queryKeyboardModifiers()
return modifiers;
}
+QList<int> QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
+{
+ QList<int> result;
+
+ KeyboardLayoutItem *kbItem = keyLayout[e->nativeVirtualKey()];
+ if (!kbItem)
+ return result;
+
+ quint32 baseKey = kbItem->qtKey[0];
+ Qt::KeyboardModifiers keyMods = e->modifiers();
+ if (baseKey == Qt::Key_Return && (e->nativeModifiers() & ExtendedKey)) {
+ result << int(Qt::Key_Enter + keyMods);
+ return result;
+ }
+ result << int(baseKey + keyMods); // The base key is _always_ valid, of course
+
+ for (int i = 1; i < 9; ++i) {
+ Qt::KeyboardModifiers neededMods = ModsTbl[i];
+ quint32 key = kbItem->qtKey[i];
+ if (key && key != baseKey && ((keyMods & neededMods) == neededMods))
+ result << int(key + (keyMods & ~neededMods));
+ }
+
+ return result;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index 3a13deb0b6..7b3f18a42d 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -48,6 +48,7 @@
QT_BEGIN_NAMESPACE
+class QKeyEvent;
class QWindow;
struct KeyboardLayoutItem;
@@ -70,6 +71,7 @@ public:
void setKeyGrabber(QWindow *w) { m_keyGrabber = w; }
static Qt::KeyboardModifiers queryKeyboardModifiers();
+ QList<int> possibleKeys(const QKeyEvent *e) const;
private:
bool translateKeyEventInternal(QWindow *receiver, const MSG &msg, bool grab);
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 05a6893aad..0717a8ec60 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -372,7 +372,7 @@ static inline int indexOfMonitor(const QList<QWindowsScreenData> &screenData,
ones and propagates resolution changes to QWindowSystemInterface.
*/
-void QWindowsScreenManager::handleScreenChanges()
+bool QWindowsScreenManager::handleScreenChanges()
{
// Look for changed monitors, add new ones
const WindowsScreenDataList newDataList = monitorData();
@@ -396,6 +396,7 @@ void QWindowsScreenManager::handleScreenChanges()
delete m_screens.takeAt(i);
} // not found
} // for existing screens
+ return true;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index 49b62632fc..dfd85f9be4 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -129,7 +129,7 @@ public:
delete m_screens.takeLast();
}
- void handleScreenChanges();
+ bool handleScreenChanges();
bool handleDisplayChange(WPARAM wParam, LPARAM lParam);
const WindowsScreenList &screens() const { return m_screens; }
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 2335870ea7..f3830eb962 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1178,7 +1178,7 @@ void QWindowsWindow::setWindowTitle(const QString &title)
SetWindowText(m_data.hwnd, (const wchar_t*)title.utf16());
}
-Qt::WindowFlags QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
+void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
{
if (QWindowsContext::verboseWindows)
qDebug() << '>' << __FUNCTION__ << this << window() << "\n from: "
@@ -1202,7 +1202,6 @@ Qt::WindowFlags QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
qDebug() << '<' << __FUNCTION__ << "\n returns: "
<< QWindowsWindow::debugWindowFlags(m_data.flags)
<< " geometry " << oldGeometry << "->" << newGeometry;
- return m_data.flags;
}
QWindowsWindow::WindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 4b1792859f..3b7666cf32 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -159,7 +159,7 @@ public:
virtual QPoint mapToGlobal(const QPoint &pos) const;
virtual QPoint mapFromGlobal(const QPoint &pos) const;
- virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ virtual void setWindowFlags(Qt::WindowFlags flags);
virtual Qt::WindowState setWindowState(Qt::WindowState state);
HWND handle() const { return m_data.hwnd; }
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.cpp b/src/plugins/platforms/xcb/qxcbclipboard.cpp
index f021ab8b4a..142a8dfcde 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbclipboard.cpp
@@ -300,6 +300,9 @@ void QXcbClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
m_timestamp[mode] = XCB_CURRENT_TIME;
}
+ if (connection()->time() == XCB_CURRENT_TIME)
+ connection()->setTime(connection()->getTimestamp());
+
if (data) {
newOwner = owner();
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 401739f7d5..ad9fb1d19c 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -864,6 +864,59 @@ void QXcbConnection::sendConnectionEvent(QXcbAtom::Atom a, uint id)
xcb_flush(xcb_connection());
}
+namespace
+{
+ class PropertyNotifyEvent {
+ public:
+ PropertyNotifyEvent(xcb_window_t win, xcb_atom_t property)
+ : window(win), type(XCB_PROPERTY_NOTIFY), atom(property) {}
+ xcb_window_t window;
+ int type;
+ xcb_atom_t atom;
+ bool checkEvent(xcb_generic_event_t *event) const {
+ if (!event)
+ return false;
+ if ((event->response_type & ~0x80) != type) {
+ return false;
+ } else {
+ xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event;
+ if ((pn->window == window) && (pn->atom == atom))
+ return true;
+ }
+ return false;
+ }
+ };
+}
+
+xcb_timestamp_t QXcbConnection::getTimestamp()
+{
+ // send a dummy event to myself to get the timestamp from X server.
+ xcb_window_t rootWindow = screens().at(primaryScreen())->root();
+ xcb_change_property(xcb_connection(), XCB_PROP_MODE_APPEND, rootWindow, atom(QXcbAtom::CLIP_TEMPORARY),
+ XCB_ATOM_INTEGER, 32, 0, NULL);
+
+ connection()->flush();
+ PropertyNotifyEvent checker(rootWindow, atom(QXcbAtom::CLIP_TEMPORARY));
+
+ xcb_generic_event_t *event = 0;
+ // lets keep this inside a loop to avoid a possible race condition, where
+ // reader thread has not yet had the time to acquire the mutex in order
+ // to add the new set of events to its event queue
+ while (true) {
+ connection()->sync();
+ if (event = checkEvent(checker))
+ break;
+ }
+
+ xcb_property_notify_event_t *pn = (xcb_property_notify_event_t *)event;
+ xcb_timestamp_t timestamp = pn->time;
+ free(event);
+
+ xcb_delete_property(xcb_connection(), rootWindow, atom(QXcbAtom::CLIP_TEMPORARY));
+
+ return timestamp;
+}
+
void QXcbConnection::processXcbEvents()
{
QXcbEventArray *eventqueue = m_reader->lock();
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 08dd304b3d..8a6c418788 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -319,7 +319,6 @@ public:
QByteArray atomName(xcb_atom_t atom);
const char *displayName() const { return m_displayName.constData(); }
-
xcb_connection_t *xcb_connection() const { return m_connection; }
const xcb_setup_t *setup() const { return m_setup; }
const xcb_format_t *formatForDepth(uint8_t depth) const;
@@ -380,6 +379,8 @@ public:
bool hasXRandr() const { return has_randr_extension; }
bool hasInputShape() const { return has_input_shape; }
+ xcb_timestamp_t getTimestamp();
+
private slots:
void processXcbEvents();
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index 1a2de82fd3..5d887cd06d 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -53,6 +53,7 @@
#include <qguiapplication.h>
#include <qrect.h>
#include <qpainter.h>
+#include <qtimer.h>
#include <qpa/qwindowsysteminterface.h>
@@ -140,8 +141,7 @@ QXcbDrag::QXcbDrag(QXcbConnection *c) : QXcbObject(c)
init();
heartbeat = -1;
-
- transaction_expiry_timer = -1;
+ cleanup_timer = -1;
}
QXcbDrag::~QXcbDrag()
@@ -510,17 +510,21 @@ void QXcbDrag::drop(const QMouseEvent *event)
if (w && (w->window()->windowType() == Qt::Desktop) /*&& !w->acceptDrops()*/)
w = 0;
-
Transaction t = {
connection()->time(),
current_target,
current_proxy_target,
(w ? w->window() : 0),
-// current_embedding_widget,
- currentDrag()
+// current_embeddig_widget,
+ currentDrag(),
+ QTime::currentTime()
};
transactions.append(t);
- restartDropExpiryTimer();
+
+ // timer is needed only for drops that came from other processes.
+ if (!t.targetWindow && cleanup_timer == -1) {
+ cleanup_timer = startTimer(XdndDropTransactionTimeout);
+ }
if (w) {
handleDrop(w->window(), &drop);
@@ -563,16 +567,6 @@ xcb_atom_t QXcbDrag::toXdndAction(Qt::DropAction a) const
}
}
-// timer used to discard old XdndDrop transactions
-enum { XdndDropTransactionTimeout = 5000 }; // 5 seconds
-
-void QXcbDrag::restartDropExpiryTimer()
-{
- if (transaction_expiry_timer != -1)
- killTimer(transaction_expiry_timer);
- transaction_expiry_timer = startTimer(XdndDropTransactionTimeout);
-}
-
int QXcbDrag::findTransactionByWindow(xcb_window_t window)
{
int at = -1;
@@ -771,8 +765,6 @@ void QXcbDrag::handle_xdnd_position(QWindow *w, const xcb_client_message_event_t
response.data.data32[3] = 0; // w, h
response.data.data32[4] = toXdndAction(qt_response.acceptedAction()); // action
-
-
if (answerRect.left() < 0)
answerRect.setLeft(0);
if (answerRect.right() > 4096)
@@ -1015,7 +1007,6 @@ void QXcbDrag::handleFinished(const xcb_client_message_event_t *event)
if (l[0]) {
int at = findTransactionByWindow(l[0]);
if (at != -1) {
- restartDropExpiryTimer();
Transaction t = transactions.takeAt(at);
// QDragManager *manager = QDragManager::self();
@@ -1044,12 +1035,13 @@ void QXcbDrag::handleFinished(const xcb_client_message_event_t *event)
// current_proxy_target = proxy_target;
// current_embedding_widget = embedding_widget;
// manager->object = currentObject;
+ } else {
+ qWarning("QXcbDrag::handleFinished - drop data has expired");
}
}
waiting_for_status = false;
}
-
void QXcbDrag::timerEvent(QTimerEvent* e)
{
if (e->timerId() == heartbeat && source_sameanswer.isNull()) {
@@ -1057,19 +1049,35 @@ void QXcbDrag::timerEvent(QTimerEvent* e)
QMouseEvent me(QEvent::MouseMove, pos, pos, pos, Qt::LeftButton,
QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
move(&me);
- } else if (e->timerId() == transaction_expiry_timer) {
+ } else if (e->timerId() == cleanup_timer) {
+ bool stopTimer = true;
for (int i = 0; i < transactions.count(); ++i) {
const Transaction &t = transactions.at(i);
if (t.targetWindow) {
- // dnd within the same process, don't delete these
+ // dnd within the same process, don't delete, these are taken care of
+ // in handleFinished()
continue;
}
- t.drag->deleteLater();
- transactions.removeAt(i--);
- }
+ QTime currentTime = QTime::currentTime();
+ int delta = t.time.msecsTo(currentTime);
+ if (delta > XdndDropTransactionTimeout) {
+ /* delete transactions which are older than XdndDropTransactionTimeout. It could mean
+ one of these:
+ - client has crashed and as a result we have never received XdndFinished
+ - showing dialog box on drop event where user's response takes more time than XdndDropTransactionTimeout (QTBUG-14493)
+ - dnd takes unusually long time to process data
+ */
+ t.drag->deleteLater();
+ transactions.removeAt(i--);
+ } else {
+ stopTimer = false;
+ }
- killTimer(transaction_expiry_timer);
- transaction_expiry_timer = -1;
+ }
+ if (stopTimer && cleanup_timer != -1) {
+ killTimer(cleanup_timer);
+ cleanup_timer = -1;
+ }
}
}
@@ -1123,7 +1131,6 @@ void QXcbDrag::handleSelectionRequest(const xcb_selection_request_event_t *event
QDrag *transactionDrag = 0;
if (at >= 0) {
- restartDropExpiryTimer();
transactionDrag = transactions.at(at).drag;
} else if (at == -2) {
transactionDrag = currentDrag();
diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h
index 99c1e2d78f..41d15505ce 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.h
+++ b/src/plugins/platforms/xcb/qxcbdrag.h
@@ -52,7 +52,7 @@
#include <qsharedpointer.h>
#include <qpointer.h>
#include <qvector.h>
-
+#include <qdatetime.h>
#include <qpixmap.h>
#include <qbackingstore.h>
@@ -146,6 +146,10 @@ private:
// timer used when target wants "continuous" move messages (eg. scroll)
int heartbeat;
+ // 10 minute timer used to discard old XdndDrop transactions
+ enum { XdndDropTransactionTimeout = 600000 };
+ int cleanup_timer;
+
QVector<xcb_atom_t> drag_types;
struct Transaction
@@ -156,6 +160,7 @@ private:
QWindow *targetWindow;
// QWidget *embedding_widget;
QDrag *drag;
+ QTime time;
};
QList<Transaction> transactions;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 64cb9afcc6..cefe1a7786 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -740,7 +740,7 @@ void QXcbWindow::setNetWmStates(NetWmStates states)
xcb_flush(xcb_connection());
}
-Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags)
+void QXcbWindow::setWindowFlags(Qt::WindowFlags flags)
{
Qt::WindowType type = static_cast<Qt::WindowType>(int(flags & Qt::WindowType_Mask));
@@ -763,8 +763,6 @@ Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags)
setTransparentForMouseEvents(flags & Qt::WindowTransparentForInput);
updateDoesNotAcceptFocus(flags & Qt::WindowDoesNotAcceptFocus);
-
- return flags;
}
void QXcbWindow::setMotifWindowFlags(Qt::WindowFlags flags)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index ab18b502be..e2f62401dc 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -81,7 +81,7 @@ public:
QMargins frameMargins() const;
void setVisible(bool visible);
- Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ void setWindowFlags(Qt::WindowFlags flags);
Qt::WindowState setWindowState(Qt::WindowState state);
WId winId() const;
void setParent(const QPlatformWindow *window);
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index 1321e83586..17fd1cf89e 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -42,6 +42,7 @@
#ifndef QCUPSPRINTERSUPPORT_H
#define QCUPSPRINTERSUPPORT_H
+#include <QtCore/qfeatures.h> // Some feature dependencies might define QT_NO_PRINTER
#ifndef QT_NO_PRINTER
#include <qpa/qplatformprintersupport.h>
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index dd385526d7..ea18f1edf6 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -135,7 +135,7 @@ QCUPSSupport::QCUPSSupport()
if (!isAvailable())
return;
- prnCount = _cupsGetDests(&printers);
+ qt_cups_num_printers = prnCount = _cupsGetDests(&printers);
for (int i = 0; i < prnCount; ++i) {
if (printers[i].is_default) {
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index 759a76de09..27351dee48 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -1174,16 +1174,6 @@ void QWin32PrintEnginePrivate::doReinit()
if (state == QPrinter::Active) {
reinit = true;
} else {
- if (!name.isEmpty()) {
- HANDLE hCheckPrinter;
- if (!OpenPrinter((LPWSTR)name.utf16(), (LPHANDLE)&hCheckPrinter, 0)) {
- initialize();
- return;
- } else {
- ClosePrinter(hCheckPrinter);
- hCheckPrinter = 0;
- }
- }
resetDC();
initDevRects();
reinit = false;
@@ -1306,12 +1296,9 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
case PPK_PrinterName:
d->name = value.toString();
- if (d->name.isEmpty()) {
+ if (d->name.isEmpty())
d->queryDefault();
- d->initialize();
- } else {
- d->doReinit();
- }
+ d->initialize();
break;
case PPK_Resolution:
diff --git a/src/sql/kernel/qsql.qdoc b/src/sql/kernel/qsql.qdoc
index 3354244c67..3b0e848af1 100644
--- a/src/sql/kernel/qsql.qdoc
+++ b/src/sql/kernel/qsql.qdoc
@@ -81,19 +81,15 @@
/*!
\enum QSql::NumericalPrecisionPolicy
- This enum type describes at which precision levels numercial values are read from
- a database.
-
- Some databases support numerical values with a precision that is not storable in a
- C++ basic data type. The default behavior is to bind these values as a QString.
- This enum can be used to override this behavior.
+ Numerical values in a database can have precisions greater than their corresponding
+ C++ types. This enum lists the policies for representing such values in the application.
\value LowPrecisionInt32 Force 32bit integer values. In case of floating point numbers,
the fractional part is silently discarded.
\value LowPrecisionInt64 Force 64bit integer values. In case of floating point numbers,
the fractional part is silently discarded.
- \value LowPrecisionDouble Force \c double values.
- \value HighPrecision The default behavior - try to preserve maximum precision.
+ \value LowPrecisionDouble Force \c double values. This is the default policy.
+ \value HighPrecision Strings will be used to preserve precision.
Note: The actual behaviour if an overflow occurs is driver specific. The Oracle database
just returns an error in this case.
diff --git a/src/sql/models/qsqltablemodel.h b/src/sql/models/qsqltablemodel.h
index 0b038e1d70..df1946fb9f 100644
--- a/src/sql/models/qsqltablemodel.h
+++ b/src/sql/models/qsqltablemodel.h
@@ -66,9 +66,6 @@ public:
explicit QSqlTableModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
virtual ~QSqlTableModel();
- virtual bool select();
- virtual bool selectRow(int row);
-
virtual void setTable(const QString &tableName);
QString tableName() const;
@@ -111,6 +108,9 @@ public:
virtual void revertRow(int row);
public Q_SLOTS:
+ virtual bool select();
+ virtual bool selectRow(int row);
+
bool submit();
void revert();
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc
index 008c0b271e..e7ee787d08 100644
--- a/src/testlib/doc/src/qttestlib-manual.qdoc
+++ b/src/testlib/doc/src/qttestlib-manual.qdoc
@@ -84,11 +84,6 @@
\li Custom types can easily be added to the test data and test output.
\endtable
- \note For higher-level GUI and application testing needs, please
- see the \l{Partner Directory} for Qt testing products provided by
- Nokia partners.
-
-
\section1 QTestLib API
All public methods are in the \l QTest namespace. In addition, the
@@ -835,6 +830,3 @@
for more information on these tools and a simple graphing example.
*/
-
-
-
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index fd8813ee88..566be9c039 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -193,9 +193,12 @@ static Symbols tokenize(const QByteArray &input, int lineNum = 1, TokenizeMode m
token = keywords[state].ident;
if (token == NOTOKEN) {
- // an error really
++data;
- continue;
+ // an error really, but let's ignore this input
+ // to not confuse moc later. However in pre-processor
+ // only mode let's continue.
+ if (!Preprocessor::preprocessOnly)
+ continue;
}
++column;
@@ -1198,8 +1201,18 @@ void Preprocessor::parseDefineArguments(Macro *m)
t = next();
if (t == PP_RPAREN)
break;
- if (t != PP_COMMA)
- error("Unexpected character in macro argument list.");
+ if (t == PP_COMMA)
+ continue;
+ if (lexem() == "...") {
+ //GCC extension: #define FOO(x, y...) x(y)
+ // The last argument was already parsed. Just mark the macro as variadic.
+ m->isVariadic = true;
+ while (test(PP_WHITESPACE));
+ if (!test(PP_RPAREN))
+ error("missing ')' in macro argument list");
+ break;
+ }
+ error("Unexpected character in macro argument list.");
}
m->arguments = arguments;
while (test(PP_WHITESPACE));
diff --git a/src/tools/qdoc/location.cpp b/src/tools/qdoc/location.cpp
index 942fc0f70c..ceb5709aae 100644
--- a/src/tools/qdoc/location.cpp
+++ b/src/tools/qdoc/location.cpp
@@ -360,7 +360,9 @@ void Location::emitMessage(MessageType type,
result += "\n[" + details + QLatin1Char(']');
result.replace("\n", "\n ");
if (type == Error)
- result.prepend(tr("error: "));
+ result.prepend(tr(": error: "));
+ else if (type == Warning)
+ result.prepend(tr(": warning: "));
result.prepend(toString());
fprintf(stderr, "%s\n", result.toLatin1().data());
fflush(stderr);
@@ -397,7 +399,6 @@ QString Location::toString() const
}
str += top();
}
- str += QLatin1String(": ");
return str;
}
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 02cd04ca48..e35697399d 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -456,7 +456,7 @@ QT_CLASS_LIB(QAxAggregated, ActiveQt, qaxaggregated.h)
QT_CLASS_LIB(QAxBindable, ActiveQt, qaxbindable.h)
QT_CLASS_LIB(QAxFactory, ActiveQt, qaxfactory.h)
QT_CLASS_LIB(QAxClass, ActiveQt, qaxfactory.h)
-QT_CLASS_LIB(QGraphicsWebView, QtWebKit, qgraphicswebview.h)
+QT_CLASS_LIB(QGraphicsWebView, QtWebKitWidgets, qgraphicswebview.h)
QT_CLASS_LIB(QWebDatabase, QtWebKit, qwebdatabase.h)
QT_CLASS_LIB(QWebElement, QtWebKit, qwebelement.h)
QT_CLASS_LIB(QWebElementCollection, QtWebKit, qwebelement.h)
@@ -470,7 +470,7 @@ QT_CLASS_LIB(QWebPage, QtWebKit, qwebpage.h)
QT_CLASS_LIB(QWebPluginFactory, QtWebKit, qwebpluginfactory.h)
QT_CLASS_LIB(QWebSecurityOrigin, QtWebKit, qwebsecurityorigin.h)
QT_CLASS_LIB(QWebSettings, QtWebKit, qwebsettings.h)
-QT_CLASS_LIB(QWebView, QtWebKit, qwebview.h)
+QT_CLASS_LIB(QWebView, QtWebKitWidgets, qwebview.h)
QT_CLASS_LIB(QAudio, QtMultimedia, qaudio.h)
QT_CLASS_LIB(QAudioDeviceInfo, QtMultimedia, qaudiodeviceinfo.h)
QT_CLASS_LIB(QAbstractAudioDeviceInfo, QtMultimedia, qaudioengine.h)
diff --git a/src/widgets/dialogs/qfiledialog.ui b/src/widgets/dialogs/qfiledialog.ui
index f7fe68fbbf..6545fc05d4 100644
--- a/src/widgets/dialogs/qfiledialog.ui
+++ b/src/widgets/dialogs/qfiledialog.ui
@@ -1,4 +1,5 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<comment>*********************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
@@ -40,8 +41,8 @@
**
*********************************************************************</comment>
<class>QFileDialog</class>
- <widget class="QDialog" name="QFileDialog" >
- <property name="geometry" >
+ <widget class="QDialog" name="QFileDialog">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -49,28 +50,28 @@
<height>316</height>
</rect>
</property>
- <property name="sizeGripEnabled" >
+ <property name="sizeGripEnabled">
<bool>true</bool>
</property>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="lookInLabel" >
- <property name="text" >
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="lookInLabel">
+ <property name="text">
<string>Look in:</string>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <layout class="QHBoxLayout" >
+ <item row="0" column="1" colspan="2">
+ <layout class="QHBoxLayout">
<item>
- <widget class="QFileDialogComboBox" name="lookInCombo" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Ignored" >
+ <widget class="QFileDialogComboBox" name="lookInCombo">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize" >
+ <property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
@@ -79,8 +80,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="backButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="backButton">
+ <property name="toolTip">
<string>Back</string>
</property>
<property name="accessibleName">
@@ -92,8 +93,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="forwardButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="forwardButton">
+ <property name="toolTip">
<string>Forward</string>
</property>
<property name="accessibleName">
@@ -105,8 +106,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="toParentButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="toParentButton">
+ <property name="toolTip">
<string>Parent Directory</string>
</property>
<property name="accessibleName">
@@ -118,8 +119,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="newFolderButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="newFolderButton">
+ <property name="toolTip">
<string>Create New Folder</string>
</property>
<property name="accessibleName">
@@ -131,8 +132,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="listModeButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="listModeButton">
+ <property name="toolTip">
<string>List View</string>
</property>
<property name="accessibleName">
@@ -144,8 +145,8 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="detailModeButton" >
- <property name="toolTip" >
+ <widget class="QToolButton" name="detailModeButton">
+ <property name="toolTip">
<string>Detail View</string>
</property>
<property name="accessibleName">
@@ -158,87 +159,102 @@
</item>
</layout>
</item>
- <item row="1" column="0" colspan="3" >
- <widget class="QSplitter" name="splitter" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <item row="1" column="0" colspan="3">
+ <widget class="QSplitter" name="splitter">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QSidebar" name="sidebar" />
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
+ <widget class="QSidebar" name="sidebar">
+ <property name="accessibleName">
+ <string>Sidebar</string>
+ </property>
+ <property name="accessibleDescription">
+ <string>List of places and bookmarks</string>
+ </property>
+ </widget>
+ <widget class="QFrame" name="frame">
+ <property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>0</number>
</property>
- <property name="leftMargin" >
+ <property name="leftMargin">
<number>0</number>
</property>
- <property name="topMargin" >
+ <property name="topMargin">
<number>0</number>
</property>
- <property name="rightMargin" >
+ <property name="rightMargin">
<number>0</number>
</property>
- <property name="bottomMargin" >
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
- <widget class="QStackedWidget" name="stackedWidget" >
- <property name="currentIndex" >
+ <widget class="QStackedWidget" name="stackedWidget">
+ <property name="currentIndex">
<number>0</number>
</property>
- <widget class="QWidget" name="page" >
- <layout class="QVBoxLayout" >
- <property name="spacing" >
+ <widget class="QWidget" name="page">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>0</number>
</property>
- <property name="leftMargin" >
+ <property name="leftMargin">
<number>0</number>
</property>
- <property name="topMargin" >
+ <property name="topMargin">
<number>0</number>
</property>
- <property name="rightMargin" >
+ <property name="rightMargin">
<number>0</number>
</property>
- <property name="bottomMargin" >
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
- <widget class="QFileDialogListView" name="listView" />
+ <widget class="QFileDialogListView" name="listView">
+ <property name="accessibleName">
+ <string>Files</string>
+ </property>
+ </widget>
</item>
</layout>
</widget>
- <widget class="QWidget" name="page_2" >
- <layout class="QVBoxLayout" >
- <property name="spacing" >
+ <widget class="QWidget" name="page_2">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>0</number>
</property>
- <property name="leftMargin" >
+ <property name="leftMargin">
<number>0</number>
</property>
- <property name="topMargin" >
+ <property name="topMargin">
<number>0</number>
</property>
- <property name="rightMargin" >
+ <property name="rightMargin">
<number>0</number>
</property>
- <property name="bottomMargin" >
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
- <widget class="QFileDialogTreeView" name="treeView" />
+ <widget class="QFileDialogTreeView" name="treeView">
+ <property name="accessibleName">
+ <string>Files</string>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -248,15 +264,15 @@
</widget>
</widget>
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="fileNameLabel" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="fileNameLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize" >
+ <property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
@@ -264,43 +280,43 @@
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QFileDialogLineEdit" name="fileNameEdit" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <item row="2" column="1">
+ <widget class="QFileDialogLineEdit" name="fileNameEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
- <item rowspan="2" row="2" column="2" >
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
+ <item row="2" column="2" rowspan="2">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="fileTypeLabel" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <item row="3" column="0">
+ <widget class="QLabel" name="fileTypeLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text" >
+ <property name="text">
<string>Files of type:</string>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="fileTypeCombo" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <item row="3" column="1">
+ <widget class="QComboBox" name="fileTypeCombo">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -345,11 +361,11 @@
<tabstop>listModeButton</tabstop>
<tabstop>detailModeButton</tabstop>
<tabstop>sidebar</tabstop>
+ <tabstop>treeView</tabstop>
<tabstop>listView</tabstop>
<tabstop>fileNameEdit</tabstop>
- <tabstop>fileTypeCombo</tabstop>
<tabstop>buttonBox</tabstop>
- <tabstop>treeView</tabstop>
+ <tabstop>fileTypeCombo</tabstop>
</tabstops>
<resources/>
<connections/>
diff --git a/src/widgets/doc/src/modelview.qdoc b/src/widgets/doc/src/modelview.qdoc
index c133005b54..304af0058d 100644
--- a/src/widgets/doc/src/modelview.qdoc
+++ b/src/widgets/doc/src/modelview.qdoc
@@ -100,8 +100,8 @@
Let's have a closer look at a standard table widget. A table widget is a 2D
array of the data elements that the user can change. The table widget can be
integrated into a program flow by reading and writing the data elements that
- the table widget provides.
- This method is very intuitive and useful in many applications, but displaying
+ the table widget provides.
+ This method is very intuitive and useful in many applications, but displaying
and editing a database table with a standard table widget can be problematic.
Two copies of the data have to be coordinated: one outside the
widget; one inside the widget. The developer is responsible for
@@ -180,12 +180,12 @@
\section1 2. A Simple Model/View Application
- If you want to develop a model/view application, where should you start?
- We recommend starting with a simple example and extending it step-by-step.
- This makes understanding the architecture a lot easier. Trying to understand
- the model/view architecture in detail before invoking the IDE has proven
- to be less convenient for many developers. It is substantially easier to
- start with a simple model/view application that has demo data. Give it a
+ If you want to develop a model/view application, where should you start?
+ We recommend starting with a simple example and extending it step-by-step.
+ This makes understanding the architecture a lot easier. Trying to understand
+ the model/view architecture in detail before invoking the IDE has proven
+ to be less convenient for many developers. It is substantially easier to
+ start with a simple model/view application that has demo data. Give it a
try! Simply replace the data in the examples below with your own.
Below are 7 very simple and independent applications that show different
@@ -202,7 +202,7 @@
We have the usual \l {modelview-part2-main-cpp.html}{main()} function:
- Here is the interesting part: We create an instance of MyModel and use
+ Here is the interesting part: We create an instance of MyModel and use
\l{QTableView::setModel()}{tableView.setModel(&myModel);} to pass a
pointer of it to \l{QTableView}{tableView}. \l{QTableView}{tableView}
will invoke the methods of the pointer it has received to find out two
@@ -606,12 +606,9 @@
\e{Open Source Press}, ISBN 3-937514-12-0.
\li \b{Foundations of Qt Development} / Johan Thelin, \e{Apress}, ISBN 1-59059-831-8.
\li \b{Advanced Qt Programming} / Mark Summerfield, \e{Prentice Hall}, ISBN 0-321-63590-6.
- This book covers Model/View programming on more than 150 pages.
+ This book covers Model/View programming on more than 150 pages.
\endlist
- More information about these books is available on the
- \l{Books about Qt Programming}{Qt Web site}.
-
The following list provides an overview of example programs contained in the first three
books listed above. Some of them make very good templates for developing similar
applications.
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index b30bdbbc6b..8cb6d70d15 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -1108,14 +1108,11 @@ void QAbstractItemView::reset()
if (d->selectionModel)
d->selectionModel->reset();
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(this)->table2Interface()->modelReset();
- QAccessibleEvent event(this, QAccessible::TableModelChanged);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(this, QAccessibleTableModelChangeEvent::ModelReset);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
/*!
@@ -3243,12 +3240,22 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
// otherwise the items will be update later anyway
update(topLeft);
}
- return;
+ } else {
+ d->updateEditorData(topLeft, bottomRight);
+ if (isVisible() && !d->delayedPendingLayout)
+ d->viewport->update();
}
- d->updateEditorData(topLeft, bottomRight);
- if (!isVisible() || d->delayedPendingLayout)
- return; // no need to update
- d->viewport->update();
+
+#ifndef QT_NO_ACCESSIBILITY
+ if (QAccessible::isActive()) {
+ QAccessibleTableModelChangeEvent accessibleEvent(this, QAccessibleTableModelChangeEvent::DataChanged);
+ accessibleEvent.setFirstRow(topLeft.row());
+ accessibleEvent.setFirstColumn(topLeft.column());
+ accessibleEvent.setLastRow(bottomRight.row());
+ accessibleEvent.setLastColumn(bottomRight.column());
+ QAccessible::updateAccessibility(&accessibleEvent);
+ }
+#endif
}
/*!
@@ -3343,14 +3350,13 @@ void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int star
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsRemoved(index, start, end);
- QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::RowsRemoved);
+ accessibleEvent.setFirstRow(start);
+ accessibleEvent.setLastRow(end);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
/*!
@@ -3424,14 +3430,13 @@ void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int s
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsRemoved(index, start, end);
- QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ColumnsRemoved);
+ accessibleEvent.setFirstColumn(start);
+ accessibleEvent.setLastColumn(end);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
@@ -3447,15 +3452,14 @@ void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int sta
Q_UNUSED(end)
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsInserted(index, start, end);
- QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::RowsInserted);
+ accessibleEvent.setFirstRow(start);
+ accessibleEvent.setLastRow(end);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
/*!
@@ -3473,14 +3477,13 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int
if (q->isVisible())
q->updateEditorGeometries();
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsInserted(index, start, end);
- QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ColumnsInserted);
+ accessibleEvent.setFirstColumn(start);
+ accessibleEvent.setLastColumn(end);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
/*!
@@ -3501,15 +3504,12 @@ void QAbstractItemViewPrivate::_q_layoutChanged()
{
doDelayedItemsLayout();
#ifndef QT_NO_ACCESSIBILITY
-#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
- QAccessible::queryAccessibleInterface(q)->table2Interface()->modelReset();
- QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
- QAccessible::updateAccessibility(&event);
+ QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ModelReset);
+ QAccessible::updateAccessibility(&accessibleEvent);
}
#endif
-#endif
}
void QAbstractItemViewPrivate::_q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 097802c909..ff703c9d8a 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE
that can be taken for views that are intended to display items with equal sizes
is to set the \l uniformItemSizes property to true.
- \sa {View Classes}, QTreeView, QTableView, QListWidget
+ \sa {View Classes}, {Item Views Puzzle Example}, QTreeView, QTableView, QListWidget
*/
/*!
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 6b04c18b9d..5dc68e47e0 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -77,6 +77,7 @@ extern QWidget *qt_button_down;
extern QWidget *qt_popup_down;
extern bool qt_replay_popup_mouse_event;
int openPopupCount = 0;
+extern QPointer<QWidget> qt_last_mouse_receiver;
void QApplicationPrivate::createEventDispatcher()
{
@@ -249,6 +250,12 @@ void QApplicationPrivate::openPopup(QWidget *popup)
QApplication::sendEvent(fw, &e);
}
}
+
+ // Dispatch leave for last mouse receiver to update undermouse states
+ if (qt_last_mouse_receiver && !QWidget::mouseGrabber()) {
+ QApplicationPrivate::dispatchEnterLeave(0, qt_last_mouse_receiver.data());
+ qt_last_mouse_receiver = 0;
+ }
}
void QApplicationPrivate::initializeMultitouch_sys()
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 362a8f4e55..29083b0670 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7807,7 +7807,7 @@ bool QWidget::event(QEvent *event)
{
Q_D(QWidget);
- // ignore mouse events when disabled
+ // ignore mouse and key events when disabled
if (!isEnabled()) {
switch(event->type()) {
case QEvent::TabletPress:
@@ -7822,6 +7822,8 @@ bool QWidget::event(QEvent *event)
case QEvent::TouchEnd:
case QEvent::TouchCancel:
case QEvent::ContextMenu:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
#endif
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 85d46bb0a3..5c34caef6b 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -712,6 +712,24 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut
#ifndef QT_NO_ITEMVIEWS
+static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth)
+{
+ qreal height = 0;
+ qreal widthUsed = 0;
+ textLayout.beginLayout();
+ while (true) {
+ QTextLine line = textLayout.createLine();
+ if (!line.isValid())
+ break;
+ line.setLineWidth(lineWidth);
+ line.setPosition(QPointF(0, height));
+ height += line.height();
+ widthUsed = qMax(widthUsed, line.naturalTextWidth());
+ }
+ textLayout.endLayout();
+ return QSizeF(widthUsed, height);
+}
+
QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int role) const
{
const QWidget *widget = option->widget;
@@ -725,10 +743,8 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int
if (option->features & QStyleOptionViewItem::HasDisplay) {
QTextOption textOption;
textOption.setWrapMode(QTextOption::WordWrap);
- QTextLayout textLayout;
+ QTextLayout textLayout(option->text, option->font);
textLayout.setTextOption(textOption);
- textLayout.setFont(option->font);
- textLayout.setText(option->text);
const bool wrapText = option->features & QStyleOptionViewItem::WrapText;
const int textMargin = proxyStyle->pixelMetric(QStyle::PM_FocusFrameHMargin, option, widget) + 1;
QRect bounds = option->rect;
@@ -745,20 +761,9 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int
break;
}
- qreal height = 0, widthUsed = 0;
- textLayout.beginLayout();
- while (true) {
- QTextLine line = textLayout.createLine();
- if (!line.isValid())
- break;
- line.setLineWidth(bounds.width());
- line.setPosition(QPointF(0, height));
- height += line.height();
- widthUsed = qMax(widthUsed, line.naturalTextWidth());
- }
- textLayout.endLayout();
- const QSize size(qCeil(widthUsed), qCeil(height));
- return QSize(size.width() + 2 * textMargin, size.height());
+ const int lineWidth = bounds.width();
+ const QSizeF size = viewItemTextLayout(textLayout, lineWidth);
+ return QSize(qCeil(size.width()) + 2 * textMargin, qCeil(size.height()));
}
break;
case Qt::DecorationRole:
@@ -773,25 +778,6 @@ QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItem *option, int
return QSize(0, 0);
}
-static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth)
-{
- qreal height = 0;
- qreal widthUsed = 0;
- textLayout.beginLayout();
- while (true) {
- QTextLine line = textLayout.createLine();
- if (!line.isValid())
- break;
- line.setLineWidth(lineWidth);
- line.setPosition(QPointF(0, height));
- height += line.height();
- widthUsed = qMax(widthUsed, line.naturalTextWidth());
- }
- textLayout.endLayout();
- return QSizeF(widthUsed, height);
-}
-
-
void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const
{
const QWidget *widget = option->widget;
@@ -803,10 +789,8 @@ void QCommonStylePrivate::viewItemDrawText(QPainter *p, const QStyleOptionViewIt
textOption.setWrapMode(wrapText ? QTextOption::WordWrap : QTextOption::ManualWrap);
textOption.setTextDirection(option->direction);
textOption.setAlignment(QStyle::visualAlignment(option->direction, option->displayAlignment));
- QTextLayout textLayout;
+ QTextLayout textLayout(option->text, option->font);
textLayout.setTextOption(textOption);
- textLayout.setFont(option->font);
- textLayout.setText(option->text);
viewItemTextLayout(textLayout, textRect.width());
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 552e2354c5..9bcf45e928 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -1935,7 +1935,6 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
gint interiorFocus = true;
d->gtk_widget_style_get(gtkToggleButton, "interior-focus", &interiorFocus, NULL);
- GtkStyle *gtkToggleButtonStyle = gtkToggleButtonStyle;
int xt = interiorFocus ? gtkToggleButtonStyle->xthickness : 0;
int yt = interiorFocus ? gtkToggleButtonStyle->ythickness : 0;
if (focus && ((option->state & State_KeyboardFocusChange) || styleHint(SH_UnderlineShortcut, option, widget)))
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 3376c3cd52..ecb3e7f222 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1836,6 +1836,7 @@ void QMacStylePrivate::animate()
}
if (!scrollBars.isEmpty()) {
int i = 0;
+ const qint64 dt = QDateTime::currentMSecsSinceEpoch();
while (i < scrollBars.size()) {
QWidget *maybeScroll = scrollBars.at(i);
if (!maybeScroll) {
@@ -1843,9 +1844,8 @@ void QMacStylePrivate::animate()
} else {
if (QScrollBar *sb = qobject_cast<QScrollBar *>(maybeScroll)) {
const OverlayScrollBarInfo& info = scrollBarInfos[sb];
- const QDateTime dt = QDateTime::currentDateTime();
- const qreal elapsed = qMax(info.lastHovered.msecsTo(dt),
- info.lastUpdate.msecsTo(dt));
+ const qreal elapsed = qMax(dt - info.lastHovered,
+ dt - info.lastUpdate);
const CGFloat opacity = 1.0 - qMax(0.0, (elapsed - ScrollBarFadeOutDelay) /
ScrollBarFadeOutDuration);
if ((opacity > 0.0 || !info.cleared) && (elapsed > ScrollBarFadeOutDelay)) {
@@ -1888,7 +1888,8 @@ bool QMacStyle::eventFilter(QObject *o, QEvent *e)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7 &&
[NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay && scrollArea) {
QMacStylePrivate::OverlayScrollBarInfo& info = d->scrollBarInfos[sb];
- const qreal elapsed = info.lastUpdate.msecsTo(QDateTime::currentDateTime());
+ const qint64 dt = QDateTime::currentMSecsSinceEpoch();
+ const qreal elapsed = dt - info.lastUpdate;
const CGFloat opacity = 1.0 - qMax(0.0, (elapsed - QMacStylePrivate::ScrollBarFadeOutDelay)
/ QMacStylePrivate::ScrollBarFadeOutDuration);
switch (e->type()) {
@@ -1897,8 +1898,8 @@ bool QMacStyle::eventFilter(QObject *o, QEvent *e)
// the fade out is stopped and it's set to 100% opaque
if (opacity > 0.0) {
info.hovered = true;
- info.lastUpdate = QDateTime::currentDateTime();
- info.lastHovered = QDateTime::currentDateTime();
+ info.lastUpdate = dt;
+ info.lastHovered = info.lastUpdate;
sb->update();
break;
}
@@ -5113,6 +5114,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ const qint64 dt = QDateTime::currentMSecsSinceEpoch();
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7 &&
[NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay &&
scrollBarsScrollArea(qobject_cast<const QScrollBar *>(widget)) &&
@@ -5127,7 +5129,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
info.lastMinimum = slider->minimum;
info.lastSize = slider->rect.size();
info.lastMaximum = slider->maximum;
- info.lastUpdate = QDateTime::currentDateTime();
+ info.lastUpdate = dt;
showSiblings = true;
}
@@ -5139,18 +5141,18 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
d->scrollBarInfos.value(sibling).lastUpdate);
info.cleared = false;
if (d->scrollBarInfos.value(sibling).hovered)
- info.lastUpdate = QDateTime::currentDateTime();
+ info.lastUpdate = dt;
}
- qreal elapsed = info.lastHovered.msecsTo(QDateTime::currentDateTime());
+ qreal elapsed = dt - info.lastHovered;
CGFloat opacity = 1.0 - qMax(0.0,
(elapsed - QMacStylePrivate::ScrollBarFadeOutDelay) /
QMacStylePrivate::ScrollBarFadeOutDuration);
const bool isHorizontal = slider->orientation == Qt::Horizontal;
if (info.hovered) {
- info.lastHovered = QDateTime::currentDateTime();
- info.lastUpdate = QDateTime::currentDateTime();
+ info.lastHovered = dt;
+ info.lastUpdate = dt;
opacity = 1.0;
// if the current scroll bar is hovered, none of the others might fade out
Q_FOREACH (const QScrollBar *sibling, siblings) {
@@ -5206,7 +5208,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
// afterwards we draw the knob, since we cannot drow the know w/o the track,
// we simulate a scrollbar with a knob from 0.0 to 1.0
- elapsed = info.lastUpdate.msecsTo(QDateTime::currentDateTime());
+ elapsed = dt - info.lastUpdate;
opacity = 1.0 - qMax(0.0, (elapsed - QMacStylePrivate::ScrollBarFadeOutDelay) /
QMacStylePrivate::ScrollBarFadeOutDuration);
info.cleared = opacity <= 0.0;
diff --git a/src/widgets/styles/qmacstyle_mac_p.h b/src/widgets/styles/qmacstyle_mac_p.h
index 2c129aa49d..ac482b8fc7 100644
--- a/src/widgets/styles/qmacstyle_mac_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p.h
@@ -215,18 +215,18 @@ public:
: lastValue(-1),
lastMinimum(-1),
lastMaximum(-1),
- lastUpdate(QDateTime::currentDateTime()),
+ lastUpdate(QDateTime::currentMSecsSinceEpoch()),
hovered(false),
- lastHovered(QDateTime::fromTime_t(0)),
+ lastHovered(0),
cleared(false)
{}
int lastValue;
int lastMinimum;
int lastMaximum;
QSize lastSize;
- QDateTime lastUpdate;
+ qint64 lastUpdate;
bool hovered;
- QDateTime lastHovered;
+ qint64 lastHovered;
bool cleared;
};
mutable QMap<const QWidget*, OverlayScrollBarInfo> scrollBarInfos;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 98bcf7d6f2..870e25b241 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -2007,10 +2007,13 @@ void QComboBoxPrivate::setCurrentIndex(const QModelIndex &mi)
/*!
\property QComboBox::currentText
- \brief the text of the current item
+ \brief the current text
- By default, for an empty combo box or a combo box in which no current
- item is set, this property contains an empty string.
+ If the combo box is editable, the current text is the value displayed
+ by the line edit. Otherwise, it is the value of the current item or
+ an empty string if the combo box is empty or no current item is set.
+
+ \sa editable
*/
QString QComboBox::currentText() const
{
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index cba4271ba0..12f957412f 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -1052,7 +1052,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
}
}
- if (unplug && floating && nativeDeco)
+ if (floating && nativeDeco)
if (const QWindow *window = q->windowHandle())
if (QPlatformWindow *platformWindow = window->handle())
platformWindow->setFrameStrutEventsEnabled(true);
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 9571502552..3217fa3cfd 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -59,9 +59,7 @@ expect_pass(test_dependent_modules)
expect_fail(test_add_resource_options)
expect_fail(test_wrap_cpp_options)
expect_pass("test(needsquoting)dirname")
-if (NOT WIN32)
- expect_pass(test_platform_defs_include)
-endif()
+expect_pass(test_platform_defs_include)
expect_pass(test_qtmainwin_library)
# If QtDBus has been installed then run the tests for its macros.
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index f6542d9fd3..03b42a2cbb 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -16,6 +16,7 @@ SUBDIRS=\
qipaddress \
qnodebug \
qprocess \
+ qprocess-noapplication \
qprocessenvironment \
qresourceengine \
qsettings \
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 19ce2f2c7a..e0f479524f 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -48,6 +48,8 @@
#include <QtGui/QPainter>
#include <QtGui/QPen>
+#include "../../../qtest-config.h"
+
Q_DECLARE_METATYPE(QBitArray)
Q_DECLARE_METATYPE(qint64)
@@ -78,8 +80,10 @@ private slots:
void stream_QByteArray_data();
void stream_QByteArray();
+#ifndef QTEST_NO_CURSOR
void stream_QCursor_data();
void stream_QCursor();
+#endif
void stream_QDate_data();
void stream_QDate();
@@ -193,7 +197,9 @@ private:
void writeQBrush(QDataStream *s);
void writeQColor(QDataStream *s);
void writeQByteArray(QDataStream *s);
+#ifndef QTEST_NO_CURSOR
void writeQCursor(QDataStream *s);
+#endif
void writeQWaitCursor(QDataStream *s);
void writeQDate(QDataStream *s);
void writeQTime(QDataStream *s);
@@ -220,7 +226,9 @@ private:
void readQBrush(QDataStream *s);
void readQColor(QDataStream *s);
void readQByteArray(QDataStream *s);
+#ifndef QTEST_NO_CURSOR
void readQCursor(QDataStream *s);
+#endif
void readQDate(QDataStream *s);
void readQTime(QDataStream *s);
void readQDateTime(QDataStream *s);
@@ -999,7 +1007,7 @@ void tst_QDataStream::readQByteArray(QDataStream *s)
}
// ************************************
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
static QCursor qCursorData(int index)
{
switch (index) {
@@ -1018,31 +1026,31 @@ static QCursor qCursorData(int index)
}
#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::stream_QCursor_data()
{
-#ifndef QT_NO_CURSOR
stream_data(9);
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::stream_QCursor()
{
-#ifndef QT_NO_CURSOR
STREAM_IMPL(QCursor);
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::writeQCursor(QDataStream *s)
{
-#ifndef QT_NO_CURSOR
QCursor d5(qCursorData(dataIndex(QTest::currentDataTag())));
*s << d5;
-#endif
}
+#endif
+#ifndef QTEST_NO_CURSOR
void tst_QDataStream::readQCursor(QDataStream *s)
{
-#ifndef QT_NO_CURSOR
QCursor test(qCursorData(dataIndex(QTest::currentDataTag())));
QCursor d5;
*s >> d5;
@@ -1061,8 +1069,8 @@ void tst_QDataStream::readQCursor(QDataStream *s)
QPixmap expected = *(test.mask());
QCOMPARE(actual, expected);
}
-#endif
}
+#endif
// ************************************
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index fb2a223559..0dddf6ca03 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -131,9 +131,11 @@ private slots:
void readAll_data();
void readAll();
void readAllBuffer();
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void readAllStdin();
void readLineStdin();
void readLineStdin_lineByLine();
+#endif
void text();
void missingEndOfLine();
void readBlock();
@@ -166,7 +168,9 @@ private slots:
#endif
void flush();
void bufferedRead();
+#ifdef Q_OS_UNIX
void isSequential();
+#endif
void encodeName();
void truncate();
void seekToPos();
@@ -211,8 +215,10 @@ private slots:
void mapOpenMode_data();
void mapOpenMode();
+#ifndef Q_OS_WINCE
void openStandardStreamsFileDescriptors();
void openStandardStreamsBufferedStreams();
+#endif
void resize_data();
void resize();
@@ -839,14 +845,9 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void tst_QFile::readAllStdin()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE");
-#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS");
-#else
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
@@ -863,17 +864,10 @@ void tst_QFile::readAllStdin()
process.closeWriteChannel();
process.waitForFinished();
QCOMPARE(process.readAll().size(), lotsOfData.size() * 5);
-#endif
}
void tst_QFile::readLineStdin()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE");
-#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS");
-#else
QByteArray lotsOfData(1024, '@'); // 10 megs
for (int i = 0; i < lotsOfData.size(); ++i) {
@@ -906,17 +900,10 @@ void tst_QFile::readLineStdin()
QCOMPARE(char(array[i]), char('0' + i % 32));
}
}
-#endif
}
void tst_QFile::readLineStdin_lineByLine()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE");
-#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS");
-#else
for (int i = 0; i < 2; ++i) {
QProcess process;
process.start(QString("stdinprocess/stdinprocess line %1").arg(i), QIODevice::Text | QIODevice::ReadWrite);
@@ -934,8 +921,8 @@ void tst_QFile::readLineStdin_lineByLine()
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
}
-#endif
}
+#endif
void tst_QFile::text()
{
@@ -1596,15 +1583,14 @@ void tst_QFile::bufferedRead()
fclose(stdFile);
}
+#ifdef Q_OS_UNIX
void tst_QFile::isSequential()
{
-#ifndef Q_OS_UNIX
- QSKIP("Unix only test.");
-#endif
QFile zero("/dev/null");
QVERIFY(zero.open(QFile::ReadOnly));
QVERIFY(zero.isSequential());
}
+#endif
void tst_QFile::encodeName()
{
@@ -3093,14 +3079,12 @@ protected:
bool MessageHandler::ok = true;
QtMessageHandler MessageHandler::oldMessageHandler = 0;
-void tst_QFile::openStandardStreamsFileDescriptors()
-{
-#ifdef Q_OS_WINCE
//allthough Windows CE (not mobile!) has functions that allow redirecting
//the standard file descriptors to a file (see SetStdioPathW/GetStdioPathW)
//it does not have functions to simply open them like below .
- QSKIP("Opening standard streams on Windows CE via descriptor not implemented");
-#endif
+#ifndef Q_OS_WINCE
+void tst_QFile::openStandardStreamsFileDescriptors()
+{
// Check that QIODevice::seek() isn't called when opening a sequential device (QFile).
MessageHandler msgHandler;
@@ -3131,9 +3115,6 @@ void tst_QFile::openStandardStreamsFileDescriptors()
void tst_QFile::openStandardStreamsBufferedStreams()
{
-#ifdef Q_OS_WINCE
- QSKIP("Not tested on Windows CE.");
-#endif
// Check that QIODevice::seek() isn't called when opening a sequential device (QFile).
MessageHandler msgHandler;
@@ -3161,6 +3142,7 @@ void tst_QFile::openStandardStreamsBufferedStreams()
QVERIFY(msgHandler.testPassed());
}
+#endif
void tst_QFile::writeNothing()
{
diff --git a/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro
new file mode 100644
index 0000000000..2f409ebdbc
--- /dev/null
+++ b/tests/auto/corelib/io/qprocess-noapplication/qprocess-noapplication.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+CONFIG += parallel_test
+CONFIG -= app_bundle debug_and_release_target
+QT = core testlib
+SOURCES = tst_qprocessnoapplication.cpp
diff --git a/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp b/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp
new file mode 100644
index 0000000000..33146cafd1
--- /dev/null
+++ b/tests/auto/corelib/io/qprocess-noapplication/tst_qprocessnoapplication.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Intel Corporation.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QProcess>
+#include <QtCore/QThread>
+#include <QtTest>
+
+class tst_QProcessNoApplication : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initializationDeadlock();
+};
+
+void tst_QProcessNoApplication::initializationDeadlock()
+{
+ // see QTBUG-27260
+ // QProcess on Unix uses (or used to, at the time of the writing of this test)
+ // a global class called QProcessManager.
+ // This class is instantiated (or was) only in the main thread, which meant that
+ // blocking the main thread while waiting for QProcess could mean a deadlock.
+
+ struct MyThread : public QThread
+ {
+ void run()
+ {
+ // what we execute does not matter, as long as we try to
+ // and that the process exits
+ QProcess::execute("true");
+ }
+ };
+
+ static char argv0[] = "tst_QProcessNoApplication";
+ char *argv[] = { argv0, 0 };
+ int argc = 1;
+ QCoreApplication app(argc, argv);
+ MyThread thread;
+ thread.start();
+ QVERIFY(thread.wait(10000));
+}
+
+QTEST_APPLESS_MAIN(tst_QProcessNoApplication)
+
+#include "tst_qprocessnoapplication.moc"
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 5e3735ce3d..f31d92751d 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -233,7 +233,7 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt
void tst_QClipboard::copy_exit_paste()
{
#ifndef QT_NO_PROCESS
-#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
+#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_QNX)
QSKIP("This test does not make sense on X11 and embedded, copied data disappears from the clipboard when the application exits ");
// ### It's still possible to test copy/paste - just keep the apps running
#endif
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index f167bcb139..45f4791439 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -44,6 +44,8 @@
#include <QtGui>
#include <QtTest/QtTest>
+#include "../../../qtest-config.h"
+
Q_DECLARE_METATYPE(QMetaType::Type)
class tst_QGuiMetaType: public QObject
@@ -133,11 +135,13 @@ template<> struct TypeComparator<QMetaType::QBitmap>
{ return v1.size() == v2.size(); }
};
+#ifndef QTEST_NO_CURSOR
template<> struct TypeComparator<QMetaType::QCursor>
{
static bool equal(const QCursor &v1, const QCursor &v2)
{ return v1.shape() == v2.shape(); }
};
+#endif
template <int ID>
struct DefaultValueFactory
@@ -176,9 +180,11 @@ template<> struct TestValueFactory<QMetaType::QRegion> {
template<> struct TestValueFactory<QMetaType::QBitmap> {
static QBitmap *create() { return new QBitmap(16, 32); }
};
+#ifndef QTEST_NO_CURSOR
template<> struct TestValueFactory<QMetaType::QCursor> {
static QCursor *create() { return new QCursor(Qt::WaitCursor); }
};
+#endif
template<> struct TestValueFactory<QMetaType::QKeySequence> {
static QKeySequence *create() { return new QKeySequence(QKeySequence::Close); }
};
diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
index 38dc1a92f2..4748b7c833 100644
--- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
+++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
@@ -65,6 +65,7 @@
#include "tst_qvariant_common.h"
+#include "../../../../qtest-config.h"
class tst_QGuiVariant : public QObject
{
@@ -182,7 +183,7 @@ void tst_QGuiVariant::canConvert_data()
var = QVariant::fromValue(QColor());
QTest::newRow("Color")
<< var << N << N << N << Y << Y << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << Y << N << N << N << N;
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
var = QVariant::fromValue(QCursor());
QTest::newRow("Cursor")
<< var << N << N << N << N << N << N << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N;
@@ -508,7 +509,7 @@ void tst_QGuiVariant::writeToReadFromDataStream_data()
QTest::newRow( "bitmap_valid" ) << QVariant::fromValue( bitmap ) << false;
QTest::newRow( "brush_valid" ) << QVariant::fromValue( QBrush( Qt::red ) ) << false;
QTest::newRow( "color_valid" ) << QVariant::fromValue( QColor( Qt::red ) ) << false;
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QTest::newRow( "cursor_valid" ) << QVariant::fromValue( QCursor( Qt::PointingHandCursor ) ) << false;
#endif
QTest::newRow( "font_valid" ) << QVariant::fromValue( QFont( "times", 12 ) ) << false;
@@ -676,12 +677,16 @@ void tst_QGuiVariant::implicitConstruction()
void tst_QGuiVariant::guiVariantAtExit()
{
// crash test, it should not crash at QGuiApplication exit
+#ifndef QTEST_NO_CURSOR
static QVariant cursor = QCursor();
+#endif
static QVariant point = QPoint();
static QVariant icon = QIcon();
static QVariant image = QImage();
static QVariant palette = QPalette();
+#ifndef QTEST_NO_CURSOR
Q_UNUSED(cursor);
+#endif
Q_UNUSED(point);
Q_UNUSED(icon);
Q_UNUSED(image);
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index d982428706..024559448c 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -63,6 +63,7 @@ private slots:
void assignment();
void equalsOperator_data();
void equalsOperator();
+ void isEmpty();
void textLayoutGlyphIndexes();
void drawExistingGlyphs();
void drawNonExistentGlyphs();
@@ -75,6 +76,7 @@ private slots:
void detach();
void setRawData();
void setRawDataAndGetAsVector();
+ void boundingRect();
private:
int m_testFontId;
@@ -235,6 +237,22 @@ void tst_QGlyphRun::equalsOperator()
QCOMPARE(one != two, !equals);
}
+void tst_QGlyphRun::isEmpty()
+{
+ QGlyphRun glyphs;
+ QVERIFY(glyphs.isEmpty());
+
+ glyphs.setGlyphIndexes(QVector<quint32>() << 1 << 2 << 3);
+ QVERIFY(!glyphs.isEmpty());
+
+ glyphs.clear();
+ QVERIFY(glyphs.isEmpty());
+
+ QVector<quint32> glyphIndexes = QVector<quint32>() << 1 << 2 << 3;
+ QVector<QPointF> positions = QVector<QPointF>() << QPointF(0, 0) << QPointF(0, 0) << QPointF(0, 0);
+ glyphs.setRawData(glyphIndexes.constData(), positions.constData(), glyphIndexes.size());
+ QVERIFY(!glyphs.isEmpty());
+}
void tst_QGlyphRun::textLayoutGlyphIndexes()
{
@@ -675,6 +693,34 @@ void tst_QGlyphRun::drawRightToLeft()
}
+void tst_QGlyphRun::boundingRect()
+{
+ QString s(QLatin1String("AbCdE"));
+
+ QRawFont rawFont(QRawFont::fromFont(QFont()));
+ QVERIFY(rawFont.isValid());
+ QVector<quint32> glyphIndexes = rawFont.glyphIndexesForString(s);
+ QVector<QPointF> positions = rawFont.advancesForGlyphIndexes(glyphIndexes);
+ QCOMPARE(glyphIndexes.size(), s.size());
+ QCOMPARE(positions.size(), glyphIndexes.size());
+
+ QGlyphRun glyphs;
+ glyphs.setRawFont(rawFont);
+ glyphs.setGlyphIndexes(glyphIndexes);
+ glyphs.setPositions(positions);
+
+ QRectF boundingRect = glyphs.boundingRect();
+
+ glyphs.clear();
+ glyphs.setRawFont(rawFont);
+ glyphs.setRawData(glyphIndexes.constData(), positions.constData(), glyphIndexes.size());
+ QCOMPARE(glyphs.boundingRect(), boundingRect);
+
+ boundingRect = QRectF(0, 0, 1, 1);
+ glyphs.setBoundingRect(boundingRect);
+ QCOMPARE(glyphs.boundingRect(), boundingRect);
+}
+
#endif // QT_NO_RAWFONT
QTEST_MAIN(tst_QGlyphRun)
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index 7a254546fe..c26964e764 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -267,6 +267,24 @@ void tst_QRawFont::glyphIndices()
expectedGlyphIndices << 44 << 83 << 83 << 70 << 69 << 86;
QCOMPARE(glyphIndices, expectedGlyphIndices);
+
+ glyphIndices = font.glyphIndexesForString(QString());
+ QVERIFY(glyphIndices.isEmpty());
+
+ QString str(QLatin1String("Foobar"));
+ int numGlyphs = str.size();
+ glyphIndices.resize(numGlyphs);
+
+ QVERIFY(!font.glyphIndexesForChars(str.constData(), 0, glyphIndices.data(), &numGlyphs));
+ QCOMPARE(numGlyphs, 0);
+
+ QVERIFY(!font.glyphIndexesForChars(str.constData(), str.size(), glyphIndices.data(), &numGlyphs));
+ QCOMPARE(numGlyphs, str.size());
+
+ QVERIFY(font.glyphIndexesForChars(str.constData(), str.size(), glyphIndices.data(), &numGlyphs));
+ QCOMPARE(numGlyphs, str.size());
+
+ QCOMPARE(glyphIndices, expectedGlyphIndices);
}
void tst_QRawFont::advances_data()
@@ -310,6 +328,33 @@ void tst_QRawFont::advances()
QVERIFY(qFuzzyIsNull(advances.at(i).y()));
}
+
+ advances = font.advancesForGlyphIndexes(QVector<quint32>());
+ QVERIFY(advances.isEmpty());
+
+ int numGlyphs = glyphIndices.size();
+ advances.resize(numGlyphs);
+
+ QVERIFY(!font.advancesForGlyphIndexes(glyphIndices.constData(), advances.data(), 0));
+
+ QVERIFY(font.advancesForGlyphIndexes(glyphIndices.constData(), advances.data(), numGlyphs));
+
+ for (int i=0; i<glyphIndices.size(); ++i) {
+#ifdef Q_OS_WIN
+ // In Windows, freetype engine returns advance of 9 when full hinting is used (default) for
+ // some of the glyphs.
+ if (font_d->fontEngine->type() == QFontEngine::Freetype
+ && (hintingPreference == QFont::PreferFullHinting || hintingPreference == QFont::PreferDefaultHinting)
+ && (i == 0 || i == 5)) {
+ QEXPECT_FAIL("", "Advance for some glyphs is not the expected with Windows Freetype engine (9 instead of 8)", Continue);
+ }
+#endif
+ QVERIFY(qFuzzyCompare(qRound(advances.at(i).x()), 8.0));
+ if (supportsSubPixelPositions)
+ QVERIFY(advances.at(i).x() > 8.0);
+
+ QVERIFY(qFuzzyIsNull(advances.at(i).y()));
+ }
}
void tst_QRawFont::textLayout()
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
index a000bbebcc..1bdb17682f 100644
--- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
@@ -286,5 +286,5 @@ void tst_QIntValidator::notifySignals()
QCOMPARE(changedSpy.count(), 6);
}
-QTEST_MAIN(tst_QIntValidator)
+QTEST_APPLESS_MAIN(tst_QIntValidator)
#include "tst_qintvalidator.moc"
diff --git a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
index 77075372f8..b3631d2016 100644
--- a/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
+++ b/tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp
@@ -122,5 +122,5 @@ void tst_QRegExpValidator::validate()
QCOMPARE(changedSpy.count(), 1);
}
-QTEST_MAIN(tst_QRegExpValidator)
+QTEST_APPLESS_MAIN(tst_QRegExpValidator)
#include "tst_qregexpvalidator.moc"
diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
index 0d45d810b1..a3ce31f585 100644
--- a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
+++ b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp
@@ -80,22 +80,22 @@ void tst_QDnsLookup::lookup_data()
QTest::addColumn<QByteArray>("txt");
QTest::newRow("a-empty") << int(QDnsLookup::A) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << ""<< "" << QByteArray();
- QTest::newRow("a-notfound") << int(QDnsLookup::A) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("a-notfound") << int(QDnsLookup::A) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
QTest::newRow("a-idn") << int(QDnsLookup::A) << QString::fromUtf8("alqualondë.troll.no") << int(QDnsLookup::NoError) << "alqualonde.troll.no" << "10.3.3.55" << "" << "" << "" << "" << QByteArray();
QTest::newRow("a-single") << int(QDnsLookup::A) << "lupinella.troll.no" << int(QDnsLookup::NoError) << "" << "10.3.4.6" << "" << "" << "" << "" << QByteArray();
QTest::newRow("a-multi") << int(QDnsLookup::A) << "multi.dev.troll.no" << int(QDnsLookup::NoError) << "" << "1.2.3.4 1.2.3.5 10.3.3.31" << "" << "" << "" << "" << QByteArray();
QTest::newRow("aaaa-empty") << int(QDnsLookup::AAAA) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("aaaa-notfound") << int(QDnsLookup::AAAA) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("aaaa-notfound") << int(QDnsLookup::AAAA) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
QTest::newRow("aaaa-single") << int(QDnsLookup::AAAA) << "dns6-test-dev.troll.no" << int(QDnsLookup::NoError) << "" << "2001:470:1f01:115::10" << "" << "" << "" << "" << QByteArray();
QTest::newRow("aaaa-multi") << int(QDnsLookup::AAAA) << "multi-dns6-test-dev.troll.no" << int(QDnsLookup::NoError) << "" << "2001:470:1f01:115::11 2001:470:1f01:115::12" << "" << "" << "" << "" << QByteArray();
QTest::newRow("any-empty") << int(QDnsLookup::ANY) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("any-notfound") << int(QDnsLookup::ANY) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("any-notfound") << int(QDnsLookup::ANY) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
QTest::newRow("any-ascii") << int(QDnsLookup::ANY) << "fluke.troll.no" << int(QDnsLookup::NoError) << "" << "10.3.3.31" << "" << "" << "" << "" << QByteArray();
QTest::newRow("mx-empty") << int(QDnsLookup::MX) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("mx-notfound") << int(QDnsLookup::MX) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("mx-notfound") << int(QDnsLookup::MX) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
QTest::newRow("mx-ascii") << int(QDnsLookup::MX) << "troll.no" << int(QDnsLookup::NoError) << "" << "" << "10 smtp.trolltech.com" << "" << "" << "" << QByteArray();
#if 0
// FIXME: we need an IDN MX record in the troll.no domain
@@ -103,23 +103,23 @@ void tst_QDnsLookup::lookup_data()
#endif
QTest::newRow("ns-empty") << int(QDnsLookup::NS) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("ns-notfound") << int(QDnsLookup::NS) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("ns-notfound") << int(QDnsLookup::NS) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
QTest::newRow("ns-ascii") << int(QDnsLookup::NS) << "troll.no" << int(QDnsLookup::NoError) << "" << "" << "" << "ns-0.trolltech.net ns-1.trolltech.net" << "" << "" << QByteArray();
QTest::newRow("ptr-empty") << int(QDnsLookup::PTR) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("ptr-notfound") << int(QDnsLookup::PTR) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("ptr-notfound") << int(QDnsLookup::PTR) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
// FIXME: we need PTR records in the troll.no domain
QTest::newRow("ptr-ascii") << int(QDnsLookup::PTR) << "8.8.8.8.in-addr.arpa" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "google-public-dns-a.google.com" << "" << QByteArray();
QTest::newRow("srv-empty") << int(QDnsLookup::SRV) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("srv-notfound") << int(QDnsLookup::SRV) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("srv-notfound") << int(QDnsLookup::SRV) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
#if 0
// FIXME: we need SRV records in the troll.no domain
QTest::newRow("srv-idn") << int(QDnsLookup::SRV) << QString::fromUtf8("_xmpp-client._tcp.råkat.se") << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << "5 0 5224 jabber.cdr.se" << QByteArray();
#endif
QTest::newRow("txt-empty") << int(QDnsLookup::TXT) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << QByteArray();
- QTest::newRow("txt-notfound") << int(QDnsLookup::TXT) << "invalid." << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
+ QTest::newRow("txt-notfound") << int(QDnsLookup::TXT) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << QByteArray();
// FIXME: we need TXT records in the troll.no domain
QTest::newRow("txt-ascii") << int(QDnsLookup::TXT) << "gmail.com" << int(QDnsLookup::NoError) << "" << "" << "" << "" << "" << "" << QByteArray("v=spf1 redirect=_spf.google.com");
}
diff --git a/tests/auto/other/networkselftest/networkselftest.pro b/tests/auto/other/networkselftest/networkselftest.pro
index 37c8712603..c8b870128d 100644
--- a/tests/auto/other/networkselftest/networkselftest.pro
+++ b/tests/auto/other/networkselftest/networkselftest.pro
@@ -4,4 +4,5 @@ TARGET = tst_networkselftest
SOURCES += tst_networkselftest.cpp
QT = core network testlib
+win32:CONFIG += insignificant_test # QTBUG-27571
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 1b789b26ae..08d679772e 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -1885,6 +1885,7 @@ void tst_QAccessibility::lineEditTest()
QCOMPARE(textIface->textAtOffset(8, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" "));
QCOMPARE(textIface->textAtOffset(25, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("advice"));
QCOMPARE(textIface->textAtOffset(92, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("oneself"));
+ QCOMPARE(textIface->textAtOffset(101, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(". --"));
QCOMPARE(textIface->textBeforeOffset(5, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" "));
QCOMPARE(textIface->textAfterOffset(5, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" "));
@@ -2821,7 +2822,10 @@ void tst_QAccessibility::comboBoxTest()
{ // not editable combobox
QComboBox combo;
combo.addItems(QStringList() << "one" << "two" << "three");
+ // Fully decorated windows have a minimum width of 160 on Windows.
+ combo.setMinimumWidth(200);
combo.show();
+ QVERIFY(QTest::qWaitForWindowShown(&combo));
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&combo);
QCOMPARE(verifyHierarchy(iface), 0);
@@ -2847,13 +2851,14 @@ void tst_QAccessibility::comboBoxTest()
QVERIFY(iface->actionInterface());
QCOMPARE(iface->actionInterface()->actionNames(), QStringList() << QAccessibleActionInterface::showMenuAction());
iface->actionInterface()->doAction(QAccessibleActionInterface::showMenuAction());
- QVERIFY(combo.view()->isVisible());
+ QTRY_VERIFY(combo.view()->isVisible());
delete iface;
}
{ // editable combobox
QComboBox editableCombo;
+ editableCombo.setMinimumWidth(200);
editableCombo.show();
editableCombo.setEditable(true);
editableCombo.addItems(QStringList() << "foo" << "bar" << "baz");
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index 7f872a4ffb..0f7c7f7a84 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -965,28 +965,28 @@ static void printPage(QPainter *painter)
void tst_QPrinter::taskQTBUG4497_reusePrinterOnDifferentFiles()
{
- TempFileCleanup tmpFile1("out1.ps");
- TempFileCleanup tmpFile2("out2.ps");
+ TempFileCleanup tmpFile1("out1.pdf");
+ TempFileCleanup tmpFile2("out2.pdf");
QPrinter printer;
{
- printer.setOutputFileName("out1.ps");
+ printer.setOutputFileName("out1.pdf");
QPainter painter(&printer);
printPage(&painter);
}
{
- printer.setOutputFileName("out2.ps");
+ printer.setOutputFileName("out2.pdf");
QPainter painter(&printer);
printPage(&painter);
}
- QFile file1("out1.ps");
+ QFile file1("out1.pdf");
QVERIFY(file1.open(QIODevice::ReadOnly));
- QFile file2("out2.ps");
+ QFile file2("out2.pdf");
QVERIFY(file2.open(QIODevice::ReadOnly));
while (!file1.atEnd() && !file2.atEnd()) {
diff --git a/tests/auto/platformquirks.h b/tests/auto/qtest-config.h
index 9bd9adda83..b885cbda74 100644
--- a/tests/auto/platformquirks.h
+++ b/tests/auto/qtest-config.h
@@ -39,27 +39,15 @@
**
****************************************************************************/
-#ifndef PLATFORMQUIRKS_H
-#define PLATFORMQUIRKS_H
+#ifndef QTEST_CONFIG_H
+#define QTEST_CONFIG_H
#include <qglobal.h>
-#ifdef QT_GUI_LIB
-#include <qapplication.h>
-#endif
-
-
-struct PlatformQuirks
-{
- static inline bool haveMouseCursor()
- {
-#if defined(Q_WS_X11)
- return X11->desktopEnvironment != DE_MEEGO_COMPOSITOR;
-#else
- return true;
-#endif
- }
-};
-
-#endif
+#ifndef QTEST_NO_CURSOR
+# if defined(QT_NO_CURSOR) || defined(Q_OS_WINCE) || defined(MEEGO_EDITION_HARMATTAN)
+# define QTEST_NO_CURSOR
+# endif
+#endif // QTEST_NO_CURSOR
+#endif // QTEST_CONFIG_H
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index bc22444b5b..eb47253587 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -65,6 +65,14 @@
#if defined(Q_COMPILER_VARIADIC_MACROS)
#define PD_VARARG(x, ...) x(__VA_ARGS__)
+
+#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
+//GCC extension for variadic macros
+#define PD_VARARGEXT(x, y...) x(y)
+#else
+#define PD_VARARGEXT(x, ...) x(__VA_ARGS__)
+#endif
+
#endif
PD_BEGIN_NAMESPACE
@@ -95,6 +103,10 @@ public slots:
PD_VARARG(void vararg1) {}
PD_VARARG(void vararg2, int) {}
PD_VARARG(void vararg3, int, int) {}
+
+ PD_VARARGEXT(void vararg4) {}
+ PD_VARARGEXT(void vararg5, int) {}
+ PD_VARARGEXT(void vararg6, int, int) {}
#endif
};
diff --git a/src/widgets/styles/qmotifstyle_p.h b/tests/auto/tools/moc/pp-dollar-signs.h
index 76f8c01119..c19b26136c 100644
--- a/src/widgets/styles/qmotifstyle_p.h
+++ b/tests/auto/tools/moc/pp-dollar-signs.h
@@ -3,7 +3,7 @@
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -39,44 +39,4 @@
**
****************************************************************************/
-#ifndef QMOTIFSTYLE_P_H
-#define QMOTIFSTYLE_P_H
-#include <qlist.h>
-#include <qdatetime.h>
-#include <qprogressbar.h>
-#include "qmotifstyle.h"
-#include "qcommonstyle_p.h"
-
-QT_BEGIN_NAMESPACE
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-// Private class
-class QMotifStylePrivate : public QCommonStylePrivate
-{
- Q_DECLARE_PUBLIC(QMotifStyle)
-public:
- QMotifStylePrivate();
-
-public:
-#ifndef QT_NO_PROGRESSBAR
- QList<QProgressBar *> bars;
- int animationFps;
- int animateTimer;
- QTime startTime;
- int animateStep;
-#endif // QT_NO_PROGRESSBAR
-};
-
-QT_END_NAMESPACE
-
-#endif //QMOTIFSTYLE_P_H
+$$ = parser->createFoo()
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index ede486ebc0..d861b84e00 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -554,6 +554,7 @@ private slots:
void autoPropertyMetaTypeRegistration();
void autoMethodArgumentMetaTypeRegistration();
void parseDefines();
+ void preprocessorOnly();
signals:
void sigWithUnsignedArg(unsigned foo);
@@ -2743,6 +2744,12 @@ void tst_Moc::parseDefines()
QVERIFY(index != -1);
index = mo->indexOfSlot("vararg3(int,int)");
QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg4()");
+ QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg5(int)");
+ QVERIFY(index != -1);
+ index = mo->indexOfSlot("vararg6(int,int)");
+ QVERIFY(index != -1);
#endif
int count = 0;
@@ -2760,6 +2767,26 @@ void tst_Moc::parseDefines()
QVERIFY(count == 2);
}
+void tst_Moc::preprocessorOnly()
+{
+#ifdef MOC_CROSS_COMPILED
+ QSKIP("Not tested when cross-compiled");
+#endif
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
+ QProcess proc;
+ proc.start("moc", QStringList() << "-E" << srcify("/pp-dollar-signs.h"));
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 0);
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(!mocOut.isEmpty());
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
+
+ QVERIFY(mocOut.contains("$$ = parser->createFoo()"));
+#else
+ QSKIP("Only tested on linux/gcc");
+#endif
+}
+
QTEST_MAIN(tst_Moc)
#include "tst_moc.moc"
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 73bca1ca3d..f78b40bdf0 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -73,7 +73,7 @@ Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(QPointF)
Q_DECLARE_METATYPE(QRectF)
-#include "../../../platformquirks.h"
+#include "../../../qtest-config.h"
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include <windows.h>
@@ -360,7 +360,9 @@ private slots:
void filtersChildEvents();
void filtersChildEvents2();
void ensureVisible();
+#ifndef QTEST_NO_CURSOR
void cursor();
+#endif
//void textControlGetterSetter();
void defaultItemTest_QGraphicsLineItem();
void defaultItemTest_QGraphicsPixmapItem();
@@ -4145,9 +4147,9 @@ void tst_QGraphicsItem::ensureVisible()
QTest::qWait(25);
}
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsItem::cursor()
{
-#ifndef QT_NO_CURSOR
QGraphicsScene scene;
QGraphicsRectItem *item1 = scene.addRect(QRectF(0, 0, 50, 50));
QGraphicsRectItem *item2 = scene.addRect(QRectF(0, 0, 50, 50));
@@ -4203,15 +4205,6 @@ void tst_QGraphicsItem::cursor()
QApplication::sendEvent(view.viewport(), &event);
}
- if (!PlatformQuirks::haveMouseCursor())
- return;
-#if !defined(Q_OS_WINCE)
- QTest::qWait(250);
-#else
- // Test environment does not have any cursor, therefore no shape
- return;
-#endif
-
QCOMPARE(view.viewport()->cursor().shape(), item1->cursor().shape());
{
@@ -4233,8 +4226,8 @@ void tst_QGraphicsItem::cursor()
QTest::qWait(25);
QCOMPARE(view.viewport()->cursor().shape(), cursor.shape());
-#endif
}
+#endif
/*
void tst_QGraphicsItem::textControlGetterSetter()
{
@@ -4499,7 +4492,7 @@ protected:
case QGraphicsItem::ItemSceneHasChanged:
break;
case QGraphicsItem::ItemCursorChange:
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
oldValues << cursor();
#endif
break;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 88aaab3096..e9865f2b22 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -49,6 +49,8 @@
#include <QMacStyle>
#endif
+#include "../../../qtest-config.h"
+
static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton)
{
QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0);
@@ -115,8 +117,10 @@ private slots:
void focusNextPrevChild();
void focusOutEvent_data();
void focusOutEvent();
+#ifndef QTEST_NO_CURSOR
void hoverEnterLeaveEvent_data();
void hoverEnterLeaveEvent();
+#endif
void hoverMoveEvent_data();
void hoverMoveEvent();
void keyPressEvent_data();
@@ -154,7 +158,9 @@ private slots:
void setFocus_complexTwoWidgets();
void popup_basic();
void popup_subwidget();
+#ifndef QTEST_NO_CURSOR
void changingCursor_basic();
+#endif
void tooltip_basic();
void childPos_data();
void childPos();
@@ -423,7 +429,7 @@ void tst_QGraphicsProxyWidget::setWidget()
}
QWidget *widget = new QWidget;
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
widget->setCursor(Qt::IBeamCursor);
#endif
widget->setPalette(QPalette(Qt::magenta));
@@ -461,7 +467,7 @@ void tst_QGraphicsProxyWidget::setWidget()
QVERIFY(subWidget->testAttribute(Qt::WA_DontShowOnScreen));
QVERIFY(!subWidget->testAttribute(Qt::WA_QuitOnClose));
QCOMPARE(proxy->acceptHoverEvents(), true);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QVERIFY(proxy->hasCursor());
// These should match
@@ -938,6 +944,7 @@ protected:
}
};
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
{
QTest::addColumn<bool>("hasWidget");
@@ -954,10 +961,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
QFETCH(bool, hasWidget);
QFETCH(bool, hoverEnabled);
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform");
-#endif
-
// proxy should translate this into events that the widget would expect
QGraphicsScene scene;
@@ -1003,6 +1006,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
if (!hasWidget)
delete widget;
}
+#endif
void tst_QGraphicsProxyWidget::hoverMoveEvent_data()
{
@@ -1522,7 +1526,7 @@ void tst_QGraphicsProxyWidget::setWidget_simple()
// Properties
// QCOMPARE(proxy.focusPolicy(), lineEdit->focusPolicy());
// QCOMPARE(proxy.palette(), lineEdit->palette());
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QCOMPARE(proxy.cursor().shape(), lineEdit->cursor().shape());
#endif
QCOMPARE(proxy.layoutDirection(), lineEdit->layoutDirection());
@@ -2538,12 +2542,9 @@ void tst_QGraphicsProxyWidget::popup_subwidget()
QCOMPARE(popup->size(), child->size().toSize());
}
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsProxyWidget::changingCursor_basic()
{
-#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
- QSKIP("hover events not supported on this platform");
-#endif
-#ifndef QT_NO_CURSOR
// Confirm that mouse events are working properly by checking that
// when moving the mouse over a line edit it will change the cursor into the I
QGraphicsScene scene;
@@ -2568,8 +2569,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
QTest::mouseMove(view.viewport(), QPoint(1, 1));
sendMouseMove(view.viewport(), QPoint(1, 1));
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor);
-#endif
}
+#endif
void tst_QGraphicsProxyWidget::tooltip_basic()
{
@@ -3617,7 +3618,7 @@ public slots:
void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
{
-#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR)
+#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QTEST_NO_CURSOR)
QSKIP("Test case unstable on this platform");
#endif
QGraphicsView view;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 96aba11d52..0ddae14738 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -68,10 +68,11 @@
#include <QtWidgets/QDesktopWidget>
#include <private/qgraphicsscene_p.h>
#include <private/qgraphicsview_p.h>
-#include "../../../platformquirks.h"
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
+#include "../../../qtest-config.h"
+
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
Q_DECLARE_METATYPE(QMatrix)
@@ -196,8 +197,10 @@ private slots:
void mapFromScenePath();
void sendEvent();
void wheelEvent();
+#ifndef QTEST_NO_CURSOR
void cursor();
void cursor2();
+#endif
void transformationAnchor();
void resizeAnchor();
void viewportUpdateMode();
@@ -256,7 +259,9 @@ private slots:
void QTBUG_4151_clipAndIgnore_data();
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
+#ifndef QTEST_NO_CURSOR
void QTBUG_7438_cursor();
+#endif
void hoverLeave();
void QTBUG_16063_microFocusRect();
@@ -678,7 +683,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
for (int i = 0; i < 2; ++i) {
// ScrollHandDrag
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
#endif
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
@@ -697,7 +702,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
QTRY_VERIFY(item->isSelected());
for (int k = 0; k < 4; ++k) {
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), Qt::ClosedHandCursor);
#endif
{
@@ -740,7 +745,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
QTRY_VERIFY(item->isSelected());
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue - 10);
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue - 10);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -800,7 +805,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
for (int i = 0; i < 2; ++i) {
// RubberBandDrag
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
#endif
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
@@ -814,7 +819,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
QApplication::sendEvent(view.viewport(), &event);
QVERIFY(event.isAccepted());
}
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -862,7 +867,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
}
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue);
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
#endif
@@ -2102,15 +2107,9 @@ void tst_QGraphicsView::wheelEvent()
QVERIFY(widget->hasFocus());
}
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsView::cursor()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support");
-#endif
- if (PlatformQuirks::haveMouseCursor())
- QSKIP("The Platform does not have regular cursor support");
-
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
item->setCursor(Qt::IBeamCursor);
@@ -2129,20 +2128,12 @@ void tst_QGraphicsView::cursor()
sendMouseMove(view.viewport(), QPoint(5, 5));
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
-#endif
}
+#endif
-// Qt/CE does not have regular cursor support.
-#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsView::cursor2()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support");
-#endif
- if (PlatformQuirks::haveMouseCursor())
- QSKIP("The Platform does not have regular cursor support");
-
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
item->setCursor(Qt::IBeamCursor);
@@ -2205,8 +2196,8 @@ void tst_QGraphicsView::cursor2()
QCOMPARE(view.viewport()->cursor().shape(), Qt::IBeamCursor);
sendMouseMove(view.viewport(), view.mapFromScene(-15, -15));
QCOMPARE(view.viewport()->cursor().shape(), Qt::SizeAllCursor);
-#endif
}
+#endif
void tst_QGraphicsView::transformationAnchor()
{
@@ -3529,7 +3520,7 @@ void tst_QGraphicsView::mouseTracking()
QGraphicsView view(&scene);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -3539,7 +3530,7 @@ void tst_QGraphicsView::mouseTracking()
// Adding an item to the scene before the scene is set on the view.
QGraphicsScene scene(-10000, -10000, 20000, 20000);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -3556,7 +3547,7 @@ void tst_QGraphicsView::mouseTracking()
QGraphicsView view3(&scene);
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
item->setCursor(Qt::CrossCursor);
#endif
scene.addItem(item);
@@ -4359,7 +4350,6 @@ void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
QEXPECT_FAIL("", message.constData(), Abort);
#endif
QVERIFY2(dx < slack && dy < slack, message.constData());
-#endif
}
void tst_QGraphicsView::task259503_scrollingArtifacts()
@@ -4505,12 +4495,9 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect);
}
+#ifndef QTEST_NO_CURSOR
void tst_QGraphicsView::QTBUG_7438_cursor()
{
-#ifndef QT_NO_CURSOR
-#if defined(Q_OS_WINCE)
- QSKIP("Qt/CE does not have regular cursor support");
-#endif
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
item->setFlag(QGraphicsItem::ItemIsMovable);
@@ -4529,8 +4516,8 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
sendMouseRelease(view.viewport(), view.mapFromScene(0, 0));
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
-#endif
}
+#endif
class GraphicsItemWithHover : public QGraphicsRectItem
{
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 177670bb84..1987a37306 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -53,6 +53,7 @@
#include <qaction.h>
#include <qwidgetaction.h>
+#include "../../../qtest-config.h"
class EventSpy : public QObject
{
@@ -3203,10 +3204,12 @@ void tst_QGraphicsWidget::itemChangeEvents()
valueDuringEvents.insert(QEvent::ParentChange, QVariant::fromValue(parentItem()));
break;
}
+#ifndef QTEST_NO_CURSOR
case QEvent::CursorChange: {
valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape()));
break;
}
+#endif
case QEvent::ToolTipChange: {
valueDuringEvents.insert(QEvent::ToolTipChange, toolTip());
break;
@@ -3252,9 +3255,11 @@ void tst_QGraphicsWidget::itemChangeEvents()
QVERIFY(!item->isVisible());
QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool());
+#ifndef QTEST_NO_CURSOR
// CursorChange should be triggered after the cursor has changed
item->setCursor(Qt::PointingHandCursor);
QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape()));
+#endif
// ToolTipChange should be triggered after the tooltip has changed
item->setToolTip("tooltipText");
diff --git a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
index de077c1059..f1e2bbf402 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
+++ b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
@@ -4,5 +4,4 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qlistwidget.cpp
-contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-21098, fails unstably
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index 79014fcbbf..b882b56735 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -1534,8 +1534,12 @@ void tst_QListWidget::fastScroll()
sbar->setValue(sbar->value() + sbar->singleStep());
QApplication::processEvents();
+ const QSize actualItemSize = widget.painted.boundingRect().size();
+ if (actualItemSize != itemSize)
+ QEXPECT_FAIL("", "QTBUG-21098", Continue);
+
// only one item should be repainted, the rest should be scrolled in memory
- QCOMPARE(widget.painted.boundingRect().size(), itemSize);
+ QCOMPARE(actualItemSize, itemSize);
}
#endif // Q_OS_MAC
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 9ea8589e76..abb979c76c 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -71,6 +71,7 @@
#include <qpa/qwindowsysteminterface.h>
+#include "../../../qtest-config.h"
QT_BEGIN_NAMESPACE
static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
@@ -2231,7 +2232,9 @@ Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap);
Q_GLOBAL_STATIC(QFont, tst_qapp_font);
Q_GLOBAL_STATIC(QRegion, tst_qapp_region);
Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase);
+#ifndef QTEST_NO_CURSOR
Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor);
+#endif
void tst_QApplication::globalStaticObjectDestruction()
{
@@ -2250,7 +2253,9 @@ void tst_QApplication::globalStaticObjectDestruction()
QVERIFY(tst_qapp_font());
QVERIFY(tst_qapp_region());
QVERIFY(tst_qapp_fontDatabase());
+#ifndef QTEST_NO_CURSOR
QVERIFY(tst_qapp_cursor());
+#endif
}
//QTEST_APPLESS_MAIN(tst_QApplication)
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 855f7fcc49..b4f31acaef 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -76,6 +76,8 @@
#include <QtWidgets/QGraphicsView>
#include <QtWidgets/QGraphicsProxyWidget>
+#include "../../../qtest-config.h"
+
#if defined(Q_OS_MAC)
#include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
#endif
@@ -172,6 +174,8 @@ private slots:
void palettePropagation();
void palettePropagation2();
void enabledPropagation();
+ void ignoreKeyEventsWhenDisabled_QTBUG27417();
+ void properTabHandlingWhenDisabled_QTBUG27417();
void popupEnterLeave();
#ifndef QT_NO_DRAGANDDROP
void acceptDropsPropagation();
@@ -273,7 +277,9 @@ private slots:
void deleteStyle();
void multipleToplevelFocusCheck();
void setFocus();
+#ifndef QTEST_NO_CURSOR
void setCursor();
+#endif
void setToolTip();
void testWindowIconChangeEventPropagation();
@@ -344,9 +350,10 @@ private slots:
void setClearAndResizeMask();
void maskedUpdate();
-#if !defined(Q_OS_WINCE_WM)
+#ifndef QTEST_NO_CURSOR
void syntheticEnterLeave();
void taskQTBUG_4055_sendSyntheticEnterLeave();
+ void underMouse();
#endif
void windowFlags();
void initialPosForDontShowOnScreenWidgets();
@@ -1049,6 +1056,43 @@ void tst_QWidget::enabledPropagation()
QVERIFY( !grandChildWidget->isEnabled() );
}
+void tst_QWidget::ignoreKeyEventsWhenDisabled_QTBUG27417()
+{
+ QLineEdit lineEdit;
+ lineEdit.setDisabled(true);
+ lineEdit.show();
+ QTest::keyClick(&lineEdit, Qt::Key_A);
+ QTRY_VERIFY(lineEdit.text().isEmpty());
+}
+
+void tst_QWidget::properTabHandlingWhenDisabled_QTBUG27417()
+{
+ QWidget widget;
+ QVBoxLayout *layout = new QVBoxLayout();
+ QLineEdit *lineEdit = new QLineEdit();
+ layout->addWidget(lineEdit);
+ QLineEdit *lineEdit2 = new QLineEdit();
+ layout->addWidget(lineEdit2);
+ QLineEdit *lineEdit3 = new QLineEdit();
+ layout->addWidget(lineEdit3);
+ widget.setLayout(layout);
+ widget.show();
+
+ lineEdit->setFocus();
+ QTRY_VERIFY(lineEdit->hasFocus());
+ QTest::keyClick(&widget, Qt::Key_Tab);
+ QTRY_VERIFY(lineEdit2->hasFocus());
+ QTest::keyClick(&widget, Qt::Key_Tab);
+ QTRY_VERIFY(lineEdit3->hasFocus());
+
+ lineEdit2->setDisabled(true);
+ lineEdit->setFocus();
+ QTRY_VERIFY(lineEdit->hasFocus());
+ QTest::keyClick(&widget, Qt::Key_Tab);
+ QTRY_VERIFY(!lineEdit2->hasFocus());
+ QVERIFY(lineEdit3->hasFocus());
+}
+
// Drag'n drop disabled in this build.
#ifndef QT_NO_DRAGANDDROP
void tst_QWidget::acceptDropsPropagation()
@@ -5222,9 +5266,9 @@ private:
int m_count;
};
+#ifndef QTEST_NO_CURSOR
void tst_QWidget::setCursor()
{
-#ifndef QT_NO_CURSOR
{
QWidget window;
window.resize(200, 200);
@@ -5339,8 +5383,8 @@ void tst_QWidget::setCursor()
widget.unsetCursor();
QCOMPARE(spy.count(), 2);
}
-#endif
}
+#endif
void tst_QWidget::setToolTip()
{
@@ -8491,8 +8535,7 @@ void tst_QWidget::maskedUpdate()
QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update.
}
-// Windows Mobile has no proper cursor support, so skip this test on that platform.
-#if !defined(Q_OS_WINCE_WM)
+#ifndef QTEST_NO_CURSOR
void tst_QWidget::syntheticEnterLeave()
{
class MyWidget : public QWidget
@@ -8595,8 +8638,7 @@ void tst_QWidget::syntheticEnterLeave()
}
#endif
-// Windows Mobile has no proper cursor support, so skip this test on that platform.
-#if !defined(Q_OS_WINCE_WM)
+#ifndef QTEST_NO_CURSOR
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
{
if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
@@ -8812,7 +8854,9 @@ QWidgetBackingStore* backingStore(QWidget &widget)
#ifndef Q_OS_WINCE_WM
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
{
+#ifndef QTEST_NO_CURSOR
QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
+#endif
QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
QPalette palette;
palette.setColor(QPalette::Window, Qt::red);
@@ -8845,7 +8889,9 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32),
correct.toImage().convertToFormat(QImage::Format_RGB32));
+#ifndef QTEST_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
}
#endif
@@ -9553,5 +9599,86 @@ void tst_QWidget::styleSheetPropagation()
}
}
+#ifndef QTEST_NO_CURSOR
+void tst_QWidget::underMouse()
+{
+ // Move the mouse cursor to a safe location
+ QCursor::setPos(0,0);
+
+ QWidget topLevelWidget;
+ QLineEdit childWidget1(&topLevelWidget);
+ QLineEdit childWidget2(&topLevelWidget);
+ QWidget popupWidget(0, Qt::Popup);
+
+ topLevelWidget.setObjectName("topLevelWidget");
+ childWidget1.setObjectName("childWidget1");
+ childWidget2.setObjectName("childWidget2");
+ popupWidget.setObjectName("popupWidget");
+
+ topLevelWidget.setGeometry(100, 100, 300, 300);
+ childWidget1.setGeometry(20, 20, 100, 100);
+ childWidget2.setGeometry(20, 120, 100, 100);
+ popupWidget.setGeometry(50, 100, 50, 50);
+
+ topLevelWidget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevelWidget));
+ QWindow *window = topLevelWidget.windowHandle();
+
+ QPoint outsideWindowPoint(30, -10);
+ QPoint inWindowPoint(30, 10);
+ QPoint child1Point(30, 50);
+ QPoint child2Point(30, 150);
+
+ // Outside window
+ QTest::mouseMove(window, outsideWindowPoint);
+ QVERIFY(!topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+
+ // Enter window, outside children
+ // Note: QTest::mouseMove will not generate enter events for windows, so send one explicitly
+ QWindowSystemInterface::handleEnterEvent(window);
+ QTest::mouseMove(window, inWindowPoint);
+ QVERIFY(topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+
+ // In childWidget1
+ QTest::mouseMove(window, child1Point);
+ QVERIFY(topLevelWidget.underMouse());
+ QVERIFY(childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+
+ // In childWidget2
+ QTest::mouseMove(window, child2Point);
+ QVERIFY(topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(childWidget2.underMouse());
+
+ // Throw up a popup window
+ popupWidget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&popupWidget));
+ QWindow *popupWindow = popupWidget.windowHandle();
+ QVERIFY(popupWindow);
+ QVERIFY(QApplication::activePopupWidget() == &popupWidget);
+
+ // If there is an active popup, undermouse should not be reported (QTBUG-27478)
+ QVERIFY(!topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+
+ // Moving around while popup active should not change undermouse either
+ QTest::mouseMove(popupWindow, popupWindow->mapFromGlobal(window->mapToGlobal(inWindowPoint)));
+ QVERIFY(!topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+
+ QTest::mouseMove(popupWindow, popupWindow->mapFromGlobal(window->mapToGlobal(child1Point)));
+ QVERIFY(!topLevelWidget.underMouse());
+ QVERIFY(!childWidget1.underMouse());
+ QVERIFY(!childWidget2.underMouse());
+}
+#endif // QTEST_NO_CURSOR
+
QTEST_MAIN(tst_QWidget)
#include "tst_qwidget.moc"
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 310e43cd53..dc8b1c12f3 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -47,7 +47,8 @@
#include <QPlastiqueStyle>
#include <private/qstylesheetstyle_p.h>
-#include "../../../platformquirks.h"
+
+#include "../../../qtest-config.h"
class tst_QStyleSheetStyle : public QObject
{
@@ -78,7 +79,9 @@ private slots:
void onWidgetDestroyed();
void fontPrecedence();
void focusColors();
+#ifndef QTEST_NO_CURSOR
void hoverColors();
+#endif
void background();
void tabAlignement();
void attributesList();
@@ -788,10 +791,9 @@ void tst_QStyleSheetStyle::focusColors()
}
}
+#ifndef QTEST_NO_CURSOR
void tst_QStyleSheetStyle::hoverColors()
{
- if (!PlatformQuirks::haveMouseCursor())
- QSKIP("No mouse Cursor on this platform");
QList<QWidget *> widgets;
widgets << new QPushButton("TESTING TESTING");
widgets << new QLineEdit("TESTING TESTING");
@@ -880,8 +882,8 @@ void tst_QStyleSheetStyle::hoverColors()
(QString::fromLatin1(widget->metaObject()->className())
+ " did not contain text color #ff0084").toLocal8Bit().constData());
}
-
}
+#endif
class SingleInheritanceDialog : public QDialog
{
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 215e25ce6e..08913650ad 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -74,6 +74,7 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
+#include "../../../qtest-config.h"
QT_BEGIN_NAMESPACE
class QPainter;
@@ -240,7 +241,7 @@ private slots:
void noTextEditedOnClear();
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
void cursor();
#endif
@@ -3260,7 +3261,7 @@ void tst_QLineEdit::textMargin()
QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition);
}
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
void tst_QLineEdit::cursor()
{
testWidget->setReadOnly(false);
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 1e91c63f16..cf2d0de0e2 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -57,6 +57,8 @@
#include <private/qmainwindowlayout_p.h>
#include <private/qdockarealayout_p.h>
+#include "../../../qtest-config.h"
+
static uchar restoreData41[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x1, 0x19, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x38, 0x1, 0x0, 0x0, 0x0, 0x8d, 0x0, 0x0, 0x0, 0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0xd4, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x1, 0x19, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x35, 0x1, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x39, 0x1, 0x0, 0x0, 0x0, 0x8d, 0x0, 0x0, 0x0, 0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0xd4, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x1, 0x89, 0x0, 0x0, 0x0, 0xe, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x36, 0x1, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0xc8, 0x0, 0x0, 0x0, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x34, 0x1, 0x0, 0x0, 0x1, 0x2a, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x1, 0x89, 0x0, 0x0, 0x0, 0xe, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x37, 0x1, 0x0, 0x0, 0x0, 0x63, 0x0, 0x0, 0x0, 0x61, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0xc8, 0x0, 0x0, 0x0, 0x5e, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x1, 0x2a, 0x0, 0x0, 0x0, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xc1, 0x0, 0x0, 0x1, 0x19};
static uchar restoreData42[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x0, 0x0, 0x2, 0x2b, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0xb6, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x38, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x87, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x32, 0x1, 0x0, 0x0, 0x1, 0xcd, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x98, 0x0, 0x0, 0x2, 0x2b, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x35, 0x1, 0x0, 0x0, 0x0, 0xb6, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x39, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x87, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x33, 0x1, 0x0, 0x0, 0x1, 0xcd, 0x0, 0x0, 0x0, 0x88, 0x0, 0x0, 0x0, 0x21, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x4, 0x4e, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x12, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x36, 0x1, 0x0, 0x0, 0x1, 0x16, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x30, 0x1, 0x0, 0x0, 0x2, 0x28, 0x0, 0x0, 0x1, 0x14, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x34, 0x1, 0x0, 0x0, 0x3, 0x40, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x4, 0x4e, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x12, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x37, 0x1, 0x0, 0x0, 0x1, 0x16, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x2, 0x28, 0x0, 0x0, 0x1, 0x14, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x3, 0x40, 0x0, 0x0, 0x1, 0xe, 0x0, 0x0, 0x0, 0xa, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x3, 0x8a, 0x0, 0x0, 0x2, 0x2b, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8};
static uchar restoreData43[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x50, 0x0, 0x0, 0x0, 0xa0, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0x53, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x38, 0x1, 0x0, 0x0, 0x0, 0x7c, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0xa5, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x98, 0x0, 0x0, 0x0, 0xa0, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0x2a, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x35, 0x1, 0x0, 0x0, 0x0, 0x53, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x39, 0x1, 0x0, 0x0, 0x0, 0x7c, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0xa5, 0x0, 0x0, 0x0, 0x25, 0x0, 0x0, 0x0, 0x16, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x1, 0xa8, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x32, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x36, 0x1, 0x0, 0x0, 0x0, 0x6c, 0x0, 0x0, 0x0, 0x66, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0xd6, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x34, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x66, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x1, 0xa8, 0x0, 0x0, 0x0, 0x26, 0xfc, 0x1, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x33, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x37, 0x1, 0x0, 0x0, 0x0, 0x6c, 0x0, 0x0, 0x0, 0x66, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0xd6, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x66, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xb8, 0x0, 0x0, 0x0, 0xa0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0xfc, 0x0, 0x0, 0x0, 0x0};
@@ -137,7 +139,7 @@ private slots:
void statusBar();
#endif
void isSeparator();
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
void setCursor();
#endif
void addToolbarAfterShow();
@@ -1646,7 +1648,7 @@ class MainWindow : public QMainWindow {
using QMainWindow::event;
};
-#ifndef QT_NO_CURSOR
+#ifndef QTEST_NO_CURSOR
void tst_QMainWindow::setCursor()
{
MainWindow mw;
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 589f157254..3807bad1ba 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -63,6 +63,8 @@
#include <QMacStyle>
#endif
+#include "../../../qtest-config.h"
+
QT_BEGIN_NAMESPACE
#if !defined(Q_WS_WIN)
extern bool qt_tab_all_widgets();
@@ -173,8 +175,10 @@ private slots:
void showShaded();
void showNormal_data();
void showNormal();
+#ifndef QTEST_NO_CURSOR
void setOpaqueResizeAndMove_data();
void setOpaqueResizeAndMove();
+#endif
void setWindowFlags_data();
void setWindowFlags();
void mouseDoubleClick();
@@ -677,6 +681,7 @@ private:
int _count;
};
+#ifndef QTEST_NO_CURSOR
void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
{
QTest::addColumn<bool>("opaqueMode");
@@ -691,9 +696,6 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
void tst_QMdiSubWindow::setOpaqueResizeAndMove()
{
-#if defined (QT_NO_CURSOR) || defined (Q_OS_WINCE_WM) //For Windows CE we will set QT_NO_CURSOR if there is no cursor support
- QSKIP("No cursor available");
-#endif
QFETCH(bool, opaqueMode);
QFETCH(int, geometryCount);
QFETCH(int, expectedGeometryCount);
@@ -800,6 +802,7 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
QCOMPARE(window->size(), windowSize + QSize(geometryCount, geometryCount));
}
}
+#endif
void tst_QMdiSubWindow::setWindowFlags_data()
{
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index a71302096f..836333ceb1 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -60,6 +60,8 @@
#include "qplaintextedit.h"
#include "../../../shared/platformclipboard.h"
+#include "../../../qtest-config.h"
+
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
typedef QList<keyPairType> pairListType;
@@ -115,7 +117,9 @@ private slots:
void shiftDownInLineLastShouldSelectToEnd();
void undoRedoShouldRepositionTextEditCursor();
void lineWrapModes();
+#ifndef QTEST_NO_CURSOR
void mouseCursorShape();
+#endif
void implicitClear();
void undoRedoAfterSetContent();
void numPadKeyNavigation();
@@ -869,9 +873,9 @@ void tst_QPlainTextEdit::lineWrapModes()
delete window;
}
+#ifndef QTEST_NO_CURSOR
void tst_QPlainTextEdit::mouseCursorShape()
{
-#ifndef QT_NO_CURSOR
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
@@ -881,8 +885,8 @@ void tst_QPlainTextEdit::mouseCursorShape()
ed->setPlainText("Foo");
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
-#endif
}
+#endif
void tst_QPlainTextEdit::implicitClear()
{
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index cc718ea51f..ec656d35d7 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -68,6 +68,7 @@
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
+#include "../../../qtest-config.h"
//Used in copyAvailable
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
@@ -141,7 +142,9 @@ private slots:
void shiftDownInLineLastShouldSelectToEnd();
void undoRedoShouldRepositionTextEditCursor();
void lineWrapModes();
+#ifndef QTEST_NO_CURSOR
void mouseCursorShape();
+#endif
void implicitClear();
void undoRedoAfterSetContent();
void numPadKeyNavigation();
@@ -1235,9 +1238,9 @@ void tst_QTextEdit::lineWrapModes()
QCOMPARE(ed->document()->pageSize().width(), qreal(1000));
}
+#ifndef QTEST_NO_CURSOR
void tst_QTextEdit::mouseCursorShape()
{
-#ifndef QT_NO_CURSOR
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
@@ -1247,8 +1250,8 @@ void tst_QTextEdit::mouseCursorShape()
ed->setPlainText("Foo");
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
-#endif
}
+#endif
void tst_QTextEdit::implicitClear()
{