summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-03-12 21:03:49 +0100
committerLars Knoll <lars.knoll@nokia.com>2012-03-12 21:03:49 +0100
commitd5098f2802255da10b749b93705084ad1fdfc6a5 (patch)
tree6462008a4ab7d13435d93490fed96c62c516cbdf
parentd5a85940f785459d7b982d5fdf59a9fd18825092 (diff)
parentb5b41c18345719612e5411cc482466d2dbafdaf7 (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
-rwxr-xr-xbin/qtmodule-configtests22
-rw-r--r--config.tests/qpa/wayland/wayland.pro12
-rwxr-xr-xconfigure282
-rw-r--r--dist/changes-4.5.0-garden2
-rw-r--r--dist/changes-5.0.05
-rw-r--r--examples/animation/stickman/animation.cpp9
-rw-r--r--examples/desktop/desktop.pro2
-rw-r--r--examples/desktop/screenshot/screenshot.cpp2
-rw-r--r--examples/desktop/systray/images/bad.pngbin0 -> 2496 bytes
-rw-r--r--examples/desktop/systray/images/heart.pngbin0 -> 25780 bytes
-rw-r--r--examples/desktop/systray/images/trash.pngbin0 -> 12128 bytes
-rw-r--r--examples/desktop/systray/main.cpp63
-rw-r--r--examples/desktop/systray/systray.pro14
-rw-r--r--examples/desktop/systray/systray.qrc7
-rw-r--r--examples/desktop/systray/window.cpp270
-rw-r--r--examples/desktop/systray/window.h112
-rw-r--r--examples/graphicsview/chip/chip.h2
-rw-r--r--examples/tools/codecs/mainwindow.cpp2
-rw-r--r--examples/touch/fingerpaint/mainwindow.cpp6
-rw-r--r--examples/widgets/scribble/mainwindow.cpp6
-rw-r--r--examples/widgets/stylesheet/stylesheeteditor.cpp2
-rw-r--r--mkspecs/common/linux.conf3
-rw-r--r--mkspecs/common/qcc-base-qnx.conf3
-rw-r--r--mkspecs/common/wince/qmake.conf4
-rw-r--r--mkspecs/features/default_pre.prf2
-rw-r--r--mkspecs/features/moc.prf6
-rw-r--r--mkspecs/features/qt.prf7
-rw-r--r--mkspecs/features/qt_functions.prf10
-rw-r--r--mkspecs/features/qt_module_config.prf16
-rw-r--r--mkspecs/features/testcase.prf6
-rw-r--r--mkspecs/features/win32/dumpcpp.prf11
-rw-r--r--mkspecs/unsupported/qws/qnx-641/qmake.conf3
-rw-r--r--mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf3
-rw-r--r--mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf3
-rw-r--r--mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf3
-rw-r--r--mkspecs/unsupported/win32-borland/qmake.conf4
-rw-r--r--mkspecs/unsupported/win32-g++-cross/qmake.conf7
-rw-r--r--mkspecs/unsupported/win32-msvc2003/qmake.conf4
-rw-r--r--mkspecs/win32-g++/qmake.conf5
-rw-r--r--mkspecs/win32-icc/qmake.conf4
-rw-r--r--mkspecs/win32-msvc2005/qmake.conf4
-rw-r--r--mkspecs/win32-msvc2008/qmake.conf4
-rw-r--r--mkspecs/win32-msvc2010/qmake.conf4
-rw-r--r--qmake/Makefile.unix145
-rw-r--r--qmake/Makefile.win324
-rw-r--r--qmake/Makefile.win32-g++6
-rw-r--r--qmake/generators/makefile.cpp32
-rw-r--r--qmake/generators/makefile.h3
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp1
-rw-r--r--qmake/project.cpp19
-rw-r--r--qmake/property.cpp34
-rw-r--r--qmake/qmake.pri1
-rw-r--r--qtbase.pro20
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos.c3
-rw-r--r--src/3rdparty/pcre/sljit/sljitUtils.c4
-rw-r--r--src/concurrent/qtconcurrent_global.h13
-rw-r--r--src/concurrent/qtconcurrentrun.h72
-rw-r--r--src/corelib/codecs/codecs.pri2
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp28
-rw-r--r--src/corelib/codecs/qtextcodec.h4
-rw-r--r--src/corelib/global/global.pri4
-rw-r--r--src/corelib/global/qisenum.h64
-rw-r--r--src/corelib/global/qprocessordetection.h26
-rw-r--r--src/corelib/global/qsysinfo.h2
-rw-r--r--src/corelib/global/qtypetraits.h420
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp5
-rw-r--r--src/corelib/json/qjsonarray.cpp2
-rw-r--r--src/corelib/json/qjsonobject.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.h6
-rw-r--r--src/corelib/kernel/qmetatype.cpp5
-rw-r--r--src/corelib/kernel/qmetatype.h6
-rw-r--r--src/corelib/kernel/qvariant.cpp10
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp21
-rw-r--r--src/corelib/tools/qlocale.h1
-rw-r--r--src/corelib/tools/qregularexpression.cpp214
-rw-r--r--src/gui/accessible/qaccessible.cpp28
-rw-r--r--src/gui/accessible/qaccessible.h19
-rw-r--r--src/gui/accessible/qaccessible2.h29
-rw-r--r--src/gui/egl/egl.pri26
-rw-r--r--src/gui/egl/qegl.cpp751
-rw-r--r--src/gui/egl/qegl_p.h191
-rw-r--r--src/gui/egl/qegl_qpa.cpp110
-rw-r--r--src/gui/egl/qeglcontext_p.h117
-rw-r--r--src/gui/egl/qeglproperties.cpp563
-rw-r--r--src/gui/gui.pro60
-rw-r--r--src/gui/image/qimage.cpp6
-rw-r--r--src/gui/kernel/qguiapplication.cpp48
-rw-r--r--src/gui/kernel/qguiapplication.h1
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.cpp1
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.h2
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp14
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h3
-rw-r--r--src/gui/kernel/qwindow.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h3
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp6
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h2
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp19
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h18
-rw-r--r--src/gui/painting/qpaintengineex.cpp7
-rw-r--r--src/gui/painting/qpaintengineex_p.h4
-rw-r--r--src/gui/painting/qpainter.cpp110
-rw-r--r--src/gui/painting/qpainter.h2
-rw-r--r--src/gui/painting/qpainter_p.h1
-rw-r--r--src/gui/text/qdistancefield.cpp67
-rw-r--r--src/gui/text/qdistancefield_p.h2
-rw-r--r--src/gui/text/qfont.cpp14
-rw-r--r--src/gui/text/qfont_p.h1
-rw-r--r--src/gui/text/qfontengine.cpp20
-rw-r--r--src/gui/text/qfontengine_p.h7
-rw-r--r--src/gui/text/qglyphrun.h2
-rw-r--r--src/gui/text/qtextengine.cpp99
-rw-r--r--src/gui/text/qtextengine_p.h32
-rw-r--r--src/gui/text/qtextlayout.cpp13
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp1
-rw-r--r--src/network/kernel/qnetworkproxy.cpp47
-rw-r--r--src/network/kernel/qnetworkproxy.h4
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp182
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp7
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp45
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h7
-rw-r--r--src/platformsupport/platformsupport.pro2
-rw-r--r--src/plugins/accessible/widgets/itemviews.cpp64
-rw-r--r--src/plugins/accessible/widgets/itemviews.h11
-rw-r--r--src/plugins/platforms/blackberry/blackberry.pro71
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm3
-rw-r--r--src/plugins/platforms/eglfs/eglfs.pro6
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.cpp21
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.h2
-rw-r--r--src/plugins/platforms/kms/qkmsdevice.cpp2
-rw-r--r--src/plugins/platforms/platforms.pro4
-rw-r--r--src/plugins/platforms/qnx/main.cpp (renamed from src/plugins/platforms/blackberry/main.cpp)16
-rw-r--r--src/plugins/platforms/qnx/qnx.pro71
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.cpp (renamed from src/plugins/platforms/blackberry/qbbbuffer.cpp)48
-rw-r--r--src/plugins/platforms/qnx/qqnxbuffer.h (renamed from src/plugins/platforms/blackberry/qbbbuffer.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.cpp (renamed from src/plugins/platforms/blackberry/qbbclipboard.cpp)34
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.h (renamed from src/plugins/platforms/blackberry/qbbclipboard.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxeventthread.cpp (renamed from src/plugins/platforms/blackberry/qbbeventthread.cpp)163
-rw-r--r--src/plugins/platforms/qnx/qqnxeventthread.h (renamed from src/plugins/platforms/blackberry/qbbeventthread.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxglbackingstore.cpp (renamed from src/plugins/platforms/blackberry/qbbglbackingstore.cpp)62
-rw-r--r--src/plugins/platforms/qnx/qqnxglbackingstore.h (renamed from src/plugins/platforms/blackberry/qbbglbackingstore.h)28
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.cpp (renamed from src/plugins/platforms/blackberry/qbbglcontext.cpp)92
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.h (renamed from src/plugins/platforms/blackberry/qbbglcontext.h)14
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp (renamed from src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp)238
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.h (renamed from src/plugins/platforms/blackberry/qbbinputcontext_imf.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp (renamed from src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp)64
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.h (renamed from src/plugins/platforms/blackberry/qbbinputcontext_noimf.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp (renamed from src/plugins/platforms/blackberry/qbbintegration.cpp)140
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h (renamed from src/plugins/platforms/blackberry/qbbintegration.h)36
-rw-r--r--src/plugins/platforms/qnx/qqnxkeytranslator.h (renamed from src/plugins/platforms/blackberry/qbbkeytranslator.h)12
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorthread.cpp (renamed from src/plugins/platforms/blackberry/qbbnavigatorthread.cpp)71
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorthread.h (renamed from src/plugins/platforms/blackberry/qbbnavigatorthread.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp (renamed from src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp)52
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h (renamed from src/plugins/platforms/blackberry/qbbrasterbackingstore.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.cpp (renamed from src/plugins/platforms/blackberry/qbbrootwindow.cpp)68
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.h (renamed from src/plugins/platforms/blackberry/qbbrootwindow.h)16
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp (renamed from src/plugins/platforms/blackberry/qbbscreen.cpp)96
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h (renamed from src/plugins/platforms/blackberry/qbbscreen.h)28
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp (renamed from src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp)118
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboard.h (renamed from src/plugins/platforms/blackberry/qbbvirtualkeyboard.h)8
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp (renamed from src/plugins/platforms/blackberry/qbbwindow.cpp)204
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h (renamed from src/plugins/platforms/blackberry/qbbwindow.h)42
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp28
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h2
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp16
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp36
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/plugins/platforms/xlib/main.cpp6
-rw-r--r--src/plugins/platforms/xlib/qxlibkeyboard.cpp36
-rw-r--r--src/plugins/platforms/xlib/xlib.json3
-rw-r--r--src/plugins/platforms/xlib/xlib.pro2
-rw-r--r--src/printsupport/dialogs/qprintdialog.h19
-rw-r--r--src/printsupport/kernel/qprinter.cpp2
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/src.pro28
-rw-r--r--src/testlib/qtest.h8
-rw-r--r--src/testlib/qtest_gui.h30
-rw-r--r--src/testlib/qtestaccessible.h50
-rw-r--r--src/testlib/qtestcase.cpp49
-rw-r--r--src/testlib/qtestcase.h16
-rw-r--r--src/testlib/qtestresult.cpp38
-rw-r--r--src/testlib/qtestresult_p.h6
-rw-r--r--src/tools/qdoc/TODO.txt87
-rw-r--r--src/tools/qdoc/atom.cpp387
-rw-r--r--src/tools/qdoc/atom.h237
-rw-r--r--src/tools/qdoc/codechunk.cpp150
-rw-r--r--src/tools/qdoc/codechunk.h123
-rw-r--r--src/tools/qdoc/codemarker.cpp682
-rw-r--r--src/tools/qdoc/codemarker.h192
-rw-r--r--src/tools/qdoc/codeparser.cpp409
-rw-r--r--src/tools/qdoc/codeparser.h107
-rw-r--r--src/tools/qdoc/config.cpp978
-rw-r--r--src/tools/qdoc/config.h199
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp1354
-rw-r--r--src/tools/qdoc/cppcodemarker.h96
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp2502
-rw-r--r--src/tools/qdoc/cppcodeparser.h196
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp6434
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h543
-rw-r--r--src/tools/qdoc/doc.cpp3393
-rw-r--r--src/tools/qdoc/doc.h198
-rw-r--r--src/tools/qdoc/doc/config/compat.qdocconf12
-rw-r--r--src/tools/qdoc/doc/config/config.pro13
-rw-r--r--src/tools/qdoc/doc/config/images/arrow_down.pngbin0 -> 177 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_l.pngbin0 -> 100 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_l_blank.pngbin0 -> 84 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bg_ll_blank.pngbin0 -> 320 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bg_r.pngbin0 -> 96 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bg_ul_blank.pngbin0 -> 304 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/box_bg.pngbin0 -> 89 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/breadcrumb.pngbin0 -> 134 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bullet_dn.pngbin0 -> 230 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bullet_gt.pngbin0 -> 124 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/bullet_sq.pngbin0 -> 74 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/bullet_up.pngbin0 -> 210 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/feedbackground.pngbin0 -> 263 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/header_bg.pngbin0 -> 114 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/horBar.pngbin0 -> 2807 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/page.pngbin0 -> 3102 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/page_bg.pngbin0 -> 84 bytes
-rw-r--r--src/tools/qdoc/doc/config/images/spinner.gifbin0 -> 2037 bytes
-rwxr-xr-xsrc/tools/qdoc/doc/config/images/sprites-combined.pngbin0 -> 62534 bytes
-rw-r--r--src/tools/qdoc/doc/config/macros.qdocconf40
-rw-r--r--src/tools/qdoc/doc/config/qdoc-online.qdocconf2
-rw-r--r--src/tools/qdoc/doc/config/qdoc-project.qdocconf48
-rw-r--r--src/tools/qdoc/doc/config/qdoc.qdocconf2
-rw-r--r--src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf98
-rw-r--r--src/tools/qdoc/doc/config/qt-defines.qdocconf17
-rw-r--r--src/tools/qdoc/doc/config/qt-html-default-styles.qdocconf32
-rw-r--r--src/tools/qdoc/doc/config/qt-html-online-styles.qdocconf72
-rw-r--r--src/tools/qdoc/doc/config/qt-html-templates-online.qdocconf115
-rw-r--r--src/tools/qdoc/doc/config/qt-html-templates.qdocconf54
-rw-r--r--src/tools/qdoc/doc/config/style/offline.css673
-rw-r--r--src/tools/qdoc/doc/corefeatures.qdoc35
-rw-r--r--src/tools/qdoc/doc/examples/componentset/ProgressBar.qml135
-rw-r--r--src/tools/qdoc/doc/examples/componentset/Switch.qml142
-rw-r--r--src/tools/qdoc/doc/examples/componentset/TabWidget.qml183
-rw-r--r--src/tools/qdoc/doc/examples/componentset/componentset.pro5
-rw-r--r--src/tools/qdoc/doc/examples/componentset/uicomponents.qdoc37
-rw-r--r--src/tools/qdoc/doc/examples/examples.qdoc84
-rw-r--r--src/tools/qdoc/doc/examples/layoutmanagement.qdocinc13
-rw-r--r--src/tools/qdoc/doc/examples/main.cpp54
-rw-r--r--src/tools/qdoc/doc/examples/mainwindow.cpp251
-rw-r--r--src/tools/qdoc/doc/examples/minimum.qdocconf38
-rw-r--r--src/tools/qdoc/doc/examples/objectmodel.qdocinc11
-rw-r--r--src/tools/qdoc/doc/examples/samples.qdocinc109
-rw-r--r--src/tools/qdoc/doc/examples/signalandslots.qdocinc9
-rw-r--r--src/tools/qdoc/doc/files/compat.qdocconf12
-rw-r--r--src/tools/qdoc/doc/files/qt.qdocconf115
-rw-r--r--src/tools/qdoc/doc/images/happy.gifbin0 -> 11526 bytes
-rw-r--r--src/tools/qdoc/doc/images/happyguy.jpgbin0 -> 53442 bytes
-rw-r--r--src/tools/qdoc/doc/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--src/tools/qdoc/doc/images/training.jpgbin0 -> 8368 bytes
-rw-r--r--src/tools/qdoc/doc/qdoc-guide.qdoc690
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc8764
-rw-r--r--src/tools/qdoc/editdistance.cpp114
-rw-r--r--src/tools/qdoc/editdistance.h59
-rw-r--r--src/tools/qdoc/generator.cpp1495
-rw-r--r--src/tools/qdoc/generator.h221
-rw-r--r--src/tools/qdoc/helpprojectwriter.cpp772
-rw-r--r--src/tools/qdoc/helpprojectwriter.h111
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp5115
-rw-r--r--src/tools/qdoc/htmlgenerator.h319
-rw-r--r--src/tools/qdoc/jscodemarker.cpp148
-rw-r--r--src/tools/qdoc/jscodemarker.h75
-rw-r--r--src/tools/qdoc/location.cpp398
-rw-r--r--src/tools/qdoc/location.h131
-rw-r--r--src/tools/qdoc/main.cpp481
-rw-r--r--src/tools/qdoc/node.cpp2780
-rw-r--r--src/tools/qdoc/node.h958
-rw-r--r--src/tools/qdoc/openedlist.cpp228
-rw-r--r--src/tools/qdoc/openedlist.h91
-rw-r--r--src/tools/qdoc/pagegenerator.cpp388
-rw-r--r--src/tools/qdoc/pagegenerator.h99
-rw-r--r--src/tools/qdoc/plaincodemarker.cpp137
-rw-r--r--src/tools/qdoc/plaincodemarker.h (renamed from src/gui/egl/qeglproperties_p.h)70
-rw-r--r--src/tools/qdoc/puredocparser.cpp63
-rw-r--r--src/tools/qdoc/puredocparser.h72
-rw-r--r--src/tools/qdoc/qdoc.pro114
-rw-r--r--src/tools/qdoc/qmlcodemarker.cpp302
-rw-r--r--src/tools/qdoc/qmlcodemarker.h86
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp291
-rw-r--r--src/tools/qdoc/qmlcodeparser.h92
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.cpp851
-rw-r--r--src/tools/qdoc/qmlmarkupvisitor.h178
-rw-r--r--src/tools/qdoc/qmlparser/qmlparser.pri19
-rw-r--r--src/tools/qdoc/qmlparser/qqmljs.g3016
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast.cpp931
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsast_p.h2640
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastfwd_p.h186
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor.cpp (renamed from config.tests/qpa/wayland/wayland.cpp)20
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h329
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.cpp161
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsengine_p.h126
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsglobal_p.h69
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar.cpp1013
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsgrammar_p.h211
-rw-r--r--src/tools/qdoc/qmlparser/qqmljskeywords_p.h860
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer.cpp1171
-rw-r--r--src/tools/qdoc/qmlparser/qqmljslexer_p.h248
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsmemorypool_p.h173
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser.cpp1817
-rw-r--r--src/tools/qdoc/qmlparser/qqmljsparser_p.h248
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp594
-rw-r--r--src/tools/qdoc/qmlvisitor.h122
-rw-r--r--src/tools/qdoc/quoter.cpp377
-rw-r--r--src/tools/qdoc/quoter.h93
-rw-r--r--src/tools/qdoc/separator.cpp77
-rw-r--r--src/tools/qdoc/separator.h58
-rw-r--r--src/tools/qdoc/text.cpp287
-rw-r--r--src/tools/qdoc/text.h106
-rw-r--r--src/tools/qdoc/tokenizer.cpp771
-rw-r--r--src/tools/qdoc/tokenizer.h182
-rw-r--r--src/tools/qdoc/tr.h72
-rw-r--r--src/tools/qdoc/tree.cpp2358
-rw-r--r--src/tools/qdoc/tree.h174
-rw-r--r--src/tools/qdoc/yyindent.cpp1190
-rw-r--r--src/tools/rcc/rcc.cpp304
-rw-r--r--src/tools/tools.pro13
-rw-r--r--src/widgets/dialogs/qdialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp65
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h3
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp28
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp17
-rw-r--r--src/widgets/util/qsystemtrayicon_mac.mm8
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp227
-rw-r--r--src/widgets/util/util.pri9
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp12
-rw-r--r--src/widgets/widgets/qabstractslider.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp4
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qprogressbar.cpp2
-rw-r--r--src/widgets/widgets/qpushbutton.cpp4
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp4
-rw-r--r--src/winmain/winmain.pro4
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp14
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp14
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp122
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp33
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp39
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp52
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp10
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp703
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp6
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp85
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.h4
-rw-r--r--tests/auto/gui/image/image.pro2
-rw-r--r--tests/auto/gui/image/qimagereader/qimagereader.pro2
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp1
-rw-r--r--tests/auto/gui/image/qimagewriter/qimagewriter.pro2
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp1
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp43
-rw-r--r--tests/auto/gui/kernel/qdrag/qdrag.pro2
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp7
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro2
-rw-r--r--tests/auto/gui/kernel/qkeysequence/qkeysequence.pro2
-rw-r--r--tests/auto/gui/kernel/qmouseevent/qmouseevent.pro2
-rw-r--r--tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp20
-rw-r--r--tests/auto/gui/kernel/qpalette/qpalette.pro2
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp1
-rw-r--r--tests/auto/gui/painting/painting.pro2
-rw-r--r--tests/auto/gui/painting/qbrush/qbrush.pro2
-rw-r--r--tests/auto/gui/painting/qpolygon/qpolygon.pro2
-rw-r--r--tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp1
-rw-r--r--tests/auto/gui/text/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro2
-rw-r--r--tests/auto/gui/text/qstatictext/qstatictext.pro2
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp11
-rw-r--r--tests/auto/gui/text/qtextblock/qtextblock.pro2
-rw-r--r--tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro2
-rw-r--r--tests/auto/gui/util/qdesktopservices/qdesktopservices.pro2
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp1
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp33
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/qnetworkinterface.pro2
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp97
-rw-r--r--tests/auto/network/network.pro4
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp9
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp6
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro2
-rw-r--r--tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp1
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp42
-rw-r--r--tests/auto/printsupport/kernel/kernel.pro4
-rw-r--r--tests/auto/printsupport/kernel/qprinter/.gitignore (renamed from tests/auto/gui/painting/qprinter/.gitignore)0
-rw-r--r--tests/auto/printsupport/kernel/qprinter/qprinter.pro (renamed from tests/auto/gui/painting/qprinter/qprinter.pro)0
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp (renamed from tests/auto/gui/painting/qprinter/tst_qprinter.cpp)0
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/.gitignore (renamed from tests/auto/gui/painting/qprinterinfo/.gitignore)0
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/qprinterinfo.pro (renamed from tests/auto/gui/painting/qprinterinfo/qprinterinfo.pro)0
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp (renamed from tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp)0
-rw-r--r--tests/auto/printsupport/printsupport.pro3
-rw-r--r--tests/auto/sql/kernel/qsql/qsql.pro2
-rw-r--r--tests/auto/sql/kernel/qsql/tst_qsql.cpp4
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml36
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt36
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml36
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml36
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.xunitxml6
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.lightxml2
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.txt2
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.xml2
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.xunitxml2
-rw-r--r--tests/auto/testlib/selftests/expected_float.txt12
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.lightxml10
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.txt10
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.xml10
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.xunitxml10
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.xml4
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.xunitxml4
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.lightxml12
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.txt12
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.xml12
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.xunitxml24
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.lightxml2
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.txt2
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.xml2
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.xunitxml2
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp23
-rw-r--r--tests/auto/tools/qmake/testdata/one_space/one_space.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/simple_app/simple_app.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/simple_dll/simple_dll.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_app/simple_app.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro6
-rw-r--r--tests/auto/tools/rcc/.gitignore1
-rw-r--r--tests/auto/tools/rcc/data/binary/aliasdir/aliasdir.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/aliasdir/compressme.txt322
-rw-r--r--tests/auto/tools/rcc/data/binary/aliases.expected4
-rw-r--r--tests/auto/tools/rcc/data/binary/aliases.qrc10
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.de.expected13
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.de_CH.expected13
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.expected13
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.ko.expected13
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.locale3
-rw-r--r--tests/auto/tools/rcc/data/binary/allfeatures.qrc30
-rw-r--r--tests/auto/tools/rcc/data/binary/blahblah.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/currentdir.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/currentdir2.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.de.expected5
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.de_CH.expected6
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.expected4
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.it.expected6
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.locale3
-rw-r--r--tests/auto/tools/rcc/data/binary/locale.qrc30
-rw-r--r--tests/auto/tools/rcc/data/binary/multiple.expected5
-rw-r--r--tests/auto/tools/rcc/data/binary/multiple.qrc10
-rw-r--r--tests/auto/tools/rcc/data/binary/otherdir/otherdir.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/prefixes.expected6
-rw-r--r--tests/auto/tools/rcc/data/binary/prefixes.qrc21
-rw-r--r--tests/auto/tools/rcc/data/binary/search_file.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/searchpath1/search_file.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/searchpath2/search_file.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/simple.expected3
-rw-r--r--tests/auto/tools/rcc/data/binary/simple.qrc7
-rw-r--r--tests/auto/tools/rcc/data/binary/subdir/subdir.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/test/german.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/test/test/test1.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/test/test/test2.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/test/testdir.txt1
-rw-r--r--tests/auto/tools/rcc/data/binary/test/testdir2.txt1
-rw-r--r--tests/auto/tools/rcc/data/images/images.bin.expected (renamed from tests/auto/tools/rcc/data/images.bin.expected)bin663 -> 663 bytes
-rw-r--r--tests/auto/tools/rcc/data/images/images.expected (renamed from tests/auto/tools/rcc/data/images.expected)0
-rw-r--r--tests/auto/tools/rcc/data/images/images.qrc (renamed from tests/auto/tools/rcc/data/images.qrc)0
-rw-r--r--tests/auto/tools/rcc/data/images/images/circle.png (renamed from tests/auto/tools/rcc/data/images/circle.png)bin165 -> 165 bytes
-rw-r--r--tests/auto/tools/rcc/data/images/images/square.png (renamed from tests/auto/tools/rcc/data/images/square.png)bin94 -> 94 bytes
-rw-r--r--tests/auto/tools/rcc/data/images/images/subdir/triangle.png (renamed from tests/auto/tools/rcc/data/images/subdir/triangle.png)bin170 -> 170 bytes
-rw-r--r--tests/auto/tools/rcc/data/parentdir.txt1
-rw-r--r--tests/auto/tools/rcc/rcc.pro7
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp212
-rw-r--r--tests/auto/widgets/effects/effects.pro1
-rw-r--r--tests/auto/widgets/effects/qpixmapfilter/noise.png (renamed from tests/auto/gui/image/qpixmapfilter/noise.png)bin7517 -> 7517 bytes
-rw-r--r--tests/auto/widgets/effects/qpixmapfilter/qpixmapfilter.pro (renamed from tests/auto/gui/image/qpixmapfilter/qpixmapfilter.pro)0
-rw-r--r--tests/auto/widgets/effects/qpixmapfilter/tst_qpixmapfilter.cpp (renamed from tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp)0
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/auto/widgets/kernel/kernel.pro1
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp4
-rw-r--r--tests/auto/widgets/kernel/qicon/.gitignore (renamed from tests/auto/gui/image/qicon/.gitignore)0
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/testtheme/16x16/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/testtheme/16x16/actions/appointment-new.png)bin897 -> 897 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/testtheme/22x22/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/testtheme/22x22/actions/appointment-new.png)bin1411 -> 1411 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/testtheme/32x32/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/testtheme/32x32/actions/appointment-new.png)bin2399 -> 2399 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/testtheme/index.theme (renamed from tests/auto/gui/image/qicon/icons/testtheme/index.theme)0
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/testtheme/scalable/actions/svg-only.svg (renamed from tests/auto/gui/image/qicon/icons/testtheme/scalable/actions/svg-only.svg)0
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/16x16/actions/address-book-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/16x16/actions/address-book-new.png)bin796 -> 796 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/16x16/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/16x16/actions/appointment-new.png)bin897 -> 897 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/22x22/actions/address-book-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/22x22/actions/address-book-new.png)bin924 -> 924 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/22x22/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/22x22/actions/appointment-new.png)bin1411 -> 1411 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/32x32/actions/address-book-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/32x32/actions/address-book-new.png)bin1897 -> 1897 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/32x32/actions/appointment-new.png (renamed from tests/auto/gui/image/qicon/icons/themeparent/32x32/actions/appointment-new.png)bin2399 -> 2399 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/index.theme (renamed from tests/auto/gui/image/qicon/icons/themeparent/index.theme)0
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/scalable/actions/address-book-new.svg (renamed from tests/auto/gui/image/qicon/icons/themeparent/scalable/actions/address-book-new.svg)0
-rw-r--r--tests/auto/widgets/kernel/qicon/icons/themeparent/scalable/actions/appointment-new.svg (renamed from tests/auto/gui/image/qicon/icons/themeparent/scalable/actions/appointment-new.svg)0
-rw-r--r--tests/auto/widgets/kernel/qicon/image.png (renamed from tests/auto/gui/image/qicon/image.png)bin14743 -> 14743 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/qicon.pro (renamed from tests/auto/gui/image/qicon/qicon.pro)0
-rw-r--r--tests/auto/widgets/kernel/qicon/rect.png (renamed from tests/auto/gui/image/qicon/rect.png)bin175 -> 175 bytes
-rw-r--r--tests/auto/widgets/kernel/qicon/tst_qicon.cpp (renamed from tests/auto/gui/image/qicon/tst_qicon.cpp)0
-rw-r--r--tests/auto/widgets/kernel/qicon/tst_qicon.qrc (renamed from tests/auto/gui/image/qicon/tst_qicon.qrc)0
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp75
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp30
-rw-r--r--tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp12
-rw-r--r--tests/auto/widgets/widgets/qmenubar/qmenubar.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/qtextedit.pro2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp1
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro4
-rw-r--r--tools/configure/configureapp.cpp63
528 files changed, 71629 insertions, 5155 deletions
diff --git a/bin/qtmodule-configtests b/bin/qtmodule-configtests
index 412f57ff8a..965a3e556b 100755
--- a/bin/qtmodule-configtests
+++ b/bin/qtmodule-configtests
@@ -268,17 +268,19 @@ sub executeTest {
unlink $testOutFile1, $testOutFile2;
# Run qmake && make
- executeLoggedCommand($QMAKE, @QMAKEARGS);
- my ($makeExitCode, $makeOutput) = executeLoggedCommand($MAKE);
-
- # If make prints "blah blah blah\nSkipped." we consider this a skipped test
- if ($makeOutput !~ qr(^Skipped\.$)ms) {
- # Check the test exists (can't reliably execute, especially for cross compilation)
- if (-e $testOutFile1 or -e $testOutFile2) {
- $ret = 1;
+ my ($qmakeExitCode, $qmakeOutput) = executeLoggedCommand($QMAKE, @QMAKEARGS);
+ if ($qmakeExitCode == 0) {
+ my ($makeExitCode, $makeOutput) = executeLoggedCommand($MAKE);
+
+ # If make prints "blah blah blah\nSkipped." we consider this a skipped test
+ if ($makeOutput !~ qr(^Skipped\.$)ms) {
+ # Check the test exists (can't reliably execute, especially for cross compilation)
+ if ($makeExitCode == 0 and (-e $testOutFile1 or -e $testOutFile2)) {
+ $ret = 1;
+ }
+ } else {
+ $ret = 2;
}
- } else {
- $ret = 2;
}
my $fh;
diff --git a/config.tests/qpa/wayland/wayland.pro b/config.tests/qpa/wayland/wayland.pro
deleted file mode 100644
index 6d85073b91..0000000000
--- a/config.tests/qpa/wayland/wayland.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-SOURCES = wayland.cpp
-CONFIG -= qt
-
-for(d, QMAKE_INCDIR_WAYLAND) {
- exists($$d):INCLUDEPATH += $$d
-}
-
-for(p, QMAKE_LIBDIR_WAYLAND) {
- exists($$p):LIBS += -L$$p
-}
-
-LIBS += $$QMAKE_LIBS_WAYLAND
diff --git a/configure b/configure
index f29df99ae9..66c5f1a06d 100755
--- a/configure
+++ b/configure
@@ -639,17 +639,6 @@ rm -f "$outpath/config.tests/.qmake.cache"
cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
QMakeVar add styles "cde mac motif plastique cleanlooks windows"
-QMakeVar add decorations "default windows styled"
-QMakeVar add mouse-drivers "pc"
-if [ "$UNAME_SYSTEM" = "Linux" ] ; then
- QMakeVar add gfx-drivers "linuxfb"
- QMakeVar add mouse-drivers "linuxtp"
-fi
-QMakeVar add kbd-drivers "tty"
-
-if [ "$CFG_DEV" = "yes" ]; then
- QMakeVar add kbd-drivers "um"
-fi
# QTDIR may be set and point to an old or system-wide Qt installation
unset QTDIR
@@ -662,7 +651,6 @@ CFG_CONFIGURE_EXIT_ON_ERROR=yes
CFG_PROFILE=no
CFG_EXCEPTIONS=unspecified
CFG_GUI=auto # (yes|no|auto)
-CFG_INCREMENTAL=auto
CFG_QCONFIG=full
CFG_DEBUG=auto
CFG_MYSQL_CONFIG=
@@ -705,37 +693,17 @@ CFG_V8SNAPSHOT=auto
CFG_DECLARATIVE_DEBUG=yes
CFG_JAVASCRIPTCORE_JIT=auto
-CFG_GFX_AVAILABLE="linuxfb transformed qvfb vnc multiscreen directfb"
-CFG_GFX_ON="linuxfb multiscreen"
-CFG_GFX_PLUGIN_AVAILABLE=
-CFG_GFX_PLUGIN=
-CFG_GFX_OFF=
-CFG_KBD_AVAILABLE="tty linuxinput qvfb"
-CFG_KBD_ON="tty" #default, see QMakeVar above
-CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
-CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above
-
CFG_ARCH=
CFG_HOST_ARCH=
-CFG_KBD_PLUGIN_AVAILABLE=
-CFG_KBD_PLUGIN=
-CFG_KBD_OFF=
-CFG_MOUSE_PLUGIN_AVAILABLE=
-CFG_MOUSE_PLUGIN=
-CFG_MOUSE_OFF=
CFG_USE_GNUMAKE=no
CFG_IM=yes
-CFG_DECORATION_AVAILABLE="styled windows default"
-CFG_DECORATION_ON="${CFG_DECORATION_AVAILABLE}" # all on by default
-CFG_DECORATION_PLUGIN_AVAILABLE=
-CFG_DECORATION_PLUGIN=
CFG_XINPUT2=auto
CFG_XINPUT=runtime
CFG_XKB=auto
CFG_XCB=auto
CFG_XCB_LIMITED=yes
-CFG_WAYLAND=auto
CFG_LIBUDEV=auto
+CFG_OBSOLETE_WAYLAND=no
CFG_EVDEV=auto
CFG_NIS=auto
CFG_CUPS=auto
@@ -849,7 +817,7 @@ QT_CFLAGS_GSTREAMER=
QT_LIBS_GSTREAMER=
#-------------------------------------------------------------------------------
-# check SQL drivers, mouse drivers and decorations available in this package
+# check SQL drivers available in this package
#-------------------------------------------------------------------------------
# opensource version removes some drivers, so force them to be off
@@ -868,47 +836,6 @@ if [ -d "$relpath/src/plugins/sqldrivers" ]; then
done
fi
-CFG_DECORATION_PLUGIN_AVAILABLE=
-if [ -d "$relpath/src/plugins/decorations" ]; then
- for a in "$relpath/src/plugins/decorations/"*; do
- if [ -d "$a" ]; then
- base_a=`basename "$a"`
- CFG_DECORATION_PLUGIN_AVAILABLE="${CFG_DECORATION_PLUGIN_AVAILABLE} ${base_a}"
- fi
- done
-fi
-
-CFG_KBD_PLUGIN_AVAILABLE=
-if [ -d "$relpath/src/plugins/kbddrivers" ]; then
- for a in "$relpath/src/plugins/kbddrivers/"*; do
- if [ -d "$a" ]; then
- base_a=`basename "$a"`
- CFG_KBD_PLUGIN_AVAILABLE="${CFG_KBD_PLUGIN_AVAILABLE} ${base_a}"
- fi
- done
-fi
-
-CFG_MOUSE_PLUGIN_AVAILABLE=
-if [ -d "$relpath/src/plugins/mousedrivers" ]; then
- for a in "$relpath/src/plugins/mousedrivers/"*; do
- if [ -d "$a" ]; then
- base_a=`basename "$a"`
- CFG_MOUSE_PLUGIN_AVAILABLE="${CFG_MOUSE_PLUGIN_AVAILABLE} ${base_a}"
- fi
- done
-fi
-
-CFG_GFX_PLUGIN_AVAILABLE=
-if [ -d "$relpath/src/plugins/gfxdrivers" ]; then
- for a in "$relpath/src/plugins/gfxdrivers/"*; do
- if [ -d "$a" ]; then
- base_a=`basename "$a"`
- CFG_GFX_PLUGIN_AVAILABLE="${CFG_GFX_PLUGIN_AVAILABLE} ${base_a}"
- fi
- done
- CFG_GFX_OFF="$CFG_GFX_AVAILABLE" # assume all off
-fi
-
CFG_IMAGEFORMAT_PLUGIN_AVAILABLE=
if [ -d "$relpath/src/plugins/imageformats" ]; then
for a in "$relpath/src/plugins/imageformats/"*; do
@@ -960,7 +887,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style yes options
- -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-wayland|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-declarative-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
+ -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-declarative-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
VAL=yes
;;
@@ -1249,20 +1176,6 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
- qvfb) # left for commandline compatibility, not documented
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- if [ "$VAL" = "yes" ]; then
- QMakeVar add gfx-drivers qvfb
- QMakeVar add kbd-drivers qvfb
- QMakeVar add mouse-drivers qvfb
- CFG_GFX_ON="$CFG_GFX_ON qvfb"
- CFG_KBD_ON="$CFG_KBD_ON qvfb"
- CFG_MOUSE_ON="$CFG_MOUSE_ON qvfb"
- fi
- else
- UNKNOWN_OPT=yes
- fi
- ;;
nomake)
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS $VAL"
;;
@@ -1446,13 +1359,6 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
- incremental)
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_INCREMENTAL="$VAL"
- else
- UNKNOWN_OPT=yes
- fi
- ;;
fatal_error)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_CONFIGURE_EXIT_ON_ERROR="$VAL"
@@ -1749,11 +1655,7 @@ while [ "$#" -gt 0 ]; do
fi
;;
wayland)
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_WAYLAND="$VAL"
- else
- UNKNOWN_OPT=yes
- fi
+ CFG_OBSOLETE_WAYLAND=yes
;;
libudev)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
@@ -1891,7 +1793,7 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
- sql-*|gfx-*|decoration-*|kbd-*|mouse-*|imageformat-*)
+ sql-*|imageformat-*)
# if Qt style options were used, $VAL can be "no", "qt", or "plugin"
# if autoconf style options were used, $VAL can be "yes" or "no"
[ "$VAL" = "yes" ] && VAL=qt
@@ -1909,30 +1811,6 @@ while [ "$#" -gt 0 ]; do
sql)
avail="$CFG_SQL_AVAILABLE"
;;
- gfx)
- avail="$CFG_GFX_AVAILABLE"
- if [ "$OPT" = "plugin" ]; then
- avail="$CFG_GFX_PLUGIN_AVAILABLE"
- fi
- ;;
- decoration)
- avail="$CFG_DECORATION_AVAILABLE"
- if [ "$OPT" = "plugin" ]; then
- avail="$CFG_DECORATION_PLUGIN_AVAILABLE"
- fi
- ;;
- kbd)
- avail="$CFG_KBD_AVAILABLE"
- if [ "$OPT" = "plugin" ]; then
- avail="$CFG_KBD_PLUGIN_AVAILABLE"
- fi
- ;;
- mouse)
- avail="$CFG_MOUSE_AVAILABLE"
- if [ "$OPT" = "plugin" ]; then
- avail="$CFG_MOUSE_PLUGIN_AVAILABLE"
- fi
- ;;
imageformat)
avail="$CFG_IMAGEFORMAT_PLUGIN_AVAILABLE"
if [ "$OPT" != "plugin" ]; then
@@ -1969,36 +1847,12 @@ while [ "$#" -gt 0 ]; do
if [ "$OPT" = "plugin" ] || [ "$OPT" = "qt" ]; then
if [ "$OPT" = "plugin" ]; then
- [ "$VAR" = "decoration" ] && QMakeVar del "${VAR}s" "$VAL"
- [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"` && CFG_DECORATION_PLUGIN="$CFG_DECORATION_PLUGIN ${VAL}"
- [ "$VAR" = "kbd" ] && QMakeVar del "${VAR}s" "$VAL"
- [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"` && CFG_KBD_PLUGIN="$CFG_KBD_PLUGIN ${VAL}"
- [ "$VAR" = "mouse" ] && QMakeVar del "${VAR}s" "$VAL"
- [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"` && CFG_MOUSE_PLUGIN="$CFG_MOUSE_PLUGIN ${VAL}"
- [ "$VAR" = "gfx" ] && QMakeVar del "${VAR}s" "$VAL"
- [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"` && CFG_GFX_PLUGIN="${CFG_GFX_PLUGIN} ${VAL}"
VAR="${VAR}-${OPT}"
- else
- if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "decoration" ] || [ "$VAR" = "mouse" ]; then
- [ "$VAR" = "gfx" ] && CFG_GFX_ON="$CFG_GFX_ON $VAL"
- [ "$VAR" = "kbd" ] && CFG_KBD_ON="$CFG_KBD_ON $VAL"
- [ "$VAR" = "decoration" ] && CFG_DECORATION_ON="$CFG_DECORATION_ON $VAL"
- [ "$VAR" = "mouse" ] && CFG_MOUSE_ON="$CFG_MOUSE_ON $VAL"
- VAR="${VAR}-driver"
- fi
fi
QMakeVar add "${VAR}s" "${VAL}"
elif [ "$OPT" = "no" ]; then
PLUG_VAR="${VAR}-plugin"
- if [ "$VAR" = "gfx" ] || [ "$VAR" = "kbd" ] || [ "$VAR" = "mouse" ]; then
- IN_VAR="${VAR}-driver"
- else
- IN_VAR="${VAR}"
- fi
- [ "$VAR" = "decoration" ] && CFG_DECORATION_ON=`echo "${CFG_DECORATION_ON} " | sed "s,${VAL} ,,g"`
- [ "$VAR" = "gfx" ] && CFG_GFX_ON=`echo "${CFG_GFX_ON} " | sed "s,${VAL} ,,g"`
- [ "$VAR" = "kbd" ] && CFG_KBD_ON=`echo "${CFG_KBD_ON} " | sed "s,${VAL} ,,g"`
- [ "$VAR" = "mouse" ] && CFG_MOUSE_ON=`echo "${CFG_MOUSE_ON} " | sed "s,${VAL} ,,g"`
+ IN_VAR="${VAR}"
QMakeVar del "${IN_VAR}s" "$VAL"
QMakeVar del "${PLUG_VAR}s" "$VAL"
fi
@@ -2221,29 +2075,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
- # symlink the qmake directory
- find "$relpath/qmake" | while read a; do
- my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"`
- if [ '!' -f "$my_a" ]; then
- if [ -d "$a" ]; then
- # directories are created...
- mkdir -p "$my_a"
- else
- a_dir=`dirname "$my_a"`
- [ -d "$a_dir" ] || mkdir -p "$a_dir"
- # ... and files are symlinked
- case `basename "$a"` in
- *.o|*.d|GNUmakefile*|qmake)
- ;;
- *)
- rm -f "$my_a"
- ln -s "$a" "$my_a"
- ;;
- esac
- fi
- fi
- done
-
# make a syncqt script that can be used in the shadow
rm -f "$outpath/bin/syncqt"
if [ -x "$relpath/bin/syncqt" ]; then
@@ -2528,6 +2359,7 @@ fi
if [ "$PLATFORM" != "$XPLATFORM" ]; then
QT_CROSS_COMPILE=yes
QMAKE_CONFIG="$QMAKE_CONFIG cross_compile"
+ QTCONFIG_CONFIG="$QTCONFIG_CONFIG cross_compile"
fi
if [ "$BUILD_ON_MAC" = "yes" ]; then
@@ -3178,13 +3010,6 @@ if [ "$OPT_HELP" = "yes" ]; then
XCBN=" "
fi
- if [ "$CFG_WAYLAND" = "no" ]; then
- XWY=" "
- XWN="*"
- else
- XWY="*"
- XWN=" "
- fi
if [ "$CFG_XINPUT2" = "no" ]; then
X2Y=" "
X2N="*"
@@ -3507,9 +3332,6 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
$XCBN -no-xcb ............ Do not compile Xcb (X protocol C-language Binding) support.
$XCBY -xcb ............... Compile Xcb support.
- $XWN -no-wayland......... Do not compile Wayland support.
- $XWY -wayland .......... Compile Wayland support.
-
EOF
fi # X11
@@ -4097,6 +3919,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
#mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured
rm -rf mkspecs/default
ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default
+ mkdir -p "$outpath/qmake" || exit
# fix makefiles
for mkfile in GNUmakefile Makefile; do
EXTRA_LFLAGS=
@@ -5271,28 +5094,8 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
fi
# Save these for a check later
- ORIG_CFG_WAYLAND="$CFG_WAYLAND"
ORIG_CFG_XCB="$CFG_XCB"
- if [ "$CFG_WAYLAND" != "no" ]; then
- if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists wayland-client 2>/dev/null; then
- QMAKE_CFLAGS_WAYLAND=`$PKG_CONFIG --cflags wayland-client 2>/dev/null`
- QMAKE_LIBS_WAYLAND=`$PKG_CONFIG --libs wayland-client 2>/dev/null`
- QMAKE_INCDIR_WAYLAND=`$PKG_CONFIG --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
- QMAKE_LIBDIR_WAYLAND=`$PKG_CONFIG --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'`
- fi
- if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qpa/wayland "Wayland" $L_FLAGS $I_FLAGS $l_FLAGS $QMAKE_CFLAGS_WAYLAND $QMAKE_LIBS_WAYLAND; then
- CFG_WAYLAND=yes
- QT_CONFIG="$QT_CONFIG wayland"
- elif [ "$CFG_WAYLAND" = "yes" ]; then
- echo "The Wayland functionality test failed!"
- exit 1
- else
- CFG_WAYLAND=no
- QMakeVar add DEFINES QT_NO_WAYLAND
- fi
- fi
-
if [ "$CFG_LIBUDEV" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then
QMAKE_INCDIR_LIBUDEV=`$PKG_CONFIG --cflags-only-I libudev 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
@@ -5403,46 +5206,32 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then
QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
- if [ "$CFG_WAYLAND" = "yes" ]; then
- QMAKE_CFLAGS_WAYLAND="$QMAKE_CFLAGS_WAYLAND $QMAKE_CFLAGS_XKBCOMMON"
- QMAKE_LIBS_WAYLAND="$QMAKE_LIBS_WAYLAND $QMAKE_LIBS_XKBCOMMON"
- fi
QMAKE_CFLAGS_XCB="$QMAKE_CFLAGS_XCB $QMAKE_CFLAGS_XKBCOMMON"
QMAKE_LIBS_XCB="$QMAKE_LIBS_XCB $QMAKE_LIBS_XKBCOMMON"
else
- if [ "$CFG_WAYLAND" = "yes" ]; then
- QMAKE_DEFINES_WAYLAND=QT_NO_WAYLAND_XKB
- fi
QMAKE_DEFINES_XCB=QT_NO_XCB_XKB
fi
- # QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
- if [ -n "$QMAKE_CFLAGS_WAYLAND" ] || [ -n "$QMAKE_LIBS_WAYLAND" ]; then
- QMakeVar set QMAKE_CFLAGS_WAYLAND "$QMAKE_CFLAGS_WAYLAND"
- QMakeVar set QMAKE_INCDIR_WAYLAND "$QMAKE_INCDIR_WAYLAND"
- QMakeVar set QMAKE_LIBS_WAYLAND "$QMAKE_LIBS_WAYLAND"
- QMakeVar set QMAKE_LIBDIR_WAYLAND "$QMAKE_LIBDIR_WAYLAND"
- QMakeVar set QMAKE_DEFINES_WAYLAND " $QMAKE_DEFINES_WAYLAND"
- fi
-
if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB"
fi
- if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
- QT_CONFIG="$QT_CONFIG coreservices"
- else
- QMakeVar add DEFINES QT_NO_CORESERVICES
+ if [ "$BUILD_ON_MAC" = "yes" ]; then
+ if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
+ QT_CONFIG="$QT_CONFIG coreservices"
+ else
+ QMakeVar add DEFINES QT_NO_CORESERVICES
+ fi
fi
if [ "$PLATFORM_QPA" = "yes" ] && [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ]; then
- if [ "$CFG_XCB" = "no" ] && [ "$CFG_WAYLAND" = "no" ]; then
- if [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_WAYLAND" = "auto" ]; then
+ if [ "$CFG_XCB" = "no" ]; then
+ if [ "$ORIG_CFG_XCB" = "auto" ]; then
echo "No QPA platform plugin enabled!"
echo " If you really want to build without a QPA platform plugin you must pass"
- echo " -no-xcb and -no-wayland to configure. Doing this will produce a Qt that"
+ echo " -no-xcb. Doing this will produce a Qt that"
echo " cannot run GUI applications."
echo " The dependencies needed for xcb to build are listed in"
echo " src/plugins/platforms/xcb/README"
@@ -5948,8 +5737,6 @@ if [ "$CFG_GUI" = "auto" ]; then
fi
if [ "$CFG_GUI" = "no" ]; then
QT_CONFIG="$QT_CONFIG no-gui"
-else
- QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GUI"
fi
@@ -6722,16 +6509,11 @@ QT_BUILD_TREE = \$\$quote($outpath)
QT_BUILD_PARTS = $CFG_BUILD_PARTS
#local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
-QMAKE_MOC = \$\$QT_BUILD_TREE/bin/moc
-QMAKE_UIC = \$\$QT_BUILD_TREE/bin/uic
-QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc
QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include
QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
include(\$\$PWD/mkspecs/qmodule.pri)
CONFIG += $QMAKE_CONFIG dylib depend_includepath fix_output_dirs no_private_qt_headers_warning QTDIR_build
-QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
-QMAKE_MOC_SRC = \$\$QT_BUILD_TREE/src/moc
EOF
@@ -6742,21 +6524,6 @@ else
echo "QMAKESPEC = $XPLATFORM" >> "$CACHEFILE.tmp"
fi
-# incrementals
-INCREMENTAL=""
-[ "$CFG_INCREMENTAL" = "auto" ] && "$WHICH" p4 >/dev/null 2>&1 && [ "$CFG_DEV" = "yes" ] && CFG_INCREMENTAL="yes"
-if [ "$CFG_INCREMENTAL" = "yes" ]; then
- find "$relpath" -perm u+w -mtime -3 | grep 'cpp$' | while read f; do
- # don't need to worry about generated files
- [ -r `echo $f | sed "s,cpp$,ui,"` ] && continue
- basename "$f" | grep '^moc_' >/dev/null 2>&1 && continue
- # done
- INCREMENTAL="$INCREMENTAL `basename \"$f\" | sed 's,.cpp,.o,'`"
- done
- [ '!' -z "$INCREMENTAL" ] && echo "QMAKE_INCREMENTAL += $INCREMENTAL" >> "$CACHEFILE.tmp"
- [ -r "$outpath/.qmake.incremental" ] && echo "include($outpath/.qmake.incremental)" >> "$CACHEFILE.tmp"
-fi
-
# replace .qmake.cache if it differs from the newly created temp file
if cmp -s "$CACHEFILE.tmp" "$CACHEFILE"; then
rm -f "$CACHEFILE.tmp"
@@ -6839,7 +6606,6 @@ if [ "$OPT_VERBOSE" = "yes" ]; then
echo "qmake switches ......... $QMAKE_SWITCHES"
fi
-[ "$CFG_INCREMENTAL" = "yes" ] && [ '!' -z "$INCREMENTAL" ] && echo "Incremental ............ $INCREMENTAL"
echo "Build .................. $CFG_BUILD_PARTS"
echo "Configuration .......... $QMAKE_CONFIG $QT_CONFIG"
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
@@ -7169,7 +6935,7 @@ for file in .projects .projects.3; do
fi
SPEC=$XQMAKESPEC ;;
*/qmake/qmake.pro) continue ;;
- *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*) SPEC=$QMAKESPEC ;;
+ *tools/bootstrap*|*tools/moc*|*tools/rcc*|*tools/uic*|*tools/qdoc*) SPEC=$QMAKESPEC ;;
*) if [ "$CFG_NOPROCESS" = "yes" ]; then
continue
else
@@ -7265,6 +7031,18 @@ EOF
fi
#-------------------------------------------------------------------------------
+# check if the user passed the obsoleted -wayland or -no-wayland flag
+#-------------------------------------------------------------------------------
+if [ "$CFG_OBSOLETE_WAYLAND" = "yes" ]; then
+cat <<EOF
+
+ NOTICE: The -wayland and -no-wayland flags are now obsolete
+
+ All configuring of QtWayland plugin and QtCompositor happens in the module
+EOF
+fi
+
+#-------------------------------------------------------------------------------
# finally save the executed command to another script
#-------------------------------------------------------------------------------
if [ `basename $0` != "config.status" ]; then
diff --git a/dist/changes-4.5.0-garden b/dist/changes-4.5.0-garden
index ce258e7630..c0946a10e5 100644
--- a/dist/changes-4.5.0-garden
+++ b/dist/changes-4.5.0-garden
@@ -118,7 +118,7 @@ Optimizations
SystemGc from the CCoeControl we are currently painting on instead.
- qeventdispatcher_s60.cpp
- * Stopped using Active Objects to recieve events, we get them from
+ * Stopped using Active Objects to receive events, we get them from
C*AppUi and CCoeControl instead.
- QWidget
diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0
index 7b8d1fa0bd..79a4eb0455 100644
--- a/dist/changes-5.0.0
+++ b/dist/changes-5.0.0
@@ -219,7 +219,7 @@ information about a particular change.
an entirely pristine context.
* Configure's -sysroot and -hostprefix are now handled slightly differently.
The QT_INSTALL_... properties are now automatically prefixed with the sysroot;
- the raw values are available as QT_RAW_INSTALL_... and the sysroot as QT_SYSROOT.
+ the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT.
The new QT_HOST_... properties can be used to refer to the Qt host tools.
* Several functions and built-in variables were modified to return normalized paths.
@@ -334,6 +334,9 @@ QtCore
QRegularExpressionMatchIterator. They aim to replace QRegExp with a more
powerful and flexible regular expression engine.
+* QEvent::AccessibilityPrepare, AccessibilityHelp and AccessibilityDescription removed:
+ * The enum values simply didn't make sense in the first place and should simply be dropped.
+
QtGui
-----
* Accessibility has been refactored. The hierachy of accessible objects is implemented via
diff --git a/examples/animation/stickman/animation.cpp b/examples/animation/stickman/animation.cpp
index 4469b365de..afdfae6eca 100644
--- a/examples/animation/stickman/animation.cpp
+++ b/examples/animation/stickman/animation.cpp
@@ -41,6 +41,7 @@
#include "animation.h"
#include <QPointF>
+#include <QVector>
#include <QIODevice>
#include <QDataStream>
@@ -57,11 +58,7 @@ public:
void setNodeCount(int nodeCount)
{
- while (nodeCount > m_nodePositions.size())
- m_nodePositions.append(QPointF());
-
- while (nodeCount < m_nodePositions.size())
- m_nodePositions.removeLast();
+ m_nodePositions.resize(nodeCount);
}
QPointF nodePos(int idx) const
@@ -75,7 +72,7 @@ public:
}
private:
- QList<QPointF> m_nodePositions;
+ QVector<QPointF> m_nodePositions;
};
Animation::Animation()
diff --git a/examples/desktop/desktop.pro b/examples/desktop/desktop.pro
index fc232088e0..adfa51f130 100644
--- a/examples/desktop/desktop.pro
+++ b/examples/desktop/desktop.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = screenshot
+SUBDIRS = screenshot systray
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/desktop
diff --git a/examples/desktop/screenshot/screenshot.cpp b/examples/desktop/screenshot/screenshot.cpp
index 7773728daa..66467d439f 100644
--- a/examples/desktop/screenshot/screenshot.cpp
+++ b/examples/desktop/screenshot/screenshot.cpp
@@ -102,7 +102,7 @@ void Screenshot::saveScreenshot()
.arg(format.toUpper())
.arg(format));
if (!fileName.isEmpty())
- originalPixmap.save(fileName, format.toAscii());
+ originalPixmap.save(fileName, format.toAscii().constData());
}
//! [3]
diff --git a/examples/desktop/systray/images/bad.png b/examples/desktop/systray/images/bad.png
new file mode 100644
index 0000000000..c8701a241a
--- /dev/null
+++ b/examples/desktop/systray/images/bad.png
Binary files differ
diff --git a/examples/desktop/systray/images/heart.png b/examples/desktop/systray/images/heart.png
new file mode 100644
index 0000000000..cee1302b7d
--- /dev/null
+++ b/examples/desktop/systray/images/heart.png
Binary files differ
diff --git a/examples/desktop/systray/images/trash.png b/examples/desktop/systray/images/trash.png
new file mode 100644
index 0000000000..4c24db926d
--- /dev/null
+++ b/examples/desktop/systray/images/trash.png
Binary files differ
diff --git a/examples/desktop/systray/main.cpp b/examples/desktop/systray/main.cpp
new file mode 100644
index 0000000000..6695113f71
--- /dev/null
+++ b/examples/desktop/systray/main.cpp
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation 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.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QMessageBox>
+
+#include "window.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(systray);
+
+ QApplication app(argc, argv);
+
+ if (!QSystemTrayIcon::isSystemTrayAvailable()) {
+ QMessageBox::critical(0, QObject::tr("Systray"),
+ QObject::tr("I couldn't detect any system tray "
+ "on this system."));
+ return 1;
+ }
+ QApplication::setQuitOnLastWindowClosed(false);
+
+ Window window;
+ window.show();
+ return app.exec();
+}
diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro
new file mode 100644
index 0000000000..5fdcf1f9c8
--- /dev/null
+++ b/examples/desktop/systray/systray.pro
@@ -0,0 +1,14 @@
+HEADERS = window.h
+SOURCES = main.cpp \
+ window.cpp
+RESOURCES = systray.qrc
+
+QT += widgets
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/desktop/systray
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS systray.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/desktop/systray
+INSTALLS += target sources
+
+simulator: warning(This example might not fully work on Simulator platform)
diff --git a/examples/desktop/systray/systray.qrc b/examples/desktop/systray/systray.qrc
new file mode 100644
index 0000000000..a8b6535849
--- /dev/null
+++ b/examples/desktop/systray/systray.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>images/bad.png</file>
+ <file>images/heart.png</file>
+ <file>images/trash.png</file>
+</qresource>
+</RCC>
diff --git a/examples/desktop/systray/window.cpp b/examples/desktop/systray/window.cpp
new file mode 100644
index 0000000000..73dc910d3b
--- /dev/null
+++ b/examples/desktop/systray/window.cpp
@@ -0,0 +1,270 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation 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.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "window.h"
+#include <QtGui>
+
+#include <QAction>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QMenu>
+#include <QPushButton>
+#include <QSpinBox>
+#include <QTextEdit>
+#include <QVBoxLayout>
+#include <QMessageBox>
+
+//! [0]
+Window::Window()
+{
+ createIconGroupBox();
+ createMessageGroupBox();
+
+ iconLabel->setMinimumWidth(durationLabel->sizeHint().width());
+
+ createActions();
+ createTrayIcon();
+
+ connect(showMessageButton, SIGNAL(clicked()), this, SLOT(showMessage()));
+ connect(showIconCheckBox, SIGNAL(toggled(bool)),
+ trayIcon, SLOT(setVisible(bool)));
+ connect(iconComboBox, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(setIcon(int)));
+ connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(messageClicked()));
+ connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
+ this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(iconGroupBox);
+ mainLayout->addWidget(messageGroupBox);
+ setLayout(mainLayout);
+
+ iconComboBox->setCurrentIndex(1);
+ trayIcon->show();
+
+ setWindowTitle(tr("Systray"));
+ resize(400, 300);
+}
+//! [0]
+
+//! [1]
+void Window::setVisible(bool visible)
+{
+ minimizeAction->setEnabled(visible);
+ maximizeAction->setEnabled(!isMaximized());
+ restoreAction->setEnabled(isMaximized() || !visible);
+ QDialog::setVisible(visible);
+}
+//! [1]
+
+//! [2]
+void Window::closeEvent(QCloseEvent *event)
+{
+ if (trayIcon->isVisible()) {
+ QMessageBox::information(this, tr("Systray"),
+ tr("The program will keep running in the "
+ "system tray. To terminate the program, "
+ "choose <b>Quit</b> in the context menu "
+ "of the system tray entry."));
+ hide();
+ event->ignore();
+ }
+}
+//! [2]
+
+//! [3]
+void Window::setIcon(int index)
+{
+ QIcon icon = iconComboBox->itemIcon(index);
+ trayIcon->setIcon(icon);
+ setWindowIcon(icon);
+
+ trayIcon->setToolTip(iconComboBox->itemText(index));
+}
+//! [3]
+
+//! [4]
+void Window::iconActivated(QSystemTrayIcon::ActivationReason reason)
+{
+ switch (reason) {
+ case QSystemTrayIcon::Trigger:
+ case QSystemTrayIcon::DoubleClick:
+ iconComboBox->setCurrentIndex((iconComboBox->currentIndex() + 1)
+ % iconComboBox->count());
+ break;
+ case QSystemTrayIcon::MiddleClick:
+ showMessage();
+ break;
+ default:
+ ;
+ }
+}
+//! [4]
+
+//! [5]
+void Window::showMessage()
+{
+ QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::MessageIcon(
+ typeComboBox->itemData(typeComboBox->currentIndex()).toInt());
+ trayIcon->showMessage(titleEdit->text(), bodyEdit->toPlainText(), icon,
+ durationSpinBox->value() * 1000);
+}
+//! [5]
+
+//! [6]
+void Window::messageClicked()
+{
+ QMessageBox::information(0, tr("Systray"),
+ tr("Sorry, I already gave what help I could.\n"
+ "Maybe you should try asking a human?"));
+}
+//! [6]
+
+void Window::createIconGroupBox()
+{
+ iconGroupBox = new QGroupBox(tr("Tray Icon"));
+
+ iconLabel = new QLabel("Icon:");
+
+ iconComboBox = new QComboBox;
+ iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
+ iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
+ iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));
+
+ showIconCheckBox = new QCheckBox(tr("Show icon"));
+ showIconCheckBox->setChecked(true);
+
+ QHBoxLayout *iconLayout = new QHBoxLayout;
+ iconLayout->addWidget(iconLabel);
+ iconLayout->addWidget(iconComboBox);
+ iconLayout->addStretch();
+ iconLayout->addWidget(showIconCheckBox);
+ iconGroupBox->setLayout(iconLayout);
+}
+
+void Window::createMessageGroupBox()
+{
+ messageGroupBox = new QGroupBox(tr("Balloon Message"));
+
+ typeLabel = new QLabel(tr("Type:"));
+
+ typeComboBox = new QComboBox;
+ typeComboBox->addItem(tr("None"), QSystemTrayIcon::NoIcon);
+ typeComboBox->addItem(style()->standardIcon(
+ QStyle::SP_MessageBoxInformation), tr("Information"),
+ QSystemTrayIcon::Information);
+ typeComboBox->addItem(style()->standardIcon(
+ QStyle::SP_MessageBoxWarning), tr("Warning"),
+ QSystemTrayIcon::Warning);
+ typeComboBox->addItem(style()->standardIcon(
+ QStyle::SP_MessageBoxCritical), tr("Critical"),
+ QSystemTrayIcon::Critical);
+ typeComboBox->setCurrentIndex(1);
+
+ durationLabel = new QLabel(tr("Duration:"));
+
+ durationSpinBox = new QSpinBox;
+ durationSpinBox->setRange(5, 60);
+ durationSpinBox->setSuffix(" s");
+ durationSpinBox->setValue(15);
+
+ durationWarningLabel = new QLabel(tr("(some systems might ignore this "
+ "hint)"));
+ durationWarningLabel->setIndent(10);
+
+ titleLabel = new QLabel(tr("Title:"));
+
+ titleEdit = new QLineEdit(tr("Cannot connect to network"));
+
+ bodyLabel = new QLabel(tr("Body:"));
+
+ bodyEdit = new QTextEdit;
+ bodyEdit->setPlainText(tr("Don't believe me. Honestly, I don't have a "
+ "clue.\nClick this balloon for details."));
+
+ showMessageButton = new QPushButton(tr("Show Message"));
+ showMessageButton->setDefault(true);
+
+ QGridLayout *messageLayout = new QGridLayout;
+ messageLayout->addWidget(typeLabel, 0, 0);
+ messageLayout->addWidget(typeComboBox, 0, 1, 1, 2);
+ messageLayout->addWidget(durationLabel, 1, 0);
+ messageLayout->addWidget(durationSpinBox, 1, 1);
+ messageLayout->addWidget(durationWarningLabel, 1, 2, 1, 3);
+ messageLayout->addWidget(titleLabel, 2, 0);
+ messageLayout->addWidget(titleEdit, 2, 1, 1, 4);
+ messageLayout->addWidget(bodyLabel, 3, 0);
+ messageLayout->addWidget(bodyEdit, 3, 1, 2, 4);
+ messageLayout->addWidget(showMessageButton, 5, 4);
+ messageLayout->setColumnStretch(3, 1);
+ messageLayout->setRowStretch(4, 1);
+ messageGroupBox->setLayout(messageLayout);
+}
+
+void Window::createActions()
+{
+ minimizeAction = new QAction(tr("Mi&nimize"), this);
+ connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide()));
+
+ maximizeAction = new QAction(tr("Ma&ximize"), this);
+ connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized()));
+
+ restoreAction = new QAction(tr("&Restore"), this);
+ connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal()));
+
+ quitAction = new QAction(tr("&Quit"), this);
+ connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
+}
+
+void Window::createTrayIcon()
+{
+ trayIconMenu = new QMenu(this);
+ trayIconMenu->addAction(minimizeAction);
+ trayIconMenu->addAction(maximizeAction);
+ trayIconMenu->addAction(restoreAction);
+ trayIconMenu->addSeparator();
+ trayIconMenu->addAction(quitAction);
+
+ trayIcon = new QSystemTrayIcon(this);
+ trayIcon->setContextMenu(trayIconMenu);
+}
diff --git a/examples/desktop/systray/window.h b/examples/desktop/systray/window.h
new file mode 100644
index 0000000000..80b7a20754
--- /dev/null
+++ b/examples/desktop/systray/window.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation 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.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WINDOW_H
+#define WINDOW_H
+
+#include <QSystemTrayIcon>
+#include <QDialog>
+
+QT_BEGIN_NAMESPACE
+class QAction;
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QMenu;
+class QPushButton;
+class QSpinBox;
+class QTextEdit;
+QT_END_NAMESPACE
+
+//! [0]
+class Window : public QDialog
+{
+ Q_OBJECT
+
+public:
+ Window();
+
+ void setVisible(bool visible);
+
+protected:
+ void closeEvent(QCloseEvent *event);
+
+private slots:
+ void setIcon(int index);
+ void iconActivated(QSystemTrayIcon::ActivationReason reason);
+ void showMessage();
+ void messageClicked();
+
+private:
+ void createIconGroupBox();
+ void createMessageGroupBox();
+ void createActions();
+ void createTrayIcon();
+
+ QGroupBox *iconGroupBox;
+ QLabel *iconLabel;
+ QComboBox *iconComboBox;
+ QCheckBox *showIconCheckBox;
+
+ QGroupBox *messageGroupBox;
+ QLabel *typeLabel;
+ QLabel *durationLabel;
+ QLabel *durationWarningLabel;
+ QLabel *titleLabel;
+ QLabel *bodyLabel;
+ QComboBox *typeComboBox;
+ QSpinBox *durationSpinBox;
+ QLineEdit *titleEdit;
+ QTextEdit *bodyEdit;
+ QPushButton *showMessageButton;
+
+ QAction *minimizeAction;
+ QAction *maximizeAction;
+ QAction *restoreAction;
+ QAction *quitAction;
+
+ QSystemTrayIcon *trayIcon;
+ QMenu *trayIconMenu;
+};
+//! [0]
+
+#endif
diff --git a/examples/graphicsview/chip/chip.h b/examples/graphicsview/chip/chip.h
index 04fae2d30c..4c1cfae37d 100644
--- a/examples/graphicsview/chip/chip.h
+++ b/examples/graphicsview/chip/chip.h
@@ -62,7 +62,7 @@ protected:
private:
int x, y;
QColor color;
- QList<QPointF> stuff;
+ QVector<QPointF> stuff;
};
#endif
diff --git a/examples/tools/codecs/mainwindow.cpp b/examples/tools/codecs/mainwindow.cpp
index 8f3c94e3d5..4adff6da6e 100644
--- a/examples/tools/codecs/mainwindow.cpp
+++ b/examples/tools/codecs/mainwindow.cpp
@@ -99,7 +99,7 @@ void MainWindow::save()
QByteArray codecName = action->data().toByteArray();
QTextStream out(&file);
- out.setCodec(codecName);
+ out.setCodec(codecName.constData());
out << textEdit->toPlainText();
}
}
diff --git a/examples/touch/fingerpaint/mainwindow.cpp b/examples/touch/fingerpaint/mainwindow.cpp
index 288068fa09..be005cf612 100644
--- a/examples/touch/fingerpaint/mainwindow.cpp
+++ b/examples/touch/fingerpaint/mainwindow.cpp
@@ -206,12 +206,12 @@ bool MainWindow::saveFile(const QByteArray &fileFormat)
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
initialPath,
tr("%1 Files (*.%2);;All Files (*)")
- .arg(QString(fileFormat.toUpper()))
- .arg(QString(fileFormat)));
+ .arg(QString::fromLatin1(fileFormat.toUpper()))
+ .arg(QString::fromLatin1(fileFormat)));
if (fileName.isEmpty()) {
return false;
} else {
- return scribbleArea->saveImage(fileName, fileFormat);
+ return scribbleArea->saveImage(fileName, fileFormat.constData());
}
}
//! [20]
diff --git a/examples/widgets/scribble/mainwindow.cpp b/examples/widgets/scribble/mainwindow.cpp
index 4a59e93a61..00bf9884c9 100644
--- a/examples/widgets/scribble/mainwindow.cpp
+++ b/examples/widgets/scribble/mainwindow.cpp
@@ -239,12 +239,12 @@ bool MainWindow::saveFile(const QByteArray &fileFormat)
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
initialPath,
tr("%1 Files (*.%2);;All Files (*)")
- .arg(QString(fileFormat.toUpper()))
- .arg(QString(fileFormat)));
+ .arg(QString::fromLatin1(fileFormat.toUpper()))
+ .arg(QString::fromLatin1(fileFormat)));
if (fileName.isEmpty()) {
return false;
} else {
- return scribbleArea->saveImage(fileName, fileFormat);
+ return scribbleArea->saveImage(fileName, fileFormat.constData());
}
}
//! [20]
diff --git a/examples/widgets/stylesheet/stylesheeteditor.cpp b/examples/widgets/stylesheet/stylesheeteditor.cpp
index 88f5100d12..5514291a7f 100644
--- a/examples/widgets/stylesheet/stylesheeteditor.cpp
+++ b/examples/widgets/stylesheet/stylesheeteditor.cpp
@@ -85,7 +85,7 @@ void StyleSheetEditor::loadStyleSheet(const QString &sheetName)
{
QFile file(":/qss/" + sheetName.toLower() + ".qss");
file.open(QFile::ReadOnly);
- QString styleSheet = QLatin1String(file.readAll());
+ QString styleSheet = QString::fromLatin1(file.readAll());
ui.styleTextEdit->setPlainText(styleSheet);
qApp->setStyleSheet(styleSheet);
diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
index 384c013309..fd10785079 100644
--- a/mkspecs/common/linux.conf
+++ b/mkspecs/common/linux.conf
@@ -38,7 +38,8 @@ QMAKE_LIBS_LIBUDEV = -ludev
QMAKE_CFLAGS_WAYLAND =
QMAKE_INCDIR_WAYLAND =
-QMAKE_LIBS_WAYLAND =
+QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client
+QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server
QMAKE_LIBDIR_WAYLAND =
QMAKE_DEFINES_WAYLAND =
QMAKE_WAYLAND_SCANNER = wayland-scanner
diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf
index 2bc33117bb..11e8ca43a2 100644
--- a/mkspecs/common/qcc-base-qnx.conf
+++ b/mkspecs/common/qcc-base-qnx.conf
@@ -41,9 +41,6 @@ QMAKE_LFLAGS = -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/lib -Wl,-rp
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
-QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
-QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
-QMAKE_RCC = $$[QT_INSTALL_BINS]/rcc
QMAKE_CXX = $$QMAKE_CC -lang-c++
diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf
index 57b89b9650..6b7a2d71fe 100644
--- a/mkspecs/common/wince/qmake.conf
+++ b/mkspecs/common/wince/qmake.conf
@@ -70,10 +70,6 @@ QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = lib
QMAKE_RC = rc
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index 5d8684bf00..c3776c4da5 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -48,7 +48,7 @@ CONFIG = lex yacc warn_on debug uic resources $$CONFIG
}
# Let qmake know about the unexpectedly appearing cache file.
- contains(QTFWD, -cache-module-fwd):_QMAKE_CACHE_ = $$QMAKE_SYNCQT_OUTDIR/.qmake.cache
+ exists($$QMAKE_SYNCQT_OUTDIR/.qmake.cache):_QMAKE_CACHE_ = $$QMAKE_SYNCQT_OUTDIR/.qmake.cache
unset(QTFWD)
unset(PRO_BASENAME)
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 3f155a2d6b..94f8100f88 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -97,12 +97,6 @@ equals(MOC_DIR, .) {
unix:!no_mocdepend {
moc_source.depends += $$first(QMAKE_MOC)
moc_header.depends += $$first(QMAKE_MOC)
- !contains(TARGET, moc) { #auto build moc
- isEmpty(QMAKE_MOC_SRC):QMAKE_MOC_SRC = "$(QTDIR)/src/tools/moc"
- make_moc.target = $$first(QMAKE_MOC)
- make_moc.commands = (cd $$QMAKE_MOC_SRC && $(MAKE))
- QMAKE_EXTRA_TARGETS += make_moc
- }
}
#generate a mocclean
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 21443aa5b5..f71afbb04e 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -168,12 +168,13 @@ for(QTLIB, QT) {
QT = $$resolve_depends(NEWQT, "QT.")
# Finally actually add the modules
for(QTLIB, QT) {
- isEmpty(QT.$${QTLIB}.name) {
+ QTLIBNAME = $$eval(QT.$${QTLIB}.name)
+ isEmpty(QTLIBNAME) {
message("Warning: unknown QT module: $$QTLIB")
next()
}
- target_qt:isEqual(TARGET, QTLIB) {
+ target_qt:isEqual(TARGET, $$QTLIBNAME) {
warning($$TARGET cannot have a QT of $$QTLIB)
next()
}
@@ -189,7 +190,7 @@ for(QTLIB, QT) {
qt_compat {
!qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us
- INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt
+ INCLUDEPATH *= $$QT.core.includes
DEFINES *= QT_COMPAT
}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 31b28156e8..474a414003 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -132,9 +132,11 @@ defineTest(qtAddModule) {
isEmpty(LINKAGE) {
# Make sure we can link to uninstalled libraries
- !isEqual(MODULE_LIBS, $$[QT_INSTALL_LIBS]) { ### XXX
- QMAKE_LIBDIR *= $$MODULE_LIBS
- unix:!mac:QMAKE_LFLAGS *= "-Wl,-rpath-link,$$MODULE_LIBS"
+ !isEmpty(MODULE_LIBS) {
+ !isEqual(MODULE_LIBS, $$[QT_INSTALL_LIBS]) { ### XXX
+ QMAKE_LIBDIR *= $$MODULE_LIBS
+ unix:!mac:QMAKE_LFLAGS *= "-Wl,-rpath-link,$$MODULE_LIBS"
+ }
}
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:LINKAGE = -l$${MODULE_NAME}$${QT_LIBINFIX}d
@@ -146,7 +148,7 @@ defineTest(qtAddModule) {
# to give access to sources or include files, and not for linking.
!isEmpty(MODULE_LIBS) {
!isEmpty(QMAKE_LSB) {
- QMAKE_LFLAGS *= --lsb-libpath=$$$$QMAKE_LIBDIR_QT
+ QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS
QMAKE_LFLAGS *= -L/opt/lsb/lib
QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX}
}
diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf
index 98cdab121f..cae5f47387 100644
--- a/mkspecs/features/qt_module_config.prf
+++ b/mkspecs/features/qt_module_config.prf
@@ -118,24 +118,24 @@ load(qt_installs)
unix|win32-g++* {
CONFIG += create_pc
- QMAKE_PKGCONFIG_LIBDIR = $$[QT_RAW_INSTALL_LIBS]
- QMAKE_PKGCONFIG_INCDIR = $$[QT_RAW_INSTALL_HEADERS]/$$TARGET
- QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_RAW_INSTALL_HEADERS]
+ QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
+ QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]/$$TARGET
+ QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS/raw]
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
include_replace.match = $$QMAKE_INCDIR_QT
- include_replace.replace = $$[QT_RAW_INSTALL_HEADERS]
+ include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
lib_replace.match = $$QMAKE_LIBDIR_QT
- lib_replace.replace = $$[QT_RAW_INSTALL_LIBS]
+ lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
prefix_replace.match = $$QT_BUILD_TREE
- prefix_replace.replace = $$[QT_RAW_INSTALL_PREFIX]
+ prefix_replace.replace = $$[QT_INSTALL_PREFIX/raw]
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace
}
unix {
CONFIG += create_libtool explicitlib
- QMAKE_PRL_LIBDIR = $$[QT_RAW_INSTALL_LIBS] ### XXX
+ QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS/raw] ### XXX
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
- QMAKE_LIBTOOL_LIBDIR = $$[QT_RAW_INSTALL_LIBS]
+ QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
}
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index 9bb9875f6d..b00d15579f 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -97,7 +97,11 @@ contains(INSTALLS, target) {
# ...
#
for(file, TESTDATA) {
- tdi = testdata_install_$${file}
+ tnam = $$file
+ tnam ~= s,\\.\\.,dotdot,
+ tnam ~= s,[?*],wildcard,
+ tnam ~= s,[^A-Za-z0-9],_,
+ tdi = testdata_$$tnam
tdif = $${tdi}.files
tdip = $${tdi}.path
diff --git a/mkspecs/features/win32/dumpcpp.prf b/mkspecs/features/win32/dumpcpp.prf
deleted file mode 100644
index 19637998c7..0000000000
--- a/mkspecs/features/win32/dumpcpp.prf
+++ /dev/null
@@ -1,11 +0,0 @@
-isEmpty(QMAKE_DUMPCPP_NAME) {
- QMAKE_DUMPCPP_NAME = make_dumpcpp
-}
-
-# auto depend on dumpcpp
-!contains(TARGET, dumpcpp) {
- isEmpty(QMAKE_DUMPCPP_SRC): QMAKE_DUMPCPP_SRC = "$(QTDIR)/tools/activeqt/dumpcpp"
- make_dumpcpp.commands = (cd $$QMAKE_DUMPCPP_SRC && $(QMAKE) && $(MAKE))
- QMAKE_EXTRA_TARGETS += $$QMAKE_DUMPCPP_NAME
-}
-
diff --git a/mkspecs/unsupported/qws/qnx-641/qmake.conf b/mkspecs/unsupported/qws/qnx-641/qmake.conf
index 441f408802..0636ca7347 100644
--- a/mkspecs/unsupported/qws/qnx-641/qmake.conf
+++ b/mkspecs/unsupported/qws/qnx-641/qmake.conf
@@ -75,9 +75,6 @@ QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK += -lsocket
QMAKE_LIBS_GUI += -lsocket
-QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
QMAKE_AR = ntox86-ar cqs
QMAKE_RANLIB =
diff --git a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf
index bb760b24a7..608da6948e 100644
--- a/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf
+++ b/mkspecs/unsupported/qws/qnx-generic-g++/qmake.conf
@@ -78,9 +78,6 @@ QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK += -lsocket
QMAKE_LIBS_GUI += -lsocket
-QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
-QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
-
QMAKE_AR = ar cqs
QMAKE_RANLIB =
diff --git a/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf
index b43c39143f..395f4fe3bf 100644
--- a/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf
+++ b/mkspecs/unsupported/qws/qnx-i386-g++/qmake.conf
@@ -74,9 +74,6 @@ QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK += -lsocket
QMAKE_LIBS_GUI += -lsocket
-QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
-QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
-
QMAKE_AR = ar cqs
QMAKE_RANLIB =
diff --git a/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf b/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf
index 29a2952989..433b09161f 100644
--- a/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf
+++ b/mkspecs/unsupported/qws/qnx-ppc-g++/qmake.conf
@@ -74,9 +74,6 @@ QMAKE_LIBS_THREAD =
QMAKE_LIBS_NETWORK += -lsocket
QMAKE_LIBS_GUI += -lsocket
-QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
-QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
-
QMAKE_AR = ar cqs
QMAKE_RANLIB =
diff --git a/mkspecs/unsupported/win32-borland/qmake.conf b/mkspecs/unsupported/win32-borland/qmake.conf
index 2ba742c104..c1aa7e46ad 100644
--- a/mkspecs/unsupported/win32-borland/qmake.conf
+++ b/mkspecs/unsupported/win32-borland/qmake.conf
@@ -69,10 +69,6 @@ QMAKE_LIBS_QT_ENTRY = -lqtmain
#QMAKE_LIBS_OPENGL =
#QMAKE_LFLAGS_OPENGL = /dopengl32.dll
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = tlib /C /P256
QMAKE_RC = brcc32 -dQ_CC_BOR
diff --git a/mkspecs/unsupported/win32-g++-cross/qmake.conf b/mkspecs/unsupported/win32-g++-cross/qmake.conf
index 9dcff807fa..9c85c9033c 100644
--- a/mkspecs/unsupported/win32-g++-cross/qmake.conf
+++ b/mkspecs/unsupported/win32-g++-cross/qmake.conf
@@ -65,7 +65,6 @@ QMAKE_LINK_OBJECT_SCRIPT= object_script
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
-
QMAKE_LIBS =
QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
@@ -88,12 +87,6 @@ QMAKE_DEL_DIR = rmdir
QMAKE_SYMBOLIC_LINK = ln -s
QMAKE_CHK_DIR_EXISTS = test -d
-#QMAKE_IDC = i686-pc-mingw32-idc
-QMAKE_MOC = i686-pc-mingw32-moc
-QMAKE_RCC = i686-pc-mingw32-rcc
-QMAKE_UIC = i686-pc-mingw32-uic
-
-#QMAKE_IDL = midl
QMAKE_LIB = i686-pc-mingw32-ar -ru
QMAKE_RC = i686-pc-mingw32-windres
QMAKE_ZIP = zip -r -9
diff --git a/mkspecs/unsupported/win32-msvc2003/qmake.conf b/mkspecs/unsupported/win32-msvc2003/qmake.conf
index a573a4dd8c..29681c1034 100644
--- a/mkspecs/unsupported/win32-msvc2003/qmake.conf
+++ b/mkspecs/unsupported/win32-msvc2003/qmake.conf
@@ -67,10 +67,6 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 641e4109ff..7a04a51932 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -65,7 +65,6 @@ QMAKE_LINK_OBJECT_SCRIPT= object_script
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
-
QMAKE_LIBS =
QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
@@ -96,10 +95,6 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
QMAKE_CHK_DIR_EXISTS = if not exist
}
-QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = ar -ru
QMAKE_RC = windres
diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf
index 2dd796d7ea..8a7260aca0 100644
--- a/mkspecs/win32-icc/qmake.conf
+++ b/mkspecs/win32-icc/qmake.conf
@@ -67,10 +67,6 @@ QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib delayimp.l
QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32.lib ws2_32.lib
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = xilib /NOLOGO
QMAKE_RC = rc
diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf
index d4b9521b6d..66f10236c0 100644
--- a/mkspecs/win32-msvc2005/qmake.conf
+++ b/mkspecs/win32-msvc2005/qmake.conf
@@ -71,10 +71,6 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc
diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf
index 00fafc7872..e360165ce3 100644
--- a/mkspecs/win32-msvc2008/qmake.conf
+++ b/mkspecs/win32-msvc2008/qmake.conf
@@ -73,10 +73,6 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc
diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf
index b53ff1a478..99645a0a96 100644
--- a/mkspecs/win32-msvc2010/qmake.conf
+++ b/mkspecs/win32-msvc2010/qmake.conf
@@ -73,10 +73,6 @@ QMAKE_LIBS_COMPAT = advapi32.lib shell32.lib comdlg32.lib user32.lib gdi32
QMAKE_LIBS_QT_ENTRY = -lqtmain
-QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe
-QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe
-QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe
-
QMAKE_IDL = midl
QMAKE_LIB = lib /NOLOGO
QMAKE_RC = rc
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 2dddecb7b0..ab9b583ad3 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -6,6 +6,8 @@ QTSRCS = @QMAKE_QTSRCS@
QMAKESPEC = @QMAKESPEC@
LFLAGS = @QMAKE_LFLAGS@
+QMKSRC = $(SOURCE_PATH)/qmake
+
#qmake code
OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \
mingw_make.o option.o winmakefile.o projectgenerator.o \
@@ -70,8 +72,8 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge
$(SOURCE_PATH)/src/corelib/global/qlogging.cpp \
$(QTSRCS)
-CPPFLAGS = -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 \
- -Igenerators/mac -Igenerators/integrity \
+CPPFLAGS = -g -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \
+ -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
-I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
@@ -98,7 +100,74 @@ distclean:: clean
depend:
makedepend -D__MAKEDEPEND__ $(CPPFLAGS) $(DEPEND_SRC)
-# don't use optimization for these
+
+project.o: $(QMKSRC)/project.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+property.o: $(QMKSRC)/property.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+meta.o: $(QMKSRC)/meta.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+main.o: $(QMKSRC)/main.cpp $(QMKSRC)/project.h
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+option.o: $(QMKSRC)/option.cpp $(QMKSRC)/option.h
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+metamakefile.o: $(QMKSRC)/generators/metamakefile.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+xmloutput.o: $(QMKSRC)/generators/xmloutput.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+makefiledeps.o: $(QMKSRC)/generators/makefiledeps.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+makefile.o: $(QMKSRC)/generators/makefile.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+borland_bmake.o: $(QMKSRC)/generators/win32/borland_bmake.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+mingw_make.o: $(QMKSRC)/generators/win32/mingw_make.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+msvc_objectmodel.o: $(QMKSRC)/generators/win32/msvc_objectmodel.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+msvc_vcproj.o: $(QMKSRC)/generators/win32/msvc_vcproj.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+msbuild_objectmodel.o: $(QMKSRC)/generators/win32/msbuild_objectmodel.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+msvc_vcxproj.o: $(QMKSRC)/generators/win32/msvc_vcxproj.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+msvc_nmake.o: $(QMKSRC)/generators/win32/msvc_nmake.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+pbuilder_pbx.o: $(QMKSRC)/generators/mac/pbuilder_pbx.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+gbuild.o: $(QMKSRC)/generators/integrity/gbuild.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+projectgenerator.o: $(QMKSRC)/generators/projectgenerator.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+
qtextstream.o: $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp
@@ -246,75 +315,9 @@ qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
-winmakefile.o: generators/win32/winmakefile.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/winmakefile.cpp
-
-project.o: project.cpp project.h option.h
- $(CXX) -c -o $@ $(CXXFLAGS) project.cpp
-
-property.o: property.cpp project.h option.h
- $(CXX) -c -o $@ $(CXXFLAGS) property.cpp
-
-meta.o: meta.cpp project.h option.h
- $(CXX) -c -o $@ $(CXXFLAGS) meta.cpp
-
-main.o: main.cpp project.h
- $(CXX) -c -o $@ $(CXXFLAGS) main.cpp
-
-option.o: option.cpp option.h $(BUILD_PATH)/src/corelib/global/qconfig.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) option.cpp
-
qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
-metamakefile.o: generators/metamakefile.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/metamakefile.cpp
-
-xmloutput.o: generators/xmloutput.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/xmloutput.cpp
-
-makefiledeps.o: generators/makefiledeps.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/makefiledeps.cpp
-
-makefile.o: generators/makefile.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/makefile.cpp
-
-unixmake.o: generators/unix/unixmake.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/unix/unixmake.cpp
-
-unixmake2.o: generators/unix/unixmake2.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/unix/unixmake2.cpp
-
-borland_bmake.o: generators/win32/borland_bmake.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/borland_bmake.cpp
-
-mingw_make.o: generators/win32/mingw_make.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/mingw_make.cpp
-
-msvc_objectmodel.o: generators/win32/msvc_objectmodel.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp
-
-msvc_vcproj.o: generators/win32/msvc_vcproj.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcproj.cpp
-
-msbuild_objectmodel.o: generators/win32/msbuild_objectmodel.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp
-
-msvc_vcxproj.o: generators/win32/msvc_vcxproj.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp
-
-msvc_nmake.o: generators/win32/msvc_nmake.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_nmake.cpp
-
-pbuilder_pbx.o: generators/mac/pbuilder_pbx.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp
-
-gbuild.o: generators/integrity/gbuild.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/integrity/gbuild.cpp
-
-projectgenerator.o: generators/projectgenerator.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) generators/projectgenerator.cpp
-
qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp
@@ -324,8 +327,4 @@ qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp
qlogging.o: $(SOURCE_PATH)/src/corelib/global/qlogging.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qlogging.cpp
-#default rules
-.cpp.o:
- $(CXX) -c -o $@ $(CXXFLAGS) $<
-
# DO NOT DELETE THIS LINE -- make depend depends on it
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index f36e4fa631..adcfb040ed 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -7,6 +7,8 @@ SOURCE_PATH = ..
BUILD_PATH = ..
!endif
+QMKSRC = $(SOURCE_PATH)\qmake
+
#
# specific stuff for NMake and ICC
#
@@ -31,7 +33,7 @@ CFLAGS_EXTRA = /MP
CFLAGS_BARE = -c -Fo./ \
-W3 -nologo -O1 \
$(CFLAGS_EXTRA) \
- -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\integrity \
+ -I$(QMKSRC) -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
-I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++
index 56d8edca7d..75c7e02334 100644
--- a/qmake/Makefile.win32-g++
+++ b/qmake/Makefile.win32-g++
@@ -43,9 +43,7 @@ endif
#
CXX = g++
CFLAGS = -c -o$@ -O \
- -I. -Igenerators -Igenerators/unix \
- -Igenerators/win32 -Igenerators/mac \
- -Igenerators/integrity \
+ -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
@@ -132,7 +130,7 @@ qmake.exe: $(OBJS) $(QTOBJS)
$(LINKQMAKE)
-$(COPY) qmake.exe $(BUILD_PATH)\bin\qmake.exe
-Makefile: Makefile.win32-g++
+Makefile: $(SOURCE_PATH)/qmake/Makefile.win32-g++
@echo "Out of date, please rerun configure"
clean::
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 63367f116a..1904b8f6c6 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -306,7 +306,6 @@ MakefileGenerator::setProjectFile(QMakeProject *p)
return;
project = p;
init();
- usePlatformDir();
findLibraries();
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE &&
project->isActiveConfig("link_prl")) //load up prl's'
@@ -1028,7 +1027,6 @@ MakefileGenerator::writePrlFile(QTextStream &t)
bool
MakefileGenerator::writeProjectMakefile()
{
- usePlatformDir();
QTextStream t(&Option::output);
//header
@@ -1146,36 +1144,6 @@ MakefileGenerator::writePrlFile()
}
}
-// Manipulate directories, so it's possible to build
-// several cross-platform targets concurrently
-void
-MakefileGenerator::usePlatformDir()
-{
- QString pltDir(project->first("QMAKE_PLATFORM_DIR"));
- if(pltDir.isEmpty())
- return;
- QChar sep = QDir::separator();
- QString slashPltDir = sep + pltDir;
-
- QString dirs[] = { QString("OBJECTS_DIR"), QString("DESTDIR"), QString("QMAKE_PKGCONFIG_DESTDIR"),
- QString("SUBLIBS_DIR"), QString("DLLDESTDIR"), QString("QMAKE_LIBTOOL_DESTDIR"),
- QString("PRECOMPILED_DIR"), QString("QMAKE_LIBDIR_QT"), QString() };
- for(int i = 0; !dirs[i].isEmpty(); ++i) {
- QString filePath = project->first(dirs[i]);
- project->values(dirs[i]) = QStringList(filePath + (filePath.isEmpty() ? pltDir : slashPltDir));
- }
-
- QString libs[] = { QString("QMAKE_LIBS_QT"), QString("QMAKE_LIBS_QT_THREAD"), QString("QMAKE_LIBS_QT_ENTRY"), QString() };
- for(int i = 0; !libs[i].isEmpty(); ++i) {
- QString filePath = project->first(libs[i]);
- int fpi = filePath.lastIndexOf(sep);
- if(fpi == -1)
- project->values(libs[i]).prepend(pltDir + sep);
- else
- project->values(libs[i]) = QStringList(filePath.left(fpi) + slashPltDir + filePath.mid(fpi));
- }
-}
-
void
MakefileGenerator::writeObj(QTextStream &t, const QString &src)
{
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 68d247a8f3..5b64ea68fb 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -198,9 +198,6 @@ protected:
filterIncludedFiles("GENERATED_SOURCES");
}
- //for cross-platform dependent directories
- virtual void usePlatformDir();
-
//for installs
virtual QString defaultInstall(const QString &);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 434d4b4559..2f19ea4495 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -247,7 +247,6 @@ bool VcprojGenerator::writeMakefile(QTextStream &t)
bool VcprojGenerator::writeProjectMakefile()
{
- usePlatformDir();
QTextStream t(&Option::output);
// Check if all requirements are fulfilled
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 7655f05f2e..b82b793319 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -579,14 +579,19 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
// The spec is already platform-dependent, so no subdirs here.
feature_roots << Option::mkfile::qmakespec + base_concat;
+ // Also check directly under the root directory of the mkspecs collection
QFileInfo specfi(Option::mkfile::qmakespec);
- if (!specfi.isRoot()) {
- QDir specdir(specfi.absolutePath());
- if (specdir.exists(QLatin1String("features"))) {
- for(QStringList::Iterator concat_it = concat.begin();
- concat_it != concat.end(); ++concat_it)
- feature_roots << (specdir.path() + (*concat_it));
+ QDir specrootdir(specfi.absolutePath());
+ while (!specrootdir.isRoot()) {
+ const QString specrootpath = specrootdir.path();
+ if (specrootpath.endsWith(mkspecs_concat)) {
+ if (QFile::exists(specrootpath + base_concat))
+ for (QStringList::Iterator concat_it = concat.begin();
+ concat_it != concat.end(); ++concat_it)
+ feature_roots << (specrootpath + (*concat_it));
+ break;
}
+ specrootdir.cdUp();
}
}
for(QStringList::Iterator concat_it = concat.begin();
@@ -2782,7 +2787,7 @@ QMakeProject::doVariableReplaceExpand(const QString &str, QHash<QString, QString
unicode != DOT && unicode != UNDERSCORE &&
//unicode != SINGLEQUOTE && unicode != DOUBLEQUOTE &&
(unicode < 'a' || unicode > 'z') && (unicode < 'A' || unicode > 'Z') &&
- (unicode < '0' || unicode > '9'))
+ (unicode < '0' || unicode > '9') && (!term || unicode != '/'))
break;
var.append(QChar(unicode));
if(++i == str_len)
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 8ed9462c60..1952b5069b 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -68,18 +68,6 @@ static const struct {
{ "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false },
{ "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false },
{ "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false }, // Just backwards compat
- { "QT_RAW_INSTALL_PREFIX", QLibraryInfo::PrefixPath, true },
- { "QT_RAW_INSTALL_DATA", QLibraryInfo::DataPath, true },
- { "QT_RAW_INSTALL_DOCS", QLibraryInfo::DocumentationPath, true },
- { "QT_RAW_INSTALL_HEADERS", QLibraryInfo::HeadersPath, true },
- { "QT_RAW_INSTALL_LIBS", QLibraryInfo::LibrariesPath, true },
- { "QT_RAW_INSTALL_BINS", QLibraryInfo::BinariesPath, true },
- { "QT_RAW_INSTALL_TESTS", QLibraryInfo::TestsPath, true },
- { "QT_RAW_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, true },
- { "QT_RAW_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, true },
- { "QT_RAW_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, true },
- { "QT_RAW_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, true },
- { "QT_RAW_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, true },
{ "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
{ "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
{ "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
@@ -87,10 +75,15 @@ static const struct {
QMakeProperty::QMakeProperty() : settings(0)
{
- for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++)
- m_values[QString::fromLatin1(propList[i].name)] = propList[i].raw
- ? QLibraryInfo::rawLocation(propList[i].loc)
- : QLibraryInfo::location(propList[i].loc);
+ for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
+ QString name = QString::fromLatin1(propList[i].name);
+ QString val = QLibraryInfo::rawLocation(propList[i].loc);
+ if (!propList[i].raw) {
+ m_values[name] = QLibraryInfo::location(propList[i].loc);
+ name += "/raw";
+ }
+ m_values[name] = val;
+ }
}
QMakeProperty::~QMakeProperty()
@@ -216,8 +209,13 @@ QMakeProperty::exec()
#ifdef QT_VERSION_STR
specialProps.append("QT_VERSION");
#endif
- foreach (QString prop, specialProps)
- fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), value(prop).toLatin1().constData());
+ foreach (QString prop, specialProps) {
+ QString val = value(prop);
+ QString pval = value(prop + "/raw");
+ fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData());
+ if (!pval.isEmpty() && pval != val)
+ fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData());
+ }
return true;
}
for(QStringList::ConstIterator it = Option::prop::properties.begin();
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index dda03d43b8..b8b9d43035 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -1,6 +1,5 @@
CONFIG += depend_includepath
-QMAKE_INCREMENTAL =
SKIP_DEPENDS += qconfig.h qmodules.h
DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODETABLES \
QT_NO_GEOM_VARIANT QT_NO_DATASTREAM
diff --git a/qtbase.pro b/qtbase.pro
index 9290d5adcd..7648a63826 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -96,36 +96,36 @@ CONFIG -= qt
#qmake
qmake.path = $$[QT_HOST_BINS]
win32 {
- qmake.files=$$QT_BUILD_TREE/bin/qmake.exe
+ qmake.files = $$OUT_PWD/bin/qmake.exe
} else {
- qmake.files=$$QT_BUILD_TREE/bin/qmake
+ qmake.files = $$OUT_PWD/bin/qmake
}
INSTALLS += qmake
#syncqt
syncqt.path = $$[QT_HOST_BINS]
-syncqt.files=$$QT_BUILD_TREE/bin/syncqt
-win32:syncqt.files=$$QT_BUILD_TREE/bin/syncqt.bat
+syncqt.files = $$OUT_PWD/bin/syncqt
+win32:syncqt.files = $$OUT_PWD/bin/syncqt.bat
INSTALLS += syncqt
#qtmodule-configtests
configtests.path = $$[QT_HOST_BINS]
-configtests.files=$$QT_BUILD_TREE/bin/qtmodule-configtests
+configtests.files = $$PWD/bin/qtmodule-configtests
INSTALLS += configtests
#mkspecs
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
-mkspecs.files=$$QT_BUILD_TREE/mkspecs/qconfig.pri $$QT_BUILD_TREE/mkspecs/qmodule.pri $$files($$QT_SOURCE_TREE/mkspecs/*)
-mkspecs.files -= $$QT_SOURCE_TREE/mkspecs/modules
+mkspecs.files = $$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$files($$PWD/mkspecs/*)
+mkspecs.files -= $$PWD/mkspecs/modules
unix {
DEFAULT_QMAKESPEC = $$QMAKESPEC
DEFAULT_QMAKESPEC ~= s,^.*mkspecs/,,g
mkspecs.commands += $(DEL_FILE) $(INSTALL_ROOT)$$mkspecs.path/default; $(SYMLINK) $$DEFAULT_QMAKESPEC $(INSTALL_ROOT)$$mkspecs.path/default
- mkspecs.files -= $$QT_SOURCE_TREE/mkspecs/default
+ mkspecs.files -= $$PWD/mkspecs/default
}
-win32:!equals(QT_BUILD_TREE, $$QT_SOURCE_TREE) {
+win32:!equals(OUT_PWD, $$PWD) {
# When shadow building on Windows, the default mkspec only exists in the build tree.
- mkspecs.files += $$QT_BUILD_TREE/mkspecs/default
+ mkspecs.files += $$OUT_PWD/mkspecs/default
}
INSTALLS += mkspecs
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 2a86cb21e9..8247875714 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -1595,6 +1595,9 @@ static HB_Error Lookup_PairPos1( GPOS_Instance* gpi,
if ( index >= ppf1->PairSetCount )
return ERR(HB_Err_Invalid_SubTable);
+ if (!ppf1->PairSet[index].PairValueCount)
+ return HB_Err_Not_Covered;
+
pvr = ppf1->PairSet[index].PairValueRecord;
if ( !pvr )
return ERR(HB_Err_Invalid_SubTable);
diff --git a/src/3rdparty/pcre/sljit/sljitUtils.c b/src/3rdparty/pcre/sljit/sljitUtils.c
index 98beaa0b5e..703f405e18 100644
--- a/src/3rdparty/pcre/sljit/sljitUtils.c
+++ b/src/3rdparty/pcre/sljit/sljitUtils.c
@@ -233,7 +233,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_w SLJIT_CALL sljit_stack_resize(struct sljit_stac
aligned_new_limit = (new_limit + sljit_page_align) & ~sljit_page_align;
aligned_old_limit = (stack->limit + sljit_page_align) & ~sljit_page_align;
if (aligned_new_limit < aligned_old_limit)
+#ifdef __QNXNTO__
+ posix_madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, POSIX_MADV_DONTNEED);
+#else
madvise((void*)aligned_new_limit, aligned_old_limit - aligned_new_limit, MADV_DONTNEED);
+#endif
stack->limit = new_limit;
return 0;
#endif
diff --git a/src/concurrent/qtconcurrent_global.h b/src/concurrent/qtconcurrent_global.h
index 1e26c2321d..422bca0258 100644
--- a/src/concurrent/qtconcurrent_global.h
+++ b/src/concurrent/qtconcurrent_global.h
@@ -68,17 +68,4 @@
# endif
#endif
-// gcc 3 version has problems with some of the
-// map/filter overloads.
-#if defined(Q_CC_GNU) && (__GNUC__ < 4)
-# define QT_NO_CONCURRENT_MAP
-# define QT_NO_CONCURRENT_FILTER
-#endif
-
-#if defined (Q_CC_MSVC) && (_MSC_VER < 1300)
-# define QT_TYPENAME
-#else
-# define QT_TYPENAME typename
-#endif
-
#endif // include guard
diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h
index 0e46db868d..2ca5621f08 100644
--- a/src/concurrent/qtconcurrentrun.h
+++ b/src/concurrent/qtconcurrentrun.h
@@ -152,187 +152,187 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3,
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject)
{
- return (new StoredFunctorCall0<QT_TYPENAME FunctionObject::result_type, FunctionObject>(functionObject))->start();
+ return (new StoredFunctorCall0<typename FunctionObject::result_type, FunctionObject>(functionObject))->start();
}
template <typename FunctionObject, typename Arg1>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1)
{
- return (new StoredFunctorCall1<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1>(functionObject, arg1))->start();
+ return (new StoredFunctorCall1<typename FunctionObject::result_type, FunctionObject, Arg1>(functionObject, arg1))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new StoredFunctorCall2<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2>(functionObject, arg1, arg2))->start();
+ return (new StoredFunctorCall2<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2>(functionObject, arg1, arg2))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new StoredFunctorCall3<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>(functionObject, arg1, arg2, arg3))->start();
+ return (new StoredFunctorCall3<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>(functionObject, arg1, arg2, arg3))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new StoredFunctorCall4<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>(functionObject, arg1, arg2, arg3, arg4))->start();
+ return (new StoredFunctorCall4<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>(functionObject, arg1, arg2, arg3, arg4))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new StoredFunctorCall5<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new StoredFunctorCall5<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall0<QT_TYPENAME FunctionObject::result_type, FunctionObject>::type(functionObject))->start();
+ return (new typename SelectStoredFunctorPointerCall0<typename FunctionObject::result_type, FunctionObject>::type(functionObject))->start();
}
template <typename FunctionObject, typename Arg1>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall1<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1>::type(functionObject, arg1))->start();
+ return (new typename SelectStoredFunctorPointerCall1<typename FunctionObject::result_type, FunctionObject, Arg1>::type(functionObject, arg1))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall2<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2>::type(functionObject, arg1, arg2))->start();
+ return (new typename SelectStoredFunctorPointerCall2<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2>::type(functionObject, arg1, arg2))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall3<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>::type(functionObject, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredFunctorPointerCall3<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3>::type(functionObject, arg1, arg2, arg3))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall4<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>::type(functionObject, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredFunctorPointerCall4<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4>::type(functionObject, arg1, arg2, arg3, arg4))->start();
}
template <typename FunctionObject, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
QFuture<typename FunctionObject::result_type> run(FunctionObject *functionObject, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredFunctorPointerCall5<QT_TYPENAME FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>::type(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredFunctorPointerCall5<typename FunctionObject::result_type, FunctionObject, Arg1, Arg2, Arg3, Arg4, Arg5>::type(functionObject, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class &object, T (Class::*fn)())
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredMemberFunctionCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1), const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class &object, T (Class::*fn)() const)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredConstMemberFunctionCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1) const, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredConstMemberFunctionCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredConstMemberFunctionCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredConstMemberFunctionCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredConstMemberFunctionCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class &object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredConstMemberFunctionCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(Class *object, T (Class::*fn)())
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(Class *object, T (Class::*fn)(Param1), const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2), const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5), const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
template <typename T, typename Class>
QFuture<T> run(const Class *object, T (Class::*fn)() const)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall0<T, Class>::type(fn, object))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1) const, const Arg1 &arg1)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall1<T, Class, Param1, Arg1>::type(fn, object, arg1))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2) const, const Arg1 &arg1, const Arg2 &arg2)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall2<T, Class, Param1, Arg1, Param2, Arg2>::type(fn, object, arg1, arg2))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall3<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3>::type(fn, object, arg1, arg2, arg3))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall4<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4>::type(fn, object, arg1, arg2, arg3, arg4))->start();
}
template <typename T, typename Class, typename Param1, typename Arg1, typename Param2, typename Arg2, typename Param3, typename Arg3, typename Param4, typename Arg4, typename Param5, typename Arg5>
QFuture<T> run(const Class *object, T (Class::*fn)(Param1, Param2, Param3, Param4, Param5) const, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
{
- return (new QT_TYPENAME SelectStoredConstMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
+ return (new typename SelectStoredConstMemberFunctionPointerCall5<T, Class, Param1, Arg1, Param2, Arg2, Param3, Arg3, Param4, Arg4, Param5, Arg5>::type(fn, object, arg1, arg2, arg3, arg4, arg5))->start();
}
} //namespace QtConcurrent
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index c3a15ab4f9..a6f8914516 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -38,7 +38,7 @@ unix {
contains(QT_CONFIG,iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
- blackberry-*-qcc:LIBS_PRIVATE *= -liconv
+ qnx-*-qcc:LIBS_PRIVATE *= -liconv
} else:contains(QT_CONFIG,gnu-libiconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index aa0ddca753..be22ff9bca 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -465,7 +465,7 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from)
Q_ASSERT((to == 0 && from != 0) || (to != 0 && from == 0));
iconv_t cd = (iconv_t) -1;
-#if defined(__GLIBC__) || defined(GNU_LIBICONV)
+#if defined(__GLIBC__) || defined(GNU_LIBICONV) || defined(Q_OS_QNX)
#if defined(Q_OS_QNX)
// on QNX the default locale is UTF-8, and an empty string will cause iconv_open to fail
static const char empty_codeset[] = "UTF-8";
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 13f0ec8ce5..784a75bcad 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -48,6 +48,7 @@
#include "qlist.h"
#include "qfile.h"
#include "qstringlist.h"
+#include "qvarlengtharray.h"
#ifdef Q_OS_UNIX
# include "qiconvcodec_p.h"
@@ -220,10 +221,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
if (!mb || !mblen)
return QString();
- const int wclen_auto = 4096;
- wchar_t wc_auto[wclen_auto];
- int wclen = wclen_auto;
- wchar_t *wc = wc_auto;
+ QVarLengthArray<wchar_t, 4096> wc(4096);
int len;
QString sp;
bool prepend = false;
@@ -243,7 +241,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
prev[1] = mb[0];
remainingChars = 0;
len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
- prev, 2, wc, wclen);
+ prev, 2, wc.data(), wc.length());
if (len) {
prepend = true;
sp.append(QChar(wc[0]));
@@ -254,18 +252,12 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
}
while (!(len=MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
- mb, mblen, wc, wclen))) {
+ mb, mblen, wc.data(), wc.length()))) {
int r = GetLastError();
if (r == ERROR_INSUFFICIENT_BUFFER) {
- if (wc != wc_auto) {
- qWarning("MultiByteToWideChar: Size changed");
- break;
- } else {
- wclen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
+ const int wclen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
mb, mblen, 0, 0);
- wc = new wchar_t[wclen];
- // and try again...
- }
+ wc.resize(wclen);
} else if (r == ERROR_NO_UNICODE_TRANSLATION) {
//find the last non NULL character
while (mblen > 1 && !(mb[mblen-1]))
@@ -283,8 +275,10 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
break;
}
}
+
if (len <= 0)
return QString();
+
if (wc[len-1] == 0) // len - 1: we don't want terminator
--len;
@@ -293,9 +287,7 @@ QString QWindowsLocalCodec::convertToUnicode(const char *chars, int length, Conv
state->state_data[0] = (char)state_data;
state->remainingChars = remainingChars;
}
- QString s((QChar*)wc, len);
- if (wc != wc_auto)
- delete [] wc;
+ QString s((QChar*)wc.data(), len);
if (prepend) {
return sp+s;
}
@@ -359,7 +351,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
s.append(QChar(ws[i]));
delete [] ws;
#endif
- delete mbcs;
+ delete [] mbcs;
return s;
}
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index b4b170f7d7..690214323d 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -72,6 +72,10 @@ public:
static QTextCodec* codecForLocale();
static void setCodecForLocale(QTextCodec *c);
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED static QTextCodec *codecForTr() { return codecForMib(4); /* Latin1 */ }
+#endif
+
static QTextCodec *codecForHtml(const QByteArray &ba);
static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec);
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 49128374e0..58cff6b81c 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -11,7 +11,9 @@ HEADERS += \
global/qnumeric.h \
global/qlogging.h \
global/qtypeinfo.h \
- global/qsysinfo.h
+ global/qsysinfo.h \
+ global/qisenum.h \
+ global/qtypetraits.h
SOURCES += \
global/qglobal.cpp \
diff --git a/src/corelib/global/qisenum.h b/src/corelib/global/qisenum.h
new file mode 100644
index 0000000000..c9b6ec6695
--- /dev/null
+++ b/src/corelib/global/qisenum.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia 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.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+
+#ifndef QISENUM_H
+#define QISENUM_H
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+#ifndef Q_IS_ENUM
+# if defined(Q_CC_GNU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+# define Q_IS_ENUM(x) __is_enum(x)
+# elif defined(Q_CC_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215)
+# define Q_IS_ENUM(x) __is_enum(x)
+# else
+# include <QtCore/qtypetraits.h>
+# define Q_IS_ENUM(x) QtPrivate::is_enum<x>::value
+# endif
+#endif
+
+QT_END_HEADER
+QT_END_NAMESPACE
+
+#endif // QISENUM_H
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 1f16f090a9..d62794e706 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -75,7 +75,7 @@
/*
Alpha family, no revisions or variants
- Alpha is bi-endian, use endianness auto-detection described above.
+ Alpha is bi-endian, use endianness auto-detection implemented below.
*/
// #elif defined(__alpha__) || defined(_M_ALPHA)
// # define Q_PROCESSOR_ALPHA
@@ -85,7 +85,7 @@
ARM family, known revisions: V5, V6, and V7
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
- auto-detection described above.
+ auto-detection implemented below.
*/
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
# define Q_PROCESSOR_ARM
@@ -154,7 +154,7 @@
/*
Itanium (IA-64) family, no revisions or variants
- Itanium is bi-endian, use endianness auto-detection described above.
+ Itanium is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
# define Q_PROCESSOR_IA64
@@ -163,7 +163,7 @@
/*
MIPS family, known revisions: I, II, III, IV, 32, 64
- MIPS is bi-endian, use endianness auto-detection described above.
+ MIPS is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__mips) || defined(__mips__) || defined(_M_MRX000)
# define Q_PROCESSOR_MIPS
@@ -188,7 +188,13 @@
# if defined(_MIPS_ARCH_MIPS64) || defined(__mips64)
# define Q_PROCESSOR_MIPS_64
# endif
+# if defined(__MIPSEL__)
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+# elif defined(__MIPSEB__)
+# define Q_BYTE_ORDER Q_BIG_ENDIAN
+# else
// Q_BYTE_ORDER not defined, use endianness auto-detection
+# endif
/*
Power family, known variants: 32- and 64-bit
@@ -197,7 +203,7 @@
See http://en.wikipedia.org/wiki/Power_Architecture
and http://en.wikipedia.org/wiki/File:PowerISA-evolution.svg
- Power is bi-endian, use endianness auto-detection described above.
+ Power is bi-endian, use endianness auto-detection implemented below.
*/
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \
@@ -225,7 +231,7 @@
/*
SuperH family, optional revision: SH-4A
- SuperH is bi-endian, use endianness auto-detection descrived above.
+ SuperH is bi-endian, use endianness auto-detection implemented below.
*/
// #elif defined(__sh__)
// # define Q_PROCESSOR_SH
@@ -249,6 +255,14 @@
#endif
+/*
+ NOTE:
+ GCC 4.6 added __BYTE_ORDER__, __ORDER_BIG_ENDIAN__, __ORDER_LITTLE_ENDIAN__
+ and __ORDER_PDP_ENDIAN__ in SVN r165881. If you are using GCC 4.6 or newer,
+ this code will properly detect your target byte order; if you are not, and
+ the __LITTLE_ENDIAN__ or __BIG_ENDIAN__ macros are not defined, then this
+ code will fail to detect the target byte order.
+*/
// Some processors support either endian format, try to detect which we are using.
#if !defined(Q_BYTE_ORDER)
# if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == Q_BIG_ENDIAN || __BYTE_ORDER__ == Q_LITTLE_ENDIAN)
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index e6e207ec3d..74c8d1de7f 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -80,8 +80,6 @@ public:
# error "Undefined byte order"
# endif
};
-#else
-# error "Qt not configured correctly, please run configure"
#endif
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
enum WinVersion {
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
new file mode 100644
index 0000000000..92bd949570
--- /dev/null
+++ b/src/corelib/global/qtypetraits.h
@@ -0,0 +1,420 @@
+// Copyright (c) 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// ----
+//
+// This code is compiled directly on many platforms, including client
+// platforms like Windows, Mac, and embedded systems. Before making
+// any changes here, make sure that you're not breaking any platforms.
+//
+// Define a small subset of tr1 type traits. The traits we define are:
+// is_integral
+// is_floating_point
+// is_pointer
+// is_enum
+// is_reference
+// is_pod
+// has_trivial_constructor
+// has_trivial_copy
+// has_trivial_assign
+// has_trivial_destructor
+// remove_const
+// remove_volatile
+// remove_cv
+// remove_reference
+// add_reference
+// remove_pointer
+// is_same
+// is_convertible
+// We can add more type traits as required.
+
+// Changes from the original implementation:
+// - Move base types from template_util.h directly into this header.
+// - Use Qt macros for long long type differences on Windows.
+// - Enclose in QtPrivate namespace.
+
+#ifndef QTYPETRAITS_H
+#define QTYPETRAITS_H
+
+#include <utility> // For pair
+#include "QtCore/qglobal.h"
+
+QT_BEGIN_HEADER
+QT_BEGIN_NAMESPACE
+
+namespace QtPrivate {
+
+// Types small_ and big_ are guaranteed such that sizeof(small_) <
+// sizeof(big_)
+typedef char small_;
+
+struct big_ {
+ char dummy[2];
+};
+
+// Identity metafunction.
+template <class T>
+struct identity_ {
+ typedef T type;
+};
+
+// integral_constant, defined in tr1, is a wrapper for an integer
+// value. We don't really need this generality; we could get away
+// with hardcoding the integer type to bool. We use the fully
+// general integer_constant for compatibility with tr1.
+
+template<class T, T v>
+struct integral_constant {
+ static const T value = v;
+ typedef T value_type;
+ typedef integral_constant<T, v> type;
+};
+
+template <class T, T v> const T integral_constant<T, v>::value;
+
+
+// Abbreviations: true_type and false_type are structs that represent boolean
+// true and false values. Also define the boost::mpl versions of those names,
+// true_ and false_.
+typedef integral_constant<bool, true> true_type;
+typedef integral_constant<bool, false> false_type;
+typedef true_type true_;
+typedef false_type false_;
+
+// if_ is a templatized conditional statement.
+// if_<cond, A, B> is a compile time evaluation of cond.
+// if_<>::type contains A if cond is true, B otherwise.
+template<bool cond, typename A, typename B>
+struct if_{
+ typedef A type;
+};
+
+template<typename A, typename B>
+struct if_<false, A, B> {
+ typedef B type;
+};
+
+
+// type_equals_ is a template type comparator, similar to Loki IsSameType.
+// type_equals_<A, B>::value is true iff "A" is the same type as "B".
+//
+// New code should prefer base::is_same, defined in base/type_traits.h.
+// It is functionally identical, but is_same is the standard spelling.
+template<typename A, typename B>
+struct type_equals_ : public false_ {
+};
+
+template<typename A>
+struct type_equals_<A, A> : public true_ {
+};
+
+// and_ is a template && operator.
+// and_<A, B>::value evaluates "A::value && B::value".
+template<typename A, typename B>
+struct and_ : public integral_constant<bool, (A::value && B::value)> {
+};
+
+// or_ is a template || operator.
+// or_<A, B>::value evaluates "A::value || B::value".
+template<typename A, typename B>
+struct or_ : public integral_constant<bool, (A::value || B::value)> {
+};
+
+template <class T> struct is_integral;
+template <class T> struct is_floating_point;
+template <class T> struct is_pointer;
+// MSVC can't compile this correctly, and neither can gcc 3.3.5 (at least)
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+// is_enum uses is_convertible, which is not available on MSVC.
+template <class T> struct is_enum;
+#endif
+template <class T> struct is_reference;
+template <class T> struct is_pod;
+template <class T> struct has_trivial_constructor;
+template <class T> struct has_trivial_copy;
+template <class T> struct has_trivial_assign;
+template <class T> struct has_trivial_destructor;
+template <class T> struct remove_const;
+template <class T> struct remove_volatile;
+template <class T> struct remove_cv;
+template <class T> struct remove_reference;
+template <class T> struct add_reference;
+template <class T> struct remove_pointer;
+template <class T, class U> struct is_same;
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+template <class From, class To> struct is_convertible;
+#endif
+
+// is_integral is false except for the built-in integer types. A
+// cv-qualified type is integral if and only if the underlying type is.
+template <class T> struct is_integral : false_type { };
+template<> struct is_integral<bool> : true_type { };
+template<> struct is_integral<char> : true_type { };
+template<> struct is_integral<unsigned char> : true_type { };
+template<> struct is_integral<signed char> : true_type { };
+#if defined(_MSC_VER)
+// wchar_t is not by default a distinct type from unsigned short in
+// Microsoft C.
+// See http://msdn2.microsoft.com/en-us/library/dh8che7s(VS.80).aspx
+template<> struct is_integral<__wchar_t> : true_type { };
+#else
+template<> struct is_integral<wchar_t> : true_type { };
+#endif
+template<> struct is_integral<short> : true_type { };
+template<> struct is_integral<unsigned short> : true_type { };
+template<> struct is_integral<int> : true_type { };
+template<> struct is_integral<unsigned int> : true_type { };
+template<> struct is_integral<long> : true_type { };
+template<> struct is_integral<unsigned long> : true_type { };
+#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
+template<> struct is_integral<__int64> : true_type { };
+template<> struct is_integral<unsigned __int64> : true_type { };
+#else
+template<> struct is_integral<long long> : true_type { };
+template<> struct is_integral<unsigned long long> : true_type { };
+#endif
+template <class T> struct is_integral<const T> : is_integral<T> { };
+template <class T> struct is_integral<volatile T> : is_integral<T> { };
+template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+
+// is_floating_point is false except for the built-in floating-point types.
+// A cv-qualified type is integral if and only if the underlying type is.
+template <class T> struct is_floating_point : false_type { };
+template<> struct is_floating_point<float> : true_type { };
+template<> struct is_floating_point<double> : true_type { };
+template<> struct is_floating_point<long double> : true_type { };
+template <class T> struct is_floating_point<const T>
+ : is_floating_point<T> { };
+template <class T> struct is_floating_point<volatile T>
+ : is_floating_point<T> { };
+template <class T> struct is_floating_point<const volatile T>
+ : is_floating_point<T> { };
+
+// is_pointer is false except for pointer types. A cv-qualified type (e.g.
+// "int* const", as opposed to "int const*") is cv-qualified if and only if
+// the underlying type is.
+template <class T> struct is_pointer : false_type { };
+template <class T> struct is_pointer<T*> : true_type { };
+template <class T> struct is_pointer<const T> : is_pointer<T> { };
+template <class T> struct is_pointer<volatile T> : is_pointer<T> { };
+template <class T> struct is_pointer<const volatile T> : is_pointer<T> { };
+
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+
+namespace internal {
+
+template <class T> struct is_class_or_union {
+ template <class U> static small_ tester(void (U::*)());
+ template <class U> static big_ tester(...);
+ static const bool value = sizeof(tester<T>(0)) == sizeof(small_);
+};
+
+// is_convertible chokes if the first argument is an array. That's why
+// we use add_reference here.
+template <bool NotUnum, class T> struct is_enum_impl
+ : is_convertible<typename add_reference<T>::type, int> { };
+
+template <class T> struct is_enum_impl<true, T> : false_type { };
+
+} // namespace internal
+
+// Specified by TR1 [4.5.1] primary type categories.
+
+// Implementation note:
+//
+// Each type is either void, integral, floating point, array, pointer,
+// reference, member object pointer, member function pointer, enum,
+// union or class. Out of these, only integral, floating point, reference,
+// class and enum types are potentially convertible to int. Therefore,
+// if a type is not a reference, integral, floating point or class and
+// is convertible to int, it's a enum. Adding cv-qualification to a type
+// does not change whether it's an enum.
+//
+// Is-convertible-to-int check is done only if all other checks pass,
+// because it can't be used with some types (e.g. void or classes with
+// inaccessible conversion operators).
+template <class T> struct is_enum
+ : internal::is_enum_impl<
+ is_same<T, void>::value ||
+ is_integral<T>::value ||
+ is_floating_point<T>::value ||
+ is_reference<T>::value ||
+ internal::is_class_or_union<T>::value,
+ T> { };
+
+template <class T> struct is_enum<const T> : is_enum<T> { };
+template <class T> struct is_enum<volatile T> : is_enum<T> { };
+template <class T> struct is_enum<const volatile T> : is_enum<T> { };
+
+#endif
+
+// is_reference is false except for reference types.
+template<typename T> struct is_reference : false_type {};
+template<typename T> struct is_reference<T&> : true_type {};
+
+
+// We can't get is_pod right without compiler help, so fail conservatively.
+// We will assume it's false except for arithmetic types, enumerations,
+// pointers and cv-qualified versions thereof. Note that std::pair<T,U>
+// is not a POD even if T and U are PODs.
+template <class T> struct is_pod
+ : integral_constant<bool, (is_integral<T>::value ||
+ is_floating_point<T>::value ||
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+ // is_enum is not available on MSVC.
+ is_enum<T>::value ||
+#endif
+ is_pointer<T>::value)> { };
+template <class T> struct is_pod<const T> : is_pod<T> { };
+template <class T> struct is_pod<volatile T> : is_pod<T> { };
+template <class T> struct is_pod<const volatile T> : is_pod<T> { };
+
+
+// We can't get has_trivial_constructor right without compiler help, so
+// fail conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial
+// constructors. (3) array of a type with a trivial constructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_constructor : is_pod<T> { };
+template <class T, class U> struct has_trivial_constructor<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_constructor<T>::value &&
+ has_trivial_constructor<U>::value)> { };
+template <class A, int N> struct has_trivial_constructor<A[N]>
+ : has_trivial_constructor<A> { };
+template <class T> struct has_trivial_constructor<const T>
+ : has_trivial_constructor<T> { };
+
+// We can't get has_trivial_copy right without compiler help, so fail
+// conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial copy
+// constructors. (3) array of a type with a trivial copy constructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_copy : is_pod<T> { };
+template <class T, class U> struct has_trivial_copy<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_copy<T>::value &&
+ has_trivial_copy<U>::value)> { };
+template <class A, int N> struct has_trivial_copy<A[N]>
+ : has_trivial_copy<A> { };
+template <class T> struct has_trivial_copy<const T> : has_trivial_copy<T> { };
+
+// We can't get has_trivial_assign right without compiler help, so fail
+// conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial copy
+// constructors. (3) array of a type with a trivial assign constructor.
+template <class T> struct has_trivial_assign : is_pod<T> { };
+template <class T, class U> struct has_trivial_assign<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_assign<T>::value &&
+ has_trivial_assign<U>::value)> { };
+template <class A, int N> struct has_trivial_assign<A[N]>
+ : has_trivial_assign<A> { };
+
+// We can't get has_trivial_destructor right without compiler help, so
+// fail conservatively. We will assume it's false except for: (1) types
+// for which is_pod is true. (2) std::pair of types with trivial
+// destructors. (3) array of a type with a trivial destructor.
+// (4) const versions thereof.
+template <class T> struct has_trivial_destructor : is_pod<T> { };
+template <class T, class U> struct has_trivial_destructor<std::pair<T, U> >
+ : integral_constant<bool,
+ (has_trivial_destructor<T>::value &&
+ has_trivial_destructor<U>::value)> { };
+template <class A, int N> struct has_trivial_destructor<A[N]>
+ : has_trivial_destructor<A> { };
+template <class T> struct has_trivial_destructor<const T>
+ : has_trivial_destructor<T> { };
+
+// Specified by TR1 [4.7.1]
+template<typename T> struct remove_const { typedef T type; };
+template<typename T> struct remove_const<T const> { typedef T type; };
+template<typename T> struct remove_volatile { typedef T type; };
+template<typename T> struct remove_volatile<T volatile> { typedef T type; };
+template<typename T> struct remove_cv {
+ typedef typename remove_const<typename remove_volatile<T>::type>::type type;
+};
+
+
+// Specified by TR1 [4.7.2] Reference modifications.
+template<typename T> struct remove_reference { typedef T type; };
+template<typename T> struct remove_reference<T&> { typedef T type; };
+
+template <typename T> struct add_reference { typedef T& type; };
+template <typename T> struct add_reference<T&> { typedef T& type; };
+
+// Specified by TR1 [4.7.4] Pointer modifications.
+template<typename T> struct remove_pointer { typedef T type; };
+template<typename T> struct remove_pointer<T*> { typedef T type; };
+template<typename T> struct remove_pointer<T* const> { typedef T type; };
+template<typename T> struct remove_pointer<T* volatile> { typedef T type; };
+template<typename T> struct remove_pointer<T* const volatile> {
+ typedef T type; };
+
+// Specified by TR1 [4.6] Relationships between types
+template<typename T, typename U> struct is_same : public false_type { };
+template<typename T> struct is_same<T, T> : public true_type { };
+
+// Specified by TR1 [4.6] Relationships between types
+#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
+namespace internal {
+
+// This class is an implementation detail for is_convertible, and you
+// don't need to know how it works to use is_convertible. For those
+// who care: we declare two different functions, one whose argument is
+// of type To and one with a variadic argument list. We give them
+// return types of different size, so we can use sizeof to trick the
+// compiler into telling us which function it would have chosen if we
+// had called it with an argument of type From. See Alexandrescu's
+// _Modern C++ Design_ for more details on this sort of trick.
+
+template <typename From, typename To>
+struct ConvertHelper {
+ static small_ Test(To);
+ static big_ Test(...);
+ static From Create();
+};
+} // namespace internal
+
+// Inherits from true_type if From is convertible to To, false_type otherwise.
+template <typename From, typename To>
+struct is_convertible
+ : integral_constant<bool,
+ sizeof(internal::ConvertHelper<From, To>::Test(
+ internal::ConvertHelper<From, To>::Create()))
+ == sizeof(small_)> {
+};
+#endif
+
+}
+
+QT_END_NAMESPACE
+QT_END_HEADER
+
+#endif // QTYPETRAITS_H
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 7a1357959e..c6f174bcf8 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -1223,12 +1223,11 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
/*!
\fn bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent)
- \note The base class implementation of this function does nothing and
- returns false.
-
Inserts a single row before the given \a row in the child items of the
\a parent specified.
+ \note This function calls the virtual method insertRows.
+
Returns true if the row is inserted; otherwise returns false.
\sa insertRows() insertColumn() removeRow()
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 433a68105d..6bae2001a1 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -122,10 +122,10 @@ QJsonArray &QJsonArray::operator =(const QJsonArray &other)
if (d && !d->ref.deref())
delete d;
d = other.d;
- a = other.a;
if (d)
d->ref.ref();
}
+ a = other.a;
return *this;
}
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index cfe71e8959..e14000fac3 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -125,10 +125,10 @@ QJsonObject &QJsonObject::operator =(const QJsonObject &other)
if (d && !d->ref.deref())
delete d;
d = other.d;
- o = other.o;
if (d)
d->ref.ref();
}
+ o = other.o;
return *this;
}
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 0a5181a508..cf76511f25 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -137,7 +137,11 @@ public:
static void installTranslator(QTranslator * messageFile);
static void removeTranslator(QTranslator * messageFile);
#endif
- enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1 };
+ enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = Latin1
+#if QT_DEPRECATED_SINCE(5, 0)
+ , CodecForTr = Latin1
+#endif
+ };
static QString translate(const char * context,
const char * key,
const char * disambiguation = 0,
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index a5dc179113..8474635fe7 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -375,8 +375,9 @@ void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
\sa type(), isRegistered(), Type
*/
-const char *QMetaType::typeName(int type)
+const char *QMetaType::typeName(int typeId)
{
+ const uint type = typeId;
// In theory it can be filled during compilation time, but for some reason template code
// that is able to do it causes GCC 4.6 to generate additional 3K of executable code. Probably
// it is not worth of it.
@@ -398,7 +399,7 @@ const char *QMetaType::typeName(int type)
} else {
const QVector<QCustomTypeInfo> * const ct = customTypes();
QReadLocker locker(customTypesLock());
- return ct && ct->count() > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty()
+ return ct && uint(ct->count()) > type - QMetaType::User && !ct->at(type - QMetaType::User).typeName.isEmpty()
? ct->at(type - QMetaType::User).typeName.constData()
: 0;
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index fb2bce7d7b..4eadb34ea1 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -45,6 +45,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qatomic.h>
#include <QtCore/qbytearray.h>
+#include <QtCore/qisenum.h>
#include <new>
@@ -210,7 +211,8 @@ public:
NeedsConstruction = 0x1,
NeedsDestruction = 0x2,
MovableType = 0x4,
- PointerToQObject = 0x8
+ PointerToQObject = 0x8,
+ IsEnumeration = 0x10
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
@@ -466,6 +468,8 @@ int qRegisterMetaType(const char *typeName
}
if (QtPrivate::IsPointerToTypeDerivedFromQObject<T>::Value)
flags |= QMetaType::PointerToQObject;
+ if (Q_IS_ENUM(T))
+ flags |= QMetaType::IsEnumeration;
return QMetaType::registerType(typeName, qMetaTypeDeleteHelper<T>,
qMetaTypeCreateHelper<T>,
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 39e8b4360f..8058a06117 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1676,12 +1676,12 @@ void QVariant::load(QDataStream &s)
// by moving all ids down by 97.
typeId -= 97;
} else if (typeId == 69 /* QIcon */) {
- // In Qt5 after modularization project this types where moved to a separate module (and ids were downgraded)
+ // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
typeId = QMetaType::QIcon;
} else if (typeId == 75 /* QSizePolicy */) {
typeId = QMetaType::QSizePolicy;
} else if (typeId >= 70) {
- // and as a result this types recieved lower ids too
+ // and as a result these types received lower ids too
if (typeId <= 74) { // QImage QPolygon QRegion QBitmap QCursor
typeId -=1;
} else if (typeId <= 86) { // QKeySequence QPen QTextLength QTextFormat QMatrix QTransform QMatrix4x4 QVector2D QVector3D QVector4D QQuaternion
@@ -1749,12 +1749,12 @@ void QVariant::save(QDataStream &s) const
// by moving all ids down by 97.
typeId += 97;
} else if (typeId == QMetaType::QIcon) {
- // In Qt5 after modularization project this types where moved to a separate module (and ids were downgraded)
+ // In Qt5 after modularization project these types where moved to a separate module (and ids were downgraded)
typeId = 69;
} else if (typeId == QMetaType::QSizePolicy) {
typeId = 75;
} else if (typeId >= QMetaType::QImage) {
- // and as a result this types recieved lower ids too
+ // and as a result these types received lower ids too
if (typeId <= QMetaType::QCursor) {
typeId +=1;
} else if (typeId <= QMetaType::QQuaternion) {
@@ -2445,6 +2445,8 @@ bool QVariant::canConvert(int targetTypeId) const
if (currentType == uint(targetTypeId))
return true;
+ if (targetTypeId < 0 || targetTypeId >= QMetaType::User)
+ return false;
// FIXME It should be LastCoreType intead of Uuid
if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) {
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 4099487f9b..ebf687bb4b 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QDebug>
#include <QtCore/QLocale>
+#include <memory>
+
QT_BEGIN_NAMESPACE
bool qt_isQMimeTypeDebuggingActivated (false);
@@ -62,27 +64,19 @@ bool qt_isQMimeTypeDebuggingActivated (false);
#endif
QMimeTypePrivate::QMimeTypePrivate()
- : name()
- //, comment()
- , localeComments()
- , genericIconName()
- , iconName()
- , globPatterns()
{}
QMimeTypePrivate::QMimeTypePrivate(const QMimeType &other)
- : name(other.d->name)
- //, comment(other.d->comment)
- , localeComments(other.d->localeComments)
- , genericIconName(other.d->genericIconName)
- , iconName(other.d->iconName)
- , globPatterns(other.d->globPatterns)
+ : name(other.d->name),
+ localeComments(other.d->localeComments),
+ genericIconName(other.d->genericIconName),
+ iconName(other.d->iconName),
+ globPatterns(other.d->globPatterns)
{}
void QMimeTypePrivate::clear()
{
name.clear();
- //comment.clear();
localeComments.clear();
genericIconName.clear();
iconName.clear();
@@ -97,7 +91,6 @@ bool QMimeTypePrivate::operator==(const QMimeTypePrivate &other) const
{
DBG();
if (name == other.name &&
- //comment == other.comment &&
localeComments == other.localeComments &&
genericIconName == other.genericIconName &&
iconName == other.iconName &&
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 2ecd934100..c029f627b2 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -42,6 +42,7 @@
#ifndef QLOCALE_H
#define QLOCALE_H
+#include <QtCore/qvariant.h>
#include <QtCore/qstring.h>
#include <QtCore/qobjectdefs.h>
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 0fa7d6459e..1db78519a3 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -47,6 +47,8 @@
#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qthreadstorage.h>
+#include <QtCore/qglobal.h>
#include <pcre.h>
@@ -989,6 +991,47 @@ void QRegularExpressionPrivate::getPatternInfo()
(patternNewlineSetting == PCRE_NEWLINE_ANYCRLF);
}
+
+/*!
+ \class QPcreJitStackPointer
+ \internal
+
+ Simple "smartpointer" wrapper around a pcre_jit_stack, to be used with
+ QThreadStorage.
+*/
+class QPcreJitStackPointer
+{
+ Q_DISABLE_COPY(QPcreJitStackPointer);
+
+public:
+ QPcreJitStackPointer()
+ {
+ // The default JIT stack size in PCRE is 32K,
+ // we allocate from 32K up to 512K.
+ stack = pcre16_jit_stack_alloc(32*1024, 512*1024);
+ }
+ ~QPcreJitStackPointer()
+ {
+ if (stack)
+ pcre16_jit_stack_free(stack);
+ }
+
+ pcre16_jit_stack *stack;
+};
+
+Q_GLOBAL_STATIC(QThreadStorage<QPcreJitStackPointer *>, jitStacks)
+
+/*!
+ \internal
+*/
+static pcre16_jit_stack *qtPcreCallback(void *)
+{
+ if (jitStacks()->hasLocalData())
+ return jitStacks()->localData()->stack;
+
+ return 0;
+}
+
/*!
\internal
*/
@@ -1044,6 +1087,9 @@ pcre16_extra *QRegularExpressionPrivate::optimizePattern()
const char *err;
studyData = pcre16_study(compiledPattern, studyOptions, &err);
+ if (studyData && studyData->flags & PCRE_EXTRA_EXECUTABLE_JIT)
+ pcre16_assign_jit_stack(studyData, qtPcreCallback, 0);
+
if (!studyData && err)
qWarning("QRegularExpressionPrivate::optimizePattern(): pcre_study failed: %s", err);
@@ -1060,6 +1106,9 @@ int QRegularExpressionPrivate::captureIndexForName(const QString &name) const
{
Q_ASSERT(!name.isEmpty());
+ if (!compiledPattern)
+ return -1;
+
int index = pcre16_get_stringnumber(compiledPattern, name.utf16());
if (index >= 0)
return index;
@@ -1070,6 +1119,32 @@ int QRegularExpressionPrivate::captureIndexForName(const QString &name) const
/*!
\internal
+ This is a simple wrapper for pcre16_exec for handling the case in which the
+ JIT runs out of memory. In that case, we allocate a thread-local JIT stack
+ and re-run pcre16_exec.
+*/
+static int pcre16SafeExec(const pcre16 *code, const pcre16_extra *extra,
+ const unsigned short *subject, int length,
+ int startOffset, int options,
+ int *ovector, int ovecsize)
+{
+ int result = pcre16_exec(code, extra, subject, length,
+ startOffset, options, ovector, ovecsize);
+
+ if (result == PCRE_ERROR_JIT_STACKLIMIT && !jitStacks()->hasLocalData()) {
+ QPcreJitStackPointer *p = new QPcreJitStackPointer;
+ jitStacks()->setLocalData(p);
+
+ result = pcre16_exec(code, extra, subject, length,
+ startOffset, options, ovector, ovecsize);
+ }
+
+ return result;
+}
+
+/*!
+ \internal
+
Performs a match of type \a matchType on the given \a subject string with
options \a matchOptions and returns the QRegularExpressionMatchPrivate of
the result. It also advances a match if a previous result is given as \a
@@ -1134,15 +1209,15 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
int result;
if (!previousMatchWasEmpty) {
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions,
+ captureOffsets, captureOffsetsCount);
} else {
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions | PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions | PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED,
+ captureOffsets, captureOffsetsCount);
if (result == PCRE_ERROR_NOMATCH) {
++offset;
@@ -1157,10 +1232,10 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString
++offset;
}
- result = pcre16_exec(compiledPattern, currentStudyData,
- subjectUtf16, subjectLength,
- offset, pcreOptions,
- captureOffsets, captureOffsetsCount);
+ result = pcre16SafeExec(compiledPattern, currentStudyData,
+ subjectUtf16, subjectLength,
+ offset, pcreOptions,
+ captureOffsets, captureOffsetsCount);
}
}
@@ -2131,4 +2206,119 @@ QDebug operator<<(QDebug debug, const QRegularExpressionMatch &match)
}
#endif
+// fool lupdate: make it extract those strings for translation, but don't put them
+// inside Qt -- they're already inside libpcre (cf. man 3 pcreapi, pcre_compile.c).
+#if 0
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2012 University of Cambridge
+
+-----------------------------------------------------------------------------
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the University of Cambridge nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+-----------------------------------------------------------------------------
+*/
+
+static const char *pcreCompileErrorCodes[] =
+{
+ QT_TRANSLATE_NOOP("QRegularExpression", "no error"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\ at end of pattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\c at end of pattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character follows \\"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "numbers out of order in {} quantifier"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number too big in {} quantifier"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing terminating ] for character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid escape sequence in character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "range out of order in character class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "nothing to repeat"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: unexpected repeat"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (? or (?-"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "POSIX named classes are supported only within a class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing )"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "reference to non-existent subpattern"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "erroffset passed as NULL"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown option bit(s) set"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "missing ) after comment"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "regular expression is too large"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "failed to get memory"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unmatched parentheses"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: code overflow"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (?<"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "lookbehind assertion is not fixed length"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "malformed number or name after (?("),
+ QT_TRANSLATE_NOOP("QRegularExpression", "conditional group contains more than two branches"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "assertion expected after (?("),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(?R or (?[+-]digits must be followed by )"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown POSIX class name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "POSIX collating elements are not supported"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "this version of PCRE is not compiled with PCRE_UTF8 support"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "character value in \\x{...} sequence is too large"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid condition (?(0)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\C not allowed in lookbehind assertion"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number after (?C is > 255"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "closing ) for (?C expected"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "recursive call could loop indefinitely"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unrecognized character after (?P"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "syntax error in subpattern name (missing terminator)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "two named subpatterns have the same name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid UTF-8 string"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "support for \\P, \\p, and \\X has not been compiled"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "malformed \\P or \\p sequence"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "unknown property name after \\P or \\p"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "subpattern name is too long (maximum 32 characters)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "too many named subpatterns (maximum 10000)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "octal value is greater than \\377 (not in UTF-8 mode)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: overran compiling workspace"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: previously-checked referenced subpattern not found"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "DEFINE group contains more than one branch"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "repeating a DEFINE group is not allowed"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "inconsistent NEWLINE options"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "a numbered reference must not be zero"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(*VERB) not recognized"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "number is too big"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "subpattern name expected"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "digit expected after (?+"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "] is an invalid data character in JavaScript compatibility mode"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "different names for subpatterns of the same number are not allowed"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "(*MARK) must have an argument"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "this version of PCRE is not compiled with PCRE_UCP support"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\c must be followed by an ASCII character"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\k is not followed by a braced, angle-bracketed, or quoted name"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "internal error: unknown opcode in find_fixedlength()"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "\\N is not supported in a class"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "too many forward references"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "disallowed Unicode code point (>= 0xd800 && <= 0xdfff)"),
+ QT_TRANSLATE_NOOP("QRegularExpression", "invalid UTF-16 string")
+};
+#endif // #if 0
+
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index e5b290ae1f..cb89fccc2d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -257,7 +257,8 @@ QT_BEGIN_NAMESPACE
\value SelectionWithin Several changes to a selection has occurred in an item
view.
\value SoundPlayed A sound has been played by an object
- \value StateChanged The QAccessible::State of an object has changed.
+ \omitvalue StateChanged The QAccessible::State of an object has changed.
+ This value is used internally for the QAccessibleStateChangeEvent.
\value TableCaptionChanged A table caption has been changed.
\value TableColumnDescriptionChanged The description of a table column, typically found in
the column's header, has been changed.
@@ -308,6 +309,7 @@ QT_BEGIN_NAMESPACE
\value ColumnHeader A header for a column of data.
\value ComboBox A list of choices that the user can select from.
\value Cursor An object that represents the mouse cursor.
+ \value Desktop The object represents the desktop or workspace.
\value Dial An object that represents a dial or knob.
\value Dialog A dialog box.
\value Document A document window, usually in an MDI environment.
@@ -345,6 +347,7 @@ QT_BEGIN_NAMESPACE
\value StaticText Static text, such as labels for other widgets.
\value StatusBar A status bar.
\value Table A table representing data in a grid of rows and columns.
+ \value Terminal A terminal or command line interface.
\value TitleBar The title bar caption of a window.
\value ToolBar A tool bar, which groups widgets that the user accesses frequently.
\value ToolTip A tool tip which provides information about other objects.
@@ -694,9 +697,32 @@ void QAccessible::updateAccessibility(const QAccessibleEvent &event)
This class should be created on the stack and used as parameter for
\l QAccessible::updateAccessibility().
+ \sa QAccessibleStateChangedEvent
*/
/*!
+ \class QAccessibleStateChangedEvent
+ \brief This subclass of QAccessibleEvent is used to inform about state changes.
+ \internal
+
+ \ingroup accessibility
+ \inmodule QtGui
+
+ This class should be created on the stack and used as parameter for
+ \l QAccessible::updateAccessibility().
+ In addition to the regular \l QAccessibleEvent it contains details about which states
+ changed.
+ \sa QAccessibleEvent
+*/
+
+/*!
+ \fn QAccessibleStateChangeEvent::changedStates() const
+ All states that have changed are set to true. This does not reflect the state of the object,
+ but indicates which states are changed.
+ Use the \l QAccessibleInterface::state() function to get the current state.
+ */
+
+/*!
Returns the QAccessibleInterface associated with the event.
The caller of this function takes ownership of the returned interface.
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 6ad1bb9da9..e8a5cf8bad 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -292,6 +292,7 @@ public:
// Additional Qt roles where enum value does not map directly to MSAA:
LayeredPane = 0x0000003F,
Terminal = 0x00000040,
+ Desktop = 0x00000041,
UserRole = 0x0000ffff
};
@@ -436,6 +437,9 @@ public:
Q_ASSERT(obj);
}
+ virtual ~QAccessibleEvent()
+ {}
+
QAccessible::Event type() const { return m_type; }
QObject *object() const { return m_object; }
int child() const { return m_child; }
@@ -448,6 +452,21 @@ private:
int m_child;
};
+class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent
+{
+public:
+ inline QAccessibleStateChangeEvent(QAccessible::State state, QObject *obj, int chld = -1)
+ : QAccessibleEvent(QAccessible::StateChanged, obj, chld), m_changedStates(state)
+ {}
+
+ QAccessible::State changedStates() const {
+ return m_changedStates;
+ }
+
+private:
+ QAccessible::State m_changedStates;
+};
+
#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index b84c484f74..61e46ebf04 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -70,24 +70,6 @@ namespace QAccessible2
LineBoundary,
NoBoundary
};
-
- enum TableModelChangeType {
- TableModelChangeInsert,
- TableModelChangeDelete,
- TableModelChangeUpdate
- };
-
- struct TableModelChange {
- int firstColumn;
- int firstRow;
- int lastColumn;
- int lastRow;
- TableModelChangeType type;
-
- TableModelChange()
- : firstColumn(0), firstRow(0), lastColumn(0), lastRow(0), type(TableModelChangeUpdate)
- {}
- };
}
class Q_GUI_EXPORT QAccessibleTextInterface
@@ -230,19 +212,8 @@ public:
virtual bool unselectRow(int row) = 0;
// Unselects one column, leaving other selected columns selected (if any).
virtual bool unselectColumn(int column) = 0;
- // Returns the type and extents describing how a table changed.
- virtual QAccessible2::TableModelChange modelChange() const = 0;
protected:
- // These functions are called when the model changes.
- virtual void modelReset() = 0;
- virtual void rowsInserted(const QModelIndex &parent, int first, int last) = 0;
- virtual void rowsRemoved(const QModelIndex &parent, int first, int last) = 0;
- virtual void columnsInserted(const QModelIndex &parent, int first, int last) = 0;
- virtual void columnsRemoved(const QModelIndex &parent, int first, int last) = 0;
- virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) = 0;
- virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) = 0;
-
friend class QAbstractItemView;
friend class QAbstractItemViewPrivate;
};
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri
deleted file mode 100644
index e4a2bbef75..0000000000
--- a/src/gui/egl/egl.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-contains(QT_CONFIG, egl): {
- CONFIG += egl
-
- HEADERS += \
- egl/qegl_p.h \
- egl/qeglcontext_p.h \
- egl/qeglproperties_p.h
-
- SOURCES += \
- egl/qegl.cpp \
- egl/qeglproperties.cpp
- unix {
- !isEmpty(QMAKE_INCDIR_EGL){
- INCLUDEPATH += $$QMAKE_INCDIR_EGL
- }
- !isEmpty(QMAKE_LIBDIR_EGL){
- for(p, QMAKE_LIBDIR_EGL) {
- exists($$p):LIBS += -L$$p
- }
- }
-
- !isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
- }
-
- SOURCES += egl/qegl_qpa.cpp
-}
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
deleted file mode 100644
index 067886cf5a..0000000000
--- a/src/gui/egl/qegl.cpp
+++ /dev/null
@@ -1,751 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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, Nokia gives you certain additional
-** rights. These rights are described in the Nokia 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.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qpaintdevice.h>
-#include <QtGui/qpixmap.h>
-#include <QtGui/qwidget.h>
-#include <QtCore/qatomic.h>
-#include <QtCore/qdebug.h>
-
-#include "qegl_p.h"
-#include "qeglcontext_p.h"
-
-
-QT_BEGIN_NAMESPACE
-
-
-/*
- QEglContextTracker is used to track the EGL contexts that we
- create internally in Qt, so that we can call eglTerminate() to
- free additional EGL resources when the last context is destroyed.
-*/
-
-class QEglContextTracker
-{
-public:
- static void ref() { contexts.ref(); }
- static void deref() {
- if (!contexts.deref()) {
- eglTerminate(QEgl::display());
- displayOpen = 0;
- }
- }
- static void setDisplayOpened() { displayOpen = 1; }
- static bool displayOpened() { return displayOpen; }
-
-private:
- static QBasicAtomicInt contexts;
- static QBasicAtomicInt displayOpen;
-};
-
-QBasicAtomicInt QEglContextTracker::contexts = Q_BASIC_ATOMIC_INITIALIZER(0);
-QBasicAtomicInt QEglContextTracker::displayOpen = Q_BASIC_ATOMIC_INITIALIZER(0);
-
-// Current GL and VG contexts. These are used to determine if
-// we can avoid an eglMakeCurrent() after a call to lazyDoneCurrent().
-// If a background thread modifies the value, the worst that will
-// happen is a redundant eglMakeCurrent() in the foreground thread.
-static QEglContext * volatile currentGLContext = 0;
-static QEglContext * volatile currentVGContext = 0;
-
-QEglContext::QEglContext()
- : apiType(QEgl::OpenGL)
- , ctx(EGL_NO_CONTEXT)
- , cfg(QEGL_NO_CONFIG)
- , currentSurface(EGL_NO_SURFACE)
- , current(false)
- , ownsContext(true)
- , sharing(false)
-{
- QEglContextTracker::ref();
-}
-
-QEglContext::~QEglContext()
-{
- destroyContext();
-
- if (currentGLContext == this)
- currentGLContext = 0;
- if (currentVGContext == this)
- currentVGContext = 0;
- QEglContextTracker::deref();
-}
-
-bool QEglContext::isValid() const
-{
- return (ctx != EGL_NO_CONTEXT);
-}
-
-bool QEglContext::isCurrent() const
-{
- return current;
-}
-
-EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options)
-{
- if ( (devType != QInternal::Pixmap) && ((options & Renderable) == 0))
- qWarning("QEgl::defaultConfig() - Only configs for pixmaps make sense to be read-only!");
-
- EGLConfig* targetConfig = 0;
-
- static EGLConfig defaultVGConfigs[] = {
- QEGL_NO_CONFIG, // 0 Window Renderable Translucent
- QEGL_NO_CONFIG, // 1 Window Renderable Opaque
- QEGL_NO_CONFIG, // 2 Pixmap Renderable Translucent
- QEGL_NO_CONFIG, // 3 Pixmap Renderable Opaque
- QEGL_NO_CONFIG, // 4 Pixmap ReadOnly Translucent
- QEGL_NO_CONFIG // 5 Pixmap ReadOnly Opaque
- };
- if (api == OpenVG) {
- if (devType == QInternal::Widget) {
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[0]);
- else
- targetConfig = &(defaultVGConfigs[1]);
- } else if (devType == QInternal::Pixmap) {
- if (options & Renderable) {
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[2]);
- else // Opaque
- targetConfig = &(defaultVGConfigs[3]);
- } else { // Read-only
- if (options & Translucent)
- targetConfig = &(defaultVGConfigs[4]);
- else // Opaque
- targetConfig = &(defaultVGConfigs[5]);
- }
- }
- }
-
-
- static EGLConfig defaultGLConfigs[] = {
- QEGL_NO_CONFIG, // 0 Window Renderable Translucent
- QEGL_NO_CONFIG, // 1 Window Renderable Opaque
- QEGL_NO_CONFIG, // 2 PBuffer Renderable Translucent
- QEGL_NO_CONFIG, // 3 PBuffer Renderable Opaque
- QEGL_NO_CONFIG, // 4 Pixmap Renderable Translucent
- QEGL_NO_CONFIG, // 5 Pixmap Renderable Opaque
- QEGL_NO_CONFIG, // 6 Pixmap ReadOnly Translucent
- QEGL_NO_CONFIG // 7 Pixmap ReadOnly Opaque
- };
- if (api == OpenGL) {
- if (devType == QInternal::Widget) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[0]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[1]);
- } else if (devType == QInternal::Pbuffer) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[2]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[3]);
- } else if (devType == QInternal::Pixmap) {
- if (options & Renderable) {
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[4]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[5]);
- } else { // ReadOnly
- if (options & Translucent)
- targetConfig = &(defaultGLConfigs[6]);
- else // Opaque
- targetConfig = &(defaultGLConfigs[7]);
- }
- }
- }
-
- if (!targetConfig) {
- qWarning("QEgl::defaultConfig() - No default config for device/api/options combo");
- return QEGL_NO_CONFIG;
- }
- if (*targetConfig != QEGL_NO_CONFIG)
- return *targetConfig;
-
-
- // We haven't found an EGL config for the target config yet, so do it now:
-
-
- // Allow overriding from an environment variable:
- QByteArray configId;
- if (api == OpenVG)
- configId = qgetenv("QT_VG_EGL_CONFIG");
- else
- configId = qgetenv("QT_GL_EGL_CONFIG");
- if (!configId.isEmpty()) {
- // Overridden, so get the EGLConfig for the specified config ID:
- EGLint properties[] = {
- EGL_CONFIG_ID, (EGLint)configId.toInt(),
- EGL_NONE
- };
- EGLint configCount = 0;
- eglChooseConfig(display(), properties, targetConfig, 1, &configCount);
- if (configCount > 0)
- return *targetConfig;
- qWarning() << "QEgl::defaultConfig() -" << configId << "appears to be invalid";
- }
-
- QEglProperties configAttribs;
- configAttribs.setRenderableType(api);
-
- EGLint surfaceType;
- switch (devType) {
- case QInternal::Widget:
- surfaceType = EGL_WINDOW_BIT;
- break;
- case QInternal::Pixmap:
- surfaceType = EGL_PIXMAP_BIT;
- break;
- case QInternal::Pbuffer:
- surfaceType = EGL_PBUFFER_BIT;
- break;
- default:
- qWarning("QEgl::defaultConfig() - Can't create EGL surface for %d device type", devType);
- return QEGL_NO_CONFIG;
- };
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- // For OpenVG, we try to create a surface using a pre-multiplied format if
- // the surface needs to have an alpha channel:
- if (api == OpenVG && (options & Translucent))
- surfaceType |= EGL_VG_ALPHA_FORMAT_PRE_BIT;
-#endif
- configAttribs.setValue(EGL_SURFACE_TYPE, surfaceType);
-
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- if (devType == QInternal::Pixmap || devType == QInternal::Pbuffer) {
- if (options & Translucent)
- configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE);
- else
- configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE);
- }
-#endif
-
- // Add paint engine requirements
- if (api == OpenVG) {
-#if !defined(QVG_SCISSOR_CLIP) && defined(EGL_ALPHA_MASK_SIZE)
- configAttribs.setValue(EGL_ALPHA_MASK_SIZE, 1);
-#endif
- } else {
- // Both OpenGL paint engines need to have stencil and sample buffers
- configAttribs.setValue(EGL_STENCIL_SIZE, 1);
- configAttribs.setValue(EGL_SAMPLE_BUFFERS, 1);
-#ifndef QT_OPENGL_ES_2
- // Additionally, the GL1 engine likes to have a depth buffer for clipping
- configAttribs.setValue(EGL_DEPTH_SIZE, 1);
-#endif
- }
-
- if (options & Translucent)
- configAttribs.setValue(EGL_ALPHA_SIZE, 1);
-
- *targetConfig = chooseConfig(&configAttribs, QEgl::BestPixelFormat);
- return *targetConfig;
-}
-
-
-// Choose a configuration that matches "properties".
-EGLConfig QEgl::chooseConfig(const QEglProperties* properties, QEgl::PixelFormatMatch match)
-{
- QEglProperties props(*properties);
- EGLConfig cfg = QEGL_NO_CONFIG;
- do {
- // Get the number of matching configurations for this set of properties.
- EGLint matching = 0;
- EGLDisplay dpy = QEgl::display();
- if (!eglChooseConfig(dpy, props.properties(), 0, 0, &matching) || !matching)
- continue;
-
- // If we want the best pixel format, then return the first
- // matching configuration.
- if (match == QEgl::BestPixelFormat) {
- eglChooseConfig(display(), props.properties(), &cfg, 1, &matching);
- if (matching < 1)
- continue;
- return cfg;
- }
-
- // Fetch all of the matching configurations and find the
- // first that matches the pixel format we wanted.
- EGLint size = matching;
- EGLConfig *configs = new EGLConfig [size];
- eglChooseConfig(display(), props.properties(), configs, size, &matching);
- for (EGLint index = 0; index < size; ++index) {
- EGLint red, green, blue, alpha;
- eglGetConfigAttrib(display(), configs[index], EGL_RED_SIZE, &red);
- eglGetConfigAttrib(display(), configs[index], EGL_GREEN_SIZE, &green);
- eglGetConfigAttrib(display(), configs[index], EGL_BLUE_SIZE, &blue);
- eglGetConfigAttrib(display(), configs[index], EGL_ALPHA_SIZE, &alpha);
- if (red == props.value(EGL_RED_SIZE) &&
- green == props.value(EGL_GREEN_SIZE) &&
- blue == props.value(EGL_BLUE_SIZE) &&
- (props.value(EGL_ALPHA_SIZE) == 0 ||
- alpha == props.value(EGL_ALPHA_SIZE))) {
- cfg = configs[index];
- delete [] configs;
- return cfg;
- }
- }
- delete [] configs;
- } while (props.reduceConfiguration());
-
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- // Don't report an error just yet if we failed to get a pbuffer
- // configuration with texture rendering. Only report failure if
- // we cannot get any pbuffer configurations at all.
- if (props.value(EGL_BIND_TO_TEXTURE_RGBA) == EGL_DONT_CARE &&
- props.value(EGL_BIND_TO_TEXTURE_RGB) == EGL_DONT_CARE)
-#endif
- {
- qWarning() << "QEglContext::chooseConfig(): Could not find a suitable EGL configuration";
- qWarning() << "Requested:" << props.toString();
- qWarning() << "Available:";
- QEgl::dumpAllConfigs();
- }
- return QEGL_NO_CONFIG;
-}
-
-bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match)
-{
- cfg = QEgl::chooseConfig(&properties, match);
- return cfg != QEGL_NO_CONFIG;
-}
-
-EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties)
-{
- return QEgl::createSurface(device, cfg, properties);
-}
-
-
-// Create the EGLContext.
-bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
-{
- // We need to select the correct API before calling eglCreateContext().
-#ifdef QT_OPENGL_ES
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#else
-#ifdef EGL_OPENGL_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_API);
-#endif
-#endif //defined(QT_OPENGL_ES)
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- // Create a new context for the configuration.
- QEglProperties contextProps;
- if (properties)
- contextProps = *properties;
-#ifdef QT_OPENGL_ES_2
- if (apiType == QEgl::OpenGL)
- contextProps.setValue(EGL_CONTEXT_CLIENT_VERSION, 2);
-#endif
- sharing = false;
- if (shareContext && shareContext->ctx == EGL_NO_CONTEXT)
- shareContext = 0;
- if (shareContext) {
- ctx = eglCreateContext(QEgl::display(), cfg, shareContext->ctx, contextProps.properties());
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::createContext(): Could not share context:" << QEgl::errorString();
- shareContext = 0;
- } else {
- sharing = true;
- }
- }
- if (ctx == EGL_NO_CONTEXT) {
- ctx = eglCreateContext(display(), cfg, EGL_NO_CONTEXT, contextProps.properties());
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::createContext(): Unable to create EGL context:" << QEgl::errorString();
- return false;
- }
- }
- return true;
-}
-
-// Destroy an EGL surface object. If it was current on this context
-// then call doneCurrent() for it first.
-void QEglContext::destroySurface(EGLSurface surface)
-{
- if (surface != EGL_NO_SURFACE) {
- if (surface == currentSurface)
- doneCurrent();
- eglDestroySurface(display(), surface);
- }
-}
-
-// Destroy the context. Note: this does not destroy the surface.
-void QEglContext::destroyContext()
-{
- if (ctx != EGL_NO_CONTEXT && ownsContext)
- eglDestroyContext(display(), ctx);
- ctx = EGL_NO_CONTEXT;
- cfg = 0;
-}
-
-bool QEglContext::makeCurrent(EGLSurface surface)
-{
- if (ctx == EGL_NO_CONTEXT) {
- qWarning() << "QEglContext::makeCurrent(): Cannot make invalid context current";
- return false;
- }
-
- if (surface == EGL_NO_SURFACE) {
- qWarning() << "QEglContext::makeCurrent(): Cannot make invalid surface current";
- return false;
- }
-
- // If lazyDoneCurrent() was called on the surface, then we may be able
- // to assume that it is still current within the thread.
- if (surface == currentSurface && currentContext(apiType) == this) {
- current = true;
- return true;
- }
-
- current = true;
- currentSurface = surface;
- setCurrentContext(apiType, this);
-
- // Force the right API to be bound before making the context current.
- // The EGL implementation should be able to figure this out from ctx,
- // but some systems require the API to be explicitly set anyway.
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- bool ok = eglMakeCurrent(QEgl::display(), surface, surface, ctx);
- if (!ok)
- qWarning() << "QEglContext::makeCurrent(" << surface << "):" << QEgl::errorString();
- return ok;
-}
-
-bool QEglContext::doneCurrent()
-{
- // If the context is invalid, we assume that an error was reported
- // when makeCurrent() was called.
- if (ctx == EGL_NO_CONTEXT)
- return false;
-
- current = false;
- currentSurface = EGL_NO_SURFACE;
- setCurrentContext(apiType, 0);
-
- // We need to select the correct API before calling eglMakeCurrent()
- // with EGL_NO_CONTEXT because threads can have both OpenGL and OpenVG
- // contexts active at the same time.
-#ifdef EGL_OPENGL_ES_API
- if (apiType == QEgl::OpenGL)
- eglBindAPI(EGL_OPENGL_ES_API);
-#endif
-#ifdef EGL_OPENVG_API
- if (apiType == QEgl::OpenVG)
- eglBindAPI(EGL_OPENVG_API);
-#endif
-
- bool ok = eglMakeCurrent(QEgl::display(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- if (!ok)
- qWarning() << "QEglContext::doneCurrent():" << QEgl::errorString();
- return ok;
-}
-
-// Act as though doneCurrent() was called, but keep the context
-// and the surface active for the moment. This allows makeCurrent()
-// to skip a call to eglMakeCurrent() if we are using the same
-// surface as the last set of painting operations. We leave the
-// currentContext() pointer as-is for now.
-bool QEglContext::lazyDoneCurrent()
-{
- current = false;
- return true;
-}
-
-bool QEglContext::swapBuffers(EGLSurface surface)
-{
- if(ctx == EGL_NO_CONTEXT)
- return false;
-
- bool ok = eglSwapBuffers(QEgl::display(), surface);
- if (!ok)
- qWarning() << "QEglContext::swapBuffers():" << QEgl::errorString();
- return ok;
-}
-
-bool QEglContext::swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region) {
- QVector<QRect> qrects = region->rects();
- EGLint *gl_rects;
- uint count;
- uint i;
-
- count = qrects.size();
- QVarLengthArray <EGLint> arr(4 * count);
- gl_rects = arr.data();
- for (i = 0; i < count; i++) {
- QRect qrect = qrects[i];
-
- gl_rects[4 * i + 0] = qrect.x();
- gl_rects[4 * i + 1] = qrect.y();
- gl_rects[4 * i + 2] = qrect.width();
- gl_rects[4 * i + 3] = qrect.height();
- }
-
- bool ok = QEgl::eglSwapBuffersRegion2NOK(QEgl::display(), surface, count, gl_rects);
-
- if (!ok)
- qWarning() << "QEglContext::swapBuffersRegion2NOK():" << QEgl::errorString();
- return ok;
-}
-
-int QEglContext::configAttrib(int name) const
-{
- EGLint value;
- EGLBoolean success = eglGetConfigAttrib(QEgl::display(), cfg, name, &value);
- if (success)
- return value;
- else
- return EGL_DONT_CARE;
-}
-
-typedef EGLImageKHR (EGLAPIENTRY *_eglCreateImageKHR)(EGLDisplay, EGLContext, EGLenum, EGLClientBuffer, const EGLint*);
-typedef EGLBoolean (EGLAPIENTRY *_eglDestroyImageKHR)(EGLDisplay, EGLImageKHR);
-
-// Defined in qegl.cpp:
-static _eglCreateImageKHR qt_eglCreateImageKHR = 0;
-static _eglDestroyImageKHR qt_eglDestroyImageKHR = 0;
-
-typedef EGLBoolean (EGLAPIENTRY *_eglSwapBuffersRegion2NOK)(EGLDisplay, EGLSurface, EGLint, const EGLint*);
-
-static _eglSwapBuffersRegion2NOK qt_eglSwapBuffersRegion2NOK = 0;
-
-EGLDisplay QEgl::display()
-{
- static EGLDisplay dpy = EGL_NO_DISPLAY;
- if (!QEglContextTracker::displayOpened()) {
- dpy = eglGetDisplay(nativeDisplay());
- QEglContextTracker::setDisplayOpened();
- if (dpy == EGL_NO_DISPLAY) {
- qWarning("QEgl::display(): Falling back to EGL_DEFAULT_DISPLAY");
- dpy = eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
- }
- if (dpy == EGL_NO_DISPLAY) {
- qWarning("QEgl::display(): Can't even open the default display");
- return EGL_NO_DISPLAY;
- }
-
- if (!eglInitialize(dpy, NULL, NULL)) {
- qWarning() << "QEgl::display(): Cannot initialize EGL display:" << QEgl::errorString();
- return EGL_NO_DISPLAY;
- }
-
- // Resolve the egl extension function pointers:
-#if (defined(EGL_KHR_image) || defined(EGL_KHR_image_base)) && !defined(EGL_EGLEXT_PROTOTYPES)
- if (QEgl::hasExtension("EGL_KHR_image") || QEgl::hasExtension("EGL_KHR_image_base")) {
- qt_eglCreateImageKHR = (_eglCreateImageKHR) eglGetProcAddress("eglCreateImageKHR");
- qt_eglDestroyImageKHR = (_eglDestroyImageKHR) eglGetProcAddress("eglDestroyImageKHR");
- }
-#endif
-
- if (QEgl::hasExtension("EGL_NOK_swap_region2")) {
- qt_eglSwapBuffersRegion2NOK = (_eglSwapBuffersRegion2NOK) eglGetProcAddress("eglSwapBuffersRegion2NOK");
- }
- }
-
- return dpy;
-}
-
-EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- if (qt_eglCreateImageKHR)
- return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglCreateImageKHR)
- return qt_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list);
-
- qWarning("QEgl::eglCreateImageKHR() called but EGL_KHR_image(_base) extension not present");
- return 0;
-}
-
-EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- if (qt_eglDestroyImageKHR)
- return qt_eglDestroyImageKHR(dpy, img);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglDestroyImageKHR)
- return qt_eglDestroyImageKHR(dpy, img);
-
- qWarning("QEgl::eglDestroyImageKHR() called but EGL_KHR_image(_base) extension not present");
- return 0;
-}
-
-EGLBoolean QEgl::eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
-{
- if (qt_eglSwapBuffersRegion2NOK)
- return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
-
- QEgl::display(); // Initialises function pointers
- if (qt_eglSwapBuffersRegion2NOK)
- return qt_eglSwapBuffersRegion2NOK(dpy, surface, count, rects);
-
- qWarning("QEgl::eglSwapBuffersRegion2NOK() called but EGL_NOK_swap_region2 extension not present");
- return 0;
-}
-
-EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties)
-{
- // Create the native drawable for the paint device.
- int devType = device->devType();
- EGLNativePixmapType pixmapDrawable = 0;
- EGLNativeWindowType windowDrawable = 0;
- bool ok;
- if (devType == QInternal::Pixmap) {
- pixmapDrawable = nativePixmap(static_cast<QPixmap *>(device));
- ok = (pixmapDrawable != 0);
- } else if (devType == QInternal::Widget) {
- windowDrawable = nativeWindow(static_cast<QWidget *>(device));
- ok = (windowDrawable != 0);
- } else {
- ok = false;
- }
- if (!ok) {
- qWarning("QEglContext::createSurface(): Cannot create the native EGL drawable");
- return EGL_NO_SURFACE;
- }
-
- // Create the EGL surface to draw into, based on the native drawable.
- const int *props;
- if (properties)
- props = properties->properties();
- else
- props = 0;
- EGLSurface surf;
- if (devType == QInternal::Widget)
- surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props);
- else
- surf = eglCreatePixmapSurface(QEgl::display(), cfg, pixmapDrawable, props);
- if (surf == EGL_NO_SURFACE) {
- qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
- }
- return surf;
-}
-
-
-// Return the error string associated with a specific code.
-QString QEgl::errorString(EGLint code)
-{
- static const char * const errors[] = {
- "Success (0x3000)", // No tr
- "Not initialized (0x3001)", // No tr
- "Bad access (0x3002)", // No tr
- "Bad alloc (0x3003)", // No tr
- "Bad attribute (0x3004)", // No tr
- "Bad config (0x3005)", // No tr
- "Bad context (0x3006)", // No tr
- "Bad current surface (0x3007)", // No tr
- "Bad display (0x3008)", // No tr
- "Bad match (0x3009)", // No tr
- "Bad native pixmap (0x300A)", // No tr
- "Bad native window (0x300B)", // No tr
- "Bad parameter (0x300C)", // No tr
- "Bad surface (0x300D)", // No tr
- "Context lost (0x300E)" // No tr
- };
- if (code >= 0x3000 && code <= 0x300E) {
- return QString::fromLatin1(errors[code - 0x3000]);
- } else {
- return QLatin1String("0x") + QString::number(int(code), 16);
- }
-}
-
-// Dump all of the EGL configurations supported by the system.
-void QEgl::dumpAllConfigs()
-{
- QEglProperties props;
- EGLint count = 0;
- if (!eglGetConfigs(display(), 0, 0, &count) || count < 1)
- return;
- EGLConfig *configs = new EGLConfig [count];
- eglGetConfigs(display(), configs, count, &count);
- for (EGLint index = 0; index < count; ++index) {
- props = QEglProperties(configs[index]);
- qWarning() << props.toString();
- }
- delete [] configs;
-}
-
-QString QEgl::extensions()
-{
- const char* exts = eglQueryString(QEgl::display(), EGL_EXTENSIONS);
- return QString(QLatin1String(exts));
-}
-
-bool QEgl::hasExtension(const char* extensionName)
-{
- QList<QByteArray> extensions =
- QByteArray(reinterpret_cast<const char *>
- (eglQueryString(QEgl::display(), EGL_EXTENSIONS))).split(' ');
- return extensions.contains(extensionName);
-}
-
-QEglContext *QEglContext::currentContext(QEgl::API api)
-{
- if (api == QEgl::OpenGL)
- return currentGLContext;
- else
- return currentVGContext;
-}
-
-void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context)
-{
- if (api == QEgl::OpenGL)
- currentGLContext = context;
- else
- currentVGContext = context;
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
deleted file mode 100644
index 3e78b97fcb..0000000000
--- a/src/gui/egl/qegl_p.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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, Nokia gives you certain additional
-** rights. These rights are described in the Nokia 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.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QEGL_P_H
-#define QEGL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience of
-// the QtGui and QtOpenVG modules. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-QT_BEGIN_INCLUDE_NAMESPACE
-
-#ifndef QT_NO_EGL
-#if defined(QT_OPENGL_ES_2)
-# include <GLES2/gl2.h>
-#endif
-
-#if defined(QT_GLES_EGL)
-# include <GLES/egl.h>
-#else
-# include <EGL/egl.h>
-#endif
-#if !defined(EGL_VERSION_1_2)
-typedef unsigned int EGLenum;
-typedef void *EGLClientBuffer;
-#endif
-#else
-
-//types from egltypes.h for compiling stub without EGL headers
-typedef int EGLBoolean;
-typedef int EGLint;
-typedef int EGLenum;
-typedef int NativeDisplayType;
-typedef void* NativeWindowType;
-typedef void* NativePixmapType;
-typedef int EGLDisplay;
-typedef int EGLConfig;
-typedef int EGLSurface;
-typedef int EGLContext;
-typedef int EGLClientBuffer;
-#define EGL_NONE 0x3038 /* Attrib list terminator */
-
-#endif
-
-
-// Internally we use the EGL-prefixed native types which are used in EGL >= 1.3.
-// For older versions of EGL, we have to define these types ourselves here:
-#if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
-#undef EGLNativeWindowType
-#undef EGLNativePixmapType
-#undef EGLNativeDisplayType
-typedef NativeWindowType EGLNativeWindowType;
-typedef NativePixmapType EGLNativePixmapType;
-typedef NativeDisplayType EGLNativeDisplayType;
-#define QEGL_NATIVE_TYPES_DEFINED 1
-#endif
-
-QT_END_INCLUDE_NAMESPACE
-
-#include <QtGui/qpaintdevice.h>
-#include <QFlags>
-
-QT_BEGIN_NAMESPACE
-
-#define QEGL_NO_CONFIG ((EGLConfig)-1)
-
-#ifndef EGLAPIENTRY
-#define EGLAPIENTRY
-#endif
-
-// Declare/define the bits of EGL_KHR_image_base we need:
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
-typedef void *EGLImageKHR;
-
-#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
-#define EGL_IMAGE_PRESERVED_KHR 0x30D2
-#define EGL_KHR_image_base
-#endif
-
-#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_pixmap)
-#define EGL_NATIVE_PIXMAP_KHR 0x30B0
-#define EGL_KHR_image_pixmap
-#endif
-
-
-class QEglProperties;
-
-namespace QEgl {
- enum API
- {
- OpenGL,
- OpenVG
- };
-
- enum PixelFormatMatch
- {
- ExactPixelFormat,
- BestPixelFormat
- };
-
- enum ConfigOption
- {
- NoOptions = 0,
- Translucent = 0x01,
- Renderable = 0x02 // Config will be compatable with the paint engines (VG or GL)
- };
- Q_DECLARE_FLAGS(ConfigOptions, ConfigOption)
-
- // Most of the time we use the same config for things like widgets & pixmaps, so rather than
- // go through the eglChooseConfig loop every time, we use defaultConfig, which will return
- // the config for a particular device/api/option combo. This function assumes that once a
- // config is chosen for a particular combo, it's safe to always use that combo.
- Q_GUI_EXPORT EGLConfig defaultConfig(int devType, API api, ConfigOptions options);
-
- Q_GUI_EXPORT EGLConfig chooseConfig(const QEglProperties* configAttribs, QEgl::PixelFormatMatch match = QEgl::ExactPixelFormat);
- Q_GUI_EXPORT EGLSurface createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *surfaceAttribs = 0);
-
- Q_GUI_EXPORT void dumpAllConfigs();
-
-#ifdef QT_NO_EGL
- Q_GUI_EXPORT QString errorString(EGLint code = 0);
-#else
- Q_GUI_EXPORT QString errorString(EGLint code = eglGetError());
-#endif
-
- Q_GUI_EXPORT QString extensions();
- Q_GUI_EXPORT bool hasExtension(const char* extensionName);
-
- Q_GUI_EXPORT EGLDisplay display();
-
- Q_GUI_EXPORT EGLNativeDisplayType nativeDisplay();
- Q_GUI_EXPORT EGLNativeWindowType nativeWindow(QWidget*);
- Q_GUI_EXPORT EGLNativePixmapType nativePixmap(QPixmap*);
-
- // Extension functions
- Q_GUI_EXPORT EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
- Q_GUI_EXPORT EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img);
- Q_GUI_EXPORT EGLBoolean eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects);
-
-}
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QEgl::ConfigOptions)
-
-QT_END_NAMESPACE
-
-#endif //QEGL_P_H
diff --git a/src/gui/egl/qegl_qpa.cpp b/src/gui/egl/qegl_qpa.cpp
deleted file mode 100644
index a0a16a5395..0000000000
--- a/src/gui/egl/qegl_qpa.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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, Nokia gives you certain additional
-** rights. These rights are described in the Nokia 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.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui/qpaintdevice.h>
-#include <QtGui/qpixmap.h>
-#include <QtGui/qwidget.h>
-#include "qeglcontext_p.h"
-
-#if !defined(QT_NO_EGL)
-
-#include <QtGui/private/qapplication_p.h>
-#include <QtGui/qdesktopwidget.h>
-
-QT_BEGIN_NAMESPACE
-
-EGLNativeDisplayType QEgl::nativeDisplay()
-{
- return EGLNativeDisplayType(EGL_DEFAULT_DISPLAY);
-}
-
-EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
-{
- return (EGLNativeWindowType)(widget->winId());
-}
-
-EGLNativePixmapType QEgl::nativePixmap(QPixmap* pixmap)
-{
- Q_UNUSED(pixmap);
- return 0;
-}
-
-//EGLDisplay QEglContext::display()
-//{
-// return eglGetDisplay(EGLNativeDisplayType(EGL_DEFAULT_DISPLAY));
-//}
-
-static QPlatformScreen *screenForDevice(QPaintDevice *device)
-{
- QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
-
- QList<QPlatformScreen *> screens = pi->screens();
-
- int screenNumber;
- if (device && device->devType() == QInternal::Widget)
- screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
- else
- screenNumber = 0;
- if (screenNumber < 0 || screenNumber >= screens.size())
- return 0;
- return screens[screenNumber];
-}
-
-// Set pixel format and other properties based on a paint device.
-void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
-{
- if (!dev)
- return;
-
- // Find the QOpenGLScreen for this paint device.
- QPlatformScreen *screen = screenForDevice(dev);
- if (!screen)
- return;
- int devType = dev->devType();
- if (devType == QInternal::Image)
- setPixelFormat(static_cast<QImage *>(dev)->format());
- else
- setPixelFormat(screen->format());
-}
-
-QT_END_NAMESPACE
-
-#endif // !QT_NO_EGL
diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h
deleted file mode 100644
index 94654eb2a8..0000000000
--- a/src/gui/egl/qeglcontext_p.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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, Nokia gives you certain additional
-** rights. These rights are described in the Nokia 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.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QEGLCONTEXT_P_H
-#define QEGLCONTEXT_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience of
-// the QtGui and QtOpenVG modules. This header file may change from
-// version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qsize.h>
-#include <QtGui/qimage.h>
-
-#include <QtGui/private/qegl_p.h>
-#include <QtGui/private/qeglproperties_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_GUI_EXPORT QEglContext
-{
-public:
- QEglContext();
- ~QEglContext();
-
- bool isValid() const;
- bool isCurrent() const;
- bool isSharing() const { return sharing; }
-
- QEgl::API api() const { return apiType; }
- void setApi(QEgl::API api) { apiType = api; }
-
- bool chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match = QEgl::ExactPixelFormat);
- bool createContext(QEglContext *shareContext = 0, const QEglProperties *properties = 0);
- void destroyContext();
- EGLSurface createSurface(QPaintDevice *device, const QEglProperties *properties = 0);
- void destroySurface(EGLSurface surface);
-
- bool makeCurrent(EGLSurface surface);
- bool doneCurrent();
- bool lazyDoneCurrent();
- bool swapBuffers(EGLSurface surface);
- bool swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region);
-
- int configAttrib(int name) const;
-
- EGLContext context() const { return ctx; }
- void setContext(EGLContext context) { ctx = context; ownsContext = false;}
-
- EGLDisplay display() {return QEgl::display();}
-
- EGLConfig config() const { return cfg; }
- void setConfig(EGLConfig config) { cfg = config; }
-
-private:
- QEgl::API apiType;
- EGLContext ctx;
- EGLConfig cfg;
- EGLSurface currentSurface;
- bool current;
- bool ownsContext;
- bool sharing;
-
- static QEglContext *currentContext(QEgl::API api);
- static void setCurrentContext(QEgl::API api, QEglContext *context);
-
- friend class QMeeGoGraphicsSystem;
- friend class QMeeGoPlatformPixmap;
-};
-
-QT_END_NAMESPACE
-
-#endif // QEGLCONTEXT_P_H
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
deleted file mode 100644
index 414ad8d06a..0000000000
--- a/src/gui/egl/qeglproperties.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** 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, Nokia gives you certain additional
-** rights. These rights are described in the Nokia 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.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qstringlist.h>
-
-#include "qeglproperties_p.h"
-#include "qeglcontext_p.h"
-
-QT_BEGIN_NAMESPACE
-
-// Initialize a property block.
-QEglProperties::QEglProperties()
-{
- props.append(EGL_NONE);
-}
-
-QEglProperties::QEglProperties(EGLConfig cfg)
-{
- props.append(EGL_NONE);
- for (int name = 0x3020; name <= 0x304F; ++name) {
- EGLint value;
- if (name != EGL_NONE && eglGetConfigAttrib(QEgl::display(), cfg, name, &value))
- setValue(name, value);
- }
- eglGetError(); // Clear the error state.
-}
-
-// Fetch the current value associated with a property.
-int QEglProperties::value(int name) const
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name)
- return props[index + 1];
- }
-
- // If the attribute has not been explicitly set, return the EGL default
- // The following defaults were taken from the EGL 1.4 spec:
- switch(name) {
- case EGL_BUFFER_SIZE: return 0;
- case EGL_RED_SIZE: return 0;
- case EGL_GREEN_SIZE: return 0;
- case EGL_BLUE_SIZE: return 0;
- case EGL_ALPHA_SIZE: return 0;
-#ifdef EGL_LUMINANCE_SIZE
- case EGL_LUMINANCE_SIZE: return 0;
-#endif
-#ifdef EGL_ALPHA_MASK_SIZE
- case EGL_ALPHA_MASK_SIZE: return 0;
-#endif
-#ifdef EGL_BIND_TO_TEXTURE_RGB
- case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
-#endif
-#ifdef EGL_BIND_TO_TEXTURE_RGBA
- case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
-#endif
-#ifdef EGL_COLOR_BUFFER_TYPE
- case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
-#endif
- case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
- case EGL_CONFIG_ID: return EGL_DONT_CARE;
- case EGL_DEPTH_SIZE: return 0;
- case EGL_LEVEL: return 0;
- case EGL_NATIVE_RENDERABLE: return EGL_DONT_CARE;
- case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
- case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
- case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
-#ifdef EGL_RENDERABLE_TYPE
- case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
-#endif
- case EGL_SAMPLE_BUFFERS: return 0;
- case EGL_SAMPLES: return 0;
- case EGL_STENCIL_SIZE: return 0;
- case EGL_SURFACE_TYPE: return EGL_WINDOW_BIT;
- case EGL_TRANSPARENT_TYPE: return EGL_NONE;
- case EGL_TRANSPARENT_RED_VALUE: return EGL_DONT_CARE;
- case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
- case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
-
-#ifdef EGL_VERSION_1_3
- case EGL_CONFORMANT: return 0;
- case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
-#endif
-
- case EGL_MAX_PBUFFER_HEIGHT:
- case EGL_MAX_PBUFFER_WIDTH:
- case EGL_MAX_PBUFFER_PIXELS:
- case EGL_NATIVE_VISUAL_ID:
- case EGL_NONE:
- // Attribute does not affect config selection.
- return EGL_DONT_CARE;
- default:
- // Attribute is unknown in EGL <= 1.4.
- return EGL_DONT_CARE;
- }
-}
-
-// Set the value associated with a property, replacing an existing
-// value if there is one.
-void QEglProperties::setValue(int name, int value)
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name) {
- props[index + 1] = value;
- return;
- }
- }
- props[props.size() - 1] = name;
- props.append(value);
- props.append(EGL_NONE);
-}
-
-// Remove a property value. Returns false if the property is not present.
-bool QEglProperties::removeValue(int name)
-{
- for (int index = 0; index < (props.size() - 1); index += 2) {
- if (props[index] == name) {
- while ((index + 2) < props.size()) {
- props[index] = props[index + 2];
- ++index;
- }
- props.resize(props.size() - 2);
- return true;
- }
- }
- return false;
-}
-
-void QEglProperties::setDeviceType(int devType)
-{
- if (devType == QInternal::Pixmap || devType == QInternal::Image)
- setValue(EGL_SURFACE_TYPE, EGL_PIXMAP_BIT);
- else if (devType == QInternal::Pbuffer)
- setValue(EGL_SURFACE_TYPE, EGL_PBUFFER_BIT);
- else
- setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
-}
-
-
-// Sets the red, green, blue, and alpha sizes based on a pixel format.
-// Normally used to match a configuration request to the screen format.
-void QEglProperties::setPixelFormat(QImage::Format pixelFormat)
-{
- int red, green, blue, alpha;
- switch (pixelFormat) {
- case QImage::Format_RGB32:
- case QImage::Format_RGB888:
- red = green = blue = 8; alpha = 0; break;
- case QImage::Format_ARGB32:
- case QImage::Format_ARGB32_Premultiplied:
- red = green = blue = alpha = 8; break;
- case QImage::Format_RGB16:
- red = 5; green = 6; blue = 5; alpha = 0; break;
- case QImage::Format_ARGB8565_Premultiplied:
- red = 5; green = 6; blue = 5; alpha = 8; break;
- case QImage::Format_RGB666:
- red = green = blue = 6; alpha = 0; break;
- case QImage::Format_ARGB6666_Premultiplied:
- red = green = blue = alpha = 6; break;
- case QImage::Format_RGB555:
- red = green = blue = 5; alpha = 0; break;
- case QImage::Format_ARGB8555_Premultiplied:
- red = green = blue = 5; alpha = 8; break;
- case QImage::Format_RGB444:
- red = green = blue = 4; alpha = 0; break;
- case QImage::Format_ARGB4444_Premultiplied:
- red = green = blue = alpha = 4; break;
- default:
- qWarning() << "QEglProperties::setPixelFormat(): Unsupported pixel format";
- red = green = blue = alpha = 1; break;
- }
- setValue(EGL_RED_SIZE, red);
- setValue(EGL_GREEN_SIZE, green);
- setValue(EGL_BLUE_SIZE, blue);
- setValue(EGL_ALPHA_SIZE, alpha);
-}
-
-void QEglProperties::setRenderableType(QEgl::API api)
-{
-#ifdef EGL_RENDERABLE_TYPE
-#if defined(QT_OPENGL_ES_2)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT);
-#elif defined(QT_OPENGL_ES)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
-#elif defined(EGL_OPENGL_BIT)
- if (api == QEgl::OpenGL)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
-#endif
-#ifdef EGL_OPENVG_BIT
- if (api == QEgl::OpenVG)
- setValue(EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT);
-#endif
-#else
- Q_UNUSED(api);
-#endif
-}
-
-// Reduce the complexity of a configuration request to ask for less
-// because the previous request did not result in success. Returns
-// true if the complexity was reduced, or false if no further
-// reductions in complexity are possible.
-bool QEglProperties::reduceConfiguration()
-{
-#ifdef EGL_SWAP_BEHAVIOR
- if (value(EGL_SWAP_BEHAVIOR) != EGL_DONT_CARE)
- removeValue(EGL_SWAP_BEHAVIOR);
-#endif
-
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- // For OpenVG, we sometimes try to create a surface using a pre-multiplied format. If we can't
- // find a config which supports pre-multiplied formats, remove the flag on the surface type:
- EGLint surfaceType = value(EGL_SURFACE_TYPE);
- if (surfaceType & EGL_VG_ALPHA_FORMAT_PRE_BIT) {
- surfaceType ^= EGL_VG_ALPHA_FORMAT_PRE_BIT;
- setValue(EGL_SURFACE_TYPE, surfaceType);
- return true;
- }
-#endif
- // EGL chooses configs with the highest color depth over
- // those with smaller (but faster) lower color depths. One
- // way around this is to set EGL_BUFFER_SIZE to 16, which
- // trumps the others. Of course, there may not be a 16-bit
- // config available, so it's the first restraint we remove.
- if (value(EGL_BUFFER_SIZE) == 16) {
- removeValue(EGL_BUFFER_SIZE);
- return true;
- }
- if (removeValue(EGL_SAMPLE_BUFFERS)) {
- removeValue(EGL_SAMPLES);
- return true;
- }
- if (removeValue(EGL_ALPHA_SIZE)) {
-#if defined(EGL_BIND_TO_TEXTURE_RGBA) && defined(EGL_BIND_TO_TEXTURE_RGB)
- if (removeValue(EGL_BIND_TO_TEXTURE_RGBA))
- setValue(EGL_BIND_TO_TEXTURE_RGB, TRUE);
-#endif
- return true;
- }
- if (removeValue(EGL_STENCIL_SIZE))
- return true;
- if (removeValue(EGL_DEPTH_SIZE))
- return true;
-#ifdef EGL_BIND_TO_TEXTURE_RGB
- if (removeValue(EGL_BIND_TO_TEXTURE_RGB))
- return true;
-#endif
- return false;
-}
-
-static void addTag(QString& str, const QString& tag)
-{
- int lastnl = str.lastIndexOf(QLatin1String("\n"));
- if (lastnl == -1)
- lastnl = 0;
- if ((str.length() - lastnl) >= 50)
- str += QLatin1String("\n ");
- str += tag;
-}
-
-// Convert a property list to a string suitable for debug output.
-QString QEglProperties::toString() const
-{
- QString str;
- int val;
-
- val = value(EGL_CONFIG_ID);
- if (val != EGL_DONT_CARE) {
- str += QLatin1String("id=");
- str += QString::number(val);
- str += QLatin1Char(' ');
- }
-
-#ifdef EGL_RENDERABLE_TYPE
- val = value(EGL_RENDERABLE_TYPE);
- if (val != EGL_DONT_CARE) {
- str += QLatin1String("type=");
- QStringList types;
- if ((val & EGL_OPENGL_ES_BIT) != 0)
- types += QLatin1String("es1");
-#ifdef EGL_OPENGL_ES2_BIT
- if ((val & EGL_OPENGL_ES2_BIT) != 0)
- types += QLatin1String("es2");
-#endif
-#ifdef EGL_OPENGL_BIT
- if ((val & EGL_OPENGL_BIT) != 0)
- types += QLatin1String("gl");
-#endif
- if ((val & EGL_OPENVG_BIT) != 0)
- types += QLatin1String("vg");
- if ((val & ~7) != 0)
- types += QString::number(val);
- str += types.join(QLatin1String(","));
- } else {
- str += QLatin1String("type=any");
- }
-#else
- str += QLatin1String("type=es1");
-#endif
-
- int red = value(EGL_RED_SIZE);
- int green = value(EGL_GREEN_SIZE);
- int blue = value(EGL_BLUE_SIZE);
- int alpha = value(EGL_ALPHA_SIZE);
- int bufferSize = value(EGL_BUFFER_SIZE);
- if (bufferSize == (red + green + blue + alpha))
- bufferSize = 0;
- str += QLatin1String(" rgba=");
- str += QString::number(red);
- str += QLatin1Char(',');
- str += QString::number(green);
- str += QLatin1Char(',');
- str += QString::number(blue);
- str += QLatin1Char(',');
- str += QString::number(alpha);
- if (bufferSize != 0) {
- // Only report buffer size if different than r+g+b+a.
- str += QLatin1String(" buffer-size=");
- str += QString::number(bufferSize);
- }
-
-#ifdef EGL_COLOR_BUFFER_TYPE
- val = value(EGL_COLOR_BUFFER_TYPE);
- if (val == EGL_LUMINANCE_BUFFER) {
- addTag(str, QLatin1String(" color-buffer-type=luminance"));
- } else if (val != EGL_DONT_CARE && val != EGL_RGB_BUFFER) {
- addTag(str, QLatin1String(" color-buffer-type="));
- str += QString::number(val, 16);
- }
-#endif
-
- val = value(EGL_DEPTH_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" depth="));
- str += QString::number(val);
- }
-
- val = value(EGL_STENCIL_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" stencil="));
- str += QString::number(val);
- }
-
- val = value(EGL_SURFACE_TYPE);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" surface-type="));
- QStringList types;
- if ((val & EGL_WINDOW_BIT) != 0)
- types += QLatin1String("window");
- if ((val & EGL_PIXMAP_BIT) != 0)
- types += QLatin1String("pixmap");
- if ((val & EGL_PBUFFER_BIT) != 0)
- types += QLatin1String("pbuffer");
-#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
- if ((val & EGL_VG_COLORSPACE_LINEAR_BIT) != 0)
- types += QLatin1String("vg-colorspace-linear");
-#endif
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- if ((val & EGL_VG_ALPHA_FORMAT_PRE_BIT) != 0)
- types += QLatin1String("vg-alpha-format-pre");
-#endif
- if ((val & ~(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT
-#ifdef EGL_VG_COLORSPACE_LINEAR_BIT
- | EGL_VG_COLORSPACE_LINEAR_BIT
-#endif
-#ifdef EGL_VG_ALPHA_FORMAT_PRE_BIT
- | EGL_VG_ALPHA_FORMAT_PRE_BIT
-#endif
- )) != 0) {
- types += QString::number(val);
- }
- str += types.join(QLatin1String(","));
- }
-
- val = value(EGL_CONFIG_CAVEAT);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" caveat="));
- if (val == EGL_NONE)
- str += QLatin1String("none");
- else if (val == EGL_SLOW_CONFIG)
- str += QLatin1String("slow");
- else if (val == EGL_NON_CONFORMANT_CONFIG)
- str += QLatin1String("non-conformant");
- else
- str += QString::number(val, 16);
- }
-
- val = value(EGL_LEVEL);
- if (val != 0) {
- addTag(str, QLatin1String(" level="));
- str += QString::number(val);
- }
-
- int width, height, pixels;
- width = value(EGL_MAX_PBUFFER_WIDTH);
- height = value(EGL_MAX_PBUFFER_HEIGHT);
- pixels = value(EGL_MAX_PBUFFER_PIXELS);
- if (height != EGL_DONT_CARE || width != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" max-pbuffer-size="));
- str += QString::number(width);
- str += QLatin1Char('x');
- str += QString::number(height);
- if (pixels != (width * height)) {
- addTag(str, QLatin1String(" max-pbuffer-pixels="));
- str += QString::number(pixels);
- }
- }
-
- val = value(EGL_NATIVE_RENDERABLE);
- if (val != EGL_DONT_CARE) {
- if (val)
- addTag(str, QLatin1String(" native-renderable=true"));
- else
- addTag(str, QLatin1String(" native-renderable=false"));
- }
-
- val = value(EGL_NATIVE_VISUAL_ID);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" visual-id="));
- str += QString::number(val);
- }
-
- val = value(EGL_NATIVE_VISUAL_TYPE);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" visual-type="));
- str += QString::number(val);
- }
-
-#ifdef EGL_PRESERVED_RESOURCES
- val = value(EGL_PRESERVED_RESOURCES);
- if (val != EGL_DONT_CARE) {
- if (val)
- addTag(str, QLatin1String(" preserved-resources=true"));
- else
- addTag(str, QLatin1String(" preserved-resources=false"));
- }
-#endif
-
- val = value(EGL_SAMPLES);
- if (val != 0) {
- addTag(str, QLatin1String(" samples="));
- str += QString::number(val);
- }
-
- val = value(EGL_SAMPLE_BUFFERS);
- if (val != 0) {
- addTag(str, QLatin1String(" sample-buffers="));
- str += QString::number(val);
- }
-
- val = value(EGL_TRANSPARENT_TYPE);
- if (val == EGL_TRANSPARENT_RGB) {
- addTag(str, QLatin1String(" transparent-rgb="));
- str += QString::number(value(EGL_TRANSPARENT_RED_VALUE));
- str += QLatin1Char(',');
- str += QString::number(value(EGL_TRANSPARENT_GREEN_VALUE));
- str += QLatin1Char(',');
- str += QString::number(value(EGL_TRANSPARENT_BLUE_VALUE));
- }
-
-#if defined(EGL_BIND_TO_TEXTURE_RGB) && defined(EGL_BIND_TO_TEXTURE_RGBA)
- val = value(EGL_BIND_TO_TEXTURE_RGB);
- int val2 = value(EGL_BIND_TO_TEXTURE_RGBA);
- if (val != EGL_DONT_CARE || val2 != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" bind-texture="));
- if (val == EGL_TRUE)
- str += QLatin1String("rgb");
- else
- str += QLatin1String("no-rgb");
- if (val2 == EGL_TRUE)
- str += QLatin1String(",rgba");
- else
- str += QLatin1String(",no-rgba");
- }
-#endif
-
-#ifdef EGL_MIN_SWAP_INTERVAL
- val = value(EGL_MIN_SWAP_INTERVAL);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" min-swap-interval="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_MIN_SWAP_INTERVAL
- val = value(EGL_MAX_SWAP_INTERVAL);
- if (val != EGL_DONT_CARE) {
- addTag(str, QLatin1String(" max-swap-interval="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_LUMINANCE_SIZE
- val = value(EGL_LUMINANCE_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" luminance="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_ALPHA_MASK_SIZE
- val = value(EGL_ALPHA_MASK_SIZE);
- if (val != 0) {
- addTag(str, QLatin1String(" alpha-mask="));
- str += QString::number(val);
- }
-#endif
-
-#ifdef EGL_CONFORMANT
- val = value(EGL_CONFORMANT);
- if (val != 0) {
- if (val)
- addTag(str, QLatin1String(" conformant=true"));
- else
- addTag(str, QLatin1String(" conformant=false"));
- }
-#endif
-
- return str;
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index db045930a3..2cee31fce1 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -32,8 +32,6 @@ include(util/util.pri)
include(math3d/math3d.pri)
include(opengl/opengl.pri)
-include(egl/egl.pri)
-
QMAKE_LIBS += $$QMAKE_LIBS_GUI
DEFINES += Q_INTERNAL_QAPP_SRC
@@ -59,20 +57,10 @@ win32:!contains(QT_CONFIG, directwrite) {
DEFINES += QT_NO_DIRECTWRITE
}
-contains(QMAKE_MAC_XARCH, no) {
- DEFINES += QT_NO_MAC_XARCH
-} else {
win32-g++*|!win32:!win32-icc*:!macx-icc* {
mmx {
mmx_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: mmx_compiler.commands += -Xarch_i386 -mmmx
- x86_64: mmx_compiler.commands += -Xarch_x86_64 -mmmx
- } else {
- mmx_compiler.commands += -mmmx
- }
-
+ mmx_compiler.commands += -mmmx
mmx_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mmx_compiler.dependency_type = TYPE_C
mmx_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -84,14 +72,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
3dnow {
mmx3dnow_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: mmx3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -mmmx
- x86_64: mmx3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -mmmx
- } else {
- mmx3dnow_compiler.commands += -m3dnow -mmmx
- }
-
+ mmx3dnow_compiler.commands += -m3dnow -mmmx
mmx3dnow_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
mmx3dnow_compiler.dependency_type = TYPE_C
mmx3dnow_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -102,14 +83,7 @@ contains(QMAKE_MAC_XARCH, no) {
QMAKE_EXTRA_COMPILERS += mmx3dnow_compiler
sse {
sse3dnow_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse3dnow_compiler.commands += -Xarch_i386 -m3dnow -Xarch_i386 -msse
- x86_64: sse3dnow_compiler.commands += -Xarch_x86_64 -m3dnow -Xarch_x86_64 -msse
- } else {
- sse3dnow_compiler.commands += -m3dnow -msse
- }
-
+ sse3dnow_compiler.commands += -m3dnow -msse
sse3dnow_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse3dnow_compiler.dependency_type = TYPE_C
sse3dnow_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -122,14 +96,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
sse {
sse_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse_compiler.commands += -Xarch_i386 -msse
- x86_64: sse_compiler.commands += -Xarch_x86_64 -msse
- } else {
- sse_compiler.commands += -msse
- }
-
+ sse_compiler.commands += -msse
sse_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse_compiler.dependency_type = TYPE_C
sse_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -141,14 +108,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
sse2 {
sse2_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: sse2_compiler.commands += -Xarch_i386 -msse2
- x86_64: sse2_compiler.commands += -Xarch_x86_64 -msse2
- } else {
- sse2_compiler.commands += -msse2
- }
-
+ sse2_compiler.commands += -msse2
sse2_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
sse2_compiler.dependency_type = TYPE_C
sse2_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -160,14 +120,7 @@ contains(QMAKE_MAC_XARCH, no) {
}
ssse3 {
ssse3_compiler.commands = $$QMAKE_CXX -c -Winline
-
- mac {
- x86: ssse3_compiler.commands += -Xarch_i386 -mssse3
- x86_64: ssse3_compiler.commands += -Xarch_x86_64 -mssse3
- } else {
- ssse3_compiler.commands += -mssse3
- }
-
+ ssse3_compiler.commands += -mssse3
ssse3_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
ssse3_compiler.dependency_type = TYPE_C
ssse3_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
@@ -198,4 +151,3 @@ contains(QMAKE_MAC_XARCH, no) {
ssse3: SOURCES += $$SSSE3_SOURCES
iwmmxt: SOURCES += $$IWMMXT_SOURCES
}
-}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 3e53b04728..61a3895a6b 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -50,6 +50,7 @@
#include "qstringlist.h"
#include "qvariant.h"
#include "qimagepixmapcleanuphooks_p.h"
+#include "qplatformintegration_qpa.h"
#include <ctype.h>
#include <stdlib.h>
#include <limits.h>
@@ -62,6 +63,7 @@
#include <qhash.h>
+#include <private/qguiapplication_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qimage_p.h>
@@ -4900,7 +4902,9 @@ QPaintEngine *QImage::paintEngine() const
return 0;
if (!d->paintEngine) {
- d->paintEngine = new QRasterPaintEngine(const_cast<QImage *>(this));
+ QPaintDevice *paintDevice = const_cast<QImage *>(this);
+ QPaintEngine *paintEngine = QGuiApplicationPrivate::platformIntegration()->createImagePaintEngine(paintDevice);
+ d->paintEngine = paintEngine ? paintEngine : new QRasterPaintEngine(paintDevice);
}
return d->paintEngine;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 42ce3745de..26690c78cf 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -696,6 +696,8 @@ void QGuiApplicationPrivate::init()
// trigger registering of QVariant's GUI types
qRegisterGuiVariant();
+ QWindowSystemInterfacePrivate::eventTime.start();
+
is_app_running = true;
init_plugins(pluginList);
QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents);
@@ -753,7 +755,17 @@ static QClipboard *clipboard();
#endif
/*!
- Returns the currently held keyboard modifiers.
+ Returns the current state of the modifier keys on the keyboard. The current
+ state is updated sychronously as the event queue is emptied of events that
+ will spontaneously change the keyboard state (QEvent::KeyPress and
+ QEvent::KeyRelease events).
+
+ It should be noted this may not reflect the actual keys held on the input
+ device at the time of calling but rather the modifiers as last reported in
+ one of the above events. If no keys are being held Qt::NoModifier is
+ returned.
+
+ \sa mouseButtons(), queryKeyboardModifiers()
*/
Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
{
@@ -761,7 +773,39 @@ Qt::KeyboardModifiers QGuiApplication::keyboardModifiers()
}
/*!
- Returns the currently held mouse buttons.
+ \fn Qt::KeyboardModifiers QApplication::queryKeyboardModifiers()
+
+ Queries and returns the state of the modifier keys on the keyboard.
+ Unlike keyboardModifiers, this method returns the actual keys held
+ on the input device at the time of calling the method.
+
+ It does not rely on the keypress events having been received by this
+ process, which makes it possible to check the modifiers while moving
+ a window, for instance. Note that in most cases, you should use
+ keyboardModifiers(), which is faster and more accurate since it contains
+ the state of the modifiers as they were when the currently processed
+ event was received.
+
+ \sa keyboardModifiers()
+*/
+Qt::KeyboardModifiers QGuiApplication::queryKeyboardModifiers()
+{
+ QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
+ return pi->queryKeyboardModifiers();
+}
+
+/*!
+ Returns the current state of the buttons on the mouse. The current state is
+ updated syncronously as the event queue is emptied of events that will
+ spontaneously change the mouse state (QEvent::MouseButtonPress and
+ QEvent::MouseButtonRelease events).
+
+ It should be noted this may not reflect the actual buttons held on the
+ input device at the time of calling but rather the mouse buttons as last
+ reported in one of the above events. If no mouse buttons are being held
+ Qt::NoButton is returned.
+
+ \sa keyboardModifiers()
*/
Qt::MouseButtons QGuiApplication::mouseButtons()
{
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index c374a05986..6fdbb000fe 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -113,6 +113,7 @@ public:
static void setPalette(const QPalette &pal);
static Qt::KeyboardModifiers keyboardModifiers();
+ static Qt::KeyboardModifiers queryKeyboardModifiers();
static Qt::MouseButtons mouseButtons();
static void setLayoutDirection(Qt::LayoutDirection direction);
diff --git a/src/gui/kernel/qplatformdrag_qpa.cpp b/src/gui/kernel/qplatformdrag_qpa.cpp
index 832b91db7e..0e7b0f41cc 100644
--- a/src/gui/kernel/qplatformdrag_qpa.cpp
+++ b/src/gui/kernel/qplatformdrag_qpa.cpp
@@ -88,6 +88,7 @@ QPlatformDrag::QPlatformDrag() : d_ptr(new QPlatformDragPrivate)
QPlatformDrag::~QPlatformDrag()
{
+ delete d_ptr;
}
QDrag *QPlatformDrag::currentDrag() const
diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag_qpa.h
index 7d22c69947..22133706d1 100644
--- a/src/gui/kernel/qplatformdrag_qpa.h
+++ b/src/gui/kernel/qplatformdrag_qpa.h
@@ -100,6 +100,8 @@ public:
private:
QPlatformDragPrivate *d_ptr;
+
+ Q_DISABLE_COPY(QPlatformDrag)
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 7a3fe05f7a..e8721edce7 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -241,6 +241,15 @@ QPlatformSharedGraphicsCache *QPlatformIntegration::createPlatformSharedGraphics
}
/*!
+ Factory function for QPaintEngine. This function will return 0 if the platform
+ integration does not support creating any paint engine the given \a paintDevice.
+*/
+QPaintEngine *QPlatformIntegration::createImagePaintEngine(QPaintDevice *paintDevice) const
+{
+ return 0;
+}
+
+/*!
Returns the platforms input context.
The default implementation returns 0, implying no input method support.
@@ -282,6 +291,11 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return 0;
}
+Qt::KeyboardModifiers QPlatformIntegration::queryKeyboardModifiers() const
+{
+ return QGuiApplication::keyboardModifiers();
+}
+
/*!
Should be called by the implementation whenever a new screen is added.
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index 483964b8f3..3f9de9df5e 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -91,6 +91,7 @@ public:
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
#endif
virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const;
+ virtual QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const;
// Event dispatcher:
virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0;
@@ -123,6 +124,8 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
+ virtual Qt::KeyboardModifiers queryKeyboardModifiers() const;
+
virtual QPlatformTheme *platformTheme() const;
protected:
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 04c2617838..367cee70e3 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1386,7 +1386,7 @@ void QWindow::hideEvent(QHideEvent *ev)
/*!
Override this to handle any event sent to the window.
- Remembet to call the base class version if you wish for mouse events,
+ Remember to call the base class version if you wish for mouse events,
key events, resize events, etc to be dispatched as usual.
*/
bool QWindow::event(QEvent *ev)
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index 5b77d97950..be9ac8e545 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -49,7 +49,7 @@
QT_BEGIN_NAMESPACE
-QTime QWindowSystemInterfacePrivate::eventTime;
+QElapsedTimer QWindowSystemInterfacePrivate::eventTime;
//------------------------------------------------------------
//
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
index f5c141b4c9..fe97b486ad 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
@@ -42,6 +42,7 @@
#define QWINDOWSYSTEMINTERFACE_QPA_P_H
#include "qwindowsysteminterface_qpa.h"
+#include <QElapsedTimer>
QT_BEGIN_HEADER
@@ -272,7 +273,7 @@ public:
static WindowSystemEvent * getWindowSystemEvent();
static void queueWindowSystemEvent(WindowSystemEvent *ev);
- static QTime eventTime;
+ static QElapsedTimer eventTime;
static QList<QTouchEvent::TouchPoint> convertTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points, QEvent::Type *type);
};
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index eb32ac162f..73be87bc1d 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1405,8 +1405,7 @@ void QOpenGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
// don't try to cache huge fonts or vastly transformed fonts
QFontEngine *fontEngine = textItem->fontEngine();
- const qreal pixelSize = fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f) {
+ if (shouldDrawCachedGlyphs(fontEngine, s->matrix) || det < 0.25f || det > 4.f) {
QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
: d->glyphCacheType;
@@ -1460,8 +1459,7 @@ void QOpenGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &text
bool drawCached = txtype < QTransform::TxProject;
// don't try to cache huge fonts or vastly transformed fonts
- const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f)
+ if (shouldDrawCachedGlyphs(ti.fontEngine, s->matrix) || det < 0.25f || det > 4.f)
drawCached = false;
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 0a6ef2a4d2..1b3dfbae28 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -157,7 +157,7 @@ public:
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool supportsTransformations(qreal, const QTransform &) const { return true; }
+ bool supportsTransformations(QFontEngine *, const QTransform &) const { return true; }
private:
Q_DISABLE_COPY(QOpenGL2PaintEngineEx)
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 1b4f4f7429..4b6101e7c9 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -72,7 +72,7 @@ public:
, m_width(0)
, m_height(0)
{
- if (ctx && !ctx->d_func()->workaround_brokenFBOReadBack)
+ if (!ctx->d_func()->workaround_brokenFBOReadBack)
QOpenGLFunctions(ctx).glGenFramebuffers(1, &m_fbo);
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f2aac442dc..b5e8bca7e0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2467,6 +2467,15 @@ static inline bool monoVal(const uchar* s, int x)
/*!
\internal
+ */
+QRasterBuffer *QRasterPaintEngine::rasterBuffer()
+{
+ Q_D(QRasterPaintEngine);
+ return d->rasterBuffer.data();
+}
+
+/*!
+ \internal
*/
void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h)
{
@@ -2923,7 +2932,7 @@ void QRasterPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
ensureRasterState();
QFontEngine *fontEngine = textItem->fontEngine();
- if (shouldDrawCachedGlyphs(fontEngine->fontDef.pixelSize, state()->matrix)) {
+ if (shouldDrawCachedGlyphs(fontEngine, state()->matrix)) {
drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->glyphPositions,
fontEngine);
} else if (state()->matrix.type() < QTransform::TxProject) {
@@ -3207,18 +3216,18 @@ void QRasterPaintEngine::releaseDC(HDC) const
#endif
-bool QRasterPaintEngine::supportsTransformations(const QFontEngine *fontEngine) const
+bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine) const
{
const QTransform &m = state()->matrix;
- return supportsTransformations(fontEngine->fontDef.pixelSize, m);
+ return supportsTransformations(fontEngine, m);
}
-bool QRasterPaintEngine::supportsTransformations(qreal pixelSize, const QTransform &m) const
+bool QRasterPaintEngine::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const
{
if (m.type() >= QTransform::TxProject)
return true;
- return !shouldDrawCachedGlyphs(pixelSize, m);
+ return !shouldDrawCachedGlyphs(fontEngine, m);
}
/*!
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 7b353188a3..79ed03e393 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -194,8 +194,11 @@ public:
void clip(const QVectorPath &path, Qt::ClipOperation op);
void clip(const QRect &rect, Qt::ClipOperation op);
void clip(const QRegion &region, Qt::ClipOperation op);
+ inline const QClipData *clip() const;
void drawStaticTextItem(QStaticTextItem *textItem);
+ virtual bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
+ QFontEngine *fontEngine);
enum ClipType {
RectClip,
@@ -227,14 +230,15 @@ public:
static bool clearTypeFontsEnabled();
#endif
+ QRasterBuffer *rasterBuffer();
void alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h);
Type type() const { return Raster; }
QPoint coordinateOffset() const;
- bool supportsTransformations(const QFontEngine *fontEngine) const;
- bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
+ bool supportsTransformations(QFontEngine *fontEngine) const;
+ bool supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const;
protected:
QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *);
@@ -247,10 +251,6 @@ private:
void fillRect(const QRectF &rect, QSpanData *data);
void drawBitmap(const QPointF &pos, const QImage &image, QSpanData *fill);
- bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
- QFontEngine *fontEngine);
-
-
bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op);
inline void ensureBrush(const QBrush &brush) {
@@ -492,6 +492,12 @@ inline const QClipData *QRasterPaintEnginePrivate::clip() const {
return baseClip.data();
}
+inline const QClipData *QRasterPaintEngine::clip() const {
+ Q_D(const QRasterPaintEngine);
+ if (state() && state()->clip && state()->clip->enabled)
+ return state()->clip;
+ return d->baseClip.data();
+}
QT_END_NAMESPACE
#endif // QPAINTENGINE_RASTER_P_H
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 93f36ba0ab..36414f4774 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -1081,9 +1081,9 @@ void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)
}
}
-bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &m) const
+bool QPaintEngineEx::supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const
{
- Q_UNUSED(pixelSize);
+ Q_UNUSED(fontEngine);
if (!m.isAffine())
return true;
@@ -1091,8 +1091,9 @@ bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform &
return false;
}
-bool QPaintEngineEx::shouldDrawCachedGlyphs(qreal pixelSize, const QTransform &m) const
+bool QPaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
{
+ qreal pixelSize = fontEngine->fontDef.pixelSize;
return (pixelSize * pixelSize * qAbs(m.determinant())) <
QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE;
}
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 62c5d972de..bc944b2297 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -226,8 +226,8 @@ public:
IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine.
};
virtual uint flags() const {return 0;}
- virtual bool supportsTransformations(qreal pixelSize, const QTransform &m) const;
- virtual bool shouldDrawCachedGlyphs(qreal pixelSize, const QTransform &m) const;
+ virtual bool supportsTransformations(QFontEngine *fontEngine, const QTransform &m) const;
+ virtual bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const;
protected:
QPaintEngineEx(QPaintEngineExPrivate &data);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 0f5468df4e..eafbe87b31 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -90,7 +90,7 @@ void qt_format_text(const QFont &font,
const QRectF &_r, int tf, const QTextOption *option, const QString& str, QRectF *brect,
int tabstops, int* tabarray, int tabarraylen,
QPainter *painter);
-static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe,
+static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine,
QTextCharFormat::UnderlineStyle underlineStyle,
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat);
@@ -5551,14 +5551,9 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
QVarLengthArray<QFixedPoint, 128> fixedPointPositions(count);
QRawFontPrivate *fontD = QRawFontPrivate::get(font);
- bool supportsTransformations;
- if (d->extended != 0) {
- supportsTransformations = d->extended->supportsTransformations(fontD->fontEngine->fontDef.pixelSize,
- d->state->matrix);
- } else {
- supportsTransformations = d->engine->type() == QPaintEngine::CoreGraphics
- || d->state->matrix.isAffine();
- }
+ bool supportsTransformations = d->extended
+ ? d->extended->supportsTransformations(fontD->fontEngine, d->state->matrix)
+ : d->engine->type() == QPaintEngine::CoreGraphics || d->state->matrix.isAffine();
for (int i=0; i<count; ++i) {
QPointF processedPosition = position + glyphPositions[i];
@@ -5646,6 +5641,7 @@ void QPainterPrivate::drawGlyphs(const quint32 *glyphArray, QFixedPoint *positio
drawTextItemDecoration(q, QPointF(leftMost.toReal(), baseLine.toReal()),
fontEngine,
+ 0, // textEngine
(underline
? QTextCharFormat::SingleUnderline
: QTextCharFormat::NoUnderline),
@@ -5739,7 +5735,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
- bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.pixelSize(),
+ bool supportsTransformations = d->extended->supportsTransformations(staticText_d->font.d->engineForScript(QUnicodeTables::Common),
d->state->matrix);
if (supportsTransformations && !staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = true;
@@ -6182,7 +6178,7 @@ static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen)
return pixmap;
}
-static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe,
+static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QFontEngine *fe, QTextEngine *textEngine,
QTextCharFormat::UnderlineStyle underlineStyle,
QTextItem::RenderFlags flags, qreal width,
const QTextCharFormat &charFormat)
@@ -6227,15 +6223,17 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
painter->fillRect(pos.x(), 0, qCeil(width), qMin(wave.height(), descent), wave);
painter->restore();
} else if (underlineStyle != QTextCharFormat::NoUnderline) {
- QLineF underLine(line.x1(), underlinePos, line.x2(), underlinePos);
-
QColor uc = charFormat.underlineColor();
if (uc.isValid())
pen.setColor(uc);
pen.setStyle((Qt::PenStyle)(underlineStyle));
painter->setPen(pen);
- painter->drawLine(underLine);
+ QLineF underline(line.x1(), underlinePos, line.x2(), underlinePos);
+ if (textEngine)
+ textEngine->addUnderline(painter, underline);
+ else
+ painter->drawLine(underline);
}
pen.setStyle(Qt::SolidLine);
@@ -6245,14 +6243,20 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const
QLineF strikeOutLine = line;
strikeOutLine.translate(0., - fe->ascent().toReal() / 3.);
painter->setPen(pen);
- painter->drawLine(strikeOutLine);
+ if (textEngine)
+ textEngine->addStrikeOut(painter, strikeOutLine);
+ else
+ painter->drawLine(strikeOutLine);
}
if (flags & QTextItem::Overline) {
- QLineF overLine = line;
- overLine.translate(0., - fe->ascent().toReal());
+ QLineF overline = line;
+ overline.translate(0., - fe->ascent().toReal());
painter->setPen(pen);
- painter->drawLine(overLine);
+ if (textEngine)
+ textEngine->addOverline(painter, overline);
+ else
+ painter->drawLine(overline);
}
painter->setPen(oldPen);
@@ -6277,7 +6281,7 @@ Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t
// We don't support glyphs that do not share a common baseline. If this turns out to
// be a relevant use case, then we need to find clusters of glyphs that share a baseline
- // and do a drawTextItemDecorations call per cluster.
+ // and do a drawTextItemDecoration call per cluster.
if (i == 0 || baseLine < positions[i].y)
baseLine = positions[i].y;
@@ -6298,12 +6302,20 @@ Q_GUI_EXPORT void qt_draw_decoration_for_glyphs(QPainter *painter, const glyph_t
drawTextItemDecoration(painter, QPointF(leftMost.toReal(), baseLine.toReal()),
fontEngine,
+ 0, // textEngine
font.underline() ? QTextCharFormat::SingleUnderline
: QTextCharFormat::NoUnderline, flags,
width.toReal(), charFormat);
}
-void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
+void QPainter::drawTextItem(const QPointF &p, const QTextItem &ti)
+{
+ Q_D(QPainter);
+
+ d->drawTextItem(p, ti, static_cast<QTextEngine *>(0));
+}
+
+void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine)
{
#ifdef QT_DEBUG_DRAW
if (qt_show_painter_debug_output)
@@ -6311,35 +6323,35 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
p.x(), p.y(), qPrintable(_ti.text()));
#endif
- Q_D(QPainter);
+ Q_Q(QPainter);
- if (!d->engine)
+ if (!engine)
return;
#ifndef QT_NO_DEBUG
- qt_painter_thread_test(d->device->devType(),
+ qt_painter_thread_test(device->devType(),
"text and fonts",
QFontDatabase::supportsThreadedFontRendering());
#endif
QTextItemInt &ti = const_cast<QTextItemInt &>(static_cast<const QTextItemInt &>(_ti));
- if (!d->extended && d->state->bgMode == Qt::OpaqueMode) {
+ if (!extended && state->bgMode == Qt::OpaqueMode) {
QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal());
- fillRect(rect, d->state->bgBrush);
+ q->fillRect(rect, state->bgBrush);
}
- if (pen().style() == Qt::NoPen)
+ if (q->pen().style() == Qt::NoPen)
return;
- const RenderHints oldRenderHints = d->state->renderHints;
- if (!d->state->renderHints & QPainter::Antialiasing && d->state->matrix.type() >= QTransform::TxScale) {
+ const QPainter::RenderHints oldRenderHints = state->renderHints;
+ if (!state->renderHints & QPainter::Antialiasing && state->matrix.type() >= QTransform::TxScale) {
// draw antialias decoration (underline/overline/strikeout) with
// transformed text
bool aa = true;
- const QTransform &m = d->state->matrix;
- if (d->state->matrix.type() < QTransform::TxShear) {
+ const QTransform &m = state->matrix;
+ if (state->matrix.type() < QTransform::TxShear) {
bool isPlain90DegreeRotation =
(qFuzzyIsNull(m.m11())
&& qFuzzyIsNull(m.m12() - qreal(1))
@@ -6362,11 +6374,11 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
aa = !isPlain90DegreeRotation;
}
if (aa)
- setRenderHint(QPainter::Antialiasing, true);
+ q->setRenderHint(QPainter::Antialiasing, true);
}
- if (!d->extended)
- d->updateState(d->state);
+ if (!extended)
+ updateState(state);
if (!ti.glyphs.numGlyphs) {
// nothing to do
@@ -6402,7 +6414,7 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
if (rtl)
x -= ti2.width.toReal();
- d->engine->drawTextItem(QPointF(x, y), ti2);
+ engine->drawTextItem(QPointF(x, y), ti2);
if (!rtl)
x += ti2.width.toReal();
@@ -6429,10 +6441,10 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
if (rtl)
x -= ti2.width.toReal();
- if (d->extended)
- d->extended->drawTextItem(QPointF(x, y), ti2);
+ if (extended)
+ extended->drawTextItem(QPointF(x, y), ti2);
else
- d->engine->drawTextItem(QPointF(x,y), ti2);
+ engine->drawTextItem(QPointF(x,y), ti2);
// reset the high byte for all glyphs
const int hi = which << 24;
@@ -6440,20 +6452,20 @@ void QPainter::drawTextItem(const QPointF &p, const QTextItem &_ti)
glyphs.glyphs[i] = hi | glyphs.glyphs[i];
} else {
- if (d->extended)
- d->extended->drawTextItem(p, ti);
+ if (extended)
+ extended->drawTextItem(p, ti);
else
- d->engine->drawTextItem(p, ti);
+ engine->drawTextItem(p, ti);
}
- drawTextItemDecoration(this, p, ti.fontEngine, ti.underlineStyle, ti.flags, ti.width.toReal(),
- ti.charFormat);
+ drawTextItemDecoration(q, p, ti.fontEngine, textEngine, ti.underlineStyle,
+ ti.flags, ti.width.toReal(), ti.charFormat);
- if (d->state->renderHints != oldRenderHints) {
- d->state->renderHints = oldRenderHints;
- if (d->extended)
- d->extended->renderHintsChanged();
+ if (state->renderHints != oldRenderHints) {
+ state->renderHints = oldRenderHints;
+ if (extended)
+ extended->renderHintsChanged();
else
- d->state->dirtyFlags |= QPaintEngine::DirtyHints;
+ state->dirtyFlags |= QPaintEngine::DirtyHints;
}
}
@@ -7550,11 +7562,12 @@ start_lengthVariant:
for (int i = 0; i < textLayout.lineCount(); i++) {
QTextLine line = textLayout.lineAt(i);
+ QTextEngine *eng = textLayout.engine();
+ eng->enableDelayDecorations();
qreal advance = line.horizontalAdvance();
xoff = 0;
if (tf & Qt::AlignRight) {
- QTextEngine *eng = textLayout.engine();
xoff = r.width() - advance -
eng->leadingSpaceWidth(eng->lines[line.lineNumber()]).toReal();
}
@@ -7562,6 +7575,7 @@ start_lengthVariant:
xoff = (r.width() - advance) / 2;
line.draw(painter, QPointF(r.x() + xoff, r.y() + yoff));
+ eng->drawDecorations(painter);
}
if (restore) {
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 67b05eeca5..97c10a2764 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -74,6 +74,7 @@ class QPainterPrivate;
class QPen;
class QPolygon;
class QTextItem;
+class QTextEngine;
class QMatrix;
class QTransform;
class QStaticText;
@@ -487,6 +488,7 @@ private:
friend class QRasterPaintEngine;
friend class QAlphaPaintEngine;
friend class QPreviewPaintEngine;
+ friend class QTextEngine;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QPainter::RenderHints)
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index fecf8bd960..3327860ac9 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -230,6 +230,7 @@ public:
void draw_helper(const QPainterPath &path, DrawOperation operation = StrokeAndFillDraw);
void drawStretchedGradient(const QPainterPath &path, DrawOperation operation);
void drawOpaqueBackground(const QPainterPath &path, DrawOperation operation);
+ void drawTextItem(const QPointF &p, const QTextItem &_ti, QTextEngine *textEngine);
#if !defined(QT_NO_RAWFONT)
void drawGlyphs(const quint32 *glyphArray, QFixedPoint *positionArray, int glyphCount,
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp
index fb06a26c8f..a1deb47175 100644
--- a/src/gui/text/qdistancefield.cpp
+++ b/src/gui/text/qdistancefield.cpp
@@ -692,17 +692,8 @@ static QImage makeDistanceField(int imgSize, const QPainterPath &path, int dfSca
return image;
}
-bool qt_fontHasNarrowOutlines(const QRawFont &f)
+static bool imageHasNarrowOutlines(const QImage &im)
{
- QRawFont font = f;
- font.setPixelSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
- Q_ASSERT(font.isValid());
-
- QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
- if (glyphIndices.size() < 1)
- return false;
-
- QImage im = font.alphaMapForGlyph(glyphIndices.at(0), QRawFont::PixelAntialiasing);
if (im.isNull())
return false;
@@ -742,6 +733,56 @@ bool qt_fontHasNarrowOutlines(const QRawFont &f)
return minHThick == 1 || minVThick == 1;
}
+bool qt_fontHasNarrowOutlines(QFontEngine *fontEngine)
+{
+ QFontEngine *fe = fontEngine->cloneWithSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
+
+ QGlyphLayout glyphs;
+ glyph_t glyph;
+ glyphs.glyphs = &glyph;
+ int numGlyphs;
+ QChar *chars = QString(QLatin1String("O")).data();
+ fe->stringToCMap(chars, 1, &glyphs, &numGlyphs, QTextEngine::GlyphIndicesOnly);
+ QImage im = fe->alphaMapForGlyph(glyph, QFixed(), QTransform());
+ delete fe;
+
+ return imageHasNarrowOutlines(im);
+}
+
+bool qt_fontHasNarrowOutlines(const QRawFont &f)
+{
+ QRawFont font = f;
+ font.setPixelSize(QT_DISTANCEFIELD_DEFAULT_BASEFONTSIZE);
+ Q_ASSERT(font.isValid());
+
+ QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
+ if (glyphIndices.size() < 1)
+ return false;
+
+ return imageHasNarrowOutlines(font.alphaMapForGlyph(glyphIndices.at(0),
+ QRawFont::PixelAntialiasing));
+}
+
+static QImage renderDistanceFieldPath(const QPainterPath &path, bool doubleResolution)
+{
+ QImage im = makeDistanceField(QT_DISTANCEFIELD_TILESIZE(doubleResolution),
+ path,
+ QT_DISTANCEFIELD_SCALE(doubleResolution),
+ QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution));
+ return im;
+}
+
+QImage qt_renderDistanceFieldGlyph(QFontEngine *fe, glyph_t glyph, bool doubleResolution)
+{
+ QFixedPoint position;
+ QPainterPath path;
+ fe->addGlyphsToPath(&glyph, &position, 1, &path, 0);
+ path.translate(-path.boundingRect().topLeft());
+ path.setFillRule(Qt::WindingFill);
+
+ return renderDistanceFieldPath(path, doubleResolution);
+}
+
QImage qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution)
{
QRawFont renderFont = font;
@@ -751,11 +792,7 @@ QImage qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool dou
path.translate(-path.boundingRect().topLeft());
path.setFillRule(Qt::WindingFill);
- QImage im = makeDistanceField(QT_DISTANCEFIELD_TILESIZE(doubleResolution),
- path,
- QT_DISTANCEFIELD_SCALE(doubleResolution),
- QT_DISTANCEFIELD_RADIUS(doubleResolution) / QT_DISTANCEFIELD_SCALE(doubleResolution));
- return im;
+ return renderDistanceFieldPath(path, doubleResolution);
}
QT_END_NAMESPACE
diff --git a/src/gui/text/qdistancefield_p.h b/src/gui/text/qdistancefield_p.h
index 486d291b78..bf87e7d3cb 100644
--- a/src/gui/text/qdistancefield_p.h
+++ b/src/gui/text/qdistancefield_p.h
@@ -79,6 +79,8 @@ QT_BEGIN_NAMESPACE
bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(const QRawFont &f);
QImage Q_GUI_EXPORT qt_renderDistanceFieldGlyph(const QRawFont &font, glyph_t glyph, bool doubleResolution);
+bool Q_GUI_EXPORT qt_fontHasNarrowOutlines(QFontEngine *fontEngine);
+QImage Q_GUI_EXPORT qt_renderDistanceFieldGlyph(QFontEngine *fontEngine, glyph_t glyph, bool doubleResolution);
QT_END_NAMESPACE
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index c68452d55a..56ff298d9b 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2733,20 +2733,6 @@ void QFontCache::updateHitCountAndTimeStamp(Engine &value)
value.data->name());
}
-void QFontCache::removeEngine(QFontEngine *engine)
-{
- EngineCache::iterator it = engineCache.begin();
- while (it != engineCache.end()) {
- if (it.value().data == engine) {
- it = engineCache.erase(it);
- if (--engine->cache_count == 0)
- decreaseCost(engine->cache_cost);
- } else {
- ++it;
- }
- }
-}
-
void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti)
{
FC_DEBUG("QFontCache: inserting new engine %p", engine);
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 06cf787880..13e5fcbedd 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -245,7 +245,6 @@ public:
void updateHitCountAndTimeStamp(Engine &value);
void insertEngine(const Key &key, QFontEngine *engine, bool insertMulti = false);
- void removeEngine(QFontEngine *engine);
private:
void increaseCost(uint cost);
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 142d627100..364a356b96 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -775,7 +775,7 @@ QByteArray QFontEngine::getSfntTable(uint tag) const
return table;
}
-void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
+void QFontEngine::setGlyphCache(const void *key, QFontEngineGlyphCache *data)
{
Q_ASSERT(data);
@@ -794,7 +794,7 @@ void QFontEngine::setGlyphCache(void *key, QFontEngineGlyphCache *data)
}
-QFontEngineGlyphCache *QFontEngine::glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
+QFontEngineGlyphCache *QFontEngine::glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
{
for (QLinkedList<GlyphCacheEntry>::const_iterator it = m_glyphCaches.constBegin(), end = m_glyphCaches.constEnd(); it != end; ++it) {
QFontEngineGlyphCache *c = it->cache.data();
@@ -1421,22 +1421,6 @@ bool QFontEngineMulti::shouldLoadFontEngineForCharacter(int at, uint ucs4) const
return true;
}
-void QFontEngineMulti::unloadEngine(int at)
-{
- QFontEngine *fontEngine = engines.at(at);
- if (fontEngine == 0)
- return;
-
- // If there are other references to the engine, keep it around and keep the reference
- if (fontEngine->ref.load() == 1) {
- QFontCache::instance()->removeEngine(fontEngine);
- if (fontEngine->cache_count == 0) {
- delete fontEngine;
- engines[at] = 0;
- }
- }
-}
-
glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs)
{
if (glyphs.numGlyphs <= 0)
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 660e3be459..1114cdf12c 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -239,8 +239,8 @@ public:
virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
- void setGlyphCache(void *key, QFontEngineGlyphCache *data);
- QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
+ void setGlyphCache(const void *key, QFontEngineGlyphCache *data);
+ QFontEngineGlyphCache *glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
@@ -284,7 +284,7 @@ protected:
private:
struct GlyphCacheEntry {
- void *context;
+ const void *context;
QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
bool operator==(const GlyphCacheEntry &other) const { return context == other.context && cache == other.cache; }
};
@@ -401,7 +401,6 @@ protected:
friend class QPSPrintEngineFontMulti;
friend class QRawFont;
virtual void loadEngine(int at) = 0;
- virtual void unloadEngine(int at);
QVector<QFontEngine *> engines;
};
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index 847b7e4852..b590775d8b 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -124,6 +124,8 @@ private:
QExplicitlySharedDataPointer<QGlyphRunPrivate> d;
};
+Q_DECLARE_TYPEINFO(QGlyphRun, Q_MOVABLE_TYPE);
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index dae02def07..3d58d91169 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1174,6 +1174,7 @@ static void init(QTextEngine *e)
e->cacheGlyphs = false;
e->forceJustification = false;
e->visualMovement = false;
+ e->delayDecorations = false;
e->layoutData = 0;
@@ -2913,6 +2914,104 @@ int QTextEngine::positionAfterVisualMovement(int pos, QTextCursor::MoveOperation
return pos;
}
+void QTextEngine::addItemDecoration(QPainter *painter, const QLineF &line, ItemDecorationList *decorationList)
+{
+ if (delayDecorations) {
+ decorationList->append(ItemDecoration(line.x1(), line.x2(), line.y1(), painter->pen()));
+ } else {
+ painter->drawLine(line);
+ }
+}
+
+void QTextEngine::addUnderline(QPainter *painter, const QLineF &line)
+{
+ // qDebug() << "Adding underline:" << line;
+ addItemDecoration(painter, line, &underlineList);
+}
+
+void QTextEngine::addStrikeOut(QPainter *painter, const QLineF &line)
+{
+ addItemDecoration(painter, line, &strikeOutList);
+}
+
+void QTextEngine::addOverline(QPainter *painter, const QLineF &line)
+{
+ addItemDecoration(painter, line, &overlineList);
+}
+
+void QTextEngine::drawItemDecorationList(QPainter *painter, const ItemDecorationList &decorationList)
+{
+ // qDebug() << "Drawing" << decorationList.size() << "decorations";
+ if (decorationList.isEmpty())
+ return;
+
+ foreach (const ItemDecoration decoration, decorationList) {
+ painter->setPen(decoration.pen);
+ QLineF line(decoration.x1, decoration.y, decoration.x2, decoration.y);
+ painter->drawLine(line);
+ }
+}
+
+void QTextEngine::drawDecorations(QPainter *painter)
+{
+ QPen oldPen = painter->pen();
+
+ adjustUnderlines();
+ drawItemDecorationList(painter, underlineList);
+ drawItemDecorationList(painter, strikeOutList);
+ drawItemDecorationList(painter, overlineList);
+
+ painter->setPen(oldPen);
+ clearDecorations();
+}
+
+void QTextEngine::clearDecorations()
+{
+ underlineList.clear();
+ strikeOutList.clear();
+ overlineList.clear();
+}
+
+void QTextEngine::adjustUnderlines()
+{
+ // qDebug() << __PRETTY_FUNCTION__ << underlineList.count() << "underlines";
+ if (underlineList.isEmpty())
+ return;
+
+ ItemDecorationList::iterator start = underlineList.begin();
+ ItemDecorationList::iterator end = underlineList.end();
+ ItemDecorationList::iterator it = start;
+ qreal underlinePos = start->y;
+ qreal penWidth = start->pen.widthF();
+ qreal lastLineEnd = start->x1;
+
+ while (it != end) {
+ if (qFuzzyCompare(lastLineEnd, it->x1)) { // no gap between underlines
+ underlinePos = qMax(underlinePos, it->y);
+ penWidth = qMax(penWidth, it->pen.widthF());
+ } else { // gap between this and the last underline
+ adjustUnderlines(start, it, underlinePos, penWidth);
+ start = it;
+ underlinePos = start->y;
+ penWidth = start->pen.widthF();
+ }
+ lastLineEnd = it->x2;
+ ++it;
+ }
+
+ adjustUnderlines(start, end, underlinePos, penWidth);
+}
+
+void QTextEngine::adjustUnderlines(ItemDecorationList::iterator start,
+ ItemDecorationList::iterator end,
+ qreal underlinePos, qreal penWidth)
+{
+ for (ItemDecorationList::iterator it = start; it != end; ++it) {
+ it->y = underlinePos;
+ it->pen.setWidth(penWidth);
+ }
+}
+
QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f)
: QTextEngine(string, f),
_layoutData(string, _memory, MemSize)
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 6f1fd713f1..03581eb6a2 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -446,6 +446,18 @@ public:
bool reallocate(int totalGlyphs);
};
+ struct ItemDecoration {
+ ItemDecoration(qreal x1, qreal x2, qreal y, const QPen &pen):
+ x1(x1), x2(x2), y(y), pen(pen) {}
+
+ qreal x1;
+ qreal x2;
+ qreal y;
+ QPen pen;
+ };
+
+ typedef QList<ItemDecoration> ItemDecorationList;
+
QTextEngine(LayoutData *data);
QTextEngine();
QTextEngine(const QString &str, const QFont &f);
@@ -597,6 +609,7 @@ public:
uint stackEngine : 1;
uint forceJustification : 1;
uint visualMovement : 1;
+ uint delayDecorations: 1;
#ifndef QT_NO_RAWFONT
uint useRawFont : 1;
#endif
@@ -605,6 +618,10 @@ public:
mutable LayoutData *layoutData;
+ ItemDecorationList underlineList;
+ ItemDecorationList strikeOutList;
+ ItemDecorationList overlineList;
+
inline bool hasFormats() const { return (block.docHandle() || specialData); }
inline bool visualCursorMovement() const
{
@@ -639,7 +656,22 @@ public:
void insertionPointsForLine(int lineNum, QVector<int> &insertionPoints);
void resetFontEngineCache();
+ void enableDelayDecorations(bool enable = true) { delayDecorations = enable; }
+
+ void addUnderline(QPainter *painter, const QLineF &line);
+ void addStrikeOut(QPainter *painter, const QLineF &line);
+ void addOverline(QPainter *painter, const QLineF &line);
+
+ void drawDecorations(QPainter *painter);
+ void clearDecorations();
+ void adjustUnderlines();
+
private:
+ void addItemDecoration(QPainter *painter, const QLineF &line, ItemDecorationList *decorationList);
+ void adjustUnderlines(ItemDecorationList::iterator start,
+ ItemDecorationList::iterator end,
+ qreal underlinePos, qreal penWidth);
+ void drawItemDecorationList(QPainter *painter, const ItemDecorationList &decorationList);
void setBoundary(int strPos) const;
void addRequiredBoundaries() const;
void shapeText(int item) const;
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index d5b05a8957..56098b0bdb 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -60,6 +60,7 @@
#include <qdebug.h>
#include "qfontengine_p.h"
+#include <private/qpainter_p.h>
QT_BEGIN_NAMESPACE
@@ -2062,7 +2063,7 @@ static void drawMenuText(QPainter *p, QFixed x, QFixed y, const QScriptItem &si,
if (rtl)
x -= w;
if (gf.num_chars)
- p->drawTextItem(QPointF(x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(x.toReal(), y.toReal()), gf, eng);
if (!rtl)
x += w;
if (ul && *ul != -1 && *ul < end) {
@@ -2083,7 +2084,7 @@ static void drawMenuText(QPainter *p, QFixed x, QFixed y, const QScriptItem &si,
gf.underlineStyle = QTextCharFormat::SingleUnderline;
if (rtl)
x -= w;
- p->drawTextItem(QPointF(x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(x.toReal(), y.toReal()), gf, eng);
if (!rtl)
x += w;
gf.underlineStyle = QTextCharFormat::NoUnderline;
@@ -2379,6 +2380,8 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
QTextLineItemIterator iterator(eng, index, pos, selection);
QFixed lineBase = line.base();
+ eng->clearDecorations();
+ eng->enableDelayDecorations();
const QFixed y = QFixed::fromReal(pos.y()) + line.y + lineBase;
@@ -2451,7 +2454,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
gf.chars = 0;
gf.num_chars = 0;
gf.width = iterator.itemWidth;
- p->drawTextItem(QPointF(iterator.x.toReal(), y.toReal()), gf);
+ QPainterPrivate::get(p)->drawTextItem(QPointF(iterator.x.toReal(), y.toReal()), gf, eng);
if (eng->option.flags() & QTextOption::ShowTabsAndSpaces) {
QChar visualTab(0x2192);
int w = QFontMetrics(f).width(visualTab);
@@ -2529,7 +2532,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
} else {
if (noText)
gf.glyphs.numGlyphs = 0; // slightly less elegant than it should be
- p->drawTextItem(pos, gf);
+ QPainterPrivate::get(p)->drawTextItem(pos, gf, eng);
}
}
if (si.analysis.flags == QScriptAnalysis::Space
@@ -2542,7 +2545,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
p->setPen(pen);
}
}
-
+ eng->drawDecorations(p);
if (eng->hasFormats())
p->setPen(pen);
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index c65edb6673..397bb0535e 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1185,6 +1185,7 @@ void QNetworkAccessManagerPrivate::clearCache(QNetworkAccessManager *manager)
if (manager->d_func()->httpThread) {
// The thread will deleteLater() itself from its finished() signal
manager->d_func()->httpThread->quit();
+ manager->d_func()->httpThread->wait(5000);
manager->d_func()->httpThread = 0;
}
}
@@ -1194,6 +1195,7 @@ QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
if (httpThread) {
// The thread will deleteLater() itself from its finished() signal
httpThread->quit();
+ httpThread->wait(5000);
httpThread = 0;
}
}
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 1f456746ae..a914ee3f04 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -904,6 +904,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
// End the thread. It will delete itself from the finished() signal
thread->quit();
+ thread->wait(5000);
finished();
} else {
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 0281eaf48b..feef74e737 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -224,8 +224,10 @@
#include "private/qsocks5socketengine_p.h"
#include "private/qhttpsocketengine_p.h"
#include "qauthenticator.h"
+#include "qdebug.h"
#include "qhash.h"
#include "qmutex.h"
+#include "qstringlist.h"
#include "qurl.h"
#ifndef QT_NO_BEARERMANAGEMENT
@@ -1508,6 +1510,51 @@ QList<QNetworkProxy> QNetworkProxyFactory::proxyForQuery(const QNetworkProxyQuer
return globalNetworkProxy()->proxyForQuery(query);
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QNetworkProxy &proxy)
+{
+ QNetworkProxy::ProxyType type = proxy.type();
+ switch (type) {
+ case QNetworkProxy::NoProxy:
+ debug << "NoProxy ";
+ break;
+ case QNetworkProxy::DefaultProxy:
+ debug << "DefaultProxy ";
+ break;
+ case QNetworkProxy::Socks5Proxy:
+ debug << "Socks5Proxy ";
+ break;
+ case QNetworkProxy::HttpProxy:
+ debug << "HttpProxy ";
+ break;
+ case QNetworkProxy::HttpCachingProxy:
+ debug << "HttpCachingProxy ";
+ break;
+ case QNetworkProxy::FtpCachingProxy:
+ debug << "FtpCachingProxy ";
+ break;
+ default:
+ debug << "Unknown proxy " << int(type);
+ break;
+ }
+ debug << "\"" << proxy.hostName() << ":" << proxy.port() << "\" ";
+ QNetworkProxy::Capabilities caps = proxy.capabilities();
+ QStringList scaps;
+ if (caps & QNetworkProxy::TunnelingCapability)
+ scaps << QStringLiteral("Tunnel");
+ if (caps & QNetworkProxy::ListeningCapability)
+ scaps << QStringLiteral("Listen");
+ if (caps & QNetworkProxy::UdpTunnelingCapability)
+ scaps << QStringLiteral("UDP");
+ if (caps & QNetworkProxy::CachingCapability)
+ scaps << QStringLiteral("Caching");
+ if (caps & QNetworkProxy::HostNameLookupCapability)
+ scaps << QStringLiteral("NameLookup");
+ debug << "[" << scaps.join(QStringLiteral(" ")) << "]";
+ return debug;
+}
+#endif
+
QT_END_NAMESPACE
#endif // QT_NO_NETWORKPROXY
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 8f961c43ac..805f5cdb5c 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -203,6 +203,10 @@ public:
static QList<QNetworkProxy> systemProxyForQuery(const QNetworkProxyQuery &query = QNetworkProxyQuery());
};
+#ifndef QT_NO_DEBUG_STREAM
+Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkProxy &proxy);
+#endif
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index 33ae4a6a14..4f1dece4a9 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -103,6 +103,7 @@ typedef struct {
#define WINHTTP_ERROR_BASE 12000
#define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15)
+#define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167)
#define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180)
QT_BEGIN_NAMESPACE
@@ -146,7 +147,7 @@ static QStringList splitSpaceSemicolon(const QString &source)
static bool isBypassed(const QString &host, const QStringList &bypassList)
{
if (host.isEmpty())
- return true;
+ return false;
bool isSimple = !host.contains(QLatin1Char('.')) && !host.contains(QLatin1Char(':'));
@@ -171,6 +172,51 @@ static bool isBypassed(const QString &host, const QStringList &bypassList)
return false;
}
+static QList<QNetworkProxy> filterProxyListByCapabilities(const QList<QNetworkProxy> &proxyList, const QNetworkProxyQuery &query)
+{
+ QNetworkProxy::Capabilities requiredCaps;
+ switch (query.queryType()) {
+ case QNetworkProxyQuery::TcpSocket:
+ requiredCaps = QNetworkProxy::TunnelingCapability;
+ break;
+ case QNetworkProxyQuery::UdpSocket:
+ requiredCaps = QNetworkProxy::UdpTunnelingCapability;
+ break;
+ case QNetworkProxyQuery::TcpServer:
+ requiredCaps = QNetworkProxy::ListeningCapability;
+ break;
+ default:
+ return proxyList;
+ break;
+ }
+ QList<QNetworkProxy> result;
+ foreach (const QNetworkProxy& proxy, proxyList) {
+ if (proxy.capabilities() & requiredCaps)
+ result.append(proxy);
+ }
+ return result;
+}
+
+static QList<QNetworkProxy> removeDuplicateProxies(const QList<QNetworkProxy> &proxyList)
+{
+ QList<QNetworkProxy> result;
+ foreach (QNetworkProxy proxy, proxyList) {
+ bool append = true;
+ for (int i=0; i < result.count(); i++) {
+ if (proxy.hostName() == result.at(i).hostName()
+ && proxy.port() == result.at(i).port()) {
+ append = false;
+ // HttpProxy trumps FtpCachingProxy or HttpCachingProxy on the same host/port
+ if (proxy.type() == QNetworkProxy::HttpProxy)
+ result[i] = proxy;
+ }
+ }
+ if (append)
+ result.append(proxy);
+ }
+ return result;
+}
+
static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, const QStringList &proxyList)
{
// Reference documentation from Microsoft:
@@ -179,38 +225,46 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
// According to the website, the proxy server list is
// one or more of the space- or semicolon-separated strings in the format:
// ([<scheme>=][<scheme>"://"]<server>[":"<port>])
+ // The first scheme relates to the protocol tag
+ // The second scheme, if present, overrides the proxy type
QList<QNetworkProxy> result;
+ QHash<QString, QNetworkProxy> taggedProxies;
+ const QString requiredTag = query.protocolTag();
+ bool checkTags = !requiredTag.isEmpty() && query.queryType() != QNetworkProxyQuery::TcpServer; //windows tags are only for clients
foreach (const QString &entry, proxyList) {
int server = 0;
+ QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy;
+ quint16 port = 8080;
+
int pos = entry.indexOf(QLatin1Char('='));
+ QStringRef scheme;
+ QStringRef protocolTag;
if (pos != -1) {
- QStringRef scheme = entry.leftRef(pos);
- if (scheme != query.protocolTag())
- continue;
-
+ scheme = protocolTag = entry.leftRef(pos);
server = pos + 1;
}
-
- QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy;
- quint16 port = 8080;
-
pos = entry.indexOf(QLatin1String("://"), server);
if (pos != -1) {
- QStringRef scheme = entry.midRef(server, pos - server);
+ scheme = entry.midRef(server, pos - server);
+ server = pos + 3;
+ }
+
+ if (!scheme.isEmpty()) {
if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
// no-op
// defaults are above
} else if (scheme == QLatin1String("socks") || scheme == QLatin1String("socks5")) {
proxyType = QNetworkProxy::Socks5Proxy;
port = 1080;
+ } else if (scheme == QLatin1String("ftp")) {
+ proxyType = QNetworkProxy::FtpCachingProxy;
+ port = 2121;
} else {
// unknown proxy type
continue;
}
-
- server = pos + 3;
}
pos = entry.indexOf(QLatin1Char(':'), server);
@@ -226,9 +280,32 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
}
result << QNetworkProxy(proxyType, entry.mid(server, pos - server), port);
+ if (!protocolTag.isEmpty())
+ taggedProxies.insert(protocolTag.toString(), result.last());
}
- return result;
+ if (checkTags && taggedProxies.contains(requiredTag)) {
+ if (query.queryType() == QNetworkProxyQuery::UrlRequest) {
+ result.clear();
+ result.append(taggedProxies.value(requiredTag));
+ return result;
+ } else {
+ result.prepend(taggedProxies.value(requiredTag));
+ }
+ }
+ if (!checkTags || requiredTag != QLatin1String("http")) {
+ // if there are different http proxies for http and https, prefer the https one (more likely to be capable of CONNECT)
+ QNetworkProxy httpProxy = taggedProxies.value(QLatin1String("http"));
+ QNetworkProxy httpsProxy = taggedProxies.value(QLatin1String("http"));
+ if (httpProxy != httpsProxy && httpProxy.type() == QNetworkProxy::HttpProxy && httpsProxy.type() == QNetworkProxy::HttpProxy) {
+ for (int i = 0; i < result.count(); i++) {
+ if (httpProxy == result.at(i))
+ result[i].setType(QNetworkProxy::HttpCachingProxy);
+ }
+ }
+ }
+ result = filterProxyListByCapabilities(result, query);
+ return removeDuplicateProxies(result);
}
class QWindowsSystemProxy
@@ -306,14 +383,27 @@ void QWindowsSystemProxy::init()
proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(ieProxyConfig.lpszProxyBypass));
GlobalFree(ieProxyConfig.lpszProxyBypass);
}
+ } else {
+ // no user configuration
+ // attempt to get the default configuration instead
+ WINHTTP_PROXY_INFO proxyInfo;
+ if (ptrWinHttpGetDefaultProxyConfiguration(&proxyInfo) &&
+ proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) {
+ // we got information from the registry
+ // overwrite the IE configuration, if any
+
+ proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxyBypass));
+ proxyServerList = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxy));
+ }
+
+ if (proxyInfo.lpszProxy)
+ GlobalFree(proxyInfo.lpszProxy);
+ if (proxyInfo.lpszProxyBypass)
+ GlobalFree(proxyInfo.lpszProxyBypass);
}
hHttpSession = NULL;
if (ieProxyConfig.fAutoDetect || !autoConfigUrl.isEmpty()) {
- // using proxy autoconfiguration
- proxyServerList.clear();
- proxyBypass.clear();
-
// open the handle and obtain the options
hHttpSession = ptrWinHttpOpen(L"Qt System Proxy access/1.0",
WINHTTP_ACCESS_TYPE_NO_PROXY,
@@ -326,6 +416,9 @@ void QWindowsSystemProxy::init()
isAutoConfig = true;
memset(&autoProxyOptions, 0, sizeof autoProxyOptions);
autoProxyOptions.fAutoLogonIfChallenged = false;
+ //Although it is possible to specify dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT | WINHTTP_AUTOPROXY_CONFIG_URL
+ //this has poor performance (WPAD is attempted for every url, taking 2.5 seconds per interface,
+ //before the configured pac file is used)
if (ieProxyConfig.fAutoDetect) {
autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
autoProxyOptions.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP |
@@ -334,23 +427,6 @@ void QWindowsSystemProxy::init()
autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)autoConfigUrl.utf16();
}
- } else {
- // not auto-detected
- // attempt to get the static configuration instead
- WINHTTP_PROXY_INFO proxyInfo;
- if (ptrWinHttpGetDefaultProxyConfiguration(&proxyInfo) &&
- proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NAMED_PROXY) {
- // we got information from the registry
- // overwrite the IE configuration, if any
-
- proxyBypass = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxyBypass));
- proxyServerList = splitSpaceSemicolon(QString::fromWCharArray(proxyInfo.lpszProxy));
- }
-
- if (proxyInfo.lpszProxy)
- GlobalFree(proxyInfo.lpszProxy);
- if (proxyInfo.lpszProxyBypass)
- GlobalFree(proxyInfo.lpszProxyBypass);
}
functional = isAutoConfig || !proxyServerList.isEmpty();
@@ -390,6 +466,25 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
DWORD getProxyError = GetLastError();
if (!getProxySucceeded
+ && (ERROR_WINHTTP_AUTODETECTION_FAILED == getProxyError)) {
+ // WPAD failed
+ if (sp->autoConfigUrl.isEmpty()) {
+ //No config file could be retrieved on the network.
+ //Don't search for it next time again.
+ sp->isAutoConfig = false;
+ } else {
+ //pac file URL is specified as well, try using that
+ sp->autoProxyOptions.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
+ sp->autoProxyOptions.lpszAutoConfigUrl = (LPCWSTR)sp->autoConfigUrl.utf16();
+ getProxySucceeded = ptrWinHttpGetProxyForUrl(sp->hHttpSession,
+ (LPCWSTR)url.toString().utf16(),
+ &sp->autoProxyOptions,
+ &proxyInfo);
+ getProxyError = GetLastError();
+ }
+ }
+
+ if (!getProxySucceeded
&& (ERROR_WINHTTP_LOGIN_FAILURE == getProxyError)) {
// We first tried without AutoLogon, because this might prevent caching the result.
// But now we've to enable it (http://msdn.microsoft.com/en-us/library/aa383153%28v=VS.85%29.aspx)
@@ -401,6 +496,13 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
getProxyError = GetLastError();
}
+ if (!getProxySucceeded
+ && (ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT == getProxyError)) {
+ // PAC file url is not connectable, or server returned error (e.g. http 404)
+ //Don't search for it next time again.
+ sp->isAutoConfig = false;
+ }
+
if (getProxySucceeded) {
// yes, we got a config for this URL
QString proxyBypass = QString::fromWCharArray(proxyInfo.lpszProxyBypass);
@@ -410,20 +512,14 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro
if (proxyInfo.lpszProxyBypass)
GlobalFree(proxyInfo.lpszProxyBypass);
+ if (proxyInfo.dwAccessType == WINHTTP_ACCESS_TYPE_NO_PROXY)
+ return sp->defaultResult; //i.e. the PAC file result was "DIRECT"
if (isBypassed(query.peerHostName(), splitSpaceSemicolon(proxyBypass)))
return sp->defaultResult;
return parseServerList(query, proxyServerList);
}
- // GetProxyForUrl failed
-
- if (ERROR_WINHTTP_AUTODETECTION_FAILED == getProxyError) {
- //No config file could be retrieved on the network.
- //Don't search for it next time again.
- sp->isAutoConfig = false;
- }
-
- return sp->defaultResult;
+ // GetProxyForUrl failed, fall back to static configuration
}
// static configuration
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index a9573bf1d8..65634a3cb7 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -1161,6 +1161,8 @@ static const char *certificate_blacklist[] = {
"07:27:14:a9", "Digisign Server ID (Enrich)", // (Malaysian) Digicert Sdn. Bhd. cross-signed by Verizon CyberTrust
"4c:0e:63:6a", "Digisign Server ID - (Enrich)", // (Malaysian) Digicert Sdn. Bhd. cross-signed by Entrust
+ "72:03:21:05:c5:0c:08:57:3d:8e:a5:30:4e:fe:e8:b0", "UTN-USERFirst-Hardware", // comodogate test certificate
+ "41", "MD5 Collisions Inc. (http://www.phreedom.org/md5)", // http://www.phreedom.org/research/rogue-ca/
0
};
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 20ad82407c..df60a0fcce 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -338,6 +338,13 @@ init_context:
long options = setupOpenSslOptions(configuration.protocol, configuration.sslOptions);
q_SSL_CTX_set_options(ctx, options);
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ // Tell OpenSSL to release memory early
+ // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
+ if (q_SSLeay() >= 0x10000000L)
+ q_SSL_CTX_set_mode(ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
// Initialize ciphers
QByteArray cipherString;
int first = true;
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 758763523f..b0d748692f 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -411,6 +411,7 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
bp,(char *)x,enc,kstr,klen,cb,u)
#endif
#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
+#define q_SSL_CTX_set_mode(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
#define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 29dab0e1e0..ca32adcd6f 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1432,8 +1432,7 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
// don't try to cache huge fonts or vastly transformed fonts
QFontEngine *fontEngine = textItem->fontEngine();
- const qreal pixelSize = fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f) {
+ if (shouldDrawCachedGlyphs(fontEngine, s->matrix) || det < 0.25f || det > 4.f) {
QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(textItem->fontEngine()->glyphFormat)
: d->glyphCacheType;
@@ -1491,8 +1490,7 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
bool drawCached = txtype < QTransform::TxProject;
// don't try to cache huge fonts or vastly transformed fonts
- const qreal pixelSize = ti.fontEngine->fontDef.pixelSize;
- if (shouldDrawCachedGlyphs(pixelSize, s->matrix) || det < 0.25f || det > 4.f)
+ if (shouldDrawCachedGlyphs(ti.fontEngine, s->matrix) || det < 0.25f || det > 4.f)
drawCached = false;
QFontEngineGlyphCache::Type glyphType = ti.fontEngine->glyphFormat >= 0
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index c5d3417555..8eeee334f5 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -155,7 +155,7 @@ public:
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool supportsTransformations(qreal, const QTransform &) const { return true; }
+ bool supportsTransformations(QFontEngine *, const QTransform &) const { return true; }
private:
Q_DISABLE_COPY(QGL2PaintEngineEx)
};
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
index 7b28b20bcb..2016500767 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig.cpp
@@ -42,7 +42,6 @@
#include "qfontenginemultifontconfig_p.h"
#include <QtGui/private/qfontengine_ft_p.h>
-#include <fontconfig/fontconfig.h>
#include <QtGui/private/qfontengine_ft_p.h>
QT_BEGIN_NAMESPACE
@@ -53,6 +52,14 @@ QFontEngineMultiFontConfig::QFontEngineMultiFontConfig(QFontEngine *fe, int scri
{
}
+QFontEngineMultiFontConfig::~QFontEngineMultiFontConfig()
+{
+ Q_FOREACH (FcPattern *pattern, cachedMatchPatterns) {
+ if (pattern)
+ FcPatternDestroy(pattern);
+ }
+}
+
bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint ucs4) const
{
QFontEngineFT *fontEngine = static_cast<QFontEngineFT *>(engines.at(at));
@@ -61,27 +68,37 @@ bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint u
FcCharSet *charSet = fontEngine->freetype->charset;
charSetHasChar = FcCharSetHasChar(charSet, ucs4);
} else {
- FcPattern *requestPattern = FcPatternCreate();
-
- FcValue value;
- value.type = FcTypeString;
- QByteArray cs = fallbackFamilyAt(at-1).toUtf8();
- value.u.s = reinterpret_cast<const FcChar8 *>(cs.data());
- FcPatternAdd(requestPattern, FC_FAMILY, value, true);
-
- FcResult result;
- FcPattern *matchPattern = FcFontMatch(0, requestPattern, &result);
+ FcPattern *matchPattern = getMatchPatternForFallback(at - 1);
if (matchPattern != 0) {
FcCharSet *charSet;
FcPatternGetCharSet(matchPattern, FC_CHARSET, 0, &charSet);
charSetHasChar = FcCharSetHasChar(charSet, ucs4);
- FcPatternDestroy(matchPattern);
}
-
- FcPatternDestroy(requestPattern);
}
return charSetHasChar;
}
+
+FcPattern * QFontEngineMultiFontConfig::getMatchPatternForFallback(int fallBackIndex) const
+{
+ Q_ASSERT(fallBackIndex < fallbackFamilyCount());
+ if (engines.size() - 1 > cachedMatchPatterns.size())
+ cachedMatchPatterns.resize(engines.size() - 1);
+ FcPattern *ret = cachedMatchPatterns.at(fallBackIndex);
+ if (ret)
+ return ret;
+ FcPattern *requestPattern = FcPatternCreate();
+ FcValue value;
+ value.type = FcTypeString;
+ QByteArray cs = fallbackFamilyAt(fallBackIndex).toUtf8();
+ value.u.s = reinterpret_cast<const FcChar8 *>(cs.data());
+ FcPatternAdd(requestPattern, FC_FAMILY, value, true);
+ FcResult result;
+ ret = FcFontMatch(0, requestPattern, &result);
+ cachedMatchPatterns.insert(fallBackIndex, ret);
+ FcPatternDestroy(requestPattern);
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 4323cb7d2e..260a9b5c70 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -43,6 +43,7 @@
#define QFONTENGINEMULTIFONTCONFIG_H
#include <QtGui/private/qfontengine_qpa_p.h>
+#include <fontconfig/fontconfig.h>
QT_BEGIN_NAMESPACE
@@ -52,7 +53,13 @@ class QFontEngineMultiFontConfig : public QFontEngineMultiQPA
public:
explicit QFontEngineMultiFontConfig(QFontEngine *fe, int script, const QStringList &fallbacks);
+ ~QFontEngineMultiFontConfig();
+
bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const;
+private:
+ FcPattern* getMatchPatternForFallback(int at) const;
+
+ mutable QVector<FcPattern*> cachedMatchPatterns;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 8322d4c70f..47618f02e3 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -3,7 +3,7 @@ TARGET = QtPlatformSupport
QPRO_PWD = $$PWD
QT += core-private gui-private
TEMPLATE = lib
-DESTDIR = $$QMAKE_LIBDIR_QT
+DESTDIR = $$QT.gui.libs
CONFIG += module
CONFIG += staticlib
diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp
index a9f3a858d2..a2fe2cb7fd 100644
--- a/src/plugins/accessible/widgets/itemviews.cpp
+++ b/src/plugins/accessible/widgets/itemviews.cpp
@@ -156,63 +156,6 @@ QHeaderView *QAccessibleTable::verticalHeader() const
return header;
}
-void QAccessibleTable::modelReset()
-{}
-
-void QAccessibleTable::rowsInserted(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = first;
- lastChange.lastRow = last;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeInsert;
-}
-
-void QAccessibleTable::rowsRemoved(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = first;
- lastChange.lastRow = last;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeDelete;
-}
-
-void QAccessibleTable::columnsInserted(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = first;
- lastChange.lastColumn = last;
- lastChange.type = QAccessible2::TableModelChangeInsert;
-}
-
-void QAccessibleTable::columnsRemoved(const QModelIndex &, int first, int last)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = first;
- lastChange.lastColumn = last;
- lastChange.type = QAccessible2::TableModelChangeDelete;
-}
-
-void QAccessibleTable::rowsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeUpdate;
-}
-
-void QAccessibleTable::columnsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
-{
- lastChange.firstRow = 0;
- lastChange.lastRow = 0;
- lastChange.firstColumn = 0;
- lastChange.lastColumn = 0;
- lastChange.type = QAccessible2::TableModelChangeUpdate;
-}
-
QAccessibleTableCell *QAccessibleTable::cell(const QModelIndex &index) const
{
if (index.isValid())
@@ -349,13 +292,6 @@ bool QAccessibleTable::unselectColumn(int column)
return true;
}
-QAccessible2::TableModelChange QAccessibleTable::modelChange() const
-{
- QAccessible2::TableModelChange change;
- // FIXME
- return change;
-}
-
QAccessible::Role QAccessibleTable::role() const
{
return m_role;
diff --git a/src/plugins/accessible/widgets/itemviews.h b/src/plugins/accessible/widgets/itemviews.h
index 3d852a2377..2672cd4a16 100644
--- a/src/plugins/accessible/widgets/itemviews.h
+++ b/src/plugins/accessible/widgets/itemviews.h
@@ -88,7 +88,6 @@ public:
virtual QString rowDescription(int row) const;
virtual int columnCount() const;
virtual int rowCount() const;
- virtual QAccessible2::TableModelChange modelChange() const;
// selection
virtual int selectedCellCount() const;
@@ -105,17 +104,7 @@ public:
virtual bool unselectColumn(int column);
protected:
- virtual void modelReset();
- virtual void rowsInserted(const QModelIndex &parent, int first, int last);
- virtual void rowsRemoved(const QModelIndex &parent, int first, int last);
- virtual void columnsInserted(const QModelIndex &parent, int first, int last);
- virtual void columnsRemoved(const QModelIndex &parent, int first, int last);
- virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row);
- virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column);
-
-protected:
QAbstractItemView* view;
- QAccessible2::TableModelChange lastChange;
inline QAccessibleTableCell *cell(const QModelIndex &index) const;
inline QAccessible::Role cellRole() const {
switch (m_role) {
diff --git a/src/plugins/platforms/blackberry/blackberry.pro b/src/plugins/platforms/blackberry/blackberry.pro
deleted file mode 100644
index 94b9c5dbc8..0000000000
--- a/src/plugins/platforms/blackberry/blackberry.pro
+++ /dev/null
@@ -1,71 +0,0 @@
-TARGET = blackberry
-include(../../qpluginbase.pri)
-
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
-QT += opengl opengl-private platformsupport platformsupport-private widgets-private
-
-# Uncomment this to build with support for IMF once it becomes available in the BBNDK
-#CONFIG += qbb_imf
-
-# Uncomment these to enable debugging output for various aspects of the plugin
-#DEFINES += QBBBUFFER_DEBUG
-#DEFINES += QBBCLIPBOARD_DEBUG
-#DEFINES += QBBEVENTTHREAD_DEBUG
-#DEFINES += QBBGLBACKINGSTORE_DEBUG
-#DEFINES += QBBGLCONTEXT_DEBUG
-#DEFINES += QBBINPUTCONTEXT_DEBUG
-#DEFINES += QBBINPUTCONTEXT_IMF_EVENT_DEBUG
-#DEFINES += QBBINTEGRATION_DEBUG
-#DEFINES += QBBNAVIGATORTHREAD_DEBUG
-#DEFINES += QBBRASTERBACKINGSTORE_DEBUG
-#DEFINES += QBBROOTWINDOW_DEBUG
-#DEFINES += QBBSCREEN_DEBUG
-#DEFINES += QBBVIRTUALKEYBOARD_DEBUG
-#DEFINES += QBBWINDOW_DEBUG
-
-SOURCES = main.cpp \
- qbbbuffer.cpp \
- qbbeventthread.cpp \
- qbbglcontext.cpp \
- qbbglbackingstore.cpp \
- qbbintegration.cpp \
- qbbnavigatorthread.cpp \
- qbbscreen.cpp \
- qbbwindow.cpp \
- qbbrasterbackingstore.cpp \
- qbbvirtualkeyboard.cpp \
- qbbclipboard.cpp \
- qbbrootwindow.cpp
-
-HEADERS = qbbbuffer.h \
- qbbeventthread.h \
- qbbkeytranslator.h \
- qbbintegration.h \
- qbbnavigatorthread.h \
- qbbglcontext.h \
- qbbglbackingstore.h \
- qbbscreen.h \
- qbbwindow.h \
- qbbrasterbackingstore.h \
- qbbvirtualkeyboard.h \
- qbbclipboard.h \
- qbbrootwindow.h
-
-CONFIG(qbb_imf) {
- DEFINES += QBB_IMF
- HEADERS += qbbinputcontext_imf.h
- SOURCES += qbbinputcontext_imf.cpp
-} else {
- HEADERS += qbbinputcontext_noimf.h
- SOURCES += qbbinputcontext_noimf.cpp
-}
-
-QMAKE_CXXFLAGS += -I./private
-
-LIBS += -lpps -lscreen -lEGL -lclipboard
-
-include (../../../platformsupport/eglconvenience/eglconvenience.pri)
-include (../../../platformsupport/fontdatabases/fontdatabases.pri)
-
-target.path += $$[QT_INSTALL_PLUGINS]/platforms
-INSTALLS += target
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 06d75036bf..58284bcddb 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -204,8 +204,7 @@ static QAccessibleInterface *acast(void *ptr)
- (void)accessibilityPerformAction:(NSString *)action {
QAccessibleActionInterface *actionInterface = acast(accessibleInterface)->actionInterface();
if (actionInterface) {
- QString qtAction = QCocoaAccessible::translateAction(action);
- actionInterface->doAction(QAccessibleActionInterface::pressAction());
+ actionInterface->doAction(QCocoaAccessible::translateAction(action));
}
}
diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro
index 8675dc164e..291e09d6ed 100644
--- a/src/plugins/platforms/eglfs/eglfs.pro
+++ b/src/plugins/platforms/eglfs/eglfs.pro
@@ -2,7 +2,11 @@ TARGET = qeglfs
TEMPLATE = lib
CONFIG += plugin
-QT += opengl core-private gui-private opengl-private platformsupport-private widgets-private
+QT += core-private gui-private platformsupport-private
+
+!contains(QT_CONFIG, no-widgets) {
+ QT += opengl opengl-private widgets-private
+}
DESTDIR = $$QT.gui.plugins/platforms
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
index 331b768a93..d2e4a47e56 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
@@ -39,17 +39,19 @@
**
****************************************************************************/
-#include <QtOpenGL/private/qgl_p.h>
-
#include "qeglfsbackingstore.h"
+#ifndef QT_NO_WIDGETS
+#include <QtOpenGL/private/qgl_p.h>
+#include <QtOpenGL/private/qglpaintdevice_p.h>
+#endif //QT_NO_WIDGETS
+
#include <QtGui/QPlatformOpenGLContext>
#include <QtGui/QScreen>
-#include <QtOpenGL/private/qglpaintdevice_p.h>
-
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_WIDGETS
class QEglFSPaintDevice : public QGLPaintDevice
{
public:
@@ -73,15 +75,20 @@ private:
QEglFSScreen *m_screen;
QGLContext *m_context;
};
-
+#endif //QT_NO_WIDGETS
QEglFSBackingStore::QEglFSBackingStore(QWindow *window)
- : QPlatformBackingStore(window)
+ : QPlatformBackingStore(window),
+ m_paintDevice(0)
{
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore %p, %p", window, window->screen());
#endif
+#ifdef QT_NO_WIDGETS
+ m_paintDevice = new QImage(0,0);
+#else
m_paintDevice = new QEglFSPaintDevice(static_cast<QEglFSScreen *>(window->screen()->handle()));
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
@@ -92,7 +99,9 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore::flush %p", window);
#endif
+#ifndef QT_NO_WIDGETS
static_cast<QEglFSPaintDevice *>(m_paintDevice)->context()->swapBuffers();
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents)
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
index 5623a96004..1ae3ecdc61 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.h
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
@@ -53,7 +53,7 @@ class QEglFSBackingStore : public QPlatformBackingStore
{
public:
QEglFSBackingStore(QWindow *window);
- ~QEglFSBackingStore() {}
+ ~QEglFSBackingStore() { delete m_paintDevice; }
QPaintDevice *paintDevice() { return m_paintDevice; }
void flush(QWindow *window, const QRegion &region, const QPoint &offset);
diff --git a/src/plugins/platforms/kms/qkmsdevice.cpp b/src/plugins/platforms/kms/qkmsdevice.cpp
index 01bf1d12be..8d42871401 100644
--- a/src/plugins/platforms/kms/qkmsdevice.cpp
+++ b/src/plugins/platforms/kms/qkmsdevice.cpp
@@ -127,7 +127,7 @@ void QKmsDevice::createScreens()
void QKmsDevice::handlePageFlipCompleted()
{
- //qDebug() << "Display signal recieved";
+ //qDebug() << "Display signal received";
drmEventContext eventContext;
memset(&eventContext, 0, sizeof eventContext);
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 8f728a5fb0..c97c1def0c 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -12,6 +12,6 @@ mac {
win32: SUBDIRS += windows
-blackberry-armv7le-qcc {
- SUBDIRS += blackberry
+qnx-*-qcc {
+ SUBDIRS += qnx
}
diff --git a/src/plugins/platforms/blackberry/main.cpp b/src/plugins/platforms/qnx/main.cpp
index b9e09c0384..b1e1687150 100644
--- a/src/plugins/platforms/blackberry/main.cpp
+++ b/src/plugins/platforms/qnx/main.cpp
@@ -40,33 +40,33 @@
****************************************************************************/
#include <QtGui/QPlatformIntegrationPlugin>
-#include "qbbintegration.h"
+#include "qqnxintegration.h"
QT_BEGIN_NAMESPACE
-class QBBIntegrationPlugin : public QPlatformIntegrationPlugin
+class QQnxIntegrationPlugin : public QPlatformIntegrationPlugin
{
public:
QStringList keys() const;
QPlatformIntegration *create(const QString&, const QStringList&);
};
-QStringList QBBIntegrationPlugin::keys() const
+QStringList QQnxIntegrationPlugin::keys() const
{
QStringList list;
- list << QLatin1String("blackberry");
+ list << QLatin1String("qnx");
return list;
}
-QPlatformIntegration *QBBIntegrationPlugin::create(const QString& system, const QStringList& paramList)
+QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
- if (system.toLower() == QLatin1String("blackberry"))
- return new QBBIntegration;
+ if (system.toLower() == QLatin1String("qnx"))
+ return new QQnxIntegration;
return 0;
}
-Q_EXPORT_PLUGIN2(blackberry, QBBIntegrationPlugin)
+Q_EXPORT_PLUGIN2(qnx, QQnxIntegrationPlugin)
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
new file mode 100644
index 0000000000..1bd3548b7d
--- /dev/null
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -0,0 +1,71 @@
+TARGET = qnx
+include(../../qpluginbase.pri)
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms
+QT += opengl opengl-private platformsupport platformsupport-private widgets-private
+
+# Uncomment this to build with support for IMF once it becomes available in the BBNDK
+#CONFIG += qqnx_imf
+
+# Uncomment these to enable debugging output for various aspects of the plugin
+#DEFINES += QQNXBUFFER_DEBUG
+#DEFINES += QQNXCLIPBOARD_DEBUG
+#DEFINES += QQNXEVENTTHREAD_DEBUG
+#DEFINES += QQNXGLBACKINGSTORE_DEBUG
+#DEFINES += QQNXGLCONTEXT_DEBUG
+#DEFINES += QQNXINPUTCONTEXT_DEBUG
+#DEFINES += QQNXINPUTCONTEXT_IMF_EVENT_DEBUG
+#DEFINES += QQNXINTEGRATION_DEBUG
+#DEFINES += QQNXNAVIGATORTHREAD_DEBUG
+#DEFINES += QQNXRASTERBACKINGSTORE_DEBUG
+#DEFINES += QQNXROOTWINDOW_DEBUG
+#DEFINES += QQNXSCREEN_DEBUG
+#DEFINES += QQNXVIRTUALKEYBOARD_DEBUG
+#DEFINES += QQNXWINDOW_DEBUG
+
+SOURCES = main.cpp \
+ qqnxbuffer.cpp \
+ qqnxeventthread.cpp \
+ qqnxglcontext.cpp \
+ qqnxglbackingstore.cpp \
+ qqnxintegration.cpp \
+ qqnxnavigatorthread.cpp \
+ qqnxscreen.cpp \
+ qqnxwindow.cpp \
+ qqnxrasterbackingstore.cpp \
+ qqnxvirtualkeyboard.cpp \
+ qqnxclipboard.cpp \
+ qqnxrootwindow.cpp
+
+HEADERS = qqnxbuffer.h \
+ qqnxeventthread.h \
+ qqnxkeytranslator.h \
+ qqnxintegration.h \
+ qqnxnavigatorthread.h \
+ qqnxglcontext.h \
+ qqnxglbackingstore.h \
+ qqnxscreen.h \
+ qqnxwindow.h \
+ qqnxrasterbackingstore.h \
+ qqnxvirtualkeyboard.h \
+ qqnxclipboard.h \
+ qqnxrootwindow.h
+
+CONFIG(qqnx_imf) {
+ DEFINES += QQNX_IMF
+ HEADERS += qqnxinputcontext_imf.h
+ SOURCES += qqnxinputcontext_imf.cpp
+} else {
+ HEADERS += qqnxinputcontext_noimf.h
+ SOURCES += qqnxinputcontext_noimf.cpp
+}
+
+QMAKE_CXXFLAGS += -I./private
+
+LIBS += -lpps -lscreen -lEGL -lclipboard
+
+include (../../../platformsupport/eglconvenience/eglconvenience.pri)
+include (../../../platformsupport/fontdatabases/fontdatabases.pri)
+
+target.path += $$[QT_INSTALL_PLUGINS]/platforms
+INSTALLS += target
diff --git a/src/plugins/platforms/blackberry/qbbbuffer.cpp b/src/plugins/platforms/qnx/qqnxbuffer.cpp
index c4ac04898d..048aec8ff6 100644
--- a/src/plugins/platforms/blackberry/qbbbuffer.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuffer.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qbbbuffer.h"
+#include "qqnxbuffer.h"
#include <QtCore/QDebug>
@@ -48,19 +48,19 @@
QT_BEGIN_NAMESPACE
-QBBBuffer::QBBBuffer()
+QQnxBuffer::QQnxBuffer()
: m_buffer(0)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - empty";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - empty";
#endif
}
-QBBBuffer::QBBBuffer(screen_buffer_t buffer)
+QQnxBuffer::QQnxBuffer(screen_buffer_t buffer)
: m_buffer(buffer)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - normal";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - normal";
#endif
// Get size of buffer
@@ -68,7 +68,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int size[2];
int result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_BUFFER_SIZE, size);
if (result != 0) {
- qFatal("QBB: failed to query buffer size, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer size, errno=%d", errno);
}
// Get stride of buffer
@@ -76,7 +76,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int stride;
result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_STRIDE, &stride);
if (result != 0) {
- qFatal("QBB: failed to query buffer stride, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer stride, errno=%d", errno);
}
// Get access to buffer's data
@@ -84,10 +84,10 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
uchar *dataPtr = 0;
result = screen_get_buffer_property_pv(buffer, SCREEN_PROPERTY_POINTER, (void **)&dataPtr);
if (result != 0) {
- qFatal("QBB: failed to query buffer pointer, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer pointer, errno=%d", errno);
}
if (dataPtr == NULL) {
- qFatal("QBB: buffer pointer is NULL, errno=%d", errno);
+ qFatal("QQNX: buffer pointer is NULL, errno=%d", errno);
}
// Get format of buffer
@@ -95,7 +95,7 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
int screenFormat;
result = screen_get_buffer_property_iv(buffer, SCREEN_PROPERTY_FORMAT, &screenFormat);
if (result != 0) {
- qFatal("QBB: failed to query buffer format, errno=%d", errno);
+ qFatal("QQNX: failed to query buffer format, errno=%d", errno);
}
// Convert screen format to QImage format
@@ -120,45 +120,45 @@ QBBBuffer::QBBBuffer(screen_buffer_t buffer)
imageFormat = QImage::Format_ARGB32_Premultiplied;
break;
default:
- qFatal("QBB: unsupported buffer format, format=%d", screenFormat);
+ qFatal("QQNX: unsupported buffer format, format=%d", screenFormat);
}
// wrap buffer in an image
m_image = QImage(dataPtr, size[0], size[1], stride, imageFormat);
}
-QBBBuffer::QBBBuffer(const QBBBuffer &other)
+QQnxBuffer::QQnxBuffer(const QQnxBuffer &other)
: m_buffer(other.m_buffer),
m_image(other.m_image)
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::QBBBuffer - copy";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::QQnxBuffer - copy";
#endif
}
-QBBBuffer::~QBBBuffer()
+QQnxBuffer::~QQnxBuffer()
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::~QBBBuffer";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::~QQnxBuffer";
#endif
}
-void QBBBuffer::invalidateInCache()
+void QQnxBuffer::invalidateInCache()
{
-#if defined(QBBBUFFER_DEBUG)
- qDebug() << "QBBBuffer::invalidateInCache";
+#if defined(QQNXBUFFER_DEBUG)
+ qDebug() << "QQnxBuffer::invalidateInCache";
#endif
// Verify native buffer exists
if (m_buffer == 0) {
- qFatal("QBB: can't invalidate cache for null buffer");
+ qFatal("QQNX: can't invalidate cache for null buffer");
}
// Evict buffer's data from cache
errno = 0;
int result = msync(m_image.bits(), m_image.height() * m_image.bytesPerLine(), MS_INVALIDATE | MS_CACHE_ONLY);
if (result != 0) {
- qFatal("QBB: failed to invalidate cache, errno=%d", errno);
+ qFatal("QQNX: failed to invalidate cache, errno=%d", errno);
}
}
diff --git a/src/plugins/platforms/blackberry/qbbbuffer.h b/src/plugins/platforms/qnx/qqnxbuffer.h
index 45cedb21a8..be8dfcafad 100644
--- a/src/plugins/platforms/blackberry/qbbbuffer.h
+++ b/src/plugins/platforms/qnx/qqnxbuffer.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBBUFFER_H
-#define QBBBUFFER_H
+#ifndef QQNXBUFFER_H
+#define QQNXBUFFER_H
#include <QtGui/QImage>
@@ -48,13 +48,13 @@
QT_BEGIN_NAMESPACE
-class QBBBuffer
+class QQnxBuffer
{
public:
- QBBBuffer();
- QBBBuffer(screen_buffer_t buffer);
- QBBBuffer(const QBBBuffer &other);
- virtual ~QBBBuffer();
+ QQnxBuffer();
+ QQnxBuffer(screen_buffer_t buffer);
+ QQnxBuffer(const QQnxBuffer &other);
+ virtual ~QQnxBuffer();
screen_buffer_t nativeBuffer() const { return m_buffer; }
const QImage *image() const { return (m_buffer != NULL) ? &m_image : NULL; }
@@ -71,4 +71,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBBUFFER_H
+#endif // QQNXBUFFER_H
diff --git a/src/plugins/platforms/blackberry/qbbclipboard.cpp b/src/plugins/platforms/qnx/qqnxclipboard.cpp
index 293a0c771b..8931a15139 100644
--- a/src/plugins/platforms/blackberry/qbbclipboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxclipboard.cpp
@@ -41,7 +41,7 @@
#ifndef QT_NO_CLIPBOARD
-#include "qbbclipboard.h"
+#include "qqnxclipboard.h"
#include <QtGui/QColor>
@@ -73,11 +73,11 @@ static QByteArray readClipboardBuff(const char *type)
return QByteArray();
}
-class QBBClipboard::MimeData : public QMimeData
+class QQnxClipboard::MimeData : public QMimeData
{
Q_OBJECT
public:
- MimeData(QBBClipboard *clipboard)
+ MimeData(QQnxClipboard *clipboard)
: QMimeData(),
m_clipboard(clipboard),
m_userMimeData(0)
@@ -97,7 +97,7 @@ public:
void addFormatToCheck(const QString &format) {
m_formatsToCheck << format;
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "formats=" << m_formatsToCheck;
#endif
}
@@ -105,7 +105,7 @@ public:
bool hasFormat(const QString &mimetype) const
{
const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0;
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "result=" << result;
#endif
return result;
@@ -120,7 +120,7 @@ public:
result << format;
}
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "result=" << result;
#endif
return result;
@@ -146,7 +146,7 @@ public:
protected:
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
{
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "preferredType=" << preferredType;
#endif
if (is_clipboard_format_present(mimetype.toUtf8().constData()) != 0)
@@ -160,7 +160,7 @@ private Q_SLOTS:
void releaseOwnership()
{
if (m_userMimeData) {
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "user data formats=" << m_userMimeData->formats() << "system formats=" << formats();
#endif
delete m_userMimeData;
@@ -170,23 +170,23 @@ private Q_SLOTS:
}
private:
- QBBClipboard * const m_clipboard;
+ QQnxClipboard * const m_clipboard;
QSet<QString> m_formatsToCheck;
QMimeData *m_userMimeData;
};
-QBBClipboard::QBBClipboard()
+QQnxClipboard::QQnxClipboard()
: m_mimeData(new MimeData(this))
{
}
-QBBClipboard::~QBBClipboard()
+QQnxClipboard::~QQnxClipboard()
{
delete m_mimeData;
}
-void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
+void QQnxClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
{
if (mode != QClipboard::Clipboard)
return;
@@ -203,7 +203,7 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
return;
const QStringList formats = data->formats();
-#if defined(QBBCLIPBOARD_DEBUG)
+#if defined(QQNXCLIPBOARD_DEBUG)
qDebug() << Q_FUNC_INFO << "formats=" << formats;
#endif
@@ -214,8 +214,8 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
continue;
int ret = set_clipboard_data(format.toUtf8().data(), buf.size(), buf.data());
-#if defined(QBBCLIPBOARD_DEBUG)
- qDebug() << "QBB: set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
+#if defined(QQNXCLIPBOARD_DEBUG)
+ qDebug() << "QQNX: set " << format << "to clipboard, size=" << buf.size() << ";ret=" << ret;
#endif
if (ret)
m_mimeData->addFormatToCheck(format);
@@ -224,7 +224,7 @@ void QBBClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode)
emitChanged(QClipboard::Clipboard);
}
-QMimeData *QBBClipboard::mimeData(QClipboard::Mode mode)
+QMimeData *QQnxClipboard::mimeData(QClipboard::Mode mode)
{
if (mode != QClipboard::Clipboard)
return 0;
@@ -239,6 +239,6 @@ QMimeData *QBBClipboard::mimeData(QClipboard::Mode mode)
QT_END_NAMESPACE
-#include "qbbclipboard.moc"
+#include "qqnxclipboard.moc"
#endif //QT_NO_CLIPBOARD
diff --git a/src/plugins/platforms/blackberry/qbbclipboard.h b/src/plugins/platforms/qnx/qqnxclipboard.h
index 11a36ba8e5..1104885d8c 100644
--- a/src/plugins/platforms/blackberry/qbbclipboard.h
+++ b/src/plugins/platforms/qnx/qqnxclipboard.h
@@ -39,19 +39,19 @@
**
****************************************************************************/
-#ifndef QBBCLIPBOARD_H
-#define QBBCLIPBOARD_H
+#ifndef QQNXCLIPBOARD_H
+#define QQNXCLIPBOARD_H
#ifndef QT_NO_CLIPBOARD
#include <QtGui/QPlatformClipboard>
QT_BEGIN_NAMESPACE
-class QBBClipboard : public QPlatformClipboard
+class QQnxClipboard : public QPlatformClipboard
{
public:
- QBBClipboard();
- virtual ~QBBClipboard();
+ QQnxClipboard();
+ virtual ~QQnxClipboard();
virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
@@ -63,4 +63,4 @@ private:
QT_END_NAMESPACE
#endif //QT_NO_CLIPBOARD
-#endif //QBBCLIPBOARD_H
+#endif //QQNXCLIPBOARD_H
diff --git a/src/plugins/platforms/blackberry/qbbeventthread.cpp b/src/plugins/platforms/qnx/qqnxeventthread.cpp
index 547428d1c4..cd30da1971 100644
--- a/src/plugins/platforms/blackberry/qbbeventthread.cpp
+++ b/src/plugins/platforms/qnx/qqnxeventthread.cpp
@@ -39,14 +39,14 @@
**
****************************************************************************/
-#include "qbbeventthread.h"
-#include "qbbintegration.h"
-#include "qbbkeytranslator.h"
+#include "qqnxeventthread.h"
+#include "qqnxintegration.h"
+#include "qqnxkeytranslator.h"
-#if defined(QBB_IMF)
-#include "qbbinputcontext_imf.h"
+#if defined(QQNX_IMF)
+#include "qqnxinputcontext_imf.h"
#else
-#include "qbbinputcontext_noimf.h"
+#include "qqnxinputcontext_noimf.h"
#endif
#include <QtGui/QWindow>
@@ -61,7 +61,7 @@
#include <cctype>
-QBBEventThread::QBBEventThread(screen_context_t context, QPlatformScreen& screen)
+QQnxEventThread::QQnxEventThread(screen_context_t context, QPlatformScreen& screen)
: QThread(),
m_screenContext(context),
m_platformScreen(screen),
@@ -89,13 +89,13 @@ QBBEventThread::QBBEventThread(screen_context_t context, QPlatformScreen& screen
}
}
-QBBEventThread::~QBBEventThread()
+QQnxEventThread::~QQnxEventThread()
{
// block until thread terminates
shutdown();
}
-void QBBEventThread::run()
+void QQnxEventThread::run()
{
screen_event_t event;
@@ -103,11 +103,11 @@ void QBBEventThread::run()
errno = 0;
int result = screen_create_event(&event);
if (result) {
- qFatal("QBB: failed to create event, errno=%d", errno);
+ qFatal("QQNX: failed to create event, errno=%d", errno);
}
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop started";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop started";
#endif
// loop indefinitely
@@ -117,22 +117,22 @@ void QBBEventThread::run()
errno = 0;
result = screen_get_event(m_screenContext, event, -1);
if (result) {
- qFatal("QBB: failed to get event, errno=%d", errno);
+ qFatal("QQNX: failed to get event, errno=%d", errno);
}
// process received event
dispatchEvent(event);
}
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop stopped";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop stopped";
#endif
// cleanup
screen_destroy_event(event);
}
-void QBBEventThread::shutdown()
+void QQnxEventThread::shutdown()
{
screen_event_t event;
@@ -140,7 +140,7 @@ void QBBEventThread::shutdown()
errno = 0;
int result = screen_create_event(&event);
if (result) {
- qFatal("QBB: failed to create event, errno=%d", errno);
+ qFatal("QQNX: failed to create event, errno=%d", errno);
}
// set the event type as user
@@ -148,7 +148,7 @@ void QBBEventThread::shutdown()
int type = SCREEN_EVENT_USER;
result = screen_set_event_property_iv(event, SCREEN_PROPERTY_TYPE, &type);
if (result) {
- qFatal("QBB: failed to set event type, errno=%d", errno);
+ qFatal("QQNX: failed to set event type, errno=%d", errno);
}
// NOTE: ignore SCREEN_PROPERTY_USER_DATA; treat all user events as shutdown events
@@ -157,32 +157,32 @@ void QBBEventThread::shutdown()
errno = 0;
result = screen_send_event(m_screenContext, event, getpid());
if (result) {
- qFatal("QBB: failed to set event type, errno=%d", errno);
+ qFatal("QQNX: failed to set event type, errno=%d", errno);
}
// cleanup
screen_destroy_event(event);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop shutdown begin";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop shutdown begin";
#endif
// block until thread terminates
wait();
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: event loop shutdown end";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: event loop shutdown end";
#endif
}
-void QBBEventThread::dispatchEvent(screen_event_t event)
+void QQnxEventThread::dispatchEvent(screen_event_t event)
{
// get the event type
errno = 0;
int qnxType;
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_TYPE, &qnxType);
if (result) {
- qFatal("QBB: failed to query event type, errno=%d", errno);
+ qFatal("QQNX: failed to query event type, errno=%d", errno);
}
switch (qnxType) {
@@ -206,29 +206,29 @@ void QBBEventThread::dispatchEvent(screen_event_t event)
case SCREEN_EVENT_USER:
// treat all user events as shutdown requests
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: QNX user event";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: QNX user event";
#endif
m_quit = true;
break;
default:
// event ignored
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: QNX unknown event";
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: QNX unknown event";
#endif
break;
}
}
-void QBBEventThread::handleKeyboardEvent(screen_event_t event)
+void QQnxEventThread::handleKeyboardEvent(screen_event_t event)
{
// get flags of key event
errno = 0;
int flags;
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_FLAGS, &flags);
if (result) {
- qFatal("QBB: failed to query event flags, errno=%d", errno);
+ qFatal("QQNX: failed to query event flags, errno=%d", errno);
}
// get key code
@@ -236,31 +236,31 @@ void QBBEventThread::handleKeyboardEvent(screen_event_t event)
int sym;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SYM, &sym);
if (result) {
- qFatal("QBB: failed to query event sym, errno=%d", errno);
+ qFatal("QQNX: failed to query event sym, errno=%d", errno);
}
int modifiers;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_MODIFIERS, &modifiers);
if (result) {
- qFatal("QBB: failed to query event modifiers, errno=%d", errno);
+ qFatal("QQNX: failed to query event modifiers, errno=%d", errno);
}
int scan;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_SCAN, &scan);
if (result) {
- qFatal("QBB: failed to query event modifiers, errno=%d", errno);
+ qFatal("QQNX: failed to query event modifiers, errno=%d", errno);
}
int cap;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_KEY_CAP, &cap);
if (result) {
- qFatal("QBB: failed to query event cap, errno=%d", errno);
+ qFatal("QQNX: failed to query event cap, errno=%d", errno);
}
injectKeyboardEvent(flags, sym, modifiers, scan, cap);
}
-void QBBEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int scan, int cap)
+void QQnxEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int scan, int cap)
{
Q_UNUSED(scan);
@@ -300,13 +300,13 @@ void QBBEventThread::injectKeyboardEvent(int flags, int sym, int modifiers, int
}
QWindowSystemInterface::handleKeyEvent(QGuiApplication::focusWindow(), type, key, qtMod, keyStr);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt key t=" << type << ", k=" << key << ", s=" << keyStr;
#endif
}
}
-void QBBEventThread::handlePointerEvent(screen_event_t event)
+void QQnxEventThread::handlePointerEvent(screen_event_t event)
{
errno = 0;
@@ -315,7 +315,7 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
void *handle;
int result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
qnxWindow = static_cast<screen_window_t>(handle);
@@ -323,48 +323,48 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
int buttonState = 0;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_BUTTONS, &buttonState);
if (result) {
- qFatal("QBB: failed to query event button state, errno=%d", errno);
+ qFatal("QQNX: failed to query event button state, errno=%d", errno);
}
// Query the window position
int windowPos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_SOURCE_POSITION, windowPos);
if (result) {
- qFatal("QBB: failed to query event window position, errno=%d", errno);
+ qFatal("QQNX: failed to query event window position, errno=%d", errno);
}
// Query the screen position
int pos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_POSITION, pos);
if (result) {
- qFatal("QBB: failed to query event position, errno=%d", errno);
+ qFatal("QQNX: failed to query event position, errno=%d", errno);
}
// Query the wheel delta
int wheelDelta = 0;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_MOUSE_WHEEL, &wheelDelta);
if (result) {
- qFatal("QBB: failed to query event wheel delta, errno=%d", errno);
+ qFatal("QQNX: failed to query event wheel delta, errno=%d", errno);
}
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
// Generate enter and leave events as needed.
if (qnxWindow != m_lastMouseWindow) {
- QWindow *wOld = QBBIntegration::window(m_lastMouseWindow);
+ QWindow *wOld = QQnxIntegration::window(m_lastMouseWindow);
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt leave, w=" << wOld;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt leave, w=" << wOld;
#endif
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt enter, w=" << w;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt enter, w=" << w;
#endif
}
}
@@ -380,13 +380,26 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
QPoint localPoint(windowPos[0], windowPos[1]);
// Convert buttons.
+ // Some QNX header files invert 'Right Button versus "Left Button' ('Right' == 0x01). But they also offer a 'Button Swap' bit,
+ // so we may receive events as shown. (If this is wrong, the fix is easy.)
+ // QNX Button mask is 8 buttons wide, with a maximum value of x080.
Qt::MouseButtons buttons = Qt::NoButton;
- if (buttonState & 1)
+ if (buttonState & 0x01)
buttons |= Qt::LeftButton;
- if (buttonState & 2)
+ if (buttonState & 0x02)
buttons |= Qt::MidButton;
- if (buttonState & 4)
+ if (buttonState & 0x04)
buttons |= Qt::RightButton;
+ if (buttonState & 0x08)
+ buttons |= Qt::ExtraButton1; // AKA 'Qt::BackButton'
+ if (buttonState & 0x10)
+ buttons |= Qt::ExtraButton2; // AKA 'Qt::ForwardButton'
+ if (buttonState & 0x20)
+ buttons |= Qt::ExtraButton3;
+ if (buttonState & 0x40)
+ buttons |= Qt::ExtraButton4;
+ if (buttonState & 0x80)
+ buttons |= Qt::ExtraButton5;
if (w) {
// Inject mouse event into Qt only if something has changed.
@@ -394,8 +407,8 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
m_lastLocalMousePoint != localPoint ||
m_lastButtonState != buttons) {
QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << static_cast<int>(buttons);
#endif
}
@@ -403,8 +416,8 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
// Screen only supports a single wheel, so we will assume Vertical orientation for
// now since that is pretty much standard.
QWindowSystemInterface::handleWheelEvent(w, localPoint, globalPoint, wheelDelta, Qt::Vertical);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt wheel, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), d=" << static_cast<int>(wheelDelta);
#endif
}
}
@@ -414,14 +427,14 @@ void QBBEventThread::handlePointerEvent(screen_event_t event)
m_lastButtonState = buttons;
}
-void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
+void QQnxEventThread::handleTouchEvent(screen_event_t event, int qnxType)
{
// get display coordinates of touch
errno = 0;
int pos[2];
int result = screen_get_event_property_iv(event, SCREEN_PROPERTY_POSITION, pos);
if (result) {
- qFatal("QBB: failed to query event position, errno=%d", errno);
+ qFatal("QQNX: failed to query event position, errno=%d", errno);
}
// get window coordinates of touch
@@ -429,7 +442,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
int windowPos[2];
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_SOURCE_POSITION, windowPos);
if (result) {
- qFatal("QBB: failed to query event window position, errno=%d", errno);
+ qFatal("QQNX: failed to query event window position, errno=%d", errno);
}
// determine which finger touched
@@ -437,7 +450,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
int touchId;
result = screen_get_event_property_iv(event, SCREEN_PROPERTY_TOUCH_ID, &touchId);
if (result) {
- qFatal("QBB: failed to query event touch id, errno=%d", errno);
+ qFatal("QQNX: failed to query event touch id, errno=%d", errno);
}
// determine which window was touched
@@ -445,7 +458,7 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
void *handle;
result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
screen_window_t qnxWindow = static_cast<screen_window_t>(handle);
@@ -453,23 +466,23 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
if (touchId < MaximumTouchPoints) {
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
// Generate enter and leave events as needed.
if (qnxWindow != m_lastMouseWindow) {
- QWindow *wOld = QBBIntegration::window(m_lastMouseWindow);
+ QWindow *wOld = QQnxIntegration::window(m_lastMouseWindow);
if (wOld) {
QWindowSystemInterface::handleLeaveEvent(wOld);
- #if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt leave, w=" << wOld;
+ #if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt leave, w=" << wOld;
#endif
}
if (w) {
QWindowSystemInterface::handleEnterEvent(w);
- #if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt enter, w=" << w;
+ #if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt enter, w=" << w;
#endif
}
}
@@ -488,8 +501,8 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
// inject event into Qt
QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << buttons;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt mouse, w=" << w << ", (" << localPoint.x() << "," << localPoint.y() << "), b=" << buttons;
#endif
}
@@ -533,25 +546,25 @@ void QBBEventThread::handleTouchEvent(screen_event_t event, int qnxType)
// inject event into Qt
QWindowSystemInterface::handleTouchEvent(w, m_touchDevice, pointList);
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: Qt touch, w=" << w << ", p=(" << pos[0] << "," << pos[1] << "), t=" << type;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: Qt touch, w=" << w << ", p=(" << pos[0] << "," << pos[1] << "), t=" << type;
#endif
}
}
}
-void QBBEventThread::handleCloseEvent(screen_event_t event)
+void QQnxEventThread::handleCloseEvent(screen_event_t event)
{
// Query the window that was closed
void *handle;
int result = screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, &handle);
if (result != 0) {
- qFatal("QBB: failed to query event window, errno=%d", errno);
+ qFatal("QQNX: failed to query event window, errno=%d", errno);
}
screen_window_t qnxWindow = static_cast<screen_window_t>(handle);
// Map window handle to top-level QWindow
- QWindow *w = QBBIntegration::window(qnxWindow);
+ QWindow *w = QQnxIntegration::window(qnxWindow);
if (w != 0) {
QWindowSystemInterface::handleCloseEvent(w);
}
diff --git a/src/plugins/platforms/blackberry/qbbeventthread.h b/src/plugins/platforms/qnx/qqnxeventthread.h
index afa738830c..61831233e9 100644
--- a/src/plugins/platforms/blackberry/qbbeventthread.h
+++ b/src/plugins/platforms/qnx/qqnxeventthread.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBEVENTTHREAD_H
-#define QBBEVENTTHREAD_H
+#ifndef QQNXEVENTTHREAD_H
+#define QQNXEVENTTHREAD_H
#include <QtCore/QThread>
@@ -51,11 +51,11 @@
QT_BEGIN_NAMESPACE
-class QBBEventThread : public QThread
+class QQnxEventThread : public QThread
{
public:
- QBBEventThread(screen_context_t context, QPlatformScreen& screen);
- virtual ~QBBEventThread();
+ QQnxEventThread(screen_context_t context, QPlatformScreen& screen);
+ virtual ~QQnxEventThread();
static void injectKeyboardEvent(int flags, int sym, int mod, int scan, int cap);
@@ -87,4 +87,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBEVENTTHREAD_H
+#endif // QQNXEVENTTHREAD_H
diff --git a/src/plugins/platforms/blackberry/qbbglbackingstore.cpp b/src/plugins/platforms/qnx/qqnxglbackingstore.cpp
index 91b07770e1..97a03e0042 100644
--- a/src/plugins/platforms/blackberry/qbbglbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxglbackingstore.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbglbackingstore.h"
-#include "qbbglcontext.h"
-#include "qbbwindow.h"
-#include "qbbscreen.h"
+#include "qqnxglbackingstore.h"
+#include "qqnxglcontext.h"
+#include "qqnxwindow.h"
+#include "qqnxscreen.h"
#include <QtGui/qwindow.h>
@@ -55,12 +55,12 @@
QT_BEGIN_NAMESPACE
-QBBGLPaintDevice::QBBGLPaintDevice(QWindow *window)
+QQnxGLPaintDevice::QQnxGLPaintDevice(QWindow *window)
: QGLPaintDevice(),
m_window(0),
m_glContext(0)
{
- m_window = static_cast<QBBWindow*>(window->handle());
+ m_window = static_cast<QQnxWindow*>(window->handle());
// Extract the QPlatformOpenGLContext from the window
QPlatformOpenGLContext *platformOpenGLContext = m_window->platformOpenGLContext();
@@ -69,81 +69,81 @@ QBBGLPaintDevice::QBBGLPaintDevice(QWindow *window)
m_glContext = QGLContext::fromOpenGLContext(platformOpenGLContext->context());
}
-QBBGLPaintDevice::~QBBGLPaintDevice()
+QQnxGLPaintDevice::~QQnxGLPaintDevice()
{
// Cleanup GL context
delete m_glContext;
}
-QPaintEngine *QBBGLPaintDevice::paintEngine() const
+QPaintEngine *QQnxGLPaintDevice::paintEngine() const
{
// Select a paint engine based on configued OpenGL version
return qt_qgl_paint_engine();
}
-QSize QBBGLPaintDevice::size() const
+QSize QQnxGLPaintDevice::size() const
{
// Get size of EGL surface
return m_window->geometry().size();
}
-QBBGLBackingStore::QBBGLBackingStore(QWindow *window)
+QQnxGLBackingStore::QQnxGLBackingStore(QWindow *window)
: QPlatformBackingStore(window),
m_openGLContext(0),
m_paintDevice(0),
m_requestedSize(),
m_size()
{
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::QBBGLBackingStore - w=" << window;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::QQnxGLBackingStore - w=" << window;
#endif
// Create an OpenGL paint device which in turn creates a QGLContext for us
- m_paintDevice = new QBBGLPaintDevice(window);
+ m_paintDevice = new QQnxGLPaintDevice(window);
m_openGLContext = m_paintDevice->context()->contextHandle();
}
-QBBGLBackingStore::~QBBGLBackingStore()
+QQnxGLBackingStore::~QQnxGLBackingStore()
{
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::~QBBGLBackingStore - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::~QQnxGLBackingStore - w=" << window();
#endif
// cleanup OpenGL paint device
delete m_paintDevice;
}
-void QBBGLBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QQnxGLBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(region);
Q_UNUSED(offset);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::flush - w=" << window;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::flush - w=" << window;
#endif
// update the display with newly rendered content
m_openGLContext->swapBuffers(window);
}
-void QBBGLBackingStore::resize(const QSize &size, const QRegion &staticContents)
+void QQnxGLBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(staticContents);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::resize - w=" << window() << ", s=" << size;
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::resize - w=" << window() << ", s=" << size;
#endif
// NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs
m_requestedSize = size;
}
-void QBBGLBackingStore::beginPaint(const QRegion &region)
+void QQnxGLBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::beginPaint - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::beginPaint - w=" << window();
#endif
// resize EGL surface if window surface resized
@@ -152,19 +152,19 @@ void QBBGLBackingStore::beginPaint(const QRegion &region)
}
}
-void QBBGLBackingStore::endPaint(const QRegion &region)
+void QQnxGLBackingStore::endPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBGLBACKINGSTORE_DEBUG)
- qDebug() << "QBBGLBackingStore::endPaint - w=" << window();
+#if defined(QQNXGLBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxGLBackingStore::endPaint - w=" << window();
#endif
}
-void QBBGLBackingStore::resizeSurface(const QSize &size)
+void QQnxGLBackingStore::resizeSurface(const QSize &size)
{
// need to destroy surface so make sure its not current
bool restoreCurrent = false;
- QBBGLContext *platformContext = static_cast<QBBGLContext *>(m_openGLContext->handle());
+ QQnxGLContext *platformContext = static_cast<QQnxGLContext *>(m_openGLContext->handle());
if (platformContext->isCurrent()) {
m_openGLContext->doneCurrent();
restoreCurrent = true;
@@ -174,7 +174,7 @@ void QBBGLBackingStore::resizeSurface(const QSize &size)
platformContext->destroySurface();
// resize window's buffers
- static_cast<QBBWindow*>(window()->handle())->setBufferSize(size);
+ static_cast<QQnxWindow*>(window()->handle())->setBufferSize(size);
// re-create EGL surface with new size
m_size = size;
diff --git a/src/plugins/platforms/blackberry/qbbglbackingstore.h b/src/plugins/platforms/qnx/qqnxglbackingstore.h
index 5455c5767c..d04fe22f5d 100644
--- a/src/plugins/platforms/blackberry/qbbglbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxglbackingstore.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBGLBACKINGSTORE_H
-#define QBBGLBACKINGSTORE_H
+#ifndef QQNXGLBACKINGSTORE_H
+#define QQNXGLBACKINGSTORE_H
#include <QtGui/qplatformbackingstore_qpa.h>
#include <QtOpenGL/private/qglpaintdevice_p.h>
@@ -50,30 +50,30 @@
QT_BEGIN_NAMESPACE
class QGLContext;
-class QBBGLContext;
-class QBBScreen;
-class QBBWindow;
+class QQnxGLContext;
+class QQnxScreen;
+class QQnxWindow;
-class QBBGLPaintDevice : public QGLPaintDevice
+class QQnxGLPaintDevice : public QGLPaintDevice
{
public:
- QBBGLPaintDevice(QWindow *window);
- virtual ~QBBGLPaintDevice();
+ QQnxGLPaintDevice(QWindow *window);
+ virtual ~QQnxGLPaintDevice();
virtual QPaintEngine *paintEngine() const;
virtual QSize size() const;
virtual QGLContext *context() const { return m_glContext; }
private:
- QBBWindow *m_window;
+ QQnxWindow *m_window;
QGLContext *m_glContext;
};
-class QBBGLBackingStore : public QPlatformBackingStore
+class QQnxGLBackingStore : public QPlatformBackingStore
{
public:
- QBBGLBackingStore(QWindow *window);
- virtual ~QBBGLBackingStore();
+ QQnxGLBackingStore(QWindow *window);
+ virtual ~QQnxGLBackingStore();
virtual QPaintDevice *paintDevice() { return m_paintDevice; }
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
@@ -85,11 +85,11 @@ public:
private:
QOpenGLContext *m_openGLContext;
- QBBGLPaintDevice *m_paintDevice;
+ QQnxGLPaintDevice *m_paintDevice;
QSize m_requestedSize;
QSize m_size;
};
QT_END_NAMESPACE
-#endif // QBBGLBACKINGSTORE_H
+#endif // QQNXGLBACKINGSTORE_H
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp
index fb74fdb5d2..d620feb710 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.cpp
+++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbglcontext.h"
-#include "qbbrootwindow.h"
-#include "qbbscreen.h"
-#include "qbbwindow.h"
+#include "qqnxglcontext.h"
+#include "qqnxrootwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxwindow.h"
#include "private/qeglconvenience_p.h"
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-EGLDisplay QBBGLContext::ms_eglDisplay = EGL_NO_DISPLAY;
+EGLDisplay QQnxGLContext::ms_eglDisplay = EGL_NO_DISPLAY;
static EGLenum checkEGLError(const char *msg)
{
@@ -78,12 +78,12 @@ static EGLenum checkEGLError(const char *msg)
return error;
}
-QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
+QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
: QPlatformOpenGLContext(),
m_glContext(glContext),
m_eglSurface(EGL_NO_SURFACE)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QSurfaceFormat format = m_glContext->format();
@@ -91,7 +91,7 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Get colour channel sizes from window format
@@ -103,7 +103,7 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Check if all channels are don't care
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
// Set colour channels based on depth of window's screen
- QBBScreen *screen = static_cast<QBBScreen*>(QBBScreen::screens().first());
+ QQnxScreen *screen = static_cast<QQnxScreen*>(QQnxScreen::screens().first());
int depth = screen->depth();
if (depth == 32) {
// SCREEN_FORMAT_RGBA8888
@@ -145,22 +145,22 @@ QBBGLContext::QBBGLContext(QOpenGLContext *glContext)
// Select EGL config based on requested window format
m_eglConfig = q_configFromGLFormat(ms_eglDisplay, format);
if (m_eglConfig == 0) {
- qFatal("QBB: failed to find EGL config");
+ qFatal("QQNXQBBWindow: failed to find EGL config");
}
m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, contextAttrs());
if (m_eglContext == EGL_NO_CONTEXT) {
checkEGLError("eglCreateContext");
- qFatal("QBB: failed to create EGL context, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to create EGL context, err=%d", eglGetError());
}
// Query/cache window format of selected EGL config
m_windowFormat = q_glFormatFromConfig(ms_eglDisplay, m_eglConfig);
}
-QBBGLContext::~QBBGLContext()
+QQnxGLContext::~QQnxGLContext()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -173,43 +173,43 @@ QBBGLContext::~QBBGLContext()
destroySurface();
}
-void QBBGLContext::initialize()
+void QQnxGLContext::initialize()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Initialize connection to EGL
ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (ms_eglDisplay == EGL_NO_DISPLAY) {
checkEGLError("eglGetDisplay");
- qFatal("QBB: failed to obtain EGL display");
+ qFatal("QQNXQBBWindow: failed to obtain EGL display");
}
EGLBoolean eglResult = eglInitialize(ms_eglDisplay, 0, 0);
if (eglResult != EGL_TRUE) {
checkEGLError("eglInitialize");
- qFatal("QBB: failed to initialize EGL display, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to initialize EGL display, err=%d", eglGetError());
}
}
-void QBBGLContext::shutdown()
+void QQnxGLContext::shutdown()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Close connection to EGL
eglTerminate(ms_eglDisplay);
}
-bool QBBGLContext::makeCurrent(QPlatformSurface *surface)
+bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNXQBBWindow: failed to set EGL API, err=%d", eglGetError());
}
if (m_eglSurface == EGL_NO_SURFACE)
@@ -218,68 +218,68 @@ bool QBBGLContext::makeCurrent(QPlatformSurface *surface)
eglResult = eglMakeCurrent(ms_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext);
if (eglResult != EGL_TRUE) {
checkEGLError("eglMakeCurrent");
- qFatal("QBB: failed to set current EGL context, err=%d", eglGetError());
+ qFatal("QQNX: failed to set current EGL context, err=%d", eglGetError());
}
return (eglResult == EGL_TRUE);
}
-void QBBGLContext::doneCurrent()
+void QQnxGLContext::doneCurrent()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// clear curent EGL context and unbind EGL surface
eglResult = eglMakeCurrent(ms_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to clear current EGL context, err=%d", eglGetError());
+ qFatal("QQNX: failed to clear current EGL context, err=%d", eglGetError());
}
}
-void QBBGLContext::swapBuffers(QPlatformSurface *surface)
+void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
{
Q_UNUSED(surface);
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Post EGL surface to window
eglResult = eglSwapBuffers(ms_eglDisplay, m_eglSurface);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to swap EGL buffers, err=%d", eglGetError());
+ qFatal("QQNX: failed to swap EGL buffers, err=%d", eglGetError());
}
}
-QFunctionPointer QBBGLContext::getProcAddress(const QByteArray &procName)
+QFunctionPointer QQnxGLContext::getProcAddress(const QByteArray &procName)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to set EGL API, err=%d", eglGetError());
+ qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
}
// Lookup EGL extension function pointer
return static_cast<QFunctionPointer>(eglGetProcAddress(procName.constData()));
}
-EGLint *QBBGLContext::contextAttrs()
+EGLint *QQnxGLContext::contextAttrs()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -292,23 +292,23 @@ EGLint *QBBGLContext::contextAttrs()
#endif
}
-bool QBBGLContext::isCurrent() const
+bool QQnxGLContext::isCurrent() const
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return (eglGetCurrentContext() == m_eglContext);
}
-void QBBGLContext::createSurface(QPlatformSurface *surface)
+void QQnxGLContext::createSurface(QPlatformSurface *surface)
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Get a pointer to the corresponding platform window
- QBBWindow *platformWindow = dynamic_cast<QBBWindow*>(surface);
+ QQnxWindow *platformWindow = dynamic_cast<QQnxWindow*>(surface);
if (!platformWindow) {
- qFatal("QBB: unable to create EGLSurface without a QBBWindow");
+ qFatal("QQNX: unable to create EGLSurface without a QQnxWindow");
}
// If the platform window does not yet have any buffers, we create
@@ -334,13 +334,13 @@ void QBBGLContext::createSurface(QPlatformSurface *surface)
m_eglSurface = eglCreateWindowSurface(ms_eglDisplay, m_eglConfig, (EGLNativeWindowType) handle, eglSurfaceAttrs);
if (m_eglSurface == EGL_NO_SURFACE) {
checkEGLError("eglCreateWindowSurface");
- qFatal("QBB: failed to create EGL surface, err=%d", eglGetError());
+ qFatal("QQNX: failed to create EGL surface, err=%d", eglGetError());
}
}
-void QBBGLContext::destroySurface()
+void QQnxGLContext::destroySurface()
{
-#if defined(QBBGLCONTEXT_DEBUG)
+#if defined(QQNXGLCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -348,7 +348,7 @@ void QBBGLContext::destroySurface()
if (m_eglSurface != EGL_NO_SURFACE) {
EGLBoolean eglResult = eglDestroySurface(ms_eglDisplay, m_eglSurface);
if (eglResult != EGL_TRUE) {
- qFatal("QBB: failed to destroy EGL surface, err=%d", eglGetError());
+ qFatal("QQNX: failed to destroy EGL surface, err=%d", eglGetError());
}
}
}
diff --git a/src/plugins/platforms/blackberry/qbbglcontext.h b/src/plugins/platforms/qnx/qqnxglcontext.h
index 8ea1df5f40..36c439802a 100644
--- a/src/plugins/platforms/blackberry/qbbglcontext.h
+++ b/src/plugins/platforms/qnx/qqnxglcontext.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBGLCONTEXT_H
-#define QBBGLCONTEXT_H
+#ifndef QQNXGLCONTEXT_H
+#define QQNXGLCONTEXT_H
#include <QtGui/QPlatformOpenGLContext>
#include <QtGui/QSurfaceFormat>
@@ -50,13 +50,13 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBGLContext : public QPlatformOpenGLContext
+class QQnxGLContext : public QPlatformOpenGLContext
{
public:
- QBBGLContext(QOpenGLContext *glContext);
- virtual ~QBBGLContext();
+ QQnxGLContext(QOpenGLContext *glContext);
+ virtual ~QQnxGLContext();
static void initialize();
static void shutdown();
@@ -90,4 +90,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBGLCONTEXT_H
+#endif // QQNXGLCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
index fab3d3f151..3f9d768ccc 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_imf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qbbinputcontext_imf.h"
-#include "qbbeventthread.h"
-#include "qbbvirtualkeyboard.h"
+#include "qqnxinputcontext_imf.h"
+#include "qqnxeventthread.h"
+#include "qqnxvirtualkeyboard.h"
#include <QtWidgets/QAbstractSpinBox>
#include <QtWidgets/QAction>
@@ -175,7 +175,7 @@ int ImfEvent::sUserEventType = QEvent::registerEventType();
static int32_t imfBeginBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -194,7 +194,7 @@ static int32_t imfBeginBatchEdit(input_session_t *ic)
static int32_t imfClearMetaKeyStates(input_session_t *ic, int32_t states)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -215,7 +215,7 @@ static int32_t imfClearMetaKeyStates(input_session_t *ic, int32_t states)
static int32_t imfCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -237,7 +237,7 @@ static int32_t imfCommitText(input_session_t *ic, spannable_string_t *text, int3
static int32_t imfDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -259,7 +259,7 @@ static int32_t imfDeleteSurroundingText(input_session_t *ic, int32_t left_length
static int32_t imfEndBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -279,7 +279,7 @@ static int32_t imfEndBatchEdit(input_session_t *ic)
static int32_t imfFinishComposingText(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -299,7 +299,7 @@ static int32_t imfFinishComposingText(input_session_t *ic)
static int32_t imfGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -318,7 +318,7 @@ static int32_t imfGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
static int32_t imfGetCursorPosition(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -338,7 +338,7 @@ static int32_t imfGetCursorPosition(input_session_t *ic)
static extracted_text_t *imfGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -361,7 +361,7 @@ static extracted_text_t *imfGetExtractedText(input_session_t *ic, extracted_text
static spannable_string_t *imfGetSelectedText(input_session_t *ic, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -380,7 +380,7 @@ static spannable_string_t *imfGetSelectedText(input_session_t *ic, int32_t flags
static spannable_string_t *imfGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -400,7 +400,7 @@ static spannable_string_t *imfGetTextAfterCursor(input_session_t *ic, int32_t n,
static spannable_string_t *imfGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -420,7 +420,7 @@ static spannable_string_t *imfGetTextBeforeCursor(input_session_t *ic, int32_t n
static int32_t imfPerformEditorAction(input_session_t *ic, int32_t editor_action)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -440,7 +440,7 @@ static int32_t imfPerformEditorAction(input_session_t *ic, int32_t editor_action
static int32_t imfReportFullscreenMode(input_session_t *ic, int32_t enabled)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -460,7 +460,7 @@ static int32_t imfReportFullscreenMode(input_session_t *ic, int32_t enabled)
static int32_t imfSendEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -477,7 +477,7 @@ static int32_t imfSendEvent(input_session_t *ic, event_t *event)
static int32_t imfSendAsyncEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -494,7 +494,7 @@ static int32_t imfSendAsyncEvent(input_session_t *ic, event_t *event)
static int32_t imfSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -515,7 +515,7 @@ static int32_t imfSetComposingRegion(input_session_t *ic, int32_t start, int32_t
static int32_t imfSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -536,7 +536,7 @@ static int32_t imfSetComposingText(input_session_t *ic, spannable_string_t *text
static int32_t imfSetSelection(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_IMF_EVENT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_IMF_EVENT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -595,7 +595,7 @@ initEvent(event_t *pEvent, const input_session_t *pSession, EventType eventType,
spannable_string_t *toSpannableString(const QString &text)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << text;
#endif
@@ -674,14 +674,14 @@ static bool imfAvailable()
return s_imfReady;
}
-QBBInputContext::QBBInputContext():
+QQnxInputContext::QQnxInputContext():
QPlatformInputContext(),
m_lastCaretPos(0),
m_isComposing(false),
m_inputPanelVisible(false),
m_inputPanelLocale(QLocale::c())
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -697,7 +697,7 @@ QBBInputContext::QBBInputContext():
// p_vkb_init_selection_service();
- QBBVirtualKeyboard &keyboard = QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard &keyboard = QQnxVirtualKeyboard::instance();
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
connect(&keyboard, SIGNAL(localeChanged(QLocale)), this, SLOT(keyboardLocaleChanged(QLocale)));
keyboardVisibilityChanged(keyboard.isVisible());
@@ -708,9 +708,9 @@ QBBInputContext::QBBInputContext():
}
-QBBInputContext::~QBBInputContext()
+QQnxInputContext::~QQnxInputContext()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -724,12 +724,12 @@ QBBInputContext::~QBBInputContext()
#define getarg(type, name) type name = imfEvent->mArgs[qs(#name)].value<type>()
#define getparg(type, name) type name = (type)(imfEvent->mArgs[qs(#name)].value<void*>())
-bool QBBInputContext::isValid() const
+bool QQnxInputContext::isValid() const
{
return imfAvailable();
}
-bool QBBInputContext::eventFilter(QObject *obj, QEvent *event)
+bool QQnxInputContext::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == ImfEvent::sUserEventType) {
// Forward the event to our real handler.
@@ -878,9 +878,9 @@ bool QBBInputContext::eventFilter(QObject *obj, QEvent *event)
}
}
-bool QBBInputContext::filterEvent( const QEvent *event )
+bool QQnxInputContext::filterEvent( const QEvent *event )
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << event;
#endif
switch (event->type()) {
@@ -895,17 +895,17 @@ bool QBBInputContext::filterEvent( const QEvent *event )
}
}
-void QBBInputContext::reset()
+void QQnxInputContext::reset()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
endComposition();
}
-void QBBInputContext::update(Qt::InputMethodQueries queries)
+void QQnxInputContext::update(Qt::InputMethodQueries queries)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
reset();
@@ -913,9 +913,9 @@ void QBBInputContext::update(Qt::InputMethodQueries queries)
QPlatformInputContext::update(queries);
}
-void QBBInputContext::closeSession()
+void QQnxInputContext::closeSession()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO
#endif
if (!imfAvailable())
@@ -927,9 +927,9 @@ void QBBInputContext::closeSession()
}
}
-void QBBInputContext::openSession()
+void QQnxInputContext::openSession()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO
#endif
if (!imfAvailable())
@@ -939,12 +939,12 @@ void QBBInputContext::openSession()
sInputSession = p_ictrl_open_session(&ic_funcs);
}
-bool QBBInputContext::hasSession()
+bool QQnxInputContext::hasSession()
{
return sInputSession != 0;
}
-bool QBBInputContext::hasSelectedText()
+bool QQnxInputContext::hasSelectedText()
{
QInputPanel *panel = qApp->inputPanel();
QObject *input = panel->inputItem();
@@ -957,11 +957,11 @@ bool QBBInputContext::hasSelectedText()
return !query.value(Qt::ImCurrentSelection).toString().isEmpty();
}
-bool QBBInputContext::dispatchRequestSoftwareInputPanel()
+bool QQnxInputContext::dispatchRequestSoftwareInputPanel()
{
- QBBVirtualKeyboard::instance().showKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: requesting virtual keyboard";
+ QQnxVirtualKeyboard::instance().showKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: requesting virtual keyboard";
#endif
QInputPanel *panel = qApp->inputPanel();
QObject *input = panel->inputItem();
@@ -984,11 +984,11 @@ bool QBBInputContext::dispatchRequestSoftwareInputPanel()
return true;
}
-bool QBBInputContext::dispatchCloseSoftwareInputPanel()
+bool QQnxInputContext::dispatchCloseSoftwareInputPanel()
{
- QBBVirtualKeyboard::instance().hideKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: hiding virtual keyboard";
+ QQnxVirtualKeyboard::instance().hideKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: hiding virtual keyboard";
#endif
// This also means we are stopping composition, but we should already have done that.
@@ -998,9 +998,9 @@ bool QBBInputContext::dispatchCloseSoftwareInputPanel()
/**
* IMF Event Dispatchers.
*/
-bool QBBInputContext::dispatchFocusEvent(FocusEventId id, int hints)
+bool QQnxInputContext::dispatchFocusEvent(FocusEventId id, int hints)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1031,7 +1031,7 @@ bool QBBInputContext::dispatchFocusEvent(FocusEventId id, int hints)
return true;
}
-bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
+bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
{
if (!imfAvailable())
return false;
@@ -1110,7 +1110,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
navigation_event_t navEvent;
initEvent(&navEvent.event, sInputSession, EVENT_NAVIGATION, key);
navEvent.magnitude = 1;
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "dispatch navigation event " << key;
#endif
p_ictrl_dispatch_event(&navEvent.event);
@@ -1124,7 +1124,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
keyEvent.meta_key_state = 0;
p_ictrl_dispatch_event(&keyEvent.event);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "dispatch key event " << key;
#endif
}
@@ -1133,7 +1133,7 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
return true;
}
-void QBBInputContext::endComposition()
+void QQnxInputContext::endComposition()
{
if (!m_isComposing)
return;
@@ -1156,7 +1156,7 @@ void QBBInputContext::endComposition()
p_ictrl_dispatch_event(&actionEvent.event);
}
-void QBBInputContext::setComposingText(QString const& composingText)
+void QQnxInputContext::setComposingText(QString const& composingText)
{
m_composingText = composingText;
m_isComposing = true;
@@ -1176,12 +1176,12 @@ void QBBInputContext::setComposingText(QString const& composingText)
QCoreApplication::sendEvent(input, &event);
}
-int32_t QBBInputContext::processEvent(event_t *event)
+int32_t QQnxInputContext::processEvent(event_t *event)
{
int32_t result = -1;
switch (event->event_type) {
case EVENT_SPELL_CHECK: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_SPELL_CHECK";
#endif
result = 0;
@@ -1189,7 +1189,7 @@ int32_t QBBInputContext::processEvent(event_t *event)
}
case EVENT_NAVIGATION: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_NAVIGATION";
#endif
@@ -1198,20 +1198,20 @@ int32_t QBBInputContext::processEvent(event_t *event)
event->event_id == NAVIGATE_LEFT ? KEYCODE_LEFT :
event->event_id == NAVIGATE_RIGHT ? KEYCODE_RIGHT : 0;
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, key, 0, 0, 0);
- QBBEventThread::injectKeyboardEvent(KEY_CAP_VALID, key, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, key, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_CAP_VALID, key, 0, 0, 0);
result = 0;
break;
}
case EVENT_KEY: {
- #if defined(QBBINPUTCONTEXT_DEBUG)
+ #if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "EVENT_KEY";
#endif
key_event_t *kevent = static_cast<key_event_t *>(event);
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
- QBBEventThread::injectKeyboardEvent(KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
+ QQnxEventThread::injectKeyboardEvent(KEY_SYM_VALID | KEY_CAP_VALID, kevent->key_code, 0, 0, kevent->key_code);
result = 0;
break;
@@ -1239,9 +1239,9 @@ int32_t QBBInputContext::processEvent(event_t *event)
* IMF Event Handlers
*/
-int32_t QBBInputContext::onBeginBatchEdit(input_session_t *ic)
+int32_t QQnxInputContext::onBeginBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1252,10 +1252,10 @@ int32_t QBBInputContext::onBeginBatchEdit(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t states)
+int32_t QQnxInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t states)
{
Q_UNUSED(states);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1267,7 +1267,7 @@ int32_t QBBInputContext::onClearMetaKeyStates(input_session_t *ic, int32_t state
return 0;
}
-int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
+int32_t QQnxInputContext::onCommitText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
Q_UNUSED(new_cursor_position); // TODO: How can we set the cursor position it's not part of the API.
if (!isSessionOkay(ic))
@@ -1280,7 +1280,7 @@ int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *t
QString commitString = QString::fromWCharArray(text->str, text->length);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "Committing [" << commitString << "]";
#endif
@@ -1294,9 +1294,9 @@ int32_t QBBInputContext::onCommitText(input_session_t *ic, spannable_string_t *t
return 0;
}
-int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
+int32_t QQnxInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t left_length, int32_t right_length)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "L:" << left_length << " R:" << right_length;
#endif
@@ -1309,8 +1309,8 @@ int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t le
return 0;
if (hasSelectedText()) {
- QBBEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
- QBBEventThread::injectKeyboardEvent(KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_DOWN | KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
+ QQnxEventThread::injectKeyboardEvent(KEY_CAP_VALID, KEYCODE_DELETE, 0, 0, 0);
reset();
return 0;
}
@@ -1326,9 +1326,9 @@ int32_t QBBInputContext::onDeleteSurroundingText(input_session_t *ic, int32_t le
return 0;
}
-int32_t QBBInputContext::onEndBatchEdit(input_session_t *ic)
+int32_t QQnxInputContext::onEndBatchEdit(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1338,9 +1338,9 @@ int32_t QBBInputContext::onEndBatchEdit(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onFinishComposingText(input_session_t *ic)
+int32_t QQnxInputContext::onFinishComposingText(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1364,10 +1364,10 @@ int32_t QBBInputContext::onFinishComposingText(input_session_t *ic)
return 0;
}
-int32_t QBBInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
+int32_t QQnxInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_modes)
{
Q_UNUSED(req_modes);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1380,9 +1380,9 @@ int32_t QBBInputContext::onGetCursorCapsMode(input_session_t *ic, int32_t req_mo
return 0;
}
-int32_t QBBInputContext::onGetCursorPosition(input_session_t *ic)
+int32_t QQnxInputContext::onGetCursorPosition(input_session_t *ic)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1401,11 +1401,11 @@ int32_t QBBInputContext::onGetCursorPosition(input_session_t *ic)
return m_lastCaretPos;
}
-extracted_text_t *QBBInputContext::onGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
+extracted_text_t *QQnxInputContext::onGetExtractedText(input_session_t *ic, extracted_text_request_t *request, int32_t flags)
{
Q_UNUSED(flags);
Q_UNUSED(request);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1422,10 +1422,10 @@ extracted_text_t *QBBInputContext::onGetExtractedText(input_session_t *ic, extra
return et;
}
-spannable_string_t *QBBInputContext::onGetSelectedText(input_session_t *ic, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetSelectedText(input_session_t *ic, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1444,10 +1444,10 @@ spannable_string_t *QBBInputContext::onGetSelectedText(input_session_t *ic, int3
return toSpannableString(text);
}
-spannable_string_t *QBBInputContext::onGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetTextAfterCursor(input_session_t *ic, int32_t n, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1467,10 +1467,10 @@ spannable_string_t *QBBInputContext::onGetTextAfterCursor(input_session_t *ic, i
return toSpannableString(text.mid(m_lastCaretPos+1, n));
}
-spannable_string_t *QBBInputContext::onGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
+spannable_string_t *QQnxInputContext::onGetTextBeforeCursor(input_session_t *ic, int32_t n, int32_t flags)
{
Q_UNUSED(flags);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1494,10 +1494,10 @@ spannable_string_t *QBBInputContext::onGetTextBeforeCursor(input_session_t *ic,
}
}
-int32_t QBBInputContext::onPerformEditorAction(input_session_t *ic, int32_t editor_action)
+int32_t QQnxInputContext::onPerformEditorAction(input_session_t *ic, int32_t editor_action)
{
Q_UNUSED(editor_action);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1510,10 +1510,10 @@ int32_t QBBInputContext::onPerformEditorAction(input_session_t *ic, int32_t edit
return 0;
}
-int32_t QBBInputContext::onReportFullscreenMode(input_session_t *ic, int32_t enabled)
+int32_t QQnxInputContext::onReportFullscreenMode(input_session_t *ic, int32_t enabled)
{
Q_UNUSED(enabled);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1526,9 +1526,9 @@ int32_t QBBInputContext::onReportFullscreenMode(input_session_t *ic, int32_t ena
return 0;
}
-int32_t QBBInputContext::onSendEvent(input_session_t *ic, event_t *event)
+int32_t QQnxInputContext::onSendEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1538,9 +1538,9 @@ int32_t QBBInputContext::onSendEvent(input_session_t *ic, event_t *event)
return processEvent(event);
}
-int32_t QBBInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
+int32_t QQnxInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1550,9 +1550,9 @@ int32_t QBBInputContext::onSendAsyncEvent(input_session_t *ic, event_t *event)
return processEvent(event);
}
-int32_t QBBInputContext::onSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
+int32_t QQnxInputContext::onSetComposingRegion(input_session_t *ic, int32_t start, int32_t end)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1584,10 +1584,10 @@ int32_t QBBInputContext::onSetComposingRegion(input_session_t *ic, int32_t start
return 0;
}
-int32_t QBBInputContext::onSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
+int32_t QQnxInputContext::onSetComposingText(input_session_t *ic, spannable_string_t *text, int32_t new_cursor_position)
{
Q_UNUSED(new_cursor_position);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1607,11 +1607,11 @@ int32_t QBBInputContext::onSetComposingText(input_session_t *ic, spannable_strin
return 0;
}
-int32_t QBBInputContext::onSetSelection(input_session_t *ic, int32_t start, int32_t end)
+int32_t QQnxInputContext::onSetSelection(input_session_t *ic, int32_t start, int32_t end)
{
Q_UNUSED(start);
Q_UNUSED(end);
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
@@ -1624,35 +1624,35 @@ int32_t QBBInputContext::onSetSelection(input_session_t *ic, int32_t start, int3
return 0;
}
-void QBBInputContext::showInputPanel()
+void QQnxInputContext::showInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
dispatchRequestSoftwareInputPanel();
}
-void QBBInputContext::hideInputPanel()
+void QQnxInputContext::hideInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
dispatchCloseSoftwareInputPanel();
}
-bool QBBInputContext::isInputPanelVisible() const
+bool QQnxInputContext::isInputPanelVisible() const
{
return m_inputPanelVisible;
}
-QLocale QBBInputContext::locale() const
+QLocale QQnxInputContext::locale() const
{
return m_inputPanelLocale;
}
-void QBBInputContext::keyboardVisibilityChanged(bool visible)
+void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "visible=" << visible;
#endif
if (m_inputPanelVisible != visible) {
@@ -1661,9 +1661,9 @@ void QBBInputContext::keyboardVisibilityChanged(bool visible)
}
}
-void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
+void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "locale=" << locale;
#endif
if (m_inputPanelLocale != locale) {
@@ -1672,12 +1672,12 @@ void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
}
}
-void QBBInputContext::inputItemChanged()
+void QQnxInputContext::inputItemChanged()
{
QInputMethod *inputMethod = qApp->inputMethod();
QObject *inputItem = inputMethod->inputItem();
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "input item=" << inputItem;
#endif
@@ -1686,9 +1686,9 @@ void QBBInputContext::inputItemChanged()
hideInputPanel();
} else {
if (qobject_cast<QAbstractSpinBox*>(inputItem)) {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::NumPunc);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::NumPunc);
} else {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::Default);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::Default);
}
if (!m_inputPanelVisible)
showInputPanel();
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_imf.h b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
index 135ec02971..1fb55296a6 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_imf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINPUTCONTEXT_H
-#define QBBINPUTCONTEXT_H
+#ifndef QQNXINPUTCONTEXT_H
+#define QQNXINPUTCONTEXT_H
#include <QtGui/QPlatformInputContext>
@@ -53,12 +53,12 @@
QT_BEGIN_NAMESPACE
-class QBBInputContext : public QPlatformInputContext
+class QQnxInputContext : public QPlatformInputContext
{
Q_OBJECT
public:
- QBBInputContext();
- ~QBBInputContext();
+ QQnxInputContext();
+ ~QQnxInputContext();
virtual bool isValid() const;
@@ -129,4 +129,4 @@ Q_DECLARE_METATYPE(extracted_text_t*)
QT_END_NAMESPACE
-#endif // QBBINPUTCONTEXT_H
+#endif // QQNXINPUTCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
index abe84e2e53..33b6c0e6f3 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.cpp
@@ -39,19 +39,19 @@
**
****************************************************************************/
-#include "qbbinputcontext_noimf.h"
-#include "qbbvirtualkeyboard.h"
+#include "qqnxinputcontext_noimf.h"
+#include "qqnxvirtualkeyboard.h"
#include <QtCore/QDebug>
#include <QtGui/QGuiApplication>
#include <QtWidgets/QAbstractSpinBox>
-QBBInputContext::QBBInputContext() :
+QQnxInputContext::QQnxInputContext() :
QPlatformInputContext(),
m_inputPanelVisible(false),
m_inputPanelLocale(QLocale::c())
{
- QBBVirtualKeyboard &keyboard = QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard &keyboard = QQnxVirtualKeyboard::instance();
connect(&keyboard, SIGNAL(visibilityChanged(bool)), this, SLOT(keyboardVisibilityChanged(bool)));
connect(&keyboard, SIGNAL(localeChanged(QLocale)), this, SLOT(keyboardLocaleChanged(QLocale)));
keyboardVisibilityChanged(keyboard.isVisible());
@@ -61,42 +61,42 @@ QBBInputContext::QBBInputContext() :
connect(inputMethod, SIGNAL(inputItemChanged()), this, SLOT(inputItemChanged()));
}
-QBBInputContext::~QBBInputContext()
+QQnxInputContext::~QQnxInputContext()
{
}
-bool QBBInputContext::isValid() const
+bool QQnxInputContext::isValid() const
{
return true;
}
-bool QBBInputContext::hasPhysicalKeyboard()
+bool QQnxInputContext::hasPhysicalKeyboard()
{
// TODO: This should query the system to check if a USB keyboard is connected.
return false;
}
-void QBBInputContext::reset()
+void QQnxInputContext::reset()
{
}
-bool QBBInputContext::filterEvent( const QEvent *event )
+bool QQnxInputContext::filterEvent( const QEvent *event )
{
if (hasPhysicalKeyboard())
return false;
if (event->type() == QEvent::CloseSoftwareInputPanel) {
- QBBVirtualKeyboard::instance().hideKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: hiding virtual keyboard";
+ QQnxVirtualKeyboard::instance().hideKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: hiding virtual keyboard";
#endif
return false;
}
if (event->type() == QEvent::RequestSoftwareInputPanel) {
- QBBVirtualKeyboard::instance().showKeyboard();
-#if defined(QBBINPUTCONTEXT_DEBUG)
- qDebug() << "QBB: requesting virtual keyboard";
+ QQnxVirtualKeyboard::instance().showKeyboard();
+#if defined(QQNXINPUTCONTEXT_DEBUG)
+ qDebug() << "QQNX: requesting virtual keyboard";
#endif
return false;
}
@@ -105,7 +105,7 @@ bool QBBInputContext::filterEvent( const QEvent *event )
}
-bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
+bool QQnxInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap)
{
Q_UNUSED(flags);
Q_UNUSED(sym);
@@ -115,35 +115,35 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan,
return false;
}
-void QBBInputContext::showInputPanel()
+void QQnxInputContext::showInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QBBVirtualKeyboard::instance().showKeyboard();
+ QQnxVirtualKeyboard::instance().showKeyboard();
}
-void QBBInputContext::hideInputPanel()
+void QQnxInputContext::hideInputPanel()
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QBBVirtualKeyboard::instance().hideKeyboard();
+ QQnxVirtualKeyboard::instance().hideKeyboard();
}
-bool QBBInputContext::isInputPanelVisible() const
+bool QQnxInputContext::isInputPanelVisible() const
{
return m_inputPanelVisible;
}
-QLocale QBBInputContext::locale() const
+QLocale QQnxInputContext::locale() const
{
return m_inputPanelLocale;
}
-void QBBInputContext::keyboardVisibilityChanged(bool visible)
+void QQnxInputContext::keyboardVisibilityChanged(bool visible)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "visible=" << visible;
#endif
if (m_inputPanelVisible != visible) {
@@ -152,9 +152,9 @@ void QBBInputContext::keyboardVisibilityChanged(bool visible)
}
}
-void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
+void QQnxInputContext::keyboardLocaleChanged(const QLocale &locale)
{
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "locale=" << locale;
#endif
if (m_inputPanelLocale != locale) {
@@ -163,12 +163,12 @@ void QBBInputContext::keyboardLocaleChanged(const QLocale &locale)
}
}
-void QBBInputContext::inputItemChanged()
+void QQnxInputContext::inputItemChanged()
{
QInputMethod *inputMethod = qApp->inputMethod();
QObject *inputItem = inputMethod->inputItem();
-#if defined(QBBINPUTCONTEXT_DEBUG)
+#if defined(QQNXINPUTCONTEXT_DEBUG)
qDebug() << Q_FUNC_INFO << "input item=" << inputItem;
#endif
@@ -177,9 +177,9 @@ void QBBInputContext::inputItemChanged()
hideInputPanel();
} else {
if (qobject_cast<QAbstractSpinBox*>(inputItem)) {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::NumPunc);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::NumPunc);
} else {
- QBBVirtualKeyboard::instance().setKeyboardMode(QBBVirtualKeyboard::Default);
+ QQnxVirtualKeyboard::instance().setKeyboardMode(QQnxVirtualKeyboard::Default);
}
if (!m_inputPanelVisible)
showInputPanel();
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
index 3d4d6da830..33a4631d16 100644
--- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINPUTCONTEXT_H
-#define QBBINPUTCONTEXT_H
+#ifndef QQNXINPUTCONTEXT_H
+#define QQNXINPUTCONTEXT_H
#include <QtCore/QLocale>
#include <QtGui/QPlatformInputContext>
@@ -48,12 +48,12 @@
QT_BEGIN_NAMESPACE
-class QBBInputContext : public QPlatformInputContext
+class QQnxInputContext : public QPlatformInputContext
{
Q_OBJECT
public:
- explicit QBBInputContext();
- ~QBBInputContext();
+ explicit QQnxInputContext();
+ ~QQnxInputContext();
virtual bool isValid() const;
@@ -81,4 +81,4 @@ private:
QT_END_NAMESPACE
-#endif // QBBINPUTCONTEXT_H
+#endif // QQNXINPUTCONTEXT_H
diff --git a/src/plugins/platforms/blackberry/qbbintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 9f922a419e..2811661269 100644
--- a/src/plugins/platforms/blackberry/qbbintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#include "qbbintegration.h"
-#include "qbbeventthread.h"
-#include "qbbglbackingstore.h"
-#include "qbbglcontext.h"
-#include "qbbnavigatorthread.h"
-#include "qbbrasterbackingstore.h"
-#include "qbbscreen.h"
-#include "qbbwindow.h"
-#include "qbbvirtualkeyboard.h"
-#include "qbbclipboard.h"
-#include "qbbglcontext.h"
-
-#if defined(QBB_IMF)
-#include "qbbinputcontext_imf.h"
+#include "qqnxintegration.h"
+#include "qqnxeventthread.h"
+#include "qqnxglbackingstore.h"
+#include "qqnxglcontext.h"
+#include "qqnxnavigatorthread.h"
+#include "qqnxrasterbackingstore.h"
+#include "qqnxscreen.h"
+#include "qqnxwindow.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxclipboard.h"
+#include "qqnxglcontext.h"
+
+#if defined(QQnx_IMF)
+#include "qqnxinputcontext_imf.h"
#else
-#include "qbbinputcontext_noimf.h"
+#include "qqnxinputcontext_noimf.h"
#endif
#include "private/qgenericunixfontdatabase_p.h"
@@ -71,10 +71,10 @@
QT_BEGIN_NAMESPACE
-QBBWindowMapper QBBIntegration::ms_windowMapper;
-QMutex QBBIntegration::ms_windowMapperMutex;
+QQnxWindowMapper QQnxIntegration::ms_windowMapper;
+QMutex QQnxIntegration::ms_windowMapperMutex;
-QBBIntegration::QBBIntegration()
+QQnxIntegration::QQnxIntegration()
: QPlatformIntegration()
, m_eventThread(0)
, m_navigatorThread(0)
@@ -86,47 +86,47 @@ QBBIntegration::QBBIntegration()
, m_clipboard(0)
#endif
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Open connection to QNX composition manager
errno = 0;
int result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
if (result != 0) {
- qFatal("QBB: failed to connect to composition manager, errno=%d", errno);
+ qFatal("QQnx: failed to connect to composition manager, errno=%d", errno);
}
// Create displays for all possible screens (which may not be attached)
- QBBScreen::createDisplays(m_screenContext);
- Q_FOREACH (QPlatformScreen *screen, QBBScreen::screens()) {
+ QQnxScreen::createDisplays(m_screenContext);
+ Q_FOREACH (QPlatformScreen *screen, QQnxScreen::screens()) {
screenAdded(screen);
}
// Initialize global OpenGL resources
- QBBGLContext::initialize();
+ QQnxGLContext::initialize();
// Create/start event thread
- m_eventThread = new QBBEventThread(m_screenContext, *QBBScreen::primaryDisplay());
+ m_eventThread = new QQnxEventThread(m_screenContext, *QQnxScreen::primaryDisplay());
m_eventThread->start();
// Create/start navigator thread
- m_navigatorThread = new QBBNavigatorThread(*QBBScreen::primaryDisplay());
+ m_navigatorThread = new QQnxNavigatorThread(*QQnxScreen::primaryDisplay());
m_navigatorThread->start();
// Create/start the keyboard class.
- QBBVirtualKeyboard::instance();
+ QQnxVirtualKeyboard::instance();
// Set up the input context
- m_inputContext = new QBBInputContext;
+ m_inputContext = new QQnxInputContext;
}
-QBBIntegration::~QBBIntegration()
+QQnxIntegration::~QQnxIntegration()
{
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBB: platform plugin shutdown begin";
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnx: platform plugin shutdown begin";
#endif
// Destroy the keyboard class.
- QBBVirtualKeyboard::destroy();
+ QQnxVirtualKeyboard::destroy();
#ifndef QT_NO_CLIPBOARD
// Delete the clipboard
@@ -140,22 +140,22 @@ QBBIntegration::~QBBIntegration()
delete m_navigatorThread;
// Destroy all displays
- QBBScreen::destroyDisplays();
+ QQnxScreen::destroyDisplays();
// Close connection to QNX composition manager
screen_destroy_context(m_screenContext);
// Cleanup global OpenGL resources
- QBBGLContext::shutdown();
+ QQnxGLContext::shutdown();
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBB: platform plugin shutdown end";
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnx: platform plugin shutdown end";
#endif
}
-bool QBBIntegration::hasCapability(QPlatformIntegration::Capability cap) const
+bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
switch (cap) {
@@ -168,90 +168,90 @@ bool QBBIntegration::hasCapability(QPlatformIntegration::Capability cap) const
}
}
-QPlatformWindow *QBBIntegration::createPlatformWindow(QWindow *window) const
+QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// New windows are created on the primary display.
- return new QBBWindow(window, m_screenContext);
+ return new QQnxWindow(window, m_screenContext);
}
-QPlatformBackingStore *QBBIntegration::createPlatformBackingStore(QWindow *window) const
+QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *window) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (paintUsingOpenGL())
- return new QBBGLBackingStore(window);
+ return new QQnxGLBackingStore(window);
else
- return new QBBRasterBackingStore(window);
+ return new QQnxRasterBackingStore(window);
}
-QPlatformOpenGLContext *QBBIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
+QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- return new QBBGLContext(context);
+ return new QQnxGLContext(context);
}
-QPlatformInputContext *QBBIntegration::inputContext() const
+QPlatformInputContext *QQnxIntegration::inputContext() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return m_inputContext;
}
-void QBBIntegration::moveToScreen(QWindow *window, int screen)
+void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
-#if defined(QBBINTEGRATION_DEBUG)
- qDebug() << "QBBIntegration::moveToScreen - w=" << window << ", s=" << screen;
+#if defined(QQNXINTEGRATION_DEBUG)
+ qDebug() << "QQnxIntegration::moveToScreen - w=" << window << ", s=" << screen;
#endif
// get platform window used by widget
- QBBWindow *platformWindow = static_cast<QBBWindow *>(window->handle());
+ QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());
// lookup platform screen by index
- QBBScreen *platformScreen = static_cast<QBBScreen*>(QBBScreen::screens().at(screen));
+ QQnxScreen *platformScreen = static_cast<QQnxScreen*>(QQnxScreen::screens().at(screen));
// move the platform window to the platform screen
platformWindow->setScreen(platformScreen);
}
-QList<QPlatformScreen *> QBBIntegration::screens() const
+QList<QPlatformScreen *> QQnxIntegration::screens() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- return QBBScreen::screens();
+ return QQnxScreen::screens();
}
-QAbstractEventDispatcher *QBBIntegration::guiThreadEventDispatcher() const
+QAbstractEventDispatcher *QQnxIntegration::guiThreadEventDispatcher() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
return m_eventDispatcher;
}
#ifndef QT_NO_CLIPBOARD
-QPlatformClipboard *QBBIntegration::clipboard() const
+QPlatformClipboard *QQnxIntegration::clipboard() const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (!m_clipboard) {
- m_clipboard = new QBBClipboard;
+ m_clipboard = new QQnxClipboard;
}
return m_clipboard;
}
#endif
-QVariant QBBIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
+QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
if (hint == ShowIsFullScreen)
@@ -260,9 +260,9 @@ QVariant QBBIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
-QWindow *QBBIntegration::window(screen_window_t qnxWindow)
+QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
@@ -270,9 +270,9 @@ QWindow *QBBIntegration::window(screen_window_t qnxWindow)
return ms_windowMapper.value(qnxWindow, 0);
}
-void QBBIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
+void QQnxIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
@@ -280,9 +280,9 @@ void QBBIntegration::addWindow(screen_window_t qnxWindow, QWindow *window)
ms_windowMapper.insert(qnxWindow, window);
}
-void QBBIntegration::removeWindow(screen_window_t qnxWindow)
+void QQnxIntegration::removeWindow(screen_window_t qnxWindow)
{
-#if defined(QBBINTEGRATION_DEBUG)
+#if defined(QQNXINTEGRATION_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
QMutexLocker locker(&ms_windowMapperMutex);
diff --git a/src/plugins/platforms/blackberry/qbbintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 6b54329dac..51d06bd0e6 100644
--- a/src/plugins/platforms/blackberry/qbbintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBINTEGRATION_H
-#define QBBINTEGRATION_H
+#ifndef QQNXINTEGRATION_H
+#define QQNXINTEGRATION_H
#include <QtGui/qplatformintegration_qpa.h>
@@ -50,23 +50,23 @@
QT_BEGIN_NAMESPACE
-class QBBEventThread;
-class QBBInputContext;
-class QBBNavigatorThread;
-class QBBWindow;
+class QQnxEventThread;
+class QQnxInputContext;
+class QQnxNavigatorThread;
+class QQnxWindow;
#ifndef QT_NO_CLIPBOARD
-class QBBClipboard;
+class QQnxClipboard;
#endif
template<class K, class V> class QHash;
-typedef QHash<screen_window_t, QWindow *> QBBWindowMapper;
+typedef QHash<screen_window_t, QWindow *> QQnxWindowMapper;
-class QBBIntegration : public QPlatformIntegration
+class QQnxIntegration : public QPlatformIntegration
{
public:
- QBBIntegration();
- virtual ~QBBIntegration();
+ QQnxIntegration();
+ virtual ~QQnxIntegration();
virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
@@ -98,22 +98,22 @@ private:
static void removeWindow(screen_window_t qnxWindow);
screen_context_t m_screenContext;
- QBBEventThread *m_eventThread;
- QBBNavigatorThread *m_navigatorThread;
- QBBInputContext *m_inputContext;
+ QQnxEventThread *m_eventThread;
+ QQnxNavigatorThread *m_navigatorThread;
+ QQnxInputContext *m_inputContext;
QPlatformFontDatabase *m_fontDatabase;
bool m_paintUsingOpenGL;
QAbstractEventDispatcher *m_eventDispatcher;
#ifndef QT_NO_CLIPBOARD
- mutable QBBClipboard* m_clipboard;
+ mutable QQnxClipboard* m_clipboard;
#endif
- static QBBWindowMapper ms_windowMapper;
+ static QQnxWindowMapper ms_windowMapper;
static QMutex ms_windowMapperMutex;
- friend class QBBWindow;
+ friend class QQnxWindow;
};
QT_END_NAMESPACE
-#endif // QBBINTEGRATION_H
+#endif // QQNXINTEGRATION_H
diff --git a/src/plugins/platforms/blackberry/qbbkeytranslator.h b/src/plugins/platforms/qnx/qqnxkeytranslator.h
index fdc1220aba..46bdfacd97 100644
--- a/src/plugins/platforms/blackberry/qbbkeytranslator.h
+++ b/src/plugins/platforms/qnx/qqnxkeytranslator.h
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#ifndef QBBKEYTRANSLATOR_H
-#define QBBKEYTRANSLATOR_H
+#ifndef QQNXKEYTRANSLATOR_H
+#define QQNXKEYTRANSLATOR_H
#include <sys/keycodes.h>
-#if defined(QBBEVENTTHREAD_DEBUG)
+#if defined(QQNXEVENTTHREAD_DEBUG)
#include <QtCore/QDebug>
#endif
@@ -227,8 +227,8 @@ Qt::Key keyTranslator( int key )
// See keycodes.h for more, but these are all the basics. And printables are already included.
default:
-#if defined(QBBEVENTTHREAD_DEBUG)
- qDebug() << "QBB: unknown key for translation:" << key;
+#if defined(QQNXEVENTTHREAD_DEBUG)
+ qDebug() << "QQNX: unknown key for translation:" << key;
#endif
break;
}
@@ -266,4 +266,4 @@ bool isKeypadKey( int key )
QT_END_NAMESPACE
-#endif // QBBKEYTRANSLATOR_H
+#endif // QQNXKEYTRANSLATOR_H
diff --git a/src/plugins/platforms/blackberry/qbbnavigatorthread.cpp b/src/plugins/platforms/qnx/qqnxnavigatorthread.cpp
index 65cbb77d31..def4cb7eb1 100644
--- a/src/plugins/platforms/blackberry/qbbnavigatorthread.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatorthread.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbnavigatorthread.h"
-#include "qbbscreen.h"
+#include "qqnxnavigatorthread.h"
+#include "qqnxscreen.h"
#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
@@ -50,6 +50,7 @@
#include <QtCore/QDebug>
#include <QtCore/QList>
#include <QtCore/QSocketNotifier>
+#include <QtCore/private/qcore_unix_p.h>
#include <errno.h>
#include <fcntl.h>
@@ -60,14 +61,14 @@
static const char *navigatorControlPath = "/pps/services/navigator/control";
static const int ppsBufferSize = 4096;
-QBBNavigatorThread::QBBNavigatorThread(QBBScreen& primaryScreen)
+QQnxNavigatorThread::QQnxNavigatorThread(QQnxScreen& primaryScreen)
: m_primaryScreen(primaryScreen),
m_fd(-1),
m_readNotifier(0)
{
}
-QBBNavigatorThread::~QBBNavigatorThread()
+QQnxNavigatorThread::~QQnxNavigatorThread()
{
// block until thread terminates
shutdown();
@@ -75,17 +76,17 @@ QBBNavigatorThread::~QBBNavigatorThread()
delete m_readNotifier;
}
-void QBBNavigatorThread::run()
+void QQnxNavigatorThread::run()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread started";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread started";
#endif
// open connection to navigator
errno = 0;
m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) {
- qWarning("QBB: failed to open navigator pps, errno=%d", errno);
+ qWarning("QQNX: failed to open navigator pps, errno=%d", errno);
return;
}
@@ -98,15 +99,15 @@ void QBBNavigatorThread::run()
// close connection to navigator
close(m_fd);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread stopped";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread stopped";
#endif
}
-void QBBNavigatorThread::shutdown()
+void QQnxNavigatorThread::shutdown()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread shutdown begin";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread shutdown begin";
#endif
// signal thread to terminate
@@ -115,14 +116,14 @@ void QBBNavigatorThread::shutdown()
// block until thread terminates
wait();
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: navigator thread shutdown end";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: navigator thread shutdown end";
#endif
}
-void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
+void QQnxNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id)
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: data=" << ppsData;
#endif
@@ -131,7 +132,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
// validate pps object
if (lines.size() == 0 || lines.at(0) != "@control") {
- qFatal("QBB: unrecognized pps object, data=%s", ppsData.constData());
+ qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData());
}
// parse pps object attributes and extract values
@@ -140,7 +141,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
// tokenize current attribute
const QByteArray &attr = lines.at(i);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: attr=" << attr;
#endif
@@ -159,7 +160,7 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
QByteArray key = attr.left(firstColon);
QByteArray value = attr.mid(secondColon + 1);
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: key=" << key;
qDebug() << "PPS: val=" << value;
#endif
@@ -172,12 +173,12 @@ void QBBNavigatorThread::parsePPS(const QByteArray &ppsData, QByteArray &msg, QB
} else if (key == "id") {
id = value;
} else {
- qFatal("QBB: unrecognized pps attribute, attr=%s", key.constData());
+ qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData());
}
}
}
-void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat)
+void QQnxNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat)
{
// construct pps message
QByteArray ppsData = "res::";
@@ -190,7 +191,7 @@ void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, c
}
ppsData += "\n";
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS reply=" << ppsData;
#endif
@@ -198,13 +199,13 @@ void QBBNavigatorThread::replyPPS(const QByteArray &res, const QByteArray &id, c
errno = 0;
int bytes = write(m_fd, ppsData.constData(), ppsData.size());
if (bytes == -1) {
- qFatal("QBB: failed to write navigator pps, errno=%d", errno);
+ qFatal("QQNX: failed to write navigator pps, errno=%d", errno);
}
}
-void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
+void QQnxNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id)
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id;
#endif
@@ -212,7 +213,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
if (msg == "orientationCheck") {
// reply to navigator that (any) orientation is acceptable
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: orientation check, o=" << dat;
#endif
replyPPS(msg, id, "true");
@@ -220,7 +221,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "orientation") {
// update screen geometry and reply to navigator that we're ready
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: orientation, o=" << dat;
#endif
m_primaryScreen.setRotation( dat.toInt() );
@@ -230,7 +231,7 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "SWIPE_DOWN") {
// simulate menu key press
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: menu";
#endif
QWindow *w = QGuiApplication::focusWindow();
@@ -240,26 +241,26 @@ void QBBNavigatorThread::handleMessage(const QByteArray &msg, const QByteArray &
} else if (msg == "exit") {
// shutdown everything
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
qDebug() << "PPS: exit";
#endif
QCoreApplication::quit();
}
}
-void QBBNavigatorThread::readData()
+void QQnxNavigatorThread::readData()
{
-#if defined(QBBNAVIGATORTHREAD_DEBUG)
- qDebug() << "QBB: reading navigator data";
+#if defined(QQNXNAVIGATORTHREAD_DEBUG)
+ qDebug() << "QQNX: reading navigator data";
#endif
// allocate buffer for pps data
char buffer[ppsBufferSize];
// attempt to read pps data
errno = 0;
- int bytes = read(m_fd, buffer, ppsBufferSize - 1);
+ int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1);
if (bytes == -1) {
- qFatal("QBB: failed to read navigator pps, errno=%d", errno);
+ qFatal("QQNX: failed to read navigator pps, errno=%d", errno);
}
// check if pps data was received
diff --git a/src/plugins/platforms/blackberry/qbbnavigatorthread.h b/src/plugins/platforms/qnx/qqnxnavigatorthread.h
index fda24b0c67..40b217db73 100644
--- a/src/plugins/platforms/blackberry/qbbnavigatorthread.h
+++ b/src/plugins/platforms/qnx/qqnxnavigatorthread.h
@@ -39,22 +39,22 @@
**
****************************************************************************/
-#ifndef QBBNAVIGATORTHREAD_H
-#define QBBNAVIGATORTHREAD_H
+#ifndef QQNXNAVIGATORTHREAD_H
+#define QQNXNAVIGATORTHREAD_H
#include <QThread>
QT_BEGIN_NAMESPACE
-class QBBScreen;
+class QQnxScreen;
class QSocketNotifier;
-class QBBNavigatorThread : public QThread
+class QQnxNavigatorThread : public QThread
{
Q_OBJECT
public:
- QBBNavigatorThread(QBBScreen &primaryScreen);
- virtual ~QBBNavigatorThread();
+ QQnxNavigatorThread(QQnxScreen &primaryScreen);
+ virtual ~QQnxNavigatorThread();
protected:
virtual void run();
@@ -68,11 +68,11 @@ private:
void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat);
void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id);
- QBBScreen &m_primaryScreen;
+ QQnxScreen &m_primaryScreen;
int m_fd;
QSocketNotifier *m_readNotifier;
};
QT_END_NAMESPACE
-#endif // QBBNAVIGATORTHREAD_H
+#endif // QQNXNAVIGATORTHREAD_H
diff --git a/src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 405e09260f..1d0da240b3 100644
--- a/src/plugins/platforms/blackberry/qbbrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbrasterbackingstore.h"
-#include "qbbwindow.h"
+#include "qqnxrasterbackingstore.h"
+#include "qqnxwindow.h"
#include <QtCore/QDebug>
@@ -48,36 +48,36 @@
QT_BEGIN_NAMESPACE
-QBBRasterBackingStore::QBBRasterBackingStore(QWindow *window)
+QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window)
{
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::QBBRasterBackingStore - w=" << window;
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::QQnxRasterBackingStore - w=" << window;
#endif
// save platform window associated with widget
- m_platformWindow = static_cast<QBBWindow*>(window->handle());
+ m_platformWindow = static_cast<QQnxWindow*>(window->handle());
}
-QBBRasterBackingStore::~QBBRasterBackingStore()
+QQnxRasterBackingStore::~QQnxRasterBackingStore()
{
-#if defined(QBBRasterBackingStore_DEBUG)
- qDebug() << "QBBRasterBackingStore::~QBBRasterBackingStore - w=" << window();
+#if defined(QQnxRasterBackingStore_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::~QQnxRasterBackingStore - w=" << window();
#endif
}
-QPaintDevice *QBBRasterBackingStore::paintDevice()
+QPaintDevice *QQnxRasterBackingStore::paintDevice()
{
return m_platformWindow->renderBuffer().image();
}
-void QBBRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(window);
Q_UNUSED(offset);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::flush - w=" << this->window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::flush - w=" << this->window();
#endif
// visit all pending scroll operations
@@ -96,22 +96,22 @@ void QBBRasterBackingStore::flush(QWindow *window, const QRegion &region, const
m_platformWindow->post(region);
}
-void QBBRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
+void QQnxRasterBackingStore::resize(const QSize &size, const QRegion &staticContents)
{
Q_UNUSED(size);
Q_UNUSED(staticContents);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::resize - w=" << window() << ", s=" << size;
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::resize - w=" << window() << ", s=" << size;
#endif
// NOTE: defer resizing window buffers until next paint as
// resize() can be called multiple times before a paint occurs
}
-bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
+bool QQnxRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
{
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::scroll - w=" << window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::scroll - w=" << window();
#endif
// calculate entire region affected by scroll operation (src + dst)
@@ -130,7 +130,7 @@ bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
} else if (op.totalArea.intersects(totalArea)) {
// current scroll overlaps previous scroll but is
// not equal in area - just paint everything
- qWarning("QBB: pending scroll operations overlap but not equal");
+ qWarning("QQNX: pending scroll operations overlap but not equal");
return false;
}
}
@@ -140,12 +140,12 @@ bool QBBRasterBackingStore::scroll(const QRegion &area, int dx, int dy)
return true;
}
-void QBBRasterBackingStore::beginPaint(const QRegion &region)
+void QQnxRasterBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBRASTERBACKINGSTORE_DEBUG)
- qDebug() << "QBBRasterBackingStore::beginPaint - w=" << window();
+#if defined(QQNXRASTERBACKINGSTORE_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::beginPaint - w=" << window();
#endif
// resize window buffers if surface resized
@@ -155,11 +155,11 @@ void QBBRasterBackingStore::beginPaint(const QRegion &region)
}
}
-void QBBRasterBackingStore::endPaint(const QRegion &region)
+void QQnxRasterBackingStore::endPaint(const QRegion &region)
{
Q_UNUSED(region);
-#if defined(QBBRasterBackingStore_DEBUG)
- qDebug() << "QBBRasterBackingStore::endPaint - w=" << window();
+#if defined(QQnxRasterBackingStore_DEBUG)
+ qDebug() << "QQnxRasterBackingStore::endPaint - w=" << window();
#endif
}
diff --git a/src/plugins/platforms/blackberry/qbbrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index ca1e27bcc8..fec51a19b9 100644
--- a/src/plugins/platforms/blackberry/qbbrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBRASTERWINDOWSURFACE_H
-#define QBBRASTERWINDOWSURFACE_H
+#ifndef QQNXRASTERWINDOWSURFACE_H
+#define QQNXRASTERWINDOWSURFACE_H
#include <QtGui/qplatformbackingstore_qpa.h>
@@ -48,13 +48,13 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBRasterBackingStore : public QPlatformBackingStore
+class QQnxRasterBackingStore : public QPlatformBackingStore
{
public:
- QBBRasterBackingStore(QWindow *window);
- virtual ~QBBRasterBackingStore();
+ QQnxRasterBackingStore(QWindow *window);
+ virtual ~QQnxRasterBackingStore();
virtual QPaintDevice *paintDevice();
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
@@ -72,10 +72,10 @@ private:
int dy;
};
- QBBWindow *m_platformWindow;
+ QQnxWindow *m_platformWindow;
QList<ScrollOp> m_scrollOpList;
};
QT_END_NAMESPACE
-#endif // QBBRASTERWINDOWSURFACE_H
+#endif // QQNXRASTERWINDOWSURFACE_H
diff --git a/src/plugins/platforms/blackberry/qbbrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
index 831b0774f9..6f6b89a6d6 100644
--- a/src/plugins/platforms/blackberry/qbbrootwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
-#include "qbbrootwindow.h"
+#include "qqnxrootwindow.h"
-#include "qbbscreen.h"
+#include "qqnxscreen.h"
#include <QtCore/QUuid>
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
#include <QtCore/QDebug>
#endif
@@ -54,12 +54,12 @@
static const int MAGIC_ZORDER_FOR_NO_NAV = 10;
-QBBRootWindow::QBBRootWindow(QBBScreen *screen)
+QQnxRootWindow::QQnxRootWindow(QQnxScreen *screen)
: m_screen(screen),
m_window(0),
m_windowGroupName()
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Create one top-level QNX window to act as a container for child windows
@@ -68,7 +68,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
int result = screen_create_window(&m_window, m_screen->nativeContext());
int val[2];
if (result != 0) {
- qFatal("QBBRootWindow: failed to create window, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to create window, errno=%d", errno);
}
// Move window to proper display
@@ -76,7 +76,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
screen_display_t display = m_screen->nativeDisplay();
result = screen_set_window_property_pv(m_window, SCREEN_PROPERTY_DISPLAY, (void **)&display);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window display, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window display, errno=%d", errno);
}
// Make sure window is above navigator but below keyboard if running as root
@@ -86,7 +86,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = MAGIC_ZORDER_FOR_NO_NAV;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ZORDER, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window z-order, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window z-order, errno=%d", errno);
}
}
@@ -95,14 +95,14 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = SCREEN_USAGE_NATIVE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_USAGE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window buffer usage, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window buffer usage, errno=%d", errno);
}
errno = 0;
val[0] = m_screen->nativeFormat();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window pixel format, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window pixel format, errno=%d", errno);
}
errno = 0;
@@ -110,13 +110,13 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window buffer size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window buffer size, errno=%d", errno);
}
errno = 0;
result = screen_create_window_buffers(m_window, 1);
if (result != 0) {
- qFatal("QBB: failed to create window buffer, errno=%d", errno);
+ qFatal("QQNX: failed to create window buffer, errno=%d", errno);
}
// Window is always the size of the display
@@ -126,7 +126,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = geometry.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window size, errno=%d", errno);
}
// Fill the window with solid black
@@ -134,7 +134,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_COLOR, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window colour, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window colour, errno=%d", errno);
}
// Make the window opaque
@@ -142,7 +142,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = SCREEN_TRANSPARENCY_NONE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window transparency, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window transparency, errno=%d", errno);
}
// Set the swap interval to 1
@@ -150,7 +150,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[0] = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SWAP_INTERVAL, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window swap interval, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window swap interval, errno=%d", errno);
}
// Set viewport size equal to window size but move outside buffer so the fill colour is used exclusively
@@ -159,7 +159,7 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = geometry.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source size, errno=%d", errno);
}
errno = 0;
@@ -167,83 +167,83 @@ QBBRootWindow::QBBRootWindow(QBBScreen *screen)
val[1] = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_POSITION, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source position, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source position, errno=%d", errno);
}
createWindowGroup();
post();
}
-QBBRootWindow::~QBBRootWindow()
+QQnxRootWindow::~QQnxRootWindow()
{
// Cleanup top-level QNX window
screen_destroy_window(m_window);
}
-void QBBRootWindow::post() const
+void QQnxRootWindow::post() const
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
errno = 0;
screen_buffer_t buffer;
int result = screen_get_window_property_pv(m_window, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)&buffer);
if (result != 0) {
- qFatal("QBBRootWindow: failed to query window buffer, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to query window buffer, errno=%d", errno);
}
errno = 0;
int dirtyRect[] = {0, 0, 1, 1};
result = screen_post_window(m_window, buffer, 1, dirtyRect, 0);
if (result != 0) {
- qFatal("QBB: failed to post window buffer, errno=%d", errno);
+ qFatal("QQNX: failed to post window buffer, errno=%d", errno);
}
}
-void QBBRootWindow::flush() const
+void QQnxRootWindow::flush() const
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Force immediate display update
errno = 0;
int result = screen_flush_context(m_screen->nativeContext(), 0);
if (result != 0) {
- qFatal("QBBRootWindow: failed to flush context, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to flush context, errno=%d", errno);
}
}
-void QBBRootWindow::setRotation(int rotation)
+void QQnxRootWindow::setRotation(int rotation)
{
-#if defined(QBBROOTWINDOW_DEBUG)
+#if defined(QQNXROOTWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "angle =" << rotation;
#endif
errno = 0;
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ROTATION, &rotation);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window rotation, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window rotation, errno=%d", errno);
}
}
-void QBBRootWindow::resize(const QSize &size)
+void QQnxRootWindow::resize(const QSize &size)
{
errno = 0;
int val[] = {size.width(), size.height()};
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window size, errno=%d", errno);
}
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBRootWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to set window source size, errno=%d", errno);
}
// NOTE: display will update when child windows relayout and repaint
}
-void QBBRootWindow::createWindowGroup()
+void QQnxRootWindow::createWindowGroup()
{
// Generate a random window group name
m_windowGroupName = QUuid::createUuid().toString().toAscii();
@@ -252,6 +252,6 @@ void QBBRootWindow::createWindowGroup()
errno = 0;
int result = screen_create_window_group(m_window, m_windowGroupName.constData());
if (result != 0) {
- qFatal("QBBRootWindow: failed to create app window group, errno=%d", errno);
+ qFatal("QQnxRootWindow: failed to create app window group, errno=%d", errno);
}
}
diff --git a/src/plugins/platforms/blackberry/qbbrootwindow.h b/src/plugins/platforms/qnx/qqnxrootwindow.h
index 0b89f52a5e..80b10c65f0 100644
--- a/src/plugins/platforms/blackberry/qbbrootwindow.h
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QBBROOTWINDOW_H
-#define QBBROOTWINDOW_H
+#ifndef QQNXROOTWINDOW_H
+#define QQNXROOTWINDOW_H
#include <QtCore/QByteArray>
#include <QtCore/QRect>
@@ -49,13 +49,13 @@
QT_BEGIN_NAMESPACE
-class QBBScreen;
+class QQnxScreen;
-class QBBRootWindow
+class QQnxRootWindow
{
public:
- QBBRootWindow(QBBScreen *screen);
- ~QBBRootWindow();
+ QQnxRootWindow(QQnxScreen *screen);
+ ~QQnxRootWindow();
screen_window_t nativeHandle() const { return m_window; }
@@ -71,11 +71,11 @@ public:
private:
void createWindowGroup();
- QBBScreen *m_screen;
+ QQnxScreen *m_screen;
screen_window_t m_window;
QByteArray m_windowGroupName;
};
QT_END_NAMESPACE
-#endif // QBBROOTWINDOW_H
+#endif // QQNXROOTWINDOW_H
diff --git a/src/plugins/platforms/blackberry/qbbscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 11e40f6150..e0e3d6d57d 100644
--- a/src/plugins/platforms/blackberry/qbbscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qbbscreen.h"
-#include "qbbvirtualkeyboard.h"
-#include "qbbwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxwindow.h"
#include <QtCore/QDebug>
#include <QtCore/QUuid>
@@ -50,10 +50,10 @@
QT_BEGIN_NAMESPACE
-QList<QPlatformScreen *> QBBScreen::ms_screens;
-QList<QBBWindow*> QBBScreen::ms_childWindows;
+QList<QPlatformScreen *> QQnxScreen::ms_screens;
+QList<QQnxWindow*> QQnxScreen::ms_childWindows;
-QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
+QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
: m_screenContext(screenContext),
m_display(display),
m_rootWindow(),
@@ -61,7 +61,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
m_posted(false),
m_platformContext(0)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Cache initial orientation of this display
@@ -69,7 +69,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
errno = 0;
int result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_ROTATION, &m_initialRotation);
if (result != 0) {
- qFatal("QBBScreen: failed to query display rotation, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display rotation, errno=%d", errno);
}
m_currentRotation = m_initialRotation;
@@ -79,7 +79,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
int val[2];
result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBScreen: failed to query display size, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display size, errno=%d", errno);
}
m_currentGeometry = m_initialGeometry = QRect(0, 0, val[0], val[1]);
@@ -88,7 +88,7 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
errno = 0;
result = screen_get_display_property_iv(m_display, SCREEN_PROPERTY_PHYSICAL_SIZE, val);
if (result != 0) {
- qFatal("QBBScreen: failed to query display physical size, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display physical size, errno=%d", errno);
}
// Peg the DPI to 96 (for now) so fonts are a reasonable size. We'll want to match
@@ -104,20 +104,20 @@ QBBScreen::QBBScreen(screen_context_t screenContext, screen_display_t display, b
// We only create the root window if we are the primary display.
if (primaryScreen)
- m_rootWindow = QSharedPointer<QBBRootWindow>(new QBBRootWindow(this));
+ m_rootWindow = QSharedPointer<QQnxRootWindow>(new QQnxRootWindow(this));
}
-QBBScreen::~QBBScreen()
+QQnxScreen::~QQnxScreen()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
}
/* static */
-void QBBScreen::createDisplays(screen_context_t context)
+void QQnxScreen::createDisplays(screen_context_t context)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// Query number of displays
@@ -125,7 +125,7 @@ void QBBScreen::createDisplays(screen_context_t context)
int displayCount;
int result = screen_get_context_property_iv(context, SCREEN_PROPERTY_DISPLAY_COUNT, &displayCount);
if (result != 0) {
- qFatal("QBBScreen: failed to query display count, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query display count, errno=%d", errno);
}
// Get all displays
@@ -133,22 +133,22 @@ void QBBScreen::createDisplays(screen_context_t context)
screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount);
result = screen_get_context_property_pv(context, SCREEN_PROPERTY_DISPLAYS, (void **)displays);
if (result != 0) {
- qFatal("QBBScreen: failed to query displays, errno=%d", errno);
+ qFatal("QQnxScreen: failed to query displays, errno=%d", errno);
}
for (int i=0; i<displayCount; i++) {
-#if defined(QBBSCREEN_DEBUG)
- qDebug() << "QBBScreen::Creating screen for display " << i;
+#if defined(QQNXSCREEN_DEBUG)
+ qDebug() << "QQnxScreen::Creating screen for display " << i;
#endif
- QBBScreen *screen = new QBBScreen(context, displays[i], i==0);
+ QQnxScreen *screen = new QQnxScreen(context, displays[i], i==0);
ms_screens.append(screen);
}
}
/* static */
-void QBBScreen::destroyDisplays()
+void QQnxScreen::destroyDisplays()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
qDeleteAll(ms_screens);
@@ -159,16 +159,16 @@ void QBBScreen::destroyDisplays()
}
/* static */
-int QBBScreen::defaultDepth()
+int QQnxScreen::defaultDepth()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
static int defaultDepth = 0;
if (defaultDepth == 0) {
// check if display depth was specified in environment variable;
// use default value if no valid value found
- defaultDepth = qgetenv("QBB_DISPLAY_DEPTH").toInt();
+ defaultDepth = qgetenv("QQNX_DISPLAY_DEPTH").toInt();
if (defaultDepth != 16 && defaultDepth != 32) {
defaultDepth = 32;
}
@@ -176,13 +176,13 @@ int QBBScreen::defaultDepth()
return defaultDepth;
}
-QRect QBBScreen::availableGeometry() const
+QRect QQnxScreen::availableGeometry() const
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
// available geometry = total geometry - keyboard
- int keyboardHeight = QBBVirtualKeyboard::instance().height();
+ int keyboardHeight = QQnxVirtualKeyboard::instance().height();
return QRect(m_currentGeometry.x(), m_currentGeometry.y(),
m_currentGeometry.width(), m_currentGeometry.height() - keyboardHeight);
}
@@ -195,9 +195,9 @@ static bool isOrthogonal(int angle1, int angle2)
return ((angle1 - angle2) % 180) != 0;
}
-void QBBScreen::setRotation(int rotation)
+void QQnxScreen::setRotation(int rotation)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "orientation =" << rotation;
#endif
// Check if rotation changed
@@ -217,7 +217,7 @@ void QBBScreen::setRotation(int rotation)
// Resize root window if we've rotated 90 or 270 from previous orientation
if (isOrthogonal(m_currentRotation, rotation)) {
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size();
#endif
if (m_rootWindow)
@@ -234,9 +234,9 @@ void QBBScreen::setRotation(int rotation)
}
}
-void QBBScreen::addWindow(QBBWindow *window)
+void QQnxScreen::addWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
@@ -244,48 +244,48 @@ void QBBScreen::addWindow(QBBWindow *window)
return;
ms_childWindows.push_back(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::removeWindow(QBBWindow *window)
+void QQnxScreen::removeWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
ms_childWindows.removeAll(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::raiseWindow(QBBWindow *window)
+void QQnxScreen::raiseWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
removeWindow(window);
ms_childWindows.push_back(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::lowerWindow(QBBWindow *window)
+void QQnxScreen::lowerWindow(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window;
#endif
removeWindow(window);
ms_childWindows.push_front(window);
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
}
-void QBBScreen::updateHierarchy()
+void QQnxScreen::updateHierarchy()
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
int topZorder = 1; // root window is z-order 0, all "top" level windows are "above" it
for (it = ms_childWindows.begin(); it != ms_childWindows.end(); it++)
@@ -296,9 +296,9 @@ void QBBScreen::updateHierarchy()
screen_flush_context( primaryDisplay()->m_screenContext, 0 );
}
-void QBBScreen::onWindowPost(QBBWindow *window)
+void QQnxScreen::onWindowPost(QQnxWindow *window)
{
-#if defined(QBBSCREEN_DEBUG)
+#if defined(QQNXSCREEN_DEBUG)
qDebug() << Q_FUNC_INFO;
#endif
Q_UNUSED(window)
diff --git a/src/plugins/platforms/blackberry/qbbscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h
index 16606944d8..5749a66f5d 100644
--- a/src/plugins/platforms/blackberry/qbbscreen.h
+++ b/src/plugins/platforms/qnx/qqnxscreen.h
@@ -44,7 +44,7 @@
#include <QtGui/QPlatformScreen>
-#include "qbbrootwindow.h"
+#include "qqnxrootwindow.h"
#include <QtCore/QByteArray>
#include <QtCore/QScopedPointer>
@@ -53,15 +53,15 @@
QT_BEGIN_NAMESPACE
-class QBBWindow;
+class QQnxWindow;
-class QBBScreen : public QPlatformScreen
+class QQnxScreen : public QPlatformScreen
{
public:
static QList<QPlatformScreen *> screens() { return ms_screens; }
static void createDisplays(screen_context_t context);
static void destroyDisplays();
- static QBBScreen *primaryDisplay() { return static_cast<QBBScreen*>(ms_screens.at(0)); }
+ static QQnxScreen *primaryDisplay() { return static_cast<QQnxScreen*>(ms_screens.at(0)); }
static int defaultDepth();
virtual QRect geometry() const { return m_currentGeometry; }
@@ -81,25 +81,25 @@ public:
const char *windowGroupName() const { return m_rootWindow->groupName().constData(); }
/* Window hierarchy management */
- static void addWindow(QBBWindow *child);
- static void removeWindow(QBBWindow *child);
- static void raiseWindow(QBBWindow *window);
- static void lowerWindow(QBBWindow *window);
+ static void addWindow(QQnxWindow *child);
+ static void removeWindow(QQnxWindow *child);
+ static void raiseWindow(QQnxWindow *window);
+ static void lowerWindow(QQnxWindow *window);
static void updateHierarchy();
- void onWindowPost(QBBWindow *window);
+ void onWindowPost(QQnxWindow *window);
- QSharedPointer<QBBRootWindow> rootWindow() const { return m_rootWindow; }
+ QSharedPointer<QQnxRootWindow> rootWindow() const { return m_rootWindow; }
private:
- QBBScreen(screen_context_t context, screen_display_t display, bool primaryScreen);
- virtual ~QBBScreen();
+ QQnxScreen(screen_context_t context, screen_display_t display, bool primaryScreen);
+ virtual ~QQnxScreen();
static bool orthogonal(int rotation1, int rotation2);
screen_context_t m_screenContext;
screen_display_t m_display;
- QSharedPointer<QBBRootWindow> m_rootWindow;
+ QSharedPointer<QQnxRootWindow> m_rootWindow;
bool m_primaryScreen;
bool m_posted;
bool m_usingOpenGL;
@@ -113,7 +113,7 @@ private:
QPlatformOpenGLContext *m_platformContext;
static QList<QPlatformScreen *> ms_screens;
- static QList<QBBWindow *> ms_childWindows;
+ static QList<QQnxWindow *> ms_childWindows;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp
index 082ef9b19d..9d7fe92660 100644
--- a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qbbvirtualkeyboard.h"
-#include "qbbscreen.h"
+#include "qqnxvirtualkeyboard.h"
+#include "qqnxscreen.h"
#include <QtGui/QPlatformScreen>
#include <QtGui/QPlatformWindow>
@@ -57,15 +57,15 @@
#include <sys/types.h>
#include <unistd.h>
-const char *QBBVirtualKeyboard::ms_PPSPath = "/pps/services/input/control?wait";
-const size_t QBBVirtualKeyboard::ms_bufferSize = 2048;
+const char *QQnxVirtualKeyboard::ms_PPSPath = "/pps/services/input/control?wait";
+const size_t QQnxVirtualKeyboard::ms_bufferSize = 2048;
-static QBBVirtualKeyboard *s_instance = 0;
+static QQnxVirtualKeyboard *s_instance = 0;
// Huge hack for keyboard shadow (see QNX PR 88400). Should be removed ASAP.
#define KEYBOARD_SHADOW_HEIGHT 8
-QBBVirtualKeyboard::QBBVirtualKeyboard() :
+QQnxVirtualKeyboard::QQnxVirtualKeyboard() :
m_encoder(NULL),
m_decoder(NULL),
m_buffer(NULL),
@@ -78,16 +78,16 @@ QBBVirtualKeyboard::QBBVirtualKeyboard() :
connect();
}
-QBBVirtualKeyboard::~QBBVirtualKeyboard()
+QQnxVirtualKeyboard::~QQnxVirtualKeyboard()
{
close();
}
/* static */
-QBBVirtualKeyboard& QBBVirtualKeyboard::instance()
+QQnxVirtualKeyboard& QQnxVirtualKeyboard::instance()
{
if (!s_instance) {
- s_instance = new QBBVirtualKeyboard();
+ s_instance = new QQnxVirtualKeyboard();
s_instance->start();
}
@@ -95,7 +95,7 @@ QBBVirtualKeyboard& QBBVirtualKeyboard::instance()
}
/* static */
-void QBBVirtualKeyboard::destroy()
+void QQnxVirtualKeyboard::destroy()
{
if (s_instance) {
delete s_instance;
@@ -103,7 +103,7 @@ void QBBVirtualKeyboard::destroy()
}
}
-void QBBVirtualKeyboard::close()
+void QQnxVirtualKeyboard::close()
{
if (m_fd) {
// any reads will fail after we close the fd, which is basically what we want.
@@ -136,7 +136,7 @@ void QBBVirtualKeyboard::close()
m_buffer = NULL;
}
-bool QBBVirtualKeyboard::connect()
+bool QQnxVirtualKeyboard::connect()
{
close();
@@ -150,7 +150,7 @@ bool QBBVirtualKeyboard::connect()
m_fd = ::open(ms_PPSPath, O_RDWR);
if (m_fd == -1)
{
- qCritical("QBBVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
+ qCritical("QQnxVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
ms_PPSPath, strerror(errno), errno);
close();
return false;
@@ -158,7 +158,7 @@ bool QBBVirtualKeyboard::connect()
m_buffer = new char[ms_bufferSize];
if (!m_buffer) {
- qCritical("QBBVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
+ qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
return false;
}
@@ -170,7 +170,7 @@ bool QBBVirtualKeyboard::connect()
return true;
}
-bool QBBVirtualKeyboard::queryPPSInfo()
+bool QQnxVirtualKeyboard::queryPPSInfo()
{
// Request info, requires id to regenerate res message.
pps_encoder_add_string(m_encoder, "msg", "info");
@@ -186,44 +186,44 @@ bool QBBVirtualKeyboard::queryPPSInfo()
return true;
}
-void QBBVirtualKeyboard::notifyClientActiveStateChange(bool active)
+void QQnxVirtualKeyboard::notifyClientActiveStateChange(bool active)
{
if (!active)
hideKeyboard();
}
-void QBBVirtualKeyboard::run()
+void QQnxVirtualKeyboard::run()
{
ppsDataReady();
}
-void QBBVirtualKeyboard::ppsDataReady()
+void QQnxVirtualKeyboard::ppsDataReady()
{
while (1) {
ssize_t nread = read(m_fd, m_buffer, ms_bufferSize - 1);
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: keyboardMessage size: " << nread;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: keyboardMessage size: " << nread;
#endif
if (nread < 0)
break;
// nread is the real space necessary, not the amount read.
if (static_cast<size_t>(nread) > ms_bufferSize - 1) {
- qCritical("QBBVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);
+ qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1);
break;
}
m_buffer[nread] = 0;
pps_decoder_parse_pps_str(m_decoder, m_buffer);
pps_decoder_push(m_decoder, NULL);
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
pps_decoder_dump_tree(m_decoder, stderr);
#endif
const char *value;
if (pps_decoder_get_string(m_decoder, "error", &value) == PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]");
continue;
}
@@ -244,48 +244,48 @@ void QBBVirtualKeyboard::ppsDataReady()
handleKeyboardInfoMessage();
else if (strcmp(value, "connect") == 0) { }
else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]");
} else if (pps_decoder_get_string(m_decoder, "res", &value) == PPS_DECODER_OK) {
if (strcmp(value, "info") == 0)
handleKeyboardInfoMessage();
else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]");
} else
- qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS message type");
+ qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS message type");
}
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: exiting keyboard thread";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: exiting keyboard thread";
#endif
if (m_decoder)
pps_decoder_cleanup(m_decoder);
}
-void QBBVirtualKeyboard::handleKeyboardInfoMessage()
+void QQnxVirtualKeyboard::handleKeyboardInfoMessage()
{
int newHeight = 0;
const char *value;
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS dat object not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
return;
}
if (pps_decoder_get_int(m_decoder, "size", &newHeight) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS size field not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
return;
}
if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS locale object not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found");
return;
}
if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS languageId field not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found");
return;
}
const QString languageId = QString::fromLatin1(value);
if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) {
- qCritical("QBBVirtualKeyboard: Keyboard PPS size countryId not found");
+ qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found");
return;
}
const QString countryId = QString::fromLatin1(value);
@@ -304,16 +304,16 @@ void QBBVirtualKeyboard::handleKeyboardInfoMessage()
emit localeChanged(locale);
}
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: handleKeyboardInfoMessage size=" << m_height << "locale=" << m_locale;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: handleKeyboardInfoMessage size=" << m_height << "locale=" << m_locale;
#endif
}
-void QBBVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
+void QQnxVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: handleKeyboardStateChangeMessage " << visible;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: handleKeyboardStateChangeMessage " << visible;
#endif
updateAvailableScreenGeometry();
@@ -323,23 +323,23 @@ void QBBVirtualKeyboard::handleKeyboardStateChangeMessage(bool visible)
hideKeyboard();
}
-void QBBVirtualKeyboard::updateAvailableScreenGeometry()
+void QQnxVirtualKeyboard::updateAvailableScreenGeometry()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: updateAvailableScreenGeometry: keyboard visible=" << m_visible << ", keyboard height=" << m_height;
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: updateAvailableScreenGeometry: keyboard visible=" << m_visible << ", keyboard height=" << m_height;
#endif
// TODO: What screen index should be used? I assume primaryScreen here because it works, and
// we do it for handleScreenGeometryChange elsewhere but since we have support
// for more than one screen, that's not going to always work.
- QBBScreen *platformScreen = QBBScreen::primaryDisplay();
+ QQnxScreen *platformScreen = QQnxScreen::primaryDisplay();
QWindowSystemInterface::handleScreenAvailableGeometryChange(platformScreen->screen(), platformScreen->availableGeometry());
}
-bool QBBVirtualKeyboard::showKeyboard()
+bool QQnxVirtualKeyboard::showKeyboard()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: showKeyboard()";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: showKeyboard()";
#endif
// Try to connect.
@@ -367,10 +367,10 @@ bool QBBVirtualKeyboard::showKeyboard()
return true;
}
-bool QBBVirtualKeyboard::hideKeyboard()
+bool QQnxVirtualKeyboard::hideKeyboard()
{
-#ifdef QBBVIRTUALKEYBOARD_DEBUG
- qDebug() << "QBB: hideKeyboard()";
+#ifdef QQNXVIRTUALKEYBOARD_DEBUG
+ qDebug() << "QQNX: hideKeyboard()";
#endif
if (m_fd == -1 && !connect())
@@ -399,12 +399,12 @@ bool QBBVirtualKeyboard::hideKeyboard()
return true;
}
-void QBBVirtualKeyboard::setKeyboardMode(KeyboardMode mode)
+void QQnxVirtualKeyboard::setKeyboardMode(KeyboardMode mode)
{
m_keyboardMode = mode;
}
-void QBBVirtualKeyboard::applyKeyboardModeOptions()
+void QQnxVirtualKeyboard::applyKeyboardModeOptions()
{
// Try to connect.
if (m_fd == -1 && !connect())
@@ -451,49 +451,49 @@ void QBBVirtualKeyboard::applyKeyboardModeOptions()
pps_encoder_reset(m_encoder);
}
-void QBBVirtualKeyboard::addDefaultModeOptions()
+void QQnxVirtualKeyboard::addDefaultModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "default");
}
-void QBBVirtualKeyboard::addUrlModeOptions()
+void QQnxVirtualKeyboard::addUrlModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "url");
}
-void QBBVirtualKeyboard::addEmailModeOptions()
+void QQnxVirtualKeyboard::addEmailModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "email");
}
-void QBBVirtualKeyboard::addWebModeOptions()
+void QQnxVirtualKeyboard::addWebModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "web");
}
-void QBBVirtualKeyboard::addNumPuncModeOptions()
+void QQnxVirtualKeyboard::addNumPuncModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "numPunc");
}
-void QBBVirtualKeyboard::addPhoneModeOptions()
+void QQnxVirtualKeyboard::addPhoneModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "phone");
}
-void QBBVirtualKeyboard::addPinModeOptions()
+void QQnxVirtualKeyboard::addPinModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "pin");
}
-void QBBVirtualKeyboard::addSymbolModeOptions()
+void QQnxVirtualKeyboard::addSymbolModeOptions()
{
pps_encoder_add_string(m_encoder, "enter", "enter.default");
pps_encoder_add_string(m_encoder, "type", "symbol");
diff --git a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.h b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.h
index 14003ee897..21b2e8736c 100644
--- a/src/plugins/platforms/blackberry/qbbvirtualkeyboard.h
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboard.h
@@ -55,7 +55,7 @@
QT_BEGIN_NAMESPACE
/* Shamelessly copied from the browser - this should be rewritten once we have a proper PPS wrapper class */
-class QBBVirtualKeyboard : public QThread
+class QQnxVirtualKeyboard : public QThread
{
Q_OBJECT
public:
@@ -72,7 +72,7 @@ public:
//
enum KeyboardMode { Default, Url, Email, Web, NumPunc, Symbol, Phone, Pin };
- static QBBVirtualKeyboard& instance();
+ static QQnxVirtualKeyboard& instance();
static void destroy();
bool showKeyboard();
@@ -88,8 +88,8 @@ Q_SIGNALS:
void visibilityChanged(bool visible);
private:
- QBBVirtualKeyboard();
- virtual ~QBBVirtualKeyboard();
+ QQnxVirtualKeyboard();
+ virtual ~QQnxVirtualKeyboard();
// Will be called internally if needed.
bool connect();
diff --git a/src/plugins/platforms/blackberry/qbbwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index bc9f112b01..cf45d062bd 100644
--- a/src/plugins/platforms/blackberry/qbbwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#include "qbbwindow.h"
-#include "qbbglcontext.h"
-#include "qbbintegration.h"
-#include "qbbscreen.h"
+#include "qqnxwindow.h"
+#include "qqnxglcontext.h"
+#include "qqnxintegration.h"
+#include "qqnxscreen.h"
#include <QtGui/QWindow>
#include <QtGui/QWindowSystemInterface>
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
-QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
+QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
: QPlatformWindow(window),
m_screenContext(context),
m_window(0),
@@ -64,7 +64,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
m_parentWindow(0),
m_visible(true)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window << ", size =" << window->size();
#endif
int result;
@@ -73,7 +73,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
errno = 0;
result = screen_create_window_type(&m_window, m_screenContext, SCREEN_CHILD_WINDOW);
if (result != 0) {
- qFatal("QBBWindow: failed to create window, errno=%d", errno);
+ qFatal("QQnxWindow: failed to create window, errno=%d", errno);
}
// Set window buffer usage based on rendering API
@@ -87,14 +87,14 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_USAGE_OPENGL_ES2;
break;
default:
- qFatal("QBBWindow: unsupported window API");
+ qFatal("QQnxWindow: unsupported window API");
break;
}
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_USAGE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window buffer usage, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window buffer usage, errno=%d", errno);
}
// Alpha channel is always pre-multiplied if present
@@ -102,7 +102,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_PRE_MULTIPLIED_ALPHA;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ALPHA_MODE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window alpha mode, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window alpha mode, errno=%d", errno);
}
// Make the window opaque
@@ -110,7 +110,7 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = SCREEN_TRANSPARENCY_NONE;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_TRANSPARENCY, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window transparency, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window transparency, errno=%d", errno);
}
// Set the window swap interval
@@ -118,43 +118,43 @@ QBBWindow::QBBWindow(QWindow *window, screen_context_t context)
val = 1;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SWAP_INTERVAL, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window swap interval, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno);
}
// Assign the window to the primary display (this is the default specified by screen).
- setScreen(QBBScreen::primaryDisplay());
+ setScreen(QQnxScreen::primaryDisplay());
// Add the window to the root of the hierarchy
- QBBScreen::addWindow(this);
+ QQnxScreen::addWindow(this);
// Add window to plugin's window mapper
- QBBIntegration::addWindow(m_window, window);
+ QQnxIntegration::addWindow(m_window, window);
}
-QBBWindow::~QBBWindow()
+QQnxWindow::~QQnxWindow()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Remove from plugin's window mapper
- QBBIntegration::removeWindow(m_window);
+ QQnxIntegration::removeWindow(m_window);
// Remove from parent's Hierarchy.
removeFromParent();
- QBBScreen::updateHierarchy();
+ QQnxScreen::updateHierarchy();
// We shouldn't allow this case unless QT allows it. Does it? Or should we send the
// handleCloseEvent on all children when this window is deleted?
if (m_childWindows.size() > 0)
- qFatal("QBBWindow: window destroyed before children!");
+ qFatal("QQnxWindow: window destroyed before children!");
// Cleanup QNX window and its buffers
screen_destroy_window(m_window);
}
-void QBBWindow::setGeometry(const QRect &rect)
+void QQnxWindow::setGeometry(const QRect &rect)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << ", (" << rect.x() << "," << rect.y() << "," << rect.width() << "," << rect.height() << ")";
#endif
@@ -170,7 +170,7 @@ void QBBWindow::setGeometry(const QRect &rect)
val[1] = rect.y();
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window position, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window position, errno=%d", errno);
}
errno = 0;
@@ -178,14 +178,14 @@ void QBBWindow::setGeometry(const QRect &rect)
val[1] = rect.height();
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window size, errno=%d", errno);
}
// Set viewport size equal to window size
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SOURCE_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window source size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window source size, errno=%d", errno);
}
// Now move all children.
@@ -194,16 +194,16 @@ void QBBWindow::setGeometry(const QRect &rect)
offset = rect.topLeft();
offset -= oldGeometry.topLeft();
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->offset(offset);
}
}
}
-void QBBWindow::offset(const QPoint &offset)
+void QQnxWindow::offset(const QPoint &offset)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Move self and then children.
@@ -220,24 +220,24 @@ void QBBWindow::offset(const QPoint &offset)
val[1] = newGeometry.y();
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window position, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window position, errno=%d", errno);
}
- QList<QBBWindow*>::iterator it;
+ QList<QQnxWindow*>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->offset(offset);
}
}
-void QBBWindow::setVisible(bool visible)
+void QQnxWindow::setVisible(bool visible)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;
#endif
m_visible = visible;
- QBBWindow *root = this;
+ QQnxWindow *root = this;
while (root->m_parentWindow)
root = root->m_parentWindow;
@@ -246,9 +246,9 @@ void QBBWindow::setVisible(bool visible)
window()->requestActivateWindow();
}
-void QBBWindow::updateVisibility(bool parentVisible)
+void QQnxWindow::updateVisibility(bool parentVisible)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "parentVisible =" << parentVisible << "window =" << window();
#endif
// Set window visibility
@@ -256,18 +256,18 @@ void QBBWindow::updateVisibility(bool parentVisible)
int val = (m_visible && parentVisible) ? 1 : 0;
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window visibility, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window visibility, errno=%d", errno);
}
- QList<QBBWindow *>::iterator it;
+ QList<QQnxWindow *>::iterator it;
for (it = m_childWindows.begin(); it != m_childWindows.end(); it++) {
(*it)->updateVisibility(m_visible && parentVisible);
}
}
-void QBBWindow::setOpacity(qreal level)
+void QQnxWindow::setOpacity(qreal level)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "opacity =" << level;
#endif
// Set window global alpha
@@ -275,16 +275,16 @@ void QBBWindow::setOpacity(qreal level)
int val = (int)(level * 255);
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window global alpha, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window global alpha, errno=%d", errno);
}
// TODO: How to handle children of this window? If we change all the visibilities, then
// the transparency will look wrong...
}
-void QBBWindow::setBufferSize(const QSize &size)
+void QQnxWindow::setBufferSize(const QSize &size)
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window() << "size =" << size;
#endif
// Set window buffer size
@@ -292,7 +292,7 @@ void QBBWindow::setBufferSize(const QSize &size)
int val[2] = { size.width(), size.height() };
int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BUFFER_SIZE, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window buffer size, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window buffer size, errno=%d", errno);
}
// Create window buffers if they do not exist
@@ -308,13 +308,13 @@ void QBBWindow::setBufferSize(const QSize &size)
errno = 0;
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_FORMAT, val);
if (result != 0) {
- qFatal("QBBWindow: failed to set window pixel format, errno=%d", errno);
+ qFatal("QQnxWindow: failed to set window pixel format, errno=%d", errno);
}
errno = 0;
result = screen_create_window_buffers(m_window, MAX_BUFFER_COUNT);
if (result != 0) {
- qFatal("QBBWindow: failed to create window buffers, errno=%d", errno);
+ qFatal("QQnxWindow: failed to create window buffers, errno=%d", errno);
}
}
@@ -327,9 +327,9 @@ void QBBWindow::setBufferSize(const QSize &size)
m_scrolled = QRegion();
}
-QBBBuffer &QBBWindow::renderBuffer()
+QQnxBuffer &QQnxWindow::renderBuffer()
{
-#if defined(QBBWINDOW_DEBUG)
+#if defined(QQNXWINDOW_DEBUG)
qDebug() << Q_FUNC_INFO << "window =" << window();
#endif
// Check if render buffer is invalid
@@ -339,12 +339,12 @@ QBBBuffer &QBBWindow::renderBuffer()
screen_buffer_t buffers[MAX_BUFFER_COUNT];
int result = screen_get_window_property_pv(m_window, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)buffers);
if (result != 0) {
- qFatal("QBBWindow: failed to query window buffers, errno=%d", errno);
+ qFatal("QQnxWindow: failed to query window buffers, errno=%d", errno);
}
// Wrap each buffer
for (int i = 0; i < MAX_BUFFER_COUNT; ++i) {
- m_buffers[i] = QBBBuffer(buffers[i]);
+ m_buffers[i] = QQnxBuffer(buffers[i]);
}
// Use the first available render buffer
@@ -355,23 +355,23 @@ QBBBuffer &QBBWindow::renderBuffer()
return m_buffers[m_currentBufferIndex];
}
-void QBBWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
+void QQnxWindow::scroll(const QRegion &region, int dx, int dy, bool flush)
{
-#if define