summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp74
-rw-r--r--src/gui/accessible/qaccessible.h41
-rw-r--r--src/gui/accessible/qaccessible2.cpp4
-rw-r--r--src/gui/accessible/qaccessible2.h5
-rw-r--r--src/gui/accessible/qaccessiblebridge.cpp4
-rw-r--r--src/gui/accessible/qaccessiblebridge.h10
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp23
-rw-r--r--src/gui/accessible/qaccessibleobject.h6
-rw-r--r--src/gui/accessible/qaccessibleplugin.cpp4
-rw-r--r--src/gui/accessible/qaccessibleplugin.h7
-rw-r--r--src/gui/accessible/qplatformaccessibility_qpa.cpp28
-rw-r--r--src/gui/accessible/qplatformaccessibility_qpa.h7
-rw-r--r--src/gui/egl/egl.pri4
-rw-r--r--src/gui/egl/qegl.cpp4
-rw-r--r--src/gui/egl/qegl_p.h7
-rw-r--r--src/gui/egl/qegl_qpa.cpp4
-rw-r--r--src/gui/egl/qegl_stub.cpp298
-rw-r--r--src/gui/egl/qeglcontext_p.h4
-rw-r--r--src/gui/egl/qeglproperties.cpp4
-rw-r--r--src/gui/egl/qeglproperties_p.h4
-rw-r--r--src/gui/egl/qeglproperties_stub.cpp141
-rw-r--r--src/gui/image/image.pri9
-rw-r--r--src/gui/image/qbitmap.cpp4
-rw-r--r--src/gui/image/qbitmap.h5
-rw-r--r--src/gui/image/qbmphandler.cpp4
-rw-r--r--src/gui/image/qbmphandler_p.h4
-rw-r--r--src/gui/image/qgifhandler.cpp4
-rw-r--r--src/gui/image/qgifhandler_p.h4
-rw-r--r--src/gui/image/qimage.cpp73
-rw-r--r--src/gui/image/qimage.h27
-rw-r--r--src/gui/image/qimage_neon.cpp4
-rw-r--r--src/gui/image/qimage_p.h9
-rw-r--r--src/gui/image/qimage_sse2.cpp4
-rw-r--r--src/gui/image/qimage_ssse3.cpp4
-rw-r--r--src/gui/image/qimageiohandler.cpp4
-rw-r--r--src/gui/image/qimageiohandler.h7
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp4
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks_p.h4
-rw-r--r--src/gui/image/qimagereader.cpp51
-rw-r--r--src/gui/image/qimagereader.h5
-rw-r--r--src/gui/image/qimagewriter.cpp28
-rw-r--r--src/gui/image/qimagewriter.h5
-rw-r--r--src/gui/image/qjpeghandler.cpp4
-rw-r--r--src/gui/image/qjpeghandler_p.h4
-rw-r--r--src/gui/image/qmnghandler.cpp497
-rw-r--r--src/gui/image/qmnghandler.pri10
-rw-r--r--src/gui/image/qmnghandler_p.h83
-rw-r--r--src/gui/image/qmovie.cpp4
-rw-r--r--src/gui/image/qmovie.h5
-rw-r--r--src/gui/image/qnativeimage.cpp4
-rw-r--r--src/gui/image/qnativeimage_p.h4
-rw-r--r--src/gui/image/qpaintengine_pic.cpp4
-rw-r--r--src/gui/image/qpaintengine_pic_p.h4
-rw-r--r--src/gui/image/qpicture.cpp20
-rw-r--r--src/gui/image/qpicture.h5
-rw-r--r--src/gui/image/qpicture_p.h4
-rw-r--r--src/gui/image/qpictureformatplugin.cpp4
-rw-r--r--src/gui/image/qpictureformatplugin.h7
-rw-r--r--src/gui/image/qpixmap.cpp13
-rw-r--r--src/gui/image/qpixmap.h7
-rw-r--r--src/gui/image/qpixmap_blitter.cpp4
-rw-r--r--src/gui/image/qpixmap_blitter_p.h4
-rw-r--r--src/gui/image/qpixmap_qpa.cpp4
-rw-r--r--src/gui/image/qpixmap_raster.cpp4
-rw-r--r--src/gui/image/qpixmap_raster_p.h4
-rw-r--r--src/gui/image/qpixmap_win.cpp6
-rw-r--r--src/gui/image/qpixmapcache.cpp4
-rw-r--r--src/gui/image/qpixmapcache.h5
-rw-r--r--src/gui/image/qpixmapcache_p.h4
-rw-r--r--src/gui/image/qplatformpixmap.cpp6
-rw-r--r--src/gui/image/qplatformpixmap_qpa.h5
-rw-r--r--src/gui/image/qpnghandler.cpp4
-rw-r--r--src/gui/image/qpnghandler_p.h4
-rw-r--r--src/gui/image/qppmhandler.cpp4
-rw-r--r--src/gui/image/qppmhandler_p.h4
-rw-r--r--src/gui/image/qtiffhandler.cpp668
-rw-r--r--src/gui/image/qtiffhandler.pri10
-rw-r--r--src/gui/image/qvolatileimage.cpp4
-rw-r--r--src/gui/image/qvolatileimage_p.h4
-rw-r--r--src/gui/image/qvolatileimagedata.cpp4
-rw-r--r--src/gui/image/qvolatileimagedata_p.h4
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp474
-rw-r--r--src/gui/image/qxbmhandler.cpp4
-rw-r--r--src/gui/image/qxbmhandler_p.h4
-rw-r--r--src/gui/image/qxpmhandler.cpp4
-rw-r--r--src/gui/image/qxpmhandler_p.h4
-rw-r--r--src/gui/kernel/kernel.pri28
-rw-r--r--src/gui/kernel/qclipboard.cpp4
-rw-r--r--src/gui/kernel/qclipboard.h5
-rw-r--r--src/gui/kernel/qclipboard_qpa.cpp4
-rw-r--r--src/gui/kernel/qcursor.cpp4
-rw-r--r--src/gui/kernel/qcursor.h5
-rw-r--r--src/gui/kernel/qcursor_p.h4
-rw-r--r--src/gui/kernel/qcursor_qpa.cpp4
-rw-r--r--src/gui/kernel/qdnd.cpp4
-rw-r--r--src/gui/kernel/qdnd_p.h4
-rw-r--r--src/gui/kernel/qdrag.cpp4
-rw-r--r--src/gui/kernel/qdrag.h5
-rw-r--r--src/gui/kernel/qevent.cpp22
-rw-r--r--src/gui/kernel/qevent.h45
-rw-r--r--src/gui/kernel/qevent_p.h4
-rw-r--r--src/gui/kernel/qgenericplugin_qpa.cpp4
-rw-r--r--src/gui/kernel/qgenericplugin_qpa.h7
-rw-r--r--src/gui/kernel/qgenericpluginfactory_qpa.cpp4
-rw-r--r--src/gui/kernel/qgenericpluginfactory_qpa.h5
-rw-r--r--src/gui/kernel/qguiapplication.cpp176
-rw-r--r--src/gui/kernel/qguiapplication.h16
-rw-r--r--src/gui/kernel/qguiapplication_p.h14
-rw-r--r--src/gui/kernel/qguivariant.cpp38
-rw-r--r--src/gui/kernel/qinputmethod.cpp (renamed from src/gui/kernel/qinputpanel.cpp)141
-rw-r--r--src/gui/kernel/qinputmethod.h134
-rw-r--r--src/gui/kernel/qinputmethod_p.h (renamed from src/gui/image/qtiffhandler_p.h)63
-rw-r--r--src/gui/kernel/qinputpanel.h85
-rw-r--r--src/gui/kernel/qinputpanel_p.h33
-rw-r--r--src/gui/kernel/qkeymapper.cpp4
-rw-r--r--src/gui/kernel/qkeymapper_p.h4
-rw-r--r--src/gui/kernel/qkeymapper_qpa.cpp4
-rw-r--r--src/gui/kernel/qkeysequence.cpp208
-rw-r--r--src/gui/kernel/qkeysequence.h14
-rw-r--r--src/gui/kernel/qkeysequence_p.h4
-rw-r--r--src/gui/kernel/qopenglcontext.cpp88
-rw-r--r--src/gui/kernel/qopenglcontext.h19
-rw-r--r--src/gui/kernel/qopenglcontext_p.h28
-rw-r--r--src/gui/kernel/qpalette.cpp4
-rw-r--r--src/gui/kernel/qpalette.h5
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.h5
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.h5
-rw-r--r--src/gui/kernel/qplatformdialoghelper_qpa.cpp556
-rw-r--r--src/gui/kernel/qplatformdialoghelper_qpa.h314
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.h5
-rw-r--r--src/gui/kernel/qplatforminputcontext_qpa.cpp32
-rw-r--r--src/gui/kernel/qplatforminputcontext_qpa.h5
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp36
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.h13
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_qpa_p.h5
-rw-r--r--src/gui/kernel/qplatformintegrationplugin_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformintegrationplugin_qpa.h5
-rw-r--r--src/gui/kernel/qplatformnativeinterface_qpa.cpp51
-rw-r--r--src/gui/kernel/qplatformnativeinterface_qpa.h8
-rw-r--r--src/gui/kernel/qplatformopenglcontext_qpa.cpp16
-rw-r--r--src/gui/kernel/qplatformopenglcontext_qpa.h8
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp33
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.h8
-rw-r--r--src/gui/kernel/qplatformscreen_qpa_p.h4
-rw-r--r--src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp212
-rw-r--r--src/gui/kernel/qplatformsharedgraphicscache_qpa.h97
-rw-r--r--src/gui/kernel/qplatformsurface_qpa.cpp8
-rw-r--r--src/gui/kernel/qplatformsurface_qpa.h11
-rw-r--r--src/gui/kernel/qplatformtheme_qpa.cpp12
-rw-r--r--src/gui/kernel/qplatformtheme_qpa.h16
-rw-r--r--src/gui/kernel/qplatformthemefactory_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformthemefactory_qpa_p.h5
-rw-r--r--src/gui/kernel/qplatformthemeplugin_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformthemeplugin_qpa.h5
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp35
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.h8
-rw-r--r--src/gui/kernel/qscreen.cpp117
-rw-r--r--src/gui/kernel/qscreen.h23
-rw-r--r--src/gui/kernel/qscreen_p.h13
-rw-r--r--src/gui/kernel/qsessionmanager.h5
-rw-r--r--src/gui/kernel/qsessionmanager_qpa.cpp4
-rw-r--r--src/gui/kernel/qshortcutmap.cpp4
-rw-r--r--src/gui/kernel/qshortcutmap_p.h4
-rw-r--r--src/gui/kernel/qstylehints.cpp4
-rw-r--r--src/gui/kernel/qstylehints.h5
-rw-r--r--src/gui/kernel/qsurface.cpp51
-rw-r--r--src/gui/kernel/qsurface.h30
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp4
-rw-r--r--src/gui/kernel/qsurfaceformat.h5
-rw-r--r--src/gui/kernel/qt_gui_pch.h4
-rw-r--r--src/gui/kernel/qtouchdevice.cpp14
-rw-r--r--src/gui/kernel/qtouchdevice.h5
-rw-r--r--src/gui/kernel/qtouchdevice_p.h5
-rw-r--r--src/gui/kernel/qwindow.cpp173
-rw-r--r--src/gui/kernel/qwindow.h21
-rw-r--r--src/gui/kernel/qwindow_p.h11
-rw-r--r--src/gui/kernel/qwindowdefs.h5
-rw-r--r--src/gui/kernel/qwindowdefs_win.h5
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp28
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.h7
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h5
-rw-r--r--src/gui/math3d/qgenericmatrix.cpp4
-rw-r--r--src/gui/math3d/qgenericmatrix.h5
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp4
-rw-r--r--src/gui/math3d/qmatrix4x4.h7
-rw-r--r--src/gui/math3d/qquaternion.cpp4
-rw-r--r--src/gui/math3d/qquaternion.h5
-rw-r--r--src/gui/math3d/qvector2d.cpp4
-rw-r--r--src/gui/math3d/qvector2d.h5
-rw-r--r--src/gui/math3d/qvector3d.cpp4
-rw-r--r--src/gui/math3d/qvector3d.h5
-rw-r--r--src/gui/math3d/qvector4d.cpp4
-rw-r--r--src/gui/math3d/qvector4d.h5
-rw-r--r--src/gui/opengl/opengl.pri78
-rw-r--r--src/gui/opengl/qopengl.cpp4
-rw-r--r--src/gui/opengl/qopengl.h9
-rw-r--r--src/gui/opengl/qopengl2pexvertexarray.cpp4
-rw-r--r--src/gui/opengl/qopengl2pexvertexarray_p.h4
-rw-r--r--src/gui/opengl/qopengl_p.h4
-rw-r--r--src/gui/opengl/qopenglbuffer.cpp4
-rw-r--r--src/gui/opengl/qopenglbuffer.h9
-rw-r--r--src/gui/opengl/qopenglcustomshaderstage.cpp4
-rw-r--r--src/gui/opengl/qopenglcustomshaderstage_p.h5
-rw-r--r--src/gui/opengl/qopenglengineshadermanager.cpp4
-rw-r--r--src/gui/opengl/qopenglengineshadermanager_p.h5
-rw-r--r--src/gui/opengl/qopenglengineshadersource_p.h5
-rw-r--r--src/gui/opengl/qopenglextensions_p.h5
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp46
-rw-r--r--src/gui/opengl/qopenglframebufferobject.h10
-rw-r--r--src/gui/opengl/qopenglframebufferobject_p.h4
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp7
-rw-r--r--src/gui/opengl/qopenglfunctions.h11
-rw-r--r--src/gui/opengl/qopenglgradientcache.cpp4
-rw-r--r--src/gui/opengl/qopenglgradientcache_p.h4
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp4
-rw-r--r--src/gui/opengl/qopenglpaintdevice.h9
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp6
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h4
-rw-r--r--src/gui/opengl/qopenglshadercache_meego_p.h5
-rw-r--r--src/gui/opengl/qopenglshadercache_p.h5
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp4
-rw-r--r--src/gui/opengl/qopenglshaderprogram.h9
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp4
-rw-r--r--src/gui/opengl/qopengltexturecache_p.h4
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp4
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h4
-rw-r--r--src/gui/opengl/qopengltriangulatingstroker.cpp4
-rw-r--r--src/gui/opengl/qopengltriangulatingstroker_p.h6
-rw-r--r--src/gui/opengl/qrbtree_p.h4
-rw-r--r--src/gui/opengl/qtriangulator.cpp4
-rw-r--r--src/gui/opengl/qtriangulator_p.h4
-rw-r--r--src/gui/painting/painting.pri13
-rw-r--r--src/gui/painting/qbackingstore.cpp4
-rw-r--r--src/gui/painting/qbackingstore.h5
-rw-r--r--src/gui/painting/qbezier.cpp4
-rw-r--r--src/gui/painting/qbezier_p.h4
-rw-r--r--src/gui/painting/qblendfunctions.cpp4
-rw-r--r--src/gui/painting/qblendfunctions_p.h4
-rw-r--r--src/gui/painting/qblittable.cpp4
-rw-r--r--src/gui/painting/qblittable_p.h4
-rw-r--r--src/gui/painting/qbrush.cpp4
-rw-r--r--src/gui/painting/qbrush.h5
-rw-r--r--src/gui/painting/qcolor.cpp4
-rw-r--r--src/gui/painting/qcolor.h5
-rw-r--r--src/gui/painting/qcolor_p.cpp4
-rw-r--r--src/gui/painting/qcolor_p.h4
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp4
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h5
-rw-r--r--src/gui/painting/qcssutil.cpp4
-rw-r--r--src/gui/painting/qcssutil_p.h4
-rw-r--r--src/gui/painting/qdatabuffer_p.h4
-rw-r--r--src/gui/painting/qdrawhelper.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd.cpp115
-rw-r--r--src/gui/painting/qdrawhelper_arm_simd_p.h76
-rw-r--r--src/gui/painting/qdrawhelper_iwmmxt.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_mmx.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_mmx3dnow.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_mmx_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_neon_asm.S4
-rw-r--r--src/gui/painting/qdrawhelper_neon_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_sse.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_sse3dnow.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_sse_p.h4
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_x86_p.h4
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h4
-rw-r--r--src/gui/painting/qemulationpaintengine.cpp4
-rw-r--r--src/gui/painting/qemulationpaintengine_p.h5
-rw-r--r--src/gui/painting/qfixed_p.h4
-rw-r--r--src/gui/painting/qgrayraster.c4
-rw-r--r--src/gui/painting/qgrayraster_p.h4
-rw-r--r--src/gui/painting/qimagescale.cpp4
-rw-r--r--src/gui/painting/qimagescale_p.h4
-rw-r--r--src/gui/painting/qmath_p.h4
-rw-r--r--src/gui/painting/qmatrix.cpp13
-rw-r--r--src/gui/painting/qmatrix.h8
-rw-r--r--src/gui/painting/qmemrotate.cpp4
-rw-r--r--src/gui/painting/qmemrotate_p.h4
-rw-r--r--src/gui/painting/qoutlinemapper.cpp4
-rw-r--r--src/gui/painting/qoutlinemapper_p.h4
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp4
-rw-r--r--src/gui/painting/qpagedpaintdevice.h5
-rw-r--r--src/gui/painting/qpagedpaintdevice_p.h4
-rw-r--r--src/gui/painting/qpaintbuffer.cpp4
-rw-r--r--src/gui/painting/qpaintbuffer_p.h4
-rw-r--r--src/gui/painting/qpaintdevice.cpp4
-rw-r--r--src/gui/painting/qpaintdevice.h5
-rw-r--r--src/gui/painting/qpaintdevice.qdoc4
-rw-r--r--src/gui/painting/qpaintdevice_qpa.cpp4
-rw-r--r--src/gui/painting/qpaintengine.cpp4
-rw-r--r--src/gui/painting/qpaintengine.h5
-rw-r--r--src/gui/painting/qpaintengine_blitter.cpp4
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h4
-rw-r--r--src/gui/painting/qpaintengine_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp20
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h4
-rw-r--r--src/gui/painting/qpaintengineex.cpp4
-rw-r--r--src/gui/painting/qpaintengineex_p.h5
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qpainter.h5
-rw-r--r--src/gui/painting/qpainter_p.h4
-rw-r--r--src/gui/painting/qpainterpath.cpp4
-rw-r--r--src/gui/painting/qpainterpath.h5
-rw-r--r--src/gui/painting/qpainterpath_p.h4
-rw-r--r--src/gui/painting/qpathclipper.cpp4
-rw-r--r--src/gui/painting/qpathclipper_p.h5
-rw-r--r--src/gui/painting/qpdf.cpp4
-rw-r--r--src/gui/painting/qpdf_p.h4
-rw-r--r--src/gui/painting/qpdfwriter.cpp4
-rw-r--r--src/gui/painting/qpdfwriter.h5
-rw-r--r--src/gui/painting/qpen.cpp4
-rw-r--r--src/gui/painting/qpen.h5
-rw-r--r--src/gui/painting/qpen_p.h4
-rw-r--r--src/gui/painting/qplatformbackingstore_qpa.cpp4
-rw-r--r--src/gui/painting/qplatformbackingstore_qpa.h5
-rw-r--r--src/gui/painting/qpolygon.cpp4
-rw-r--r--src/gui/painting/qpolygon.h5
-rw-r--r--src/gui/painting/qpolygonclipper_p.h4
-rw-r--r--src/gui/painting/qrasterdefs_p.h4
-rw-r--r--src/gui/painting/qrasterizer.cpp4
-rw-r--r--src/gui/painting/qrasterizer_p.h4
-rw-r--r--src/gui/painting/qregion.cpp21
-rw-r--r--src/gui/painting/qregion.h37
-rw-r--r--src/gui/painting/qrgb.h5
-rw-r--r--src/gui/painting/qstroker.cpp4
-rw-r--r--src/gui/painting/qstroker_p.h4
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp16
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h6
-rw-r--r--src/gui/painting/qtransform.cpp4
-rw-r--r--src/gui/painting/qtransform.h5
-rw-r--r--src/gui/painting/qvectorpath_p.h5
-rw-r--r--src/gui/text/qabstractfontengine_p.h4
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.cpp4
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h8
-rw-r--r--src/gui/text/qabstracttextdocumentlayout_p.h4
-rw-r--r--src/gui/text/qcssparser.cpp4
-rw-r--r--src/gui/text/qcssparser_p.h4
-rw-r--r--src/gui/text/qcssscanner.cpp4
-rw-r--r--src/gui/text/qfont.cpp6
-rw-r--r--src/gui/text/qfont.h5
-rw-r--r--src/gui/text/qfont_p.h4
-rw-r--r--src/gui/text/qfont_qpa.cpp4
-rw-r--r--src/gui/text/qfontdatabase.cpp17
-rw-r--r--src/gui/text/qfontdatabase.h6
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp4
-rw-r--r--src/gui/text/qfontengine.cpp12
-rw-r--r--src/gui/text/qfontengine_ft.cpp15
-rw-r--r--src/gui/text/qfontengine_ft_p.h7
-rw-r--r--src/gui/text/qfontengine_p.h12
-rw-r--r--src/gui/text/qfontengine_qpa.cpp4
-rw-r--r--src/gui/text/qfontengine_qpa_p.h4
-rw-r--r--src/gui/text/qfontengine_qpf.cpp4
-rw-r--r--src/gui/text/qfontengine_qpf_p.h4
-rw-r--r--src/gui/text/qfontenginedirectwrite.cpp9
-rw-r--r--src/gui/text/qfontenginedirectwrite_p.h7
-rw-r--r--src/gui/text/qfontengineglyphcache_p.h4
-rw-r--r--src/gui/text/qfontinfo.h5
-rw-r--r--src/gui/text/qfontmetrics.cpp4
-rw-r--r--src/gui/text/qfontmetrics.h5
-rw-r--r--src/gui/text/qfontsubset.cpp4
-rw-r--r--src/gui/text/qfontsubset_p.h4
-rw-r--r--src/gui/text/qfragmentmap.cpp4
-rw-r--r--src/gui/text/qfragmentmap_p.h4
-rw-r--r--src/gui/text/qglyphrun.cpp4
-rw-r--r--src/gui/text/qglyphrun.h5
-rw-r--r--src/gui/text/qglyphrun_p.h4
-rw-r--r--src/gui/text/qlinecontrol.cpp1729
-rw-r--r--src/gui/text/qlinecontrol_p.h456
-rw-r--r--src/gui/text/qpfutil.cpp4
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp4
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.h5
-rw-r--r--src/gui/text/qrawfont.cpp8
-rw-r--r--src/gui/text/qrawfont.h5
-rw-r--r--src/gui/text/qrawfont_ft.cpp4
-rw-r--r--src/gui/text/qrawfont_p.h4
-rw-r--r--src/gui/text/qrawfont_qpa.cpp4
-rw-r--r--src/gui/text/qstatictext.cpp4
-rw-r--r--src/gui/text/qstatictext.h5
-rw-r--r--src/gui/text/qstatictext_p.h4
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp4
-rw-r--r--src/gui/text/qsyntaxhighlighter.h5
-rw-r--r--src/gui/text/qtextcontrol.cpp2893
-rw-r--r--src/gui/text/qtextcontrol_p.h288
-rw-r--r--src/gui/text/qtextcontrol_p_p.h232
-rw-r--r--src/gui/text/qtextcursor.cpp4
-rw-r--r--src/gui/text/qtextcursor.h5
-rw-r--r--src/gui/text/qtextcursor_p.h4
-rw-r--r--src/gui/text/qtextdocument.cpp4
-rw-r--r--src/gui/text/qtextdocument.h5
-rw-r--r--src/gui/text/qtextdocument_p.cpp23
-rw-r--r--src/gui/text/qtextdocument_p.h4
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp4
-rw-r--r--src/gui/text/qtextdocumentfragment.h5
-rw-r--r--src/gui/text/qtextdocumentfragment_p.h4
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp4
-rw-r--r--src/gui/text/qtextdocumentlayout_p.h4
-rw-r--r--src/gui/text/qtextdocumentwriter.cpp4
-rw-r--r--src/gui/text/qtextdocumentwriter.h5
-rw-r--r--src/gui/text/qtextengine.cpp10
-rw-r--r--src/gui/text/qtextengine_p.h4
-rw-r--r--src/gui/text/qtextformat.cpp4
-rw-r--r--src/gui/text/qtextformat.h5
-rw-r--r--src/gui/text/qtextformat_p.h4
-rw-r--r--src/gui/text/qtexthtmlparser.cpp4
-rw-r--r--src/gui/text/qtexthtmlparser_p.h4
-rw-r--r--src/gui/text/qtextimagehandler.cpp4
-rw-r--r--src/gui/text/qtextimagehandler_p.h4
-rw-r--r--src/gui/text/qtextlayout.cpp11
-rw-r--r--src/gui/text/qtextlayout.h5
-rw-r--r--src/gui/text/qtextlist.cpp4
-rw-r--r--src/gui/text/qtextlist.h5
-rw-r--r--src/gui/text/qtextobject.cpp4
-rw-r--r--src/gui/text/qtextobject.h5
-rw-r--r--src/gui/text/qtextobject_p.h4
-rw-r--r--src/gui/text/qtextodfwriter.cpp4
-rw-r--r--src/gui/text/qtextodfwriter_p.h4
-rw-r--r--src/gui/text/qtextoption.cpp4
-rw-r--r--src/gui/text/qtextoption.h5
-rw-r--r--src/gui/text/qtexttable.cpp4
-rw-r--r--src/gui/text/qtexttable.h5
-rw-r--r--src/gui/text/qtexttable_p.h4
-rw-r--r--src/gui/text/qzip.cpp4
-rw-r--r--src/gui/text/qzipreader_p.h4
-rw-r--r--src/gui/text/qzipwriter_p.h4
-rw-r--r--src/gui/text/text.pri25
-rw-r--r--src/gui/util/qdesktopservices.cpp4
-rw-r--r--src/gui/util/qdesktopservices.h9
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp4
-rw-r--r--src/gui/util/qdesktopservices_qpa.cpp4
-rw-r--r--src/gui/util/qdesktopservices_win.cpp4
-rw-r--r--src/gui/util/qdesktopservices_x11.cpp4
-rw-r--r--src/gui/util/qhexstring_p.h4
-rw-r--r--src/gui/util/qvalidator.cpp53
-rw-r--r--src/gui/util/qvalidator.h8
440 files changed, 3611 insertions, 9878 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index de37f67943..8610ef726d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -654,13 +654,29 @@ void QAccessible::setRootObject(QObject *object)
}
/*!
- Notifies accessibility clients about a change in \a object's
- accessibility information.
+ \deprecated
- \a reason specifies the cause of the change, for example,
- \c ValueChange when the position of a slider has been changed. \a
- child is the (1-based) index of the child element that has changed.
- When \a child is 0, the object itself has changed.
+ Use the version with a single \l QAccessibleEvent paremeter instead.
+*/
+void QAccessible::updateAccessibility(QObject *object, int child, Event reason)
+{
+ Q_ASSERT(object);
+
+ qWarning("QAccessible::updateAccessibility is deprecated.");
+
+ QAccessibleEvent event = QAccessibleEvent(reason, object, child);
+ updateAccessibility(event);
+}
+
+/*!
+ Notifies about a change that might be relevant for accessibility clients.
+
+ \a event gives the details about the change.
+ This includes the source of the change and what the actual change is.
+ There should be sufficient details delivered with this event to give meaningful notifications.
+
+ For example, the type \c ValueChange indicates that the position of
+ a slider has been changed.
Call this function whenever the state of your accessible object or
one of its sub-elements has been changed either programmatically
@@ -671,12 +687,10 @@ void QAccessible::setRootObject(QObject *object)
the parameters of the call is expensive you can test isActive() to
avoid unnecessary computations.
*/
-void QAccessible::updateAccessibility(QObject *object, int child, Event reason)
+void QAccessible::updateAccessibility(const QAccessibleEvent &event)
{
- Q_ASSERT(object);
-
if (updateHandler) {
- updateHandler(object, child, reason);
+ updateHandler(event);
return;
}
@@ -684,9 +698,43 @@ void QAccessible::updateAccessibility(QObject *object, int child, Event reason)
return;
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
- pfAccessibility->notifyAccessibilityUpdate(object, child, reason);
+ pfAccessibility->notifyAccessibilityUpdate(event);
}
+/*!
+ \class QAccessibleEvent
+ \brief The QAccessibleEvent is use to notify about changes that are
+ relevant for accessibility in the application.
+
+ \ingroup accessibility
+ \inmodule QtGui
+
+ This class should be created on the stack and used as parameter for
+ \l QAccessible::updateAccessibility().
+*/
+
+/*!
+ Returns the QAccessibleInterface associated with the event.
+
+ The caller of this function takes ownership of the returned interface.
+*/
+QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
+{
+ QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object);
+ if (!iface)
+ return 0;
+
+ if (m_child >= 0) {
+ QAccessibleInterface *child = iface->child(m_child);
+ if (child) {
+ delete iface;
+ iface = child;
+ } else {
+ qWarning() << "Cannot creat accessible child interface for object: " << m_object << " index: " << m_child;
+ }
+ }
+ return iface;
+}
/*!
\class QAccessibleInterface
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index bafd3a8a6b..dc74ac1814 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -55,11 +55,11 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
class QAccessibleInterface;
+class QAccessibleEvent;
class QWindow;
// We need to inherit QObject to expose the enums to QML.
@@ -306,12 +306,6 @@ public:
enum RelationFlag {
Unrelated = 0x00000000,
- Self = 0x00000001,
-
- Covers = 0x00001000,
- Covered = 0x00002000,
- GeometryMask = 0x0000ff00,
-
FocusChild = 0x00010000,
Label = 0x00020000,
Labelled = 0x00040000,
@@ -333,7 +327,7 @@ public:
};
typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
- typedef void(*UpdateHandler)(QObject*, int who, Event reason);
+ typedef void(*UpdateHandler)(const QAccessibleEvent &event);
typedef void(*RootObjectHandler)(QObject*);
static void installFactory(InterfaceFactory);
@@ -342,7 +336,10 @@ public:
static RootObjectHandler installRootObjectHandler(RootObjectHandler);
static QAccessibleInterface *queryAccessibleInterface(QObject *);
+
static void updateAccessibility(QObject *object, int child, Event reason);
+ static void updateAccessibility(const QAccessibleEvent &event);
+
static bool isActive();
static void setRootObject(QObject *object);
@@ -432,7 +429,29 @@ public:
private:
};
-#define QAccessibleInterface_iid "com.trolltech.Qt.QAccessibleInterface"
+class Q_GUI_EXPORT QAccessibleEvent
+{
+public:
+ inline QAccessibleEvent(QAccessible::Event type, QObject *object, int child = -1)
+ : m_type(type), m_object(object), m_child(child)
+ {
+ Q_ASSERT(object);
+ }
+
+ QAccessible::Event type() const { return m_type; }
+ QObject *object() const { return m_object; }
+ int child() const { return m_child; }
+
+ QAccessibleInterface *accessibleInterface() const;
+
+private:
+ QAccessible::Event m_type;
+ QObject *m_object;
+ int m_child;
+};
+
+
+#define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
Q_GUI_EXPORT const char *qAccessibleRoleString(QAccessible::Role role);
diff --git a/src/gui/accessible/qaccessible2.cpp b/src/gui/accessible/qaccessible2.cpp
index 0a7a8b0b6f..0f854c6158 100644
--- a/src/gui/accessible/qaccessible2.cpp
+++ b/src/gui/accessible/qaccessible2.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index 0b1ddc99b1..b84c484f74 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/gui/accessible/qaccessiblebridge.cpp b/src/gui/accessible/qaccessiblebridge.cpp
index d702972cd2..8fcf0474a1 100644
--- a/src/gui/accessible/qaccessiblebridge.cpp
+++ b/src/gui/accessible/qaccessiblebridge.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/accessible/qaccessiblebridge.h b/src/gui/accessible/qaccessiblebridge.h
index d0470f38e6..147bf30bd0 100644
--- a/src/gui/accessible/qaccessiblebridge.h
+++ b/src/gui/accessible/qaccessiblebridge.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,18 +49,18 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
class QAccessibleInterface;
+class QAccessibleEvent;
class QAccessibleBridge
{
public:
virtual ~QAccessibleBridge() {}
virtual void setRootObject(QAccessibleInterface *) = 0;
- virtual void notifyAccessibilityUpdate(int, QAccessibleInterface*, int) = 0;
+ virtual void notifyAccessibilityUpdate(const QAccessibleEvent &event) = 0;
};
struct Q_GUI_EXPORT QAccessibleBridgeFactoryInterface : public QFactoryInterface
@@ -68,7 +68,7 @@ struct Q_GUI_EXPORT QAccessibleBridgeFactoryInterface : public QFactoryInterface
virtual QAccessibleBridge *create(const QString& name) = 0;
};
-#define QAccessibleBridgeFactoryInterface_iid "com.trolltech.Qt.QAccessibleBridgeFactoryInterface"
+#define QAccessibleBridgeFactoryInterface_iid "org.qt-project.Qt.QAccessibleBridgeFactoryInterface"
Q_DECLARE_INTERFACE(QAccessibleBridgeFactoryInterface, QAccessibleBridgeFactoryInterface_iid)
class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject, public QAccessibleBridgeFactoryInterface
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index e271df2a13..b9e0ac388b 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -202,7 +202,7 @@ static QObjectList topLevelObjects()
if (w->windowType() != Qt::Popup && w->windowType() != Qt::Desktop) {
if (QAccessibleInterface *root = w->accessibleRoot()) {
if (root->object())
- list.append(w->accessibleRoot()->object());
+ list.append(root->object());
delete root;
}
}
@@ -224,20 +224,6 @@ int QAccessibleApplication::indexOfChild(const QAccessibleInterface *child) cons
return tlw.indexOf(child->object());
}
-/*! \reimp */
-QAccessible::Relation QAccessibleApplication::relationTo(const QAccessibleInterface *other) const
-{
- QObject *o = other ? other->object() : 0;
- if (!o)
- return QAccessible::Unrelated;
-
- if(o == object()) {
- return QAccessible::Self;
- }
-
- return QAccessible::Unrelated;
-}
-
QAccessibleInterface *QAccessibleApplication::parent() const
{
return 0;
@@ -262,9 +248,6 @@ int QAccessibleApplication::navigate(QAccessible::RelationFlag relation, int,
QObject *targetObject = 0;
switch (relation) {
- case QAccessible::Self:
- targetObject = object();
- break;
case QAccessible::FocusChild:
if (QWindow *window = QGuiApplication::activeWindow()) {
*target = window->accessibleRoot();
diff --git a/src/gui/accessible/qaccessibleobject.h b/src/gui/accessible/qaccessibleobject.h
index 58b95baffa..2372e82f89 100644
--- a/src/gui/accessible/qaccessibleobject.h
+++ b/src/gui/accessible/qaccessibleobject.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
@@ -86,7 +85,6 @@ public:
// relations
int childCount() const;
int indexOfChild(const QAccessibleInterface*) const;
- QAccessible::Relation relationTo(const QAccessibleInterface *other) const;
// navigation
QAccessibleInterface *parent() const;
diff --git a/src/gui/accessible/qaccessibleplugin.cpp b/src/gui/accessible/qaccessibleplugin.cpp
index 0d9d57b0ec..8823d63b79 100644
--- a/src/gui/accessible/qaccessibleplugin.cpp
+++ b/src/gui/accessible/qaccessibleplugin.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/accessible/qaccessibleplugin.h b/src/gui/accessible/qaccessibleplugin.h
index d3610e40f6..275e9ea753 100644
--- a/src/gui/accessible/qaccessibleplugin.h
+++ b/src/gui/accessible/qaccessibleplugin.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_ACCESSIBILITY
@@ -61,7 +60,7 @@ struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QFactoryInterface
virtual QAccessibleInterface* create(const QString &key, QObject *object) = 0;
};
-#define QAccessibleFactoryInterface_iid "com.trolltech.Qt.QAccessibleFactoryInterface"
+#define QAccessibleFactoryInterface_iid "org.qt-project.Qt.QAccessibleFactoryInterface"
Q_DECLARE_INTERFACE(QAccessibleFactoryInterface, QAccessibleFactoryInterface_iid)
class QAccessiblePluginPrivate;
diff --git a/src/gui/accessible/qplatformaccessibility_qpa.cpp b/src/gui/accessible/qplatformaccessibility_qpa.cpp
index 47c351921e..9de11e7c1f 100644
--- a/src/gui/accessible/qplatformaccessibility_qpa.cpp
+++ b/src/gui/accessible/qplatformaccessibility_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,6 +45,8 @@
#include "qaccessiblebridge.h"
#include <QtGui/QGuiApplication>
+#include <QDebug>
+
QT_BEGIN_NAMESPACE
/* accessiblebridge plugin discovery stuff */
@@ -73,33 +75,15 @@ QPlatformAccessibility::~QPlatformAccessibility()
{
}
-void QPlatformAccessibility::notifyAccessibilityUpdate(QObject *o,
- int who,
- QAccessible::Event reason)
+void QPlatformAccessibility::notifyAccessibilityUpdate(const QAccessibleEvent &event)
{
initialize();
if (!bridges() || bridges()->isEmpty())
return;
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
- if (!iface)
- return;
-
- // updates for List/Table/Tree should send child
- if (who) {
- QAccessibleInterface *child = iface->child(who - 1);
- if (child) {
- delete iface;
- iface = child;
- who = 0;
- }
- }
-
for (int i = 0; i < bridges()->count(); ++i)
- bridges()->at(i)->notifyAccessibilityUpdate(reason, iface, who);
- delete iface;
-
+ bridges()->at(i)->notifyAccessibilityUpdate(event);
}
void QPlatformAccessibility::setRootObject(QObject *o)
diff --git a/src/gui/accessible/qplatformaccessibility_qpa.h b/src/gui/accessible/qplatformaccessibility_qpa.h
index 15297110b8..364f87b0c9 100644
--- a/src/gui/accessible/qplatformaccessibility_qpa.h
+++ b/src/gui/accessible/qplatformaccessibility_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QPlatformAccessibility
{
@@ -58,7 +57,7 @@ public:
QPlatformAccessibility();
virtual ~QPlatformAccessibility();
- virtual void notifyAccessibilityUpdate(QObject *o, int who, QAccessible::Event reason);
+ virtual void notifyAccessibilityUpdate(const QAccessibleEvent &event);
virtual void setRootObject(QObject *o);
virtual void initialize();
virtual void cleanup();
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri
index 59af997477..e4a2bbef75 100644
--- a/src/gui/egl/egl.pri
+++ b/src/gui/egl/egl.pri
@@ -23,8 +23,4 @@ contains(QT_CONFIG, egl): {
}
SOURCES += egl/qegl_qpa.cpp
-} else:symbian: {
- DEFINES += QT_NO_EGL
- SOURCES += egl/qegl_stub.cpp
- SOURCES += egl/qeglproperties_stub.cpp
}
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 4ee656f777..067886cf5a 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h
index 02712b4026..3e78b97fcb 100644
--- a/src/gui/egl/qegl_p.h
+++ b/src/gui/egl/qegl_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -113,9 +113,6 @@ QT_BEGIN_NAMESPACE
#define EGLAPIENTRY
#endif
-// Try to get some info to debug the symbian build failues:
-
-
// Declare/define the bits of EGL_KHR_image_base we need:
#if !defined(EGL_KHR_image) && !defined(EGL_KHR_image_base)
typedef void *EGLImageKHR;
diff --git a/src/gui/egl/qegl_qpa.cpp b/src/gui/egl/qegl_qpa.cpp
index 2b7daf47b2..a0a16a5395 100644
--- a/src/gui/egl/qegl_qpa.cpp
+++ b/src/gui/egl/qegl_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/egl/qegl_stub.cpp b/src/gui/egl/qegl_stub.cpp
deleted file mode 100644
index 3d9d72587e..0000000000
--- a/src/gui/egl/qegl_stub.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 <QtCore/qdebug.h>
-
-#include "qegl_p.h"
-#include "qeglcontext_p.h"
-
-
-QT_BEGIN_NAMESPACE
-
-static void noegl(const char *fn)
-{
- qWarning() << fn << " called, but Qt configured without EGL" << endl;
-}
-
-#define NOEGL noegl(__FUNCTION__);
-
-QEglContext::QEglContext()
- : apiType(QEgl::OpenGL)
- , ctx(0)
- , cfg(QEGL_NO_CONFIG)
- , currentSurface(0)
- , current(false)
- , ownsContext(true)
- , sharing(false)
-{
- NOEGL
-}
-
-QEglContext::~QEglContext()
-{
- NOEGL
-}
-
-bool QEglContext::isValid() const
-{
- NOEGL
- return false;
-}
-
-bool QEglContext::isCurrent() const
-{
- NOEGL
- return false;
-}
-
-EGLConfig QEgl::defaultConfig(int devType, API api, ConfigOptions options)
-{
- Q_UNUSED(devType)
- Q_UNUSED(api)
- Q_UNUSED(options)
- NOEGL
- return QEGL_NO_CONFIG;
-}
-
-
-// Choose a configuration that matches "properties".
-EGLConfig QEgl::chooseConfig(const QEglProperties* properties, QEgl::PixelFormatMatch match)
-{
- Q_UNUSED(properties)
- Q_UNUSED(match)
- NOEGL
- return QEGL_NO_CONFIG;
-}
-
-bool QEglContext::chooseConfig(const QEglProperties& properties, QEgl::PixelFormatMatch match)
-{
- Q_UNUSED(properties)
- Q_UNUSED(match)
- NOEGL
- return false;
-}
-
-EGLSurface QEglContext::createSurface(QPaintDevice* device, const QEglProperties *properties)
-{
- Q_UNUSED(device)
- Q_UNUSED(properties)
- NOEGL
- return 0;
-}
-
-
-// Create the EGLContext.
-bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties)
-{
- Q_UNUSED(shareContext)
- Q_UNUSED(properties)
- NOEGL
- return false;
-}
-
-// Destroy an EGL surface object. If it was current on this context
-// then call doneCurrent() for it first.
-void QEglContext::destroySurface(EGLSurface surface)
-{
- Q_UNUSED(surface)
- NOEGL
-}
-
-// Destroy the context. Note: this does not destroy the surface.
-void QEglContext::destroyContext()
-{
- NOEGL
-}
-
-bool QEglContext::makeCurrent(EGLSurface surface)
-{
- Q_UNUSED(surface)
- NOEGL
- return false;
-}
-
-bool QEglContext::doneCurrent()
-{
- NOEGL
- return false;
-}
-
-// 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()
-{
- NOEGL
- return false;
-}
-
-bool QEglContext::swapBuffers(EGLSurface surface)
-{
- Q_UNUSED(surface)
- NOEGL
- return false;
-}
-
-bool QEglContext::swapBuffersRegion2NOK(EGLSurface surface, const QRegion *region)
-{
- Q_UNUSED(surface)
- Q_UNUSED(region)
- NOEGL
- return false;
-}
-
-int QEglContext::configAttrib(int name) const
-{
- Q_UNUSED(name)
- NOEGL
- return 0;
-}
-
-EGLDisplay QEgl::display()
-{
- NOEGL
- return 0;
-}
-
-EGLImageKHR QEgl::eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
-{
- Q_UNUSED(dpy)
- Q_UNUSED(ctx)
- Q_UNUSED(target)
- Q_UNUSED(buffer)
- Q_UNUSED(attrib_list)
- NOEGL
- return 0;
-}
-
-EGLBoolean QEgl::eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img)
-{
- Q_UNUSED(dpy)
- Q_UNUSED(img)
- NOEGL
- return 0;
-}
-
-EGLBoolean QEgl::eglSwapBuffersRegion2NOK(EGLDisplay dpy, EGLSurface surface, EGLint count, const EGLint *rects)
-{
- Q_UNUSED(dpy);
- Q_UNUSED(surface);
- Q_UNUSED(count);
- Q_UNUSED(rects);
- NOEGL
- return 0;
-}
-
-EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglProperties *properties)
-{
- Q_UNUSED(device)
- Q_UNUSED(cfg)
- Q_UNUSED(properties)
- NOEGL
- return 0;
-}
-
-
-// Return the error string associated with a specific code.
-QString QEgl::errorString(EGLint code)
-{
- Q_UNUSED(code)
- NOEGL
- return QString();
-}
-
-// Dump all of the EGL configurations supported by the system.
-void QEgl::dumpAllConfigs()
-{
- NOEGL
-}
-
-QString QEgl::extensions()
-{
- NOEGL
- return QString();
-}
-
-bool QEgl::hasExtension(const char* extensionName)
-{
- Q_UNUSED(extensionName)
- NOEGL
- return false;
-}
-
-QEglContext *QEglContext::currentContext(QEgl::API api)
-{
- Q_UNUSED(api)
- NOEGL
- return false;
-}
-
-void QEglContext::setCurrentContext(QEgl::API api, QEglContext *context)
-{
- Q_UNUSED(api)
- Q_UNUSED(context)
- NOEGL
-}
-
-EGLNativeDisplayType QEgl::nativeDisplay()
-{
- NOEGL
- return 0;
-}
-
-EGLNativeWindowType QEgl::nativeWindow(QWidget* widget)
-{
- Q_UNUSED(widget)
- NOEGL
- return (EGLNativeWindowType)0;
-}
-
-EGLNativePixmapType QEgl::nativePixmap(QPixmap*)
-{
- NOEGL
- return (EGLNativePixmapType)0;
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h
index 70cdfc72ac..94654eb2a8 100644
--- a/src/gui/egl/qeglcontext_p.h
+++ b/src/gui/egl/qeglcontext_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp
index 29b1cd371d..414ad8d06a 100644
--- a/src/gui/egl/qeglproperties.cpp
+++ b/src/gui/egl/qeglproperties.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h
index d7bc0893d4..a5fc8f9b1f 100644
--- a/src/gui/egl/qeglproperties_p.h
+++ b/src/gui/egl/qeglproperties_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/egl/qeglproperties_stub.cpp b/src/gui/egl/qeglproperties_stub.cpp
deleted file mode 100644
index 7be8a0a4b9..0000000000
--- a/src/gui/egl/qeglproperties_stub.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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
-
-static void noegl(const char *fn)
-{
- qWarning() << fn << " called, but Qt configured without EGL" << endl;
-}
-
-#define NOEGL noegl(__FUNCTION__);
-
-// Initialize a property block.
-QEglProperties::QEglProperties()
-{
- NOEGL
-}
-
-QEglProperties::QEglProperties(EGLConfig cfg)
-{
- Q_UNUSED(cfg)
- NOEGL
-}
-
-// Fetch the current value associated with a property.
-int QEglProperties::value(int name) const
-{
- Q_UNUSED(name)
- NOEGL
- return 0;
-}
-
-// Set the value associated with a property, replacing an existing
-// value if there is one.
-void QEglProperties::setValue(int name, int value)
-{
- Q_UNUSED(name)
- Q_UNUSED(value)
- NOEGL
-}
-
-// Remove a property value. Returns false if the property is not present.
-bool QEglProperties::removeValue(int name)
-{
- Q_UNUSED(name)
- NOEGL
- return false;
-}
-
-void QEglProperties::setDeviceType(int devType)
-{
- Q_UNUSED(devType)
- NOEGL
-}
-
-
-// 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)
-{
- Q_UNUSED(pixelFormat)
- NOEGL
-
-}
-
-void QEglProperties::setRenderableType(QEgl::API api)
-{
- Q_UNUSED(api);
- NOEGL
-}
-
-// 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()
-{
- NOEGL
- return false;
-}
-
-// Convert a property list to a string suitable for debug output.
-QString QEglProperties::toString() const
-{
- NOEGL
- return QString();
-}
-
-void QEglProperties::setPaintDeviceFormat(QPaintDevice *dev)
-{
- Q_UNUSED(dev)
- NOEGL
-}
-
-QT_END_NAMESPACE
-
-
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index b8eb546ba5..dd7b665ecc 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -48,12 +48,7 @@ SOURCES += \
SOURCES += image/qpixmap_qpa.cpp
win32: SOURCES += image/qpixmap_win.cpp
-!symbian|contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2) {
- SOURCES += image/qvolatileimagedata.cpp
-}
-else {
- SOURCES += image/qvolatileimagedata_symbian.cpp
-}
+SOURCES += image/qvolatileimagedata.cpp
# Built-in image format support
HEADERS += \
@@ -72,8 +67,6 @@ SOURCES += \
else:DEFINES *= QT_NO_IMAGEFORMAT_PNG
contains(QT_CONFIG, jpeg):include($$PWD/qjpeghandler.pri)
-contains(QT_CONFIG, mng):include($$PWD/qmnghandler.pri)
-contains(QT_CONFIG, tiff):include($$PWD/qtiffhandler.pri)
contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri)
# SIMD
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index 6c1320e868..8184200813 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index 5740b874db..f67e2ddef8 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QVariant;
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 3d9f8228f2..f9e11f1390 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qbmphandler_p.h b/src/gui/image/qbmphandler_p.h
index f2eb8f69b2..d203a77677 100644
--- a/src/gui/image/qbmphandler_p.h
+++ b/src/gui/image/qbmphandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qgifhandler.cpp b/src/gui/image/qgifhandler.cpp
index 6968ca6736..3cffe99c86 100644
--- a/src/gui/image/qgifhandler.cpp
+++ b/src/gui/image/qgifhandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
** WARNING:
diff --git a/src/gui/image/qgifhandler_p.h b/src/gui/image/qgifhandler_p.h
index 0d9724a071..05b26d09e7 100644
--- a/src/gui/image/qgifhandler_p.h
+++ b/src/gui/image/qgifhandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
** WARNING:
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 564abd2af2..07af19d06a 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -124,7 +124,8 @@ QImageData::QImageData()
dpmx(qt_defaultDpiX() * 100 / qreal(2.54)),
dpmy(qt_defaultDpiY() * 100 / qreal(2.54)),
offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false),
- is_cached(false), is_locked(false), paintEngine(0)
+ is_cached(false), is_locked(false), cleanupFunction(0), cleanupInfo(0),
+ paintEngine(0)
{
}
@@ -206,6 +207,8 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format, int nu
QImageData::~QImageData()
{
+ if (cleanupFunction)
+ cleanupFunction(cleanupInfo);
if (is_cached)
QImagePixmapCleanupHooks::executeImageHooks((((qint64) ser_no) << 32) | ((qint64) detach_no));
delete paintEngine;
@@ -363,7 +366,6 @@ bool QImageData::checkForAlphaPixels() const
\row \o PBM \o Portable Bitmap \o Read
\row \o PGM \o Portable Graymap \o Read
\row \o PPM \o Portable Pixmap \o Read/write
- \row \o TIFF \o Tagged Image File Format \o Read/write
\row \o XBM \o X11 Bitmap \o Read/write
\row \o XPM \o X11 Pixmap \o Read/write
\endtable
@@ -617,6 +619,18 @@ bool QImageData::checkForAlphaPixels() const
*/
/*!
+ \typedef QImageCleanupFunction
+ \since 5.0
+
+ A function with the following signature that can be used to
+ implement basic image memory management:
+
+ \code
+ void myImageCleanupHandler(void *info);
+ \endcode
+*/
+
+/*!
\enum QImage::InvertMode
This enum type is used to describe how pixel values should be
@@ -772,7 +786,7 @@ QImage::QImage(const QSize &size, Format format)
-QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QImage::Format format, bool readOnly)
+QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction, void *cleanupInfo)
{
QImageData *d = 0;
@@ -815,6 +829,9 @@ QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QIm
d->bytes_per_line = bpl;
d->nbytes = d->bytes_per_line * height;
+ d->cleanupFunction = cleanupFunction;
+ d->cleanupInfo = cleanupInfo;
+
return d;
}
@@ -824,17 +841,21 @@ QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QIm
and \a height must be specified in pixels, \a data must be 32-bit aligned,
and each scanline of data in the image must also be 32-bit aligned.
- The buffer must remain valid throughout the life of the
- QImage. The image does not delete the buffer at destruction.
+ The buffer must remain valid throughout the life of the QImage and
+ all copies that have not been modified or otherwise detached from
+ the original buffer. The image does not delete the buffer at destruction.
+ You can provide a function pointer \a cleanupFunction along with an
+ extra pointer \a cleanupInfo that will be called when the last copy
+ is destroyed.
If \a format is an indexed color format, the image color table is
initially empty and must be sufficiently expanded with
setColorCount() or setColorTable() before the image is used.
*/
-QImage::QImage(uchar* data, int width, int height, Format format)
+QImage::QImage(uchar* data, int width, int height, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo)
: QPaintDevice()
{
- d = QImageData::create(data, width, height, 0, format, false);
+ d = QImageData::create(data, width, height, 0, format, false, cleanupFunction, cleanupInfo);
}
/*!
@@ -846,8 +867,10 @@ QImage::QImage(uchar* data, int width, int height, Format format)
The buffer must remain valid throughout the life of the QImage and
all copies that have not been modified or otherwise detached from
- the original buffer. The image does not delete the buffer at
- destruction.
+ the original buffer. The image does not delete the buffer at destruction.
+ You can provide a function pointer \a cleanupFunction along with an
+ extra pointer \a cleanupInfo that will be called when the last copy
+ is destroyed.
If \a format is an indexed color format, the image color table is
initially empty and must be sufficiently expanded with
@@ -860,10 +883,10 @@ QImage::QImage(uchar* data, int width, int height, Format format)
constructing a QImage from raw data, without the possibility of the raw
data being changed.
*/
-QImage::QImage(const uchar* data, int width, int height, Format format)
+QImage::QImage(const uchar* data, int width, int height, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo)
: QPaintDevice()
{
- d = QImageData::create(const_cast<uchar*>(data), width, height, 0, format, true);
+ d = QImageData::create(const_cast<uchar*>(data), width, height, 0, format, true, cleanupFunction, cleanupInfo);
}
/*!
@@ -872,17 +895,21 @@ QImage::QImage(const uchar* data, int width, int height, Format format)
and \a height must be specified in pixels. \a bytesPerLine
specifies the number of bytes per line (stride).
- The buffer must remain valid throughout the life of the
- QImage. The image does not delete the buffer at destruction.
+ The buffer must remain valid throughout the life of the QImage and
+ all copies that have not been modified or otherwise detached from
+ the original buffer. The image does not delete the buffer at destruction.
+ You can provide a function pointer \a cleanupFunction along with an
+ extra pointer \a cleanupInfo that will be called when the last copy
+ is destroyed.
If \a format is an indexed color format, the image color table is
initially empty and must be sufficiently expanded with
setColorCount() or setColorTable() before the image is used.
*/
-QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format format)
+QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo)
:QPaintDevice()
{
- d = QImageData::create(data, width, height, bytesPerLine, format, false);
+ d = QImageData::create(data, width, height, bytesPerLine, format, false, cleanupFunction, cleanupInfo);
}
@@ -892,8 +919,12 @@ QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format form
and \a height must be specified in pixels. \a bytesPerLine
specifies the number of bytes per line (stride).
- The buffer must remain valid throughout the life of the
- QImage. The image does not delete the buffer at destruction.
+ The buffer must remain valid throughout the life of the QImage and
+ all copies that have not been modified or otherwise detached from
+ the original buffer. The image does not delete the buffer at destruction.
+ You can provide a function pointer \a cleanupFunction along with an
+ extra pointer \a cleanupInfo that will be called when the last copy
+ is destroyed.
If \a format is an indexed color format, the image color table is
initially empty and must be sufficiently expanded with
@@ -907,10 +938,10 @@ QImage::QImage(uchar *data, int width, int height, int bytesPerLine, Format form
data being changed.
*/
-QImage::QImage(const uchar *data, int width, int height, int bytesPerLine, Format format)
+QImage::QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction, void *cleanupInfo)
:QPaintDevice()
{
- d = QImageData::create(const_cast<uchar*>(data), width, height, bytesPerLine, format, true);
+ d = QImageData::create(const_cast<uchar*>(data), width, height, bytesPerLine, format, true, cleanupFunction, cleanupInfo);
}
/*!
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 7a5a732c9a..5a3ae8f886 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -57,7 +57,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QIODevice;
class QStringList;
@@ -71,7 +70,7 @@ struct QImageData;
class QImageDataMisc; // internal
#ifndef QT_NO_IMAGE_TEXT
#if QT_DEPRECATED_SINCE(5, 0)
-class Q_GUI_EXPORT QImageTextKeyLang {
+class QT_DEPRECATED QImageTextKeyLang {
public:
QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
QImageTextKeyLang() { }
@@ -89,6 +88,7 @@ public:
#endif
#endif //QT_NO_IMAGE_TEXT
+typedef void (*QImageCleanupFunction)(void*);
class Q_GUI_EXPORT QImage : public QPaintDevice
{
@@ -129,10 +129,10 @@ public:
QImage();
QImage(const QSize &size, Format format);
QImage(int width, int height, Format format);
- QImage(uchar *data, int width, int height, Format format);
- QImage(const uchar *data, int width, int height, Format format);
- QImage(uchar *data, int width, int height, int bytesPerLine, Format format);
- QImage(const uchar *data, int width, int height, int bytesPerLine, Format format);
+ QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
+ QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
+ QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
+ QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
#ifndef QT_NO_IMAGEFORMAT_XPM
explicit QImage(const char * const xpm[]);
@@ -271,11 +271,11 @@ public:
void setText(const QString &key, const QString &value);
#if QT_DEPRECATED_SINCE(5, 0)
- inline QString text(const char* key, const char* lang=0) const;
- inline QList<QImageTextKeyLang> textList() const;
- inline QStringList textLanguages() const;
- inline QString text(const QImageTextKeyLang&) const;
- inline void setText(const char* key, const char* lang, const QString&);
+ QT_DEPRECATED inline QString text(const char* key, const char* lang=0) const;
+ QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const;
+ QT_DEPRECATED inline QStringList textLanguages() const;
+ QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const;
+ QT_DEPRECATED inline void setText(const char* key, const char* lang, const QString&);
#endif
#endif
@@ -383,6 +383,7 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
setText(k, s);
}
#endif
+
inline int QImage::numColors() const
{
return colorCount();
diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp
index cdf817b051..b19dfac3ec 100644
--- a/src/gui/image/qimage_neon.cpp
+++ b/src/gui/image/qimage_neon.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index 6e846fd0cf..fd1370d1d3 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -69,7 +69,7 @@ struct Q_GUI_EXPORT QImageData { // internal image data
QImageData();
~QImageData();
static QImageData *create(const QSize &size, QImage::Format format, int numColors = 0);
- static QImageData *create(uchar *data, int w, int h, int bpl, QImage::Format format, bool readOnly);
+ static QImageData *create(uchar *data, int w, int h, int bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
QAtomicInt ref;
@@ -94,6 +94,9 @@ struct Q_GUI_EXPORT QImageData { // internal image data
uint is_cached : 1;
uint is_locked : 1;
+ QImageCleanupFunction cleanupFunction;
+ void* cleanupInfo;
+
bool checkForAlphaPixels() const;
// Convert the image in-place, minimizing memory reallocation
diff --git a/src/gui/image/qimage_sse2.cpp b/src/gui/image/qimage_sse2.cpp
index 872d1d6be7..8a36bfb0d2 100644
--- a/src/gui/image/qimage_sse2.cpp
+++ b/src/gui/image/qimage_sse2.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimage_ssse3.cpp b/src/gui/image/qimage_ssse3.cpp
index 95cf694d2a..2ca80ef3bb 100644
--- a/src/gui/image/qimage_ssse3.cpp
+++ b/src/gui/image/qimage_ssse3.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index d9691563b1..153412fb29 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 188b4ef1a8..0252ec02cc 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QImage;
class QRect;
@@ -120,7 +119,7 @@ struct Q_GUI_EXPORT QImageIOHandlerFactoryInterface : public QFactoryInterface
virtual QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const = 0;
};
-#define QImageIOHandlerFactoryInterface_iid "com.trolltech.Qt.QImageIOHandlerFactoryInterface"
+#define QImageIOHandlerFactoryInterface_iid "org.qt-project.Qt.QImageIOHandlerFactoryInterface"
Q_DECLARE_INTERFACE(QImageIOHandlerFactoryInterface, QImageIOHandlerFactoryInterface_iid)
class Q_GUI_EXPORT QImageIOPlugin : public QObject, public QImageIOHandlerFactoryInterface
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index e83897aced..6d8693ffb1 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h
index 11abe173c4..e7fadcabfd 100644
--- a/src/gui/image/qimagepixmapcleanuphooks_p.h
+++ b/src/gui/image/qimagepixmapcleanuphooks_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index b6345191d6..4a9a9b00f4 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -144,12 +144,6 @@
#ifndef QT_NO_IMAGEFORMAT_JPEG
#include <private/qjpeghandler_p.h>
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
-#include <private/qmnghandler_p.h>
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
-#include <private/qtiffhandler_p.h>
-#endif
#ifdef QT_BUILTIN_GIF_READER
#include <private/qgifhandler_p.h>
#endif
@@ -168,12 +162,6 @@ enum _qt_BuiltInFormatType {
#ifndef QT_NO_IMAGEFORMAT_JPEG
_qt_JpgFormat,
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- _qt_MngFormat,
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- _qt_TifFormat,
-#endif
#ifdef QT_BUILTIN_GIF_READER
_qt_GifFormat,
#endif
@@ -206,12 +194,6 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = {
#ifndef QT_NO_IMAGEFORMAT_JPEG
{_qt_JpgFormat, "jpg"},
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- {_qt_MngFormat, "mng"},
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- {_qt_TifFormat, "tif"},
-#endif
#ifdef QT_BUILTIN_GIF_READER
{_qt_GifFormat, "gif"},
#endif
@@ -344,14 +326,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
} else if (testFormat == "jpg" || testFormat == "jpeg") {
handler = new QJpegHandler;
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- } else if (testFormat == "mng") {
- handler = new QMngHandler;
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- } else if (testFormat == "tif" || testFormat == "tiff") {
- handler = new QTiffHandler;
-#endif
#ifdef QT_BUILTIN_GIF_READER
} else if (testFormat == "gif") {
handler = new QGifHandler;
@@ -440,18 +414,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
handler = new QJpegHandler;
break;
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- case _qt_MngFormat:
- if (QMngHandler::canRead(device))
- handler = new QMngHandler;
- break;
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- case _qt_TifFormat:
- if (QTiffHandler::canRead(device))
- handler = new QTiffHandler;
- break;
-#endif
#ifdef QT_BUILTIN_GIF_READER
case _qt_GifFormat:
if (QGifHandler::canRead(device))
@@ -1466,23 +1428,18 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
\row \o GIF \o Graphic Interchange Format (optional)
\row \o JPG \o Joint Photographic Experts Group
\row \o JPEG \o Joint Photographic Experts Group
- \row \o MNG \o Multiple-image Network Graphics
\row \o PNG \o Portable Network Graphics
\row \o PBM \o Portable Bitmap
\row \o PGM \o Portable Graymap
\row \o PPM \o Portable Pixmap
- \row \o TIFF \o Tagged Image File Format
\row \o XBM \o X11 Bitmap
\row \o XPM \o X11 Pixmap
\row \o SVG \o Scalable Vector Graphics
\endtable
Reading and writing SVG files is supported through Qt's
- \l{QtSvg Module}{SVG Module}.
-
- To configure Qt with GIF support, pass \c -qt-gif to the \c
- configure script or check the appropriate option in the graphical
- installer.
+ \l{QtSvg Module}{SVG Module}. The \l{QtImageFormats Module}{Image Formats Module}
+ provides support for additional image formats.
Note that the QApplication instance must be created before this function is
called.
diff --git a/src/gui/image/qimagereader.h b/src/gui/image/qimagereader.h
index f132991d92..f359cd3e21 100644
--- a/src/gui/image/qimagereader.h
+++ b/src/gui/image/qimagereader.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QColor;
class QIODevice;
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index b7d57fa4d3..966017452c 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -117,12 +117,6 @@
#ifndef QT_NO_IMAGEFORMAT_JPEG
#include <private/qjpeghandler_p.h>
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
-#include <private/qmnghandler_p.h>
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
-#include <private/qtiffhandler_p.h>
-#endif
#ifdef QT_BUILTIN_GIF_READER
#include <private/qgifhandler_p.h>
#endif
@@ -186,14 +180,6 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
} else if (testFormat == "jpg" || testFormat == "jpeg") {
handler = new QJpegHandler;
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- } else if (testFormat == "mng") {
- handler = new QMngHandler;
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- } else if (testFormat == "tif" || testFormat == "tiff") {
- handler = new QTiffHandler;
-#endif
#ifdef QT_BUILTIN_GIF_READER
} else if (testFormat == "gif") {
handler = new QGifHandler;
@@ -673,13 +659,13 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
\row \o JPEG \o Joint Photographic Experts Group
\row \o PNG \o Portable Network Graphics
\row \o PPM \o Portable Pixmap
- \row \o TIFF \o Tagged Image File Format
\row \o XBM \o X11 Bitmap
\row \o XPM \o X11 Pixmap
\endtable
Reading and writing SVG files is supported through Qt's
- \l{QtSvg Module}{SVG Module}.
+ \l{QtSvg Module}{SVG Module}. The \l{QtImageFormats Module}{Image Formats Module}
+ provides support for additional image formats.
Note that the QApplication instance must be created before this function is
called.
@@ -705,12 +691,6 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
#ifndef QT_NO_IMAGEFORMAT_JPEG
formats << "jpg" << "jpeg";
#endif
-#ifndef QT_NO_IMAGEFORMAT_MNG
- formats << "mng";
-#endif
-#ifndef QT_NO_IMAGEFORMAT_TIFF
- formats << "tif" << "tiff";
-#endif
#ifdef QT_BUILTIN_GIF_READER
formats << "gif";
#endif
diff --git a/src/gui/image/qimagewriter.h b/src/gui/image/qimagewriter.h
index 5aac7e8599..a352d20bfd 100644
--- a/src/gui/image/qimagewriter.h
+++ b/src/gui/image/qimagewriter.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QIODevice;
class QImage;
diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp
index f0f9368e22..0260d18217 100644
--- a/src/gui/image/qjpeghandler.cpp
+++ b/src/gui/image/qjpeghandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qjpeghandler_p.h b/src/gui/image/qjpeghandler_p.h
index 7827804959..145361d2b6 100644
--- a/src/gui/image/qjpeghandler_p.h
+++ b/src/gui/image/qjpeghandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qmnghandler.cpp b/src/gui/image/qmnghandler.cpp
deleted file mode 100644
index 6a6ee8d2cf..0000000000
--- a/src/gui/image/qmnghandler.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 "qmnghandler_p.h"
-
-#include "qimage.h"
-#include "qvariant.h"
-#include "qcolor.h"
-
-#define MNG_USE_SO
-#include <libmng.h>
-
-QT_BEGIN_NAMESPACE
-
-class QMngHandlerPrivate
-{
- Q_DECLARE_PUBLIC(QMngHandler)
- public:
- bool haveReadNone;
- bool haveReadAll;
- mng_handle hMNG;
- QImage image;
- int elapsed;
- int nextDelay;
- int iterCount;
- int frameIndex;
- int nextIndex;
- int frameCount;
- mng_uint32 iStyle;
- mng_bool readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead);
- mng_bool writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten);
- mng_bool processHeader(mng_uint32 iWidth, mng_uint32 iHeight);
- QMngHandlerPrivate(QMngHandler *q_ptr);
- ~QMngHandlerPrivate();
- bool getNextImage(QImage *result);
- bool writeImage(const QImage &image);
- int currentImageNumber() const;
- int imageCount() const;
- bool jumpToImage(int imageNumber);
- bool jumpToNextImage();
- int nextImageDelay() const;
- bool setBackgroundColor(const QColor &color);
- QColor backgroundColor() const;
- QMngHandler *q_ptr;
-};
-
-static mng_bool myerror(mng_handle /*hMNG*/,
- mng_int32 iErrorcode,
- mng_int8 /*iSeverity*/,
- mng_chunkid iChunkname,
- mng_uint32 /*iChunkseq*/,
- mng_int32 iExtra1,
- mng_int32 iExtra2,
- mng_pchar zErrortext)
-{
- qWarning("MNG error %d: %s; chunk %c%c%c%c; subcode %d:%d",
- iErrorcode,zErrortext,
- (iChunkname>>24)&0xff,
- (iChunkname>>16)&0xff,
- (iChunkname>>8)&0xff,
- (iChunkname>>0)&0xff,
- iExtra1,iExtra2);
- return TRUE;
-}
-
-static mng_ptr myalloc(mng_size_t iSize)
-{
-#if defined(Q_OS_WINCE)
- mng_ptr ptr = malloc(iSize);
- memset(ptr, 0, iSize);
- return ptr;
-#else
- return (mng_ptr)calloc(1, iSize);
-#endif
-}
-
-static void myfree(mng_ptr pPtr, mng_size_t /*iSize*/)
-{
- free(pPtr);
-}
-
-static mng_bool myopenstream(mng_handle)
-{
- return MNG_TRUE;
-}
-
-static mng_bool myclosestream(mng_handle hMNG)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- pMydata->haveReadAll = true;
- return MNG_TRUE;
-}
-
-static mng_bool myreaddata(mng_handle hMNG,
- mng_ptr pBuf,
- mng_uint32 iSize,
- mng_uint32p pRead)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- return pMydata->readData(pBuf, iSize, pRead);
-}
-
-static mng_bool mywritedata(mng_handle hMNG,
- mng_ptr pBuf,
- mng_uint32 iSize,
- mng_uint32p pWritten)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- return pMydata->writeData(pBuf, iSize, pWritten);
-}
-
-static mng_bool myprocessheader(mng_handle hMNG,
- mng_uint32 iWidth,
- mng_uint32 iHeight)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- return pMydata->processHeader(iWidth, iHeight);
-}
-
-static mng_ptr mygetcanvasline(mng_handle hMNG,
- mng_uint32 iLinenr)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- return (mng_ptr)pMydata->image.scanLine(iLinenr);
-}
-
-static mng_bool myrefresh(mng_handle /*hMNG*/,
- mng_uint32 /*iX*/,
- mng_uint32 /*iY*/,
- mng_uint32 /*iWidth*/,
- mng_uint32 /*iHeight*/)
-{
- return MNG_TRUE;
-}
-
-static mng_uint32 mygettickcount(mng_handle hMNG)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- return pMydata->elapsed++;
-}
-
-static mng_bool mysettimer(mng_handle hMNG,
- mng_uint32 iMsecs)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- pMydata->elapsed += iMsecs;
- pMydata->nextDelay = iMsecs;
- return MNG_TRUE;
-}
-
-static mng_bool myprocessterm(mng_handle hMNG,
- mng_uint8 iTermaction,
- mng_uint8 /*iIteraction*/,
- mng_uint32 /*iDelay*/,
- mng_uint32 iItermax)
-{
- QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
- if (iTermaction == 3)
- pMydata->iterCount = iItermax;
- return MNG_TRUE;
-}
-
-static mng_bool mytrace(mng_handle,
- mng_int32 iFuncnr,
- mng_int32 iFuncseq,
- mng_pchar zFuncname)
-{
- qDebug("mng trace: iFuncnr: %d iFuncseq: %d zFuncname: %s", iFuncnr, iFuncseq, zFuncname);
- return MNG_TRUE;
-}
-
-QMngHandlerPrivate::QMngHandlerPrivate(QMngHandler *q_ptr)
- : haveReadNone(true), haveReadAll(false), elapsed(0), nextDelay(0), iterCount(1),
- frameIndex(-1), nextIndex(0), frameCount(0), q_ptr(q_ptr)
-{
- iStyle = (QSysInfo::ByteOrder == QSysInfo::LittleEndian) ? MNG_CANVAS_BGRA8 : MNG_CANVAS_ARGB8;
- // Initialize libmng
- hMNG = mng_initialize((mng_ptr)this, myalloc, myfree, mytrace);
- if (hMNG) {
- // Set callback functions
- mng_setcb_errorproc(hMNG, myerror);
- mng_setcb_openstream(hMNG, myopenstream);
- mng_setcb_closestream(hMNG, myclosestream);
- mng_setcb_readdata(hMNG, myreaddata);
- mng_setcb_writedata(hMNG, mywritedata);
- mng_setcb_processheader(hMNG, myprocessheader);
- mng_setcb_getcanvasline(hMNG, mygetcanvasline);
- mng_setcb_refresh(hMNG, myrefresh);
- mng_setcb_gettickcount(hMNG, mygettickcount);
- mng_setcb_settimer(hMNG, mysettimer);
- mng_setcb_processterm(hMNG, myprocessterm);
- mng_set_doprogressive(hMNG, MNG_FALSE);
- mng_set_suspensionmode(hMNG, MNG_TRUE);
- }
-}
-
-QMngHandlerPrivate::~QMngHandlerPrivate()
-{
- mng_cleanup(&hMNG);
-}
-
-mng_bool QMngHandlerPrivate::readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
-{
- Q_Q(QMngHandler);
- *pRead = q->device()->read((char *)pBuf, iSize);
- return (*pRead > 0) ? MNG_TRUE : MNG_FALSE;
-}
-
-mng_bool QMngHandlerPrivate::writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
-{
- Q_Q(QMngHandler);
- *pWritten = q->device()->write((char *)pBuf, iSize);
- return MNG_TRUE;
-}
-
-mng_bool QMngHandlerPrivate::processHeader(mng_uint32 iWidth, mng_uint32 iHeight)
-{
- if (mng_set_canvasstyle(hMNG, iStyle) != MNG_NOERROR)
- return MNG_FALSE;
- image = QImage(iWidth, iHeight, QImage::Format_ARGB32);
- image.fill(0);
- return MNG_TRUE;
-}
-
-bool QMngHandlerPrivate::getNextImage(QImage *result)
-{
- mng_retcode ret;
- if (haveReadNone) {
- haveReadNone = false;
- ret = mng_readdisplay(hMNG);
- } else {
- ret = mng_display_resume(hMNG);
- }
- if ((MNG_NOERROR == ret) || (MNG_NEEDTIMERWAIT == ret)) {
- *result = image;
- frameIndex = nextIndex++;
- if (haveReadAll && (frameCount == 0))
- frameCount = nextIndex;
- return true;
- }
- return false;
-}
-
-bool QMngHandlerPrivate::writeImage(const QImage &image)
-{
- mng_reset(hMNG);
- if (mng_create(hMNG) != MNG_NOERROR)
- return false;
-
- this->image = image.convertToFormat(QImage::Format_ARGB32);
- int w = image.width();
- int h = image.height();
-
- if (
- // width, height, ticks, layercount, framecount, playtime, simplicity
- (mng_putchunk_mhdr(hMNG, w, h, 1000, 0, 0, 0, 7) == MNG_NOERROR) &&
- // termination_action, action_after_iterations, delay, iteration_max
- (mng_putchunk_term(hMNG, 3, 0, 1, 0x7FFFFFFF) == MNG_NOERROR) &&
- // width, height, bitdepth, colortype, compression, filter, interlace
- (mng_putchunk_ihdr(hMNG, w, h, 8, 6, 0, 0, 0) == MNG_NOERROR) &&
- // width, height, colortype, bitdepth, compression, filter, interlace, canvasstyle, getcanvasline
- (mng_putimgdata_ihdr(hMNG, w, h, 6, 8, 0, 0, 0, iStyle, mygetcanvasline) == MNG_NOERROR) &&
- (mng_putchunk_iend(hMNG) == MNG_NOERROR) &&
- (mng_putchunk_mend(hMNG) == MNG_NOERROR) &&
- (mng_write(hMNG) == MNG_NOERROR)
- )
- return true;
- return false;
-}
-
-int QMngHandlerPrivate::currentImageNumber() const
-{
-// return mng_get_currentframe(hMNG) % imageCount(); not implemented, apparently
- return frameIndex;
-}
-
-int QMngHandlerPrivate::imageCount() const
-{
-// return mng_get_totalframes(hMNG); not implemented, apparently
- if (haveReadAll)
- return frameCount;
- return 0; // Don't know
-}
-
-bool QMngHandlerPrivate::jumpToImage(int imageNumber)
-{
- if (imageNumber == nextIndex)
- return true;
-
- if ((imageNumber == 0) && haveReadAll && (nextIndex == frameCount)) {
- // Loop!
- nextIndex = 0;
- return true;
- }
- if (mng_display_freeze(hMNG) == MNG_NOERROR) {
- if (mng_display_goframe(hMNG, imageNumber) == MNG_NOERROR) {
- nextIndex = imageNumber;
- return true;
- }
- }
- return false;
-}
-
-bool QMngHandlerPrivate::jumpToNextImage()
-{
- return jumpToImage((currentImageNumber()+1) % imageCount());
-}
-
-int QMngHandlerPrivate::nextImageDelay() const
-{
- return nextDelay;
-}
-
-bool QMngHandlerPrivate::setBackgroundColor(const QColor &color)
-{
- mng_uint16 iRed = (mng_uint16)(color.red() << 8);
- mng_uint16 iBlue = (mng_uint16)(color.blue() << 8);
- mng_uint16 iGreen = (mng_uint16)(color.green() << 8);
- return (mng_set_bgcolor(hMNG, iRed, iBlue, iGreen) == MNG_NOERROR);
-}
-
-QColor QMngHandlerPrivate::backgroundColor() const
-{
- mng_uint16 iRed;
- mng_uint16 iBlue;
- mng_uint16 iGreen;
- if (mng_get_bgcolor(hMNG, &iRed, &iBlue, &iGreen) == MNG_NOERROR)
- return QColor((iRed >> 8) & 0xFF, (iGreen >> 8) & 0xFF, (iBlue >> 8) & 0xFF);
- return QColor();
-}
-
-QMngHandler::QMngHandler()
- : d_ptr(new QMngHandlerPrivate(this))
-{
-}
-
-QMngHandler::~QMngHandler()
-{
-}
-
-/*! \reimp */
-bool QMngHandler::canRead() const
-{
- Q_D(const QMngHandler);
- if ((!d->haveReadNone
- && (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount))))
- || canRead(device()))
- {
- setFormat("mng");
- return true;
- }
- return false;
-}
-
-/*! \internal */
-bool QMngHandler::canRead(QIODevice *device)
-{
- if (!device) {
- qWarning("QMngHandler::canRead() called with no device");
- return false;
- }
-
- return device->peek(8) == "\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A";
-}
-
-/*! \reimp */
-QByteArray QMngHandler::name() const
-{
- return "mng";
-}
-
-/*! \reimp */
-bool QMngHandler::read(QImage *image)
-{
- Q_D(QMngHandler);
- return canRead() ? d->getNextImage(image) : false;
-}
-
-/*! \reimp */
-bool QMngHandler::write(const QImage &image)
-{
- Q_D(QMngHandler);
- return d->writeImage(image);
-}
-
-/*! \reimp */
-int QMngHandler::currentImageNumber() const
-{
- Q_D(const QMngHandler);
- return d->currentImageNumber();
-}
-
-/*! \reimp */
-int QMngHandler::imageCount() const
-{
- Q_D(const QMngHandler);
- return d->imageCount();
-}
-
-/*! \reimp */
-bool QMngHandler::jumpToImage(int imageNumber)
-{
- Q_D(QMngHandler);
- return d->jumpToImage(imageNumber);
-}
-
-/*! \reimp */
-bool QMngHandler::jumpToNextImage()
-{
- Q_D(QMngHandler);
- return d->jumpToNextImage();
-}
-
-/*! \reimp */
-int QMngHandler::loopCount() const
-{
- Q_D(const QMngHandler);
- if (d->iterCount == 0x7FFFFFFF)
- return -1; // infinite loop
- return d->iterCount-1;
-}
-
-/*! \reimp */
-int QMngHandler::nextImageDelay() const
-{
- Q_D(const QMngHandler);
- return d->nextImageDelay();
-}
-
-/*! \reimp */
-QVariant QMngHandler::option(ImageOption option) const
-{
- Q_D(const QMngHandler);
- if (option == QImageIOHandler::Animation)
- return true;
- else if (option == QImageIOHandler::BackgroundColor)
- return d->backgroundColor();
- return QVariant();
-}
-
-/*! \reimp */
-void QMngHandler::setOption(ImageOption option, const QVariant & value)
-{
- Q_D(QMngHandler);
- if (option == QImageIOHandler::BackgroundColor)
- d->setBackgroundColor(qvariant_cast<QColor>(value));
-}
-
-/*! \reimp */
-bool QMngHandler::supportsOption(ImageOption option) const
-{
- if (option == QImageIOHandler::Animation)
- return true;
- else if (option == QImageIOHandler::BackgroundColor)
- return true;
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/image/qmnghandler.pri b/src/gui/image/qmnghandler.pri
deleted file mode 100644
index ffb98de92b..0000000000
--- a/src/gui/image/qmnghandler.pri
+++ /dev/null
@@ -1,10 +0,0 @@
-# common to plugin and built-in forms
-INCLUDEPATH *= $$PWD
-HEADERS += $$PWD/qmnghandler_p.h
-SOURCES += $$PWD/qmnghandler.cpp
-contains(QT_CONFIG, system-mng) {
- if(unix|win32-g++*):LIBS += -lmng
- else:win32: LIBS += libmng.lib
-} else {
- include($$PWD/../../3rdparty/libmng.pri)
-}
diff --git a/src/gui/image/qmnghandler_p.h b/src/gui/image/qmnghandler_p.h
deleted file mode 100644
index 42b4fd06a8..0000000000
--- a/src/gui/image/qmnghandler_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 QMNGHANDLER_P_H
-#define QMNGHANDLER_P_H
-
-#include <QtCore/qscopedpointer.h>
-#include <QtGui/qimageiohandler.h>
-
-QT_BEGIN_NAMESPACE
-
-class QImage;
-class QByteArray;
-class QIODevice;
-class QVariant;
-class QMngHandlerPrivate;
-
-class QMngHandler : public QImageIOHandler
-{
- public:
- QMngHandler();
- ~QMngHandler();
- virtual bool canRead() const;
- virtual QByteArray name() const;
- virtual bool read(QImage *image);
- virtual bool write(const QImage &image);
- virtual int currentImageNumber() const;
- virtual int imageCount() const;
- virtual bool jumpToImage(int imageNumber);
- virtual bool jumpToNextImage();
- virtual int loopCount() const;
- virtual int nextImageDelay() const;
- static bool canRead(QIODevice *device);
- virtual QVariant option(ImageOption option) const;
- virtual void setOption(ImageOption option, const QVariant & value);
- virtual bool supportsOption(ImageOption option) const;
-
- private:
- Q_DECLARE_PRIVATE(QMngHandler)
- QScopedPointer<QMngHandlerPrivate> d_ptr;
-};
-
-QT_END_NAMESPACE
-
-#endif // QMNGHANDLER_P_H
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 0be6833a87..8dfcf57dfd 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index eb2b81d0b5..9d4cb87b15 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -55,7 +55,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QByteArray;
class QColor;
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index 776a17857e..45a8e29100 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qnativeimage_p.h b/src/gui/image/qnativeimage_p.h
index 0d8834cad3..7809d75c47 100644
--- a/src/gui/image/qnativeimage_p.h
+++ b/src/gui/image/qnativeimage_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpaintengine_pic.cpp b/src/gui/image/qpaintengine_pic.cpp
index cf9ecc17da..5cf5a37c5f 100644
--- a/src/gui/image/qpaintengine_pic.cpp
+++ b/src/gui/image/qpaintengine_pic.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpaintengine_pic_p.h b/src/gui/image/qpaintengine_pic_p.h
index 830867d89d..f5145a5305 100644
--- a/src/gui/image/qpaintengine_pic_p.h
+++ b/src/gui/image/qpaintengine_pic_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 1ca34df356..089cc5011c 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -1425,20 +1425,16 @@ QPictureHandler::QPictureHandler(const char *f, const char *h, const QByteArray&
typedef QList<QPictureHandler *> QPHList;
Q_GLOBAL_STATIC(QPHList, pictureHandlers)
-#ifndef QT_NO_LIBRARY
-Q_GLOBAL_STATIC(QMutex, mutex)
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, factoryLoader,
- (QPictureFormatInterface_iid,
- QLatin1String("/pictureformats")))
-#endif
void qt_init_picture_plugins()
{
#ifndef QT_NO_LIBRARY
- QMutexLocker locker(mutex());
- QFactoryLoader *loader = factoryLoader();
- QStringList keys = loader->keys();
+ static QBasicMutex mutex;
+ QMutexLocker locker(&mutex);
+ static QFactoryLoader loader(QPictureFormatInterface_iid,
+ QStringLiteral("/pictureformats"));
+ QStringList keys = loader.keys();
for (int i = 0; i < keys.count(); ++i)
- if (QPictureFormatInterface *format = qobject_cast<QPictureFormatInterface*>(loader->instance(keys.at(i))))
+ if (QPictureFormatInterface *format = qobject_cast<QPictureFormatInterface*>(loader.instance(keys.at(i))))
format->installIOHandler(keys.at(i));
#endif
}
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index e408d65cbc..c3dbab25c5 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_PICTURE
diff --git a/src/gui/image/qpicture_p.h b/src/gui/image/qpicture_p.h
index 8c68d19558..f2d1a88408 100644
--- a/src/gui/image/qpicture_p.h
+++ b/src/gui/image/qpicture_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp
index 558d4febce..cb46790d69 100644
--- a/src/gui/image/qpictureformatplugin.cpp
+++ b/src/gui/image/qpictureformatplugin.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h
index 9fd79c001d..7bcd32b4fd 100644
--- a/src/gui/image/qpictureformatplugin.h
+++ b/src/gui/image/qpictureformatplugin.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_PICTURE)
@@ -66,7 +65,7 @@ struct Q_GUI_EXPORT QPictureFormatInterface : public QFactoryInterface
virtual bool installIOHandler(const QString &) = 0;
};
-#define QPictureFormatInterface_iid "com.trolltech.Qt.QPictureFormatInterface"
+#define QPictureFormatInterface_iid "org.qt-project.Qt.QPictureFormatInterface"
Q_DECLARE_INTERFACE(QPictureFormatInterface, QPictureFormatInterface_iid)
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 48d393cc24..f1a06fa33c 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -1253,8 +1253,7 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
screen. Alternatively, if no manipulation is desired, the image
file can be loaded directly into a QPixmap. On Windows, the
QPixmap class also supports conversion between \c HBITMAP and
- QPixmap. On Symbian, the QPixmap class also supports conversion
- between CFbsBitmap and QPixmap.
+ QPixmap.
QPixmap provides a collection of functions that can be used to
obtain a variety of information about the pixmap. In addition,
@@ -1362,12 +1361,6 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
to the QPixmap, and returns the HICON handle. The fromWinHICON()
function returns a QPixmap that is equivalent to the given icon.
- In addition, on Symbian, the QPixmap class supports conversion to
- and from CFbsBitmap: the toSymbianCFbsBitmap() function creates
- CFbsBitmap equivalent to the QPixmap, based on given mode and returns
- a CFbsBitmap object. The fromSymbianCFbsBitmap() function returns a
- QPixmap that is equivalent to the given bitmap and given mode.
-
\section1 Pixmap Transformations
QPixmap supports a number of functions for creating a new pixmap
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 5e8ef70828..de76321f0a 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QImageWriter;
class QImageReader;
@@ -146,7 +145,7 @@ public:
inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = 0);
void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = 0);
-#ifdef QT_DEPRECATED
+#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED int serialNumber() const;
#endif
qint64 cacheKey() const;
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index 041c11af3a..e5222fa216 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 42d649642f..95397374c6 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmap_qpa.cpp b/src/gui/image/qpixmap_qpa.cpp
index 7f2ff2e266..162c5f5286 100644
--- a/src/gui/image/qpixmap_qpa.cpp
+++ b/src/gui/image/qpixmap_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 424572ebd4..3fe5216313 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index de4d0e6f17..864fad42ec 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index 5ee7ca9eba..6b0ec38f53 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -44,8 +44,8 @@
#include "qpixmap_raster_p.h"
#include <qglobal.h>
-#include <qt_windows.h>
#include <QScopedArrayPointer>
+#include <qt_windows.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 0f874bee6c..7769c45b2e 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 81f9f4b028..99bc59a50a 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QPixmapCache
{
diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h
index 2f609a8471..6ca109b03f 100644
--- a/src/gui/image/qpixmapcache_p.h
+++ b/src/gui/image/qpixmapcache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp
index 30f1f4819b..5162ea80d9 100644
--- a/src/gui/image/qplatformpixmap.cpp
+++ b/src/gui/image/qplatformpixmap.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -133,6 +133,8 @@ bool QPlatformPixmap::fromData(const uchar *buf, uint len, const char *format, Q
QBuffer b(&a);
b.open(QIODevice::ReadOnly);
QImage image = QImageReader(&b, format).read();
+ if (image.isNull())
+ return false;
fromImage(makeBitmapCompliantIfNeeded(this, image, flags), flags);
return !isNull();
}
diff --git a/src/gui/image/qplatformpixmap_qpa.h b/src/gui/image/qplatformpixmap_qpa.h
index 13c3bc2fe8..154c5079a7 100644
--- a/src/gui/image/qplatformpixmap_qpa.h
+++ b/src/gui/image/qplatformpixmap_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QImageReader;
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index a935ea3a28..7acad067b5 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qpnghandler_p.h b/src/gui/image/qpnghandler_p.h
index 8f17bd18a4..5f04f81ac3 100644
--- a/src/gui/image/qpnghandler_p.h
+++ b/src/gui/image/qpnghandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp
index b08f97a3ca..fc625c044f 100644
--- a/src/gui/image/qppmhandler.cpp
+++ b/src/gui/image/qppmhandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qppmhandler_p.h b/src/gui/image/qppmhandler_p.h
index 43e9b09f70..9cb47d063e 100644
--- a/src/gui/image/qppmhandler_p.h
+++ b/src/gui/image/qppmhandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp
deleted file mode 100644
index 475622021b..0000000000
--- a/src/gui/image/qtiffhandler.cpp
+++ /dev/null
@@ -1,668 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the plugins 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 "qtiffhandler_p.h"
-#include <qvariant.h>
-#include <qdebug.h>
-#include <qimage.h>
-#include <qglobal.h>
-extern "C" {
-#include "tiffio.h"
-}
-
-QT_BEGIN_NAMESPACE
-
-tsize_t qtiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
-{
- QIODevice* device = static_cast<QTiffHandler*>(fd)->device();
- return device->isReadable() ? device->read(static_cast<char *>(buf), size) : -1;
-}
-
-tsize_t qtiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
-{
- return static_cast<QTiffHandler*>(fd)->device()->write(static_cast<char *>(buf), size);
-}
-
-toff_t qtiffSeekProc(thandle_t fd, toff_t off, int whence)
-{
- QIODevice *device = static_cast<QTiffHandler*>(fd)->device();
- switch (whence) {
- case SEEK_SET:
- device->seek(off);
- break;
- case SEEK_CUR:
- device->seek(device->pos() + off);
- break;
- case SEEK_END:
- device->seek(device->size() + off);
- break;
- }
-
- return device->pos();
-}
-
-int qtiffCloseProc(thandle_t /*fd*/)
-{
- return 0;
-}
-
-toff_t qtiffSizeProc(thandle_t fd)
-{
- return static_cast<QTiffHandler*>(fd)->device()->size();
-}
-
-int qtiffMapProc(thandle_t /*fd*/, tdata_t* /*pbase*/, toff_t* /*psize*/)
-{
- return 0;
-}
-
-void qtiffUnmapProc(thandle_t /*fd*/, tdata_t /*base*/, toff_t /*size*/)
-{
-}
-
-// for 32 bits images
-inline void rotate_right_mirror_horizontal(QImage *const image)// rotate right->mirrored horizontal
-{
- const int height = image->height();
- const int width = image->width();
- QImage generated(/* width = */ height, /* height = */ width, image->format());
- const uint32 *originalPixel = reinterpret_cast<const uint32*>(image->bits());
- uint32 *const generatedPixels = reinterpret_cast<uint32*>(generated.bits());
- for (int row=0; row < height; ++row) {
- for (int col=0; col < width; ++col) {
- int idx = col * height + row;
- generatedPixels[idx] = *originalPixel;
- ++originalPixel;
- }
- }
- *image = generated;
-}
-
-inline void rotate_right_mirror_vertical(QImage *const image) // rotate right->mirrored vertical
-{
- const int height = image->height();
- const int width = image->width();
- QImage generated(/* width = */ height, /* height = */ width, image->format());
- const int lastCol = width - 1;
- const int lastRow = height - 1;
- const uint32 *pixel = reinterpret_cast<const uint32*>(image->bits());
- uint32 *const generatedBits = reinterpret_cast<uint32*>(generated.bits());
- for (int row=0; row < height; ++row) {
- for (int col=0; col < width; ++col) {
- int idx = (lastCol - col) * height + (lastRow - row);
- generatedBits[idx] = *pixel;
- ++pixel;
- }
- }
- *image = generated;
-}
-
-QTiffHandler::QTiffHandler() : QImageIOHandler()
-{
- compression = NoCompression;
-}
-
-bool QTiffHandler::canRead() const
-{
- if (canRead(device())) {
- setFormat("tiff");
- return true;
- }
- return false;
-}
-
-bool QTiffHandler::canRead(QIODevice *device)
-{
- if (!device) {
- qWarning("QTiffHandler::canRead() called with no device");
- return false;
- }
-
- // current implementation uses TIFFClientOpen which needs to be
- // able to seek, so sequential devices are not supported
- QByteArray header = device->peek(4);
- return header == QByteArray::fromRawData("\x49\x49\x2A\x00", 4)
- || header == QByteArray::fromRawData("\x4D\x4D\x00\x2A", 4);
-}
-
-bool QTiffHandler::read(QImage *image)
-{
- if (!canRead())
- return false;
-
- TIFF *const tiff = TIFFClientOpen("foo",
- "r",
- this,
- qtiffReadProc,
- qtiffWriteProc,
- qtiffSeekProc,
- qtiffCloseProc,
- qtiffSizeProc,
- qtiffMapProc,
- qtiffUnmapProc);
-
- if (!tiff) {
- return false;
- }
- uint32 width;
- uint32 height;
- uint16 photometric;
- if (!TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &width)
- || !TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &height)
- || !TIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric)) {
- TIFFClose(tiff);
- return false;
- }
-
- // BitsPerSample defaults to 1 according to the TIFF spec.
- uint16 bitPerSample;
- if (!TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bitPerSample))
- bitPerSample = 1;
- uint16 samplesPerPixel; // they may be e.g. grayscale with 2 samples per pixel
- if (!TIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &samplesPerPixel))
- samplesPerPixel = 1;
-
- bool grayscale = photometric == PHOTOMETRIC_MINISBLACK || photometric == PHOTOMETRIC_MINISWHITE;
- if (grayscale && bitPerSample == 1 && samplesPerPixel == 1) {
- if (image->size() != QSize(width, height) || image->format() != QImage::Format_Mono)
- *image = QImage(width, height, QImage::Format_Mono);
- QVector<QRgb> colortable(2);
- if (photometric == PHOTOMETRIC_MINISBLACK) {
- colortable[0] = 0xff000000;
- colortable[1] = 0xffffffff;
- } else {
- colortable[0] = 0xffffffff;
- colortable[1] = 0xff000000;
- }
- image->setColorTable(colortable);
-
- if (!image->isNull()) {
- for (uint32 y=0; y<height; ++y) {
- if (TIFFReadScanline(tiff, image->scanLine(y), y, 0) < 0) {
- TIFFClose(tiff);
- return false;
- }
- }
- }
- } else {
- if ((grayscale || photometric == PHOTOMETRIC_PALETTE) && bitPerSample == 8 && samplesPerPixel == 1) {
- if (image->size() != QSize(width, height) || image->format() != QImage::Format_Indexed8)
- *image = QImage(width, height, QImage::Format_Indexed8);
- if (!image->isNull()) {
- const uint16 tableSize = 256;
- QVector<QRgb> qtColorTable(tableSize);
- if (grayscale) {
- for (int i = 0; i<tableSize; ++i) {
- const int c = (photometric == PHOTOMETRIC_MINISBLACK) ? i : (255 - i);
- qtColorTable[i] = qRgb(c, c, c);
- }
- } else {
- // create the color table
- uint16 *redTable = 0;
- uint16 *greenTable = 0;
- uint16 *blueTable = 0;
- if (!TIFFGetField(tiff, TIFFTAG_COLORMAP, &redTable, &greenTable, &blueTable)) {
- TIFFClose(tiff);
- return false;
- }
- if (!redTable || !greenTable || !blueTable) {
- TIFFClose(tiff);
- return false;
- }
-
- for (int i = 0; i<tableSize ;++i) {
- const int red = redTable[i] / 257;
- const int green = greenTable[i] / 257;
- const int blue = blueTable[i] / 257;
- qtColorTable[i] = qRgb(red, green, blue);
- }
- }
-
- image->setColorTable(qtColorTable);
- for (uint32 y=0; y<height; ++y) {
- if (TIFFReadScanline(tiff, image->scanLine(y), y, 0) < 0) {
- TIFFClose(tiff);
- return false;
- }
- }
-
- // free redTable, greenTable and greenTable done by libtiff
- }
- } else {
- if (image->size() != QSize(width, height) || image->format() != QImage::Format_ARGB32)
- *image = QImage(width, height, QImage::Format_ARGB32);
- if (!image->isNull()) {
- const int stopOnError = 1;
- if (TIFFReadRGBAImageOriented(tiff, width, height, reinterpret_cast<uint32 *>(image->bits()), ORIENTATION_TOPLEFT, stopOnError)) {
- for (uint32 y=0; y<height; ++y)
- convert32BitOrder(image->scanLine(y), width);
- } else {
- TIFFClose(tiff);
- return false;
- }
- }
- }
- }
-
- if (image->isNull()) {
- TIFFClose(tiff);
- return false;
- }
-
- float resX = 0;
- float resY = 0;
- uint16 resUnit = RESUNIT_NONE;
- if (TIFFGetField(tiff, TIFFTAG_RESOLUTIONUNIT, &resUnit)
- && TIFFGetField(tiff, TIFFTAG_XRESOLUTION, &resX)
- && TIFFGetField(tiff, TIFFTAG_YRESOLUTION, &resY)) {
-
- switch(resUnit) {
- case RESUNIT_CENTIMETER:
- image->setDotsPerMeterX(qRound(resX * 100));
- image->setDotsPerMeterY(qRound(resY * 100));
- break;
- case RESUNIT_INCH:
- image->setDotsPerMeterX(qRound(resX * (100 / 2.54)));
- image->setDotsPerMeterY(qRound(resY * (100 / 2.54)));
- break;
- default:
- // do nothing as defaults have already
- // been set within the QImage class
- break;
- }
- }
-
- // rotate the image if the orientation is defined in the file
- uint16 orientationTag;
- if (TIFFGetField(tiff, TIFFTAG_ORIENTATION, &orientationTag)) {
- if (image->format() == QImage::Format_ARGB32) {
- // TIFFReadRGBAImageOriented() flip the image but does not rotate them
- switch (orientationTag) {
- case 5:
- rotate_right_mirror_horizontal(image);
- break;
- case 6:
- rotate_right_mirror_vertical(image);
- break;
- case 7:
- rotate_right_mirror_horizontal(image);
- break;
- case 8:
- rotate_right_mirror_vertical(image);
- break;
- }
- } else {
- switch (orientationTag) {
- case 1: // default orientation
- break;
- case 2: // mirror horizontal
- *image = image->mirrored(true, false);
- break;
- case 3: // mirror both
- *image = image->mirrored(true, true);
- break;
- case 4: // mirror vertical
- *image = image->mirrored(false, true);
- break;
- case 5: // rotate right mirror horizontal
- {
- QMatrix transformation;
- transformation.rotate(90);
- *image = image->transformed(transformation);
- *image = image->mirrored(true, false);
- break;
- }
- case 6: // rotate right
- {
- QMatrix transformation;
- transformation.rotate(90);
- *image = image->transformed(transformation);
- break;
- }
- case 7: // rotate right, mirror vertical
- {
- QMatrix transformation;
- transformation.rotate(90);
- *image = image->transformed(transformation);
- *image = image->mirrored(false, true);
- break;
- }
- case 8: // rotate left
- {
- QMatrix transformation;
- transformation.rotate(270);
- *image = image->transformed(transformation);
- break;
- }
- }
- }
- }
-
-
- TIFFClose(tiff);
- return true;
-}
-
-static bool checkGrayscale(const QVector<QRgb> &colorTable)
-{
- if (colorTable.size() != 256)
- return false;
-
- const bool increasing = (colorTable.at(0) == 0xff000000);
- for (int i = 0; i < 256; ++i) {
- if ((increasing && colorTable.at(i) != qRgb(i, i, i))
- || (!increasing && colorTable.at(i) != qRgb(255 - i, 255 - i, 255 - i)))
- return false;
- }
- return true;
-}
-
-bool QTiffHandler::write(const QImage &image)
-{
- if (!device()->isWritable())
- return false;
-
- TIFF *const tiff = TIFFClientOpen("foo",
- "w",
- this,
- qtiffReadProc,
- qtiffWriteProc,
- qtiffSeekProc,
- qtiffCloseProc,
- qtiffSizeProc,
- qtiffMapProc,
- qtiffUnmapProc);
- if (!tiff)
- return false;
-
- const int width = image.width();
- const int height = image.height();
-
- if (!TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, width)
- || !TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, height)
- || !TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG)) {
- TIFFClose(tiff);
- return false;
- }
-
- // set the resolution
- bool resolutionSet = false;
- const int dotPerMeterX = image.dotsPerMeterX();
- const int dotPerMeterY = image.dotsPerMeterY();
- if ((dotPerMeterX % 100) == 0
- && (dotPerMeterY % 100) == 0) {
- resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_CENTIMETER)
- && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, dotPerMeterX/100.0)
- && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, dotPerMeterY/100.0);
- } else {
- resolutionSet = TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH)
- && TIFFSetField(tiff, TIFFTAG_XRESOLUTION, static_cast<float>(image.logicalDpiX()))
- && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, static_cast<float>(image.logicalDpiY()));
- }
- if (!resolutionSet) {
- TIFFClose(tiff);
- return false;
- }
-
- // configure image depth
- const QImage::Format format = image.format();
- if (format == QImage::Format_Mono || format == QImage::Format_MonoLSB) {
- uint16 photometric = PHOTOMETRIC_MINISBLACK;
- if (image.colorTable().at(0) == 0xffffffff)
- photometric = PHOTOMETRIC_MINISWHITE;
- if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_CCITTRLE)
- || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 1)) {
- TIFFClose(tiff);
- return false;
- }
-
- // try to do the conversion in chunks no greater than 16 MB
- int chunks = (width * height / (1024 * 1024 * 16)) + 1;
- int chunkHeight = qMax(height / chunks, 1);
-
- int y = 0;
- while (y < height) {
- QImage chunk = image.copy(0, y, width, qMin(chunkHeight, height - y)).convertToFormat(QImage::Format_Mono);
-
- int chunkStart = y;
- int chunkEnd = y + chunk.height();
- while (y < chunkEnd) {
- if (TIFFWriteScanline(tiff, reinterpret_cast<uint32 *>(chunk.scanLine(y - chunkStart)), y) != 1) {
- TIFFClose(tiff);
- return false;
- }
- ++y;
- }
- }
- TIFFClose(tiff);
- } else if (format == QImage::Format_Indexed8) {
- const QVector<QRgb> colorTable = image.colorTable();
- bool isGrayscale = checkGrayscale(colorTable);
- if (isGrayscale) {
- uint16 photometric = PHOTOMETRIC_MINISBLACK;
- if (image.colorTable().at(0) == 0xffffffff)
- photometric = PHOTOMETRIC_MINISWHITE;
- if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, photometric)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_PACKBITS)
- || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) {
- TIFFClose(tiff);
- return false;
- }
- } else {
- if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_PACKBITS)
- || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) {
- TIFFClose(tiff);
- return false;
- }
- //// write the color table
- // allocate the color tables
- uint16 *redTable = static_cast<uint16 *>(malloc(256 * sizeof(uint16)));
- uint16 *greenTable = static_cast<uint16 *>(malloc(256 * sizeof(uint16)));
- uint16 *blueTable = static_cast<uint16 *>(malloc(256 * sizeof(uint16)));
- if (!redTable || !greenTable || !blueTable) {
- free(redTable);
- free(greenTable);
- free(blueTable);
- TIFFClose(tiff);
- return false;
- }
-
- // set the color table
- const int tableSize = colorTable.size();
- Q_ASSERT(tableSize <= 256);
- for (int i = 0; i<tableSize; ++i) {
- const QRgb color = colorTable.at(i);
- redTable[i] = qRed(color) * 257;
- greenTable[i] = qGreen(color) * 257;
- blueTable[i] = qBlue(color) * 257;
- }
-
- const bool setColorTableSuccess = TIFFSetField(tiff, TIFFTAG_COLORMAP, redTable, greenTable, blueTable);
-
- free(redTable);
- free(greenTable);
- free(blueTable);
-
- if (!setColorTableSuccess) {
- TIFFClose(tiff);
- return false;
- }
- }
-
- //// write the data
- // try to do the conversion in chunks no greater than 16 MB
- int chunks = (width * height/ (1024 * 1024 * 16)) + 1;
- int chunkHeight = qMax(height / chunks, 1);
-
- int y = 0;
- while (y < height) {
- QImage chunk = image.copy(0, y, width, qMin(chunkHeight, height - y));
-
- int chunkStart = y;
- int chunkEnd = y + chunk.height();
- while (y < chunkEnd) {
- if (TIFFWriteScanline(tiff, reinterpret_cast<uint32 *>(chunk.scanLine(y - chunkStart)), y) != 1) {
- TIFFClose(tiff);
- return false;
- }
- ++y;
- }
- }
- TIFFClose(tiff);
-
- } else {
- if (!TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB)
- || !TIFFSetField(tiff, TIFFTAG_COMPRESSION, compression == NoCompression ? COMPRESSION_NONE : COMPRESSION_LZW)
- || !TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 4)
- || !TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 8)) {
- TIFFClose(tiff);
- return false;
- }
- // try to do the ARGB32 conversion in chunks no greater than 16 MB
- int chunks = (width * height * 4 / (1024 * 1024 * 16)) + 1;
- int chunkHeight = qMax(height / chunks, 1);
-
- int y = 0;
- while (y < height) {
- QImage chunk = image.copy(0, y, width, qMin(chunkHeight, height - y)).convertToFormat(QImage::Format_ARGB32);
-
- int chunkStart = y;
- int chunkEnd = y + chunk.height();
- while (y < chunkEnd) {
- if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
- convert32BitOrder(chunk.scanLine(y - chunkStart), width);
- else
- convert32BitOrderBigEndian(chunk.scanLine(y - chunkStart), width);
-
- if (TIFFWriteScanline(tiff, reinterpret_cast<uint32 *>(chunk.scanLine(y - chunkStart)), y) != 1) {
- TIFFClose(tiff);
- return false;
- }
- ++y;
- }
- }
- TIFFClose(tiff);
- }
-
- return true;
-}
-
-QByteArray QTiffHandler::name() const
-{
- return "tiff";
-}
-
-QVariant QTiffHandler::option(ImageOption option) const
-{
- if (option == Size && canRead()) {
- QSize imageSize;
- qint64 pos = device()->pos();
- TIFF *tiff = TIFFClientOpen("foo",
- "r",
- const_cast<QTiffHandler*>(this),
- qtiffReadProc,
- qtiffWriteProc,
- qtiffSeekProc,
- qtiffCloseProc,
- qtiffSizeProc,
- qtiffMapProc,
- qtiffUnmapProc);
-
- if (tiff) {
- uint32 width = 0;
- uint32 height = 0;
- TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &width);
- TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &height);
- imageSize = QSize(width, height);
- TIFFClose(tiff);
- }
- device()->seek(pos);
- if (imageSize.isValid())
- return imageSize;
- } else if (option == CompressionRatio) {
- return compression;
- } else if (option == ImageFormat) {
- return QImage::Format_ARGB32;
- }
- return QVariant();
-}
-
-void QTiffHandler::setOption(ImageOption option, const QVariant &value)
-{
- if (option == CompressionRatio && value.type() == QVariant::Int)
- compression = value.toInt();
-}
-
-bool QTiffHandler::supportsOption(ImageOption option) const
-{
- return option == CompressionRatio
- || option == Size
- || option == ImageFormat;
-}
-
-void QTiffHandler::convert32BitOrder(void *buffer, int width)
-{
- uint32 *target = reinterpret_cast<uint32 *>(buffer);
- for (int32 x=0; x<width; ++x) {
- uint32 p = target[x];
- // convert between ARGB and ABGR
- target[x] = (p & 0xff000000)
- | ((p & 0x00ff0000) >> 16)
- | (p & 0x0000ff00)
- | ((p & 0x000000ff) << 16);
- }
-}
-
-void QTiffHandler::convert32BitOrderBigEndian(void *buffer, int width)
-{
- uint32 *target = reinterpret_cast<uint32 *>(buffer);
- for (int32 x=0; x<width; ++x) {
- uint32 p = target[x];
- target[x] = (p & 0xff000000) >> 24
- | (p & 0x00ff0000) << 8
- | (p & 0x0000ff00) << 8
- | (p & 0x000000ff) << 8;
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/image/qtiffhandler.pri b/src/gui/image/qtiffhandler.pri
deleted file mode 100644
index e1cc3ee2b7..0000000000
--- a/src/gui/image/qtiffhandler.pri
+++ /dev/null
@@ -1,10 +0,0 @@
-# common to plugin and built-in forms
-INCLUDEPATH *= $$PWD
-HEADERS += $$PWD/qtiffhandler_p.h
-SOURCES += $$PWD/qtiffhandler.cpp
-contains(QT_CONFIG, system-tiff) {
- if(unix|win32-g++*):LIBS += -ltiff
- else:win32: LIBS += libtiff.lib
-} else {
- include($$PWD/../../3rdparty/libtiff.pri)
-}
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
index e675e4ca67..8122c9cfe8 100644
--- a/src/gui/image/qvolatileimage.cpp
+++ b/src/gui/image/qvolatileimage.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h
index 8f1664c429..808def7c32 100644
--- a/src/gui/image/qvolatileimage_p.h
+++ b/src/gui/image/qvolatileimage_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qvolatileimagedata.cpp b/src/gui/image/qvolatileimagedata.cpp
index 32f265e9d9..3fcf24e187 100644
--- a/src/gui/image/qvolatileimagedata.cpp
+++ b/src/gui/image/qvolatileimagedata.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qvolatileimagedata_p.h b/src/gui/image/qvolatileimagedata_p.h
index 2890530aaa..59e1be12e3 100644
--- a/src/gui/image/qvolatileimagedata_p.h
+++ b/src/gui/image/qvolatileimagedata_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
deleted file mode 100644
index f438d96e68..0000000000
--- a/src/gui/image/qvolatileimagedata_symbian.cpp
+++ /dev/null
@@ -1,474 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "qvolatileimagedata_p.h"
-#include <fbs.h>
-#include <QtGui/private/qt_s60_p.h>
-#include <QtGui/qpaintengine.h>
-#include <QtGui/private/qimage_p.h>
-
-QT_BEGIN_NAMESPACE
-
-static CFbsBitmap *rasterizeBitmap(CFbsBitmap *bitmap, TDisplayMode newMode)
-{
- if (!bitmap) {
- return 0;
- }
- QScopedPointer<CFbsBitmap> newBitmap(new CFbsBitmap);
- if (newBitmap->Create(bitmap->SizeInPixels(), newMode) != KErrNone) {
- qWarning("QVolatileImage: Failed to create new bitmap");
- return 0;
- }
- CFbsBitmapDevice *bitmapDevice = 0;
- CFbsBitGc *bitmapGc = 0;
- QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(newBitmap.data()));
- QScopedPointer<CFbsBitmapDevice> bitmapDevicePtr(bitmapDevice);
- QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
- bitmapGc->Activate(bitmapDevice);
- bitmapGc->BitBlt(TPoint(), bitmap);
- delete bitmapGc;
- return newBitmap.take();
-}
-
-static inline TDisplayMode format2TDisplayMode(QImage::Format format)
-{
- TDisplayMode mode;
- switch (format) {
- case QImage::Format_MonoLSB:
- mode = EGray2;
- break;
- case QImage::Format_Indexed8:
- mode = EColor256;
- break;
- case QImage::Format_RGB444:
- mode = EColor4K;
- break;
- case QImage::Format_RGB16:
- mode = EColor64K;
- break;
- case QImage::Format_RGB888:
- mode = EColor16M;
- break;
- case QImage::Format_RGB32:
- mode = EColor16MU;
- break;
- case QImage::Format_ARGB32:
- mode = EColor16MA;
- break;
- case QImage::Format_ARGB32_Premultiplied:
- mode = Q_SYMBIAN_ECOLOR16MAP;
- break;
- default:
- mode = ENone;
- break;
- }
- return mode;
-}
-
-static CFbsBitmap *imageToBitmap(const QImage &image)
-{
- if (image.isNull()) {
- return 0;
- }
- CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Create(TSize(image.width(), image.height()),
- format2TDisplayMode(image.format())) == KErrNone) {
- bitmap->BeginDataAccess();
- uchar *dptr = reinterpret_cast<uchar *>(bitmap->DataAddress());
- int bmpLineLen = bitmap->DataStride();
- int imgLineLen = image.bytesPerLine();
- if (bmpLineLen == imgLineLen) {
- qMemCopy(dptr, image.constBits(), image.byteCount());
- } else {
- int len = qMin(bmpLineLen, imgLineLen);
- const uchar *sptr = image.constBits();
- for (int y = 0; y < image.height(); ++y) {
- qMemCopy(dptr, sptr, len);
- dptr += bmpLineLen;
- sptr += imgLineLen;
- }
- }
- bitmap->EndDataAccess();
- } else {
- qWarning("QVolatileImage: Failed to create source bitmap");
- delete bitmap;
- bitmap = 0;
- }
- return bitmap;
-}
-
-static CFbsBitmap *copyData(const QVolatileImageData &source)
-{
- source.beginDataAccess();
- CFbsBitmap *bmp = imageToBitmap(source.image);
- source.endDataAccess();
- return bmp;
-}
-
-static CFbsBitmap *convertData(const QVolatileImageData &source, QImage::Format newFormat)
-{
- source.beginDataAccess();
- QImage img = source.image.convertToFormat(newFormat);
- CFbsBitmap *bmp = imageToBitmap(img);
- source.endDataAccess();
- return bmp;
-}
-
-static CFbsBitmap *duplicateBitmap(const CFbsBitmap &sourceBitmap)
-{
- CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Duplicate(sourceBitmap.Handle()) != KErrNone) {
- qWarning("QVolatileImage: Failed to duplicate source bitmap");
- delete bitmap;
- bitmap = 0;
- }
- return bitmap;
-}
-
-static CFbsBitmap *createBitmap(int w, int h, QImage::Format format)
-{
- CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Create(TSize(w, h), format2TDisplayMode(format)) != KErrNone) {
- qWarning("QVolatileImage: Failed to create source bitmap %d,%d (%d)", w, h, format);
- delete bitmap;
- bitmap = 0;
- }
- return bitmap;
-}
-
-static inline bool bitmapNeedsCopy(CFbsBitmap *bitmap)
-{
- bool needsCopy = bitmap->IsCompressedInRAM();
-#ifdef Q_SYMBIAN_HAS_EXTENDED_BITMAP_TYPE
- needsCopy |= (bitmap->ExtendedBitmapType() != KNullUid);
-#endif
- return needsCopy;
-}
-
-static bool cleanup_function_registered = false;
-static QVolatileImageData *firstImageData = 0;
-
-static void cleanup()
-{
- if (RFbsSession::GetSession()) {
- QVolatileImageData *imageData = firstImageData;
- while (imageData) {
- imageData->release();
- imageData = imageData->next;
- }
- }
-}
-
-static void ensureCleanup()
-{
- // Destroy all underlying bitmaps in a post routine to prevent panics.
- // This is a must because CFbsBitmap destructor needs the fbs session,
- // that was used to create the bitmap, to be open still.
- if (!cleanup_function_registered) {
- qAddPostRoutine(cleanup);
- cleanup_function_registered = true;
- }
-}
-
-static void registerImageData(QVolatileImageData *imageData)
-{
- ensureCleanup();
- imageData->next = firstImageData;
- if (firstImageData) {
- firstImageData->prev = imageData;
- }
- firstImageData = imageData;
-}
-
-static void unregisterImageData(QVolatileImageData *imageData)
-{
- if (imageData->prev) {
- imageData->prev->next = imageData->next;
- } else {
- firstImageData = imageData->next;
- }
- if (imageData->next) {
- imageData->next->prev = imageData->prev;
- }
-}
-
-QVolatileImageData::QVolatileImageData()
- : next(0), prev(0), bitmap(0), pengine(0)
-{
- registerImageData(this);
-}
-
-QVolatileImageData::QVolatileImageData(int w, int h, QImage::Format format)
- : next(0), prev(0), bitmap(0), pengine(0)
-{
- registerImageData(this);
- bitmap = createBitmap(w, h, format);
- updateImage();
-}
-
-QVolatileImageData::QVolatileImageData(const QImage &sourceImage)
- : next(0), prev(0), bitmap(0), pengine(0)
-{
- registerImageData(this);
- image = sourceImage;
- // The following is not mandatory, but we do it here to have a bitmap
- // created always in order to reduce local heap usage.
- ensureBitmap();
-}
-
-QVolatileImageData::QVolatileImageData(void *nativeImage, void *nativeMask)
- : next(0), prev(0), bitmap(0), pengine(0)
-{
- registerImageData(this);
- if (nativeImage) {
- CFbsBitmap *source = static_cast<CFbsBitmap *>(nativeImage);
- CFbsBitmap *mask = static_cast<CFbsBitmap *>(nativeMask);
- initWithBitmap(source);
- if (mask) {
- applyMask(mask);
- }
- }
-}
-
-QVolatileImageData::QVolatileImageData(const QVolatileImageData &other)
-{
- bitmap = 0;
- pengine = 0;
- next = prev = 0;
- registerImageData(this);
- if (!other.image.isNull()) {
- bitmap = copyData(other);
- updateImage();
- }
-}
-
-QVolatileImageData::~QVolatileImageData()
-{
- release();
- unregisterImageData(this);
-}
-
-void QVolatileImageData::release()
-{
- delete bitmap;
- bitmap = 0;
- delete pengine;
- pengine = 0;
-}
-
-void QVolatileImageData::beginDataAccess() const
-{
- if (bitmap) {
- bitmap->BeginDataAccess();
- }
-}
-
-void QVolatileImageData::endDataAccess(bool readOnly) const
-{
- if (bitmap) {
- bitmap->EndDataAccess(readOnly);
- }
-}
-
-bool QVolatileImageData::ensureFormat(QImage::Format format)
-{
- if (image.isNull()) {
- return false;
- }
- if (image.format() != format) {
- CFbsBitmap *newBitmap = convertData(*this, format);
- if (newBitmap && newBitmap != bitmap) {
- delete bitmap;
- bitmap = newBitmap;
- updateImage();
- } else {
- return false;
- }
- }
- return true;
-}
-
-void *QVolatileImageData::duplicateNativeImage() const
-{
- const_cast<QVolatileImageData *>(this)->ensureBitmap();
- if (bitmap) {
- if (bitmap->DisplayMode() == EColor16M) {
- // slow path: needs rgb swapping
- beginDataAccess();
- QImage tmp = image.rgbSwapped();
- endDataAccess(true);
- return imageToBitmap(tmp);
- } else if (bitmap->DisplayMode() == EGray2) {
- // slow path: needs inverting pixels
- beginDataAccess();
- QImage tmp = image.copy();
- endDataAccess(true);
- tmp.invertPixels();
- return imageToBitmap(tmp);
- } else {
- // fast path: just duplicate the bitmap
- return duplicateBitmap(*bitmap);
- }
- }
- return 0;
-}
-
-void QVolatileImageData::updateImage()
-{
- if (bitmap) {
- TSize size = bitmap->SizeInPixels();
- beginDataAccess();
- // Use existing buffer, no copy. The data address never changes so it
- // is enough to do this whenever we have a new CFbsBitmap. N.B. never
- // use const uchar* here, that would create a read-only image data which
- // would make a copy in detach() even when refcount is 1.
- image = QImage(reinterpret_cast<uchar *>(bitmap->DataAddress()),
- size.iWidth, size.iHeight, bitmap->DataStride(),
- qt_TDisplayMode2Format(bitmap->DisplayMode()));
- endDataAccess(true);
- } else {
- image = QImage();
- }
-}
-
-void QVolatileImageData::initWithBitmap(CFbsBitmap *source)
-{
- bool needsCopy = bitmapNeedsCopy(source);
- if (source->DisplayMode() == EColor16M) {
- // EColor16M is BGR
- CFbsBitmap *unswappedBmp = source;
- if (needsCopy) {
- unswappedBmp = rasterizeBitmap(source, source->DisplayMode());
- }
- unswappedBmp->BeginDataAccess();
- TSize sourceSize = unswappedBmp->SizeInPixels();
- QImage img((uchar *) unswappedBmp->DataAddress(),
- sourceSize.iWidth, sourceSize.iHeight, unswappedBmp->DataStride(),
- qt_TDisplayMode2Format(unswappedBmp->DisplayMode()));
- img = img.rgbSwapped();
- unswappedBmp->EndDataAccess(true);
- bitmap = imageToBitmap(img);
- if (needsCopy) {
- delete unswappedBmp;
- }
- } else if (needsCopy) {
- // Rasterize extended and compressed bitmaps.
- bitmap = rasterizeBitmap(source, EColor16MAP);
- } else if (source->DisplayMode() == EGray2) {
- // The pixels will be inverted, must make a copy.
- bitmap = rasterizeBitmap(source, source->DisplayMode());
- } else {
- // Efficient path: no pixel data copying. Just duplicate. This of course
- // means the original bitmap's data may get modified, but that's fine
- // and is in accordance with the QPixmap::fromSymbianCFbsBitmap() docs.
- bitmap = duplicateBitmap(*source);
- }
- updateImage();
- if (bitmap && bitmap->DisplayMode() == EGray2) {
- // Symbian thinks set pixels are white/transparent, Qt thinks they are
- // foreground/solid. Invert mono bitmaps so that masks work correctly.
- beginDataAccess();
- image.invertPixels();
- endDataAccess();
- }
-}
-
-void QVolatileImageData::applyMask(CFbsBitmap *mask)
-{
- ensureFormat(QImage::Format_ARGB32_Premultiplied);
- bool destroyMask = false;
- if (bitmapNeedsCopy(mask)) {
- mask = rasterizeBitmap(mask, EColor16MU);
- if (!mask) {
- return;
- }
- destroyMask = true;
- }
- mask->BeginDataAccess();
- TSize maskSize = mask->SizeInPixels();
- QImage maskImg((const uchar *) mask->DataAddress(), maskSize.iWidth, maskSize.iHeight,
- mask->DataStride(), qt_TDisplayMode2Format(mask->DisplayMode()));
- if (mask->DisplayMode() == EGray2) {
- maskImg = maskImg.copy();
- maskImg.invertPixels();
- }
- beginDataAccess();
- image.setAlphaChannel(maskImg);
- endDataAccess();
- mask->EndDataAccess(true);
- ensureImage();
- if (destroyMask) {
- delete mask;
- }
-}
-
-void QVolatileImageData::ensureImage()
-{
- if (bitmap && !image.isNull()) {
- QImageData *imaged = image.data_ptr();
- if (imaged->ref != 1 || imaged->ro_data) {
- // This is bad, the imagedata got shared somehow. Detach, in order to
- // have the next check fail and thus have 'image' recreated.
- beginDataAccess();
- image.detach();
- endDataAccess(true);
- }
- }
- if (bitmap && image.constBits() != reinterpret_cast<const uchar *>(bitmap->DataAddress())) {
- // Should not ever get here. If we do it means that either 'image' has
- // been replaced with a copy (e.g. because some QImage API assigned a
- // new, regular QImage to *this) or the bitmap's data address changed
- // unexpectedly.
- qWarning("QVolatileImageData: Ptr mismatch");
- // Recover by recreating the image so that it uses the bitmap as its buffer.
- updateImage();
- }
-}
-
-void QVolatileImageData::ensureBitmap()
-{
- if (!bitmap && !image.isNull()) {
- bitmap = imageToBitmap(image);
- updateImage();
- }
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index dda57239cc..9990c9f4d0 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qxbmhandler_p.h b/src/gui/image/qxbmhandler_p.h
index 13ab343f8b..081f3133b2 100644
--- a/src/gui/image/qxbmhandler_p.h
+++ b/src/gui/image/qxbmhandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index 48047d2d55..f2fab75d76 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/image/qxpmhandler_p.h b/src/gui/image/qxpmhandler_p.h
index 092d9bb3f1..7acdc49eec 100644
--- a/src/gui/image/qxpmhandler_p.h
+++ b/src/gui/image/qxpmhandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index bf552c9991..7b01ba14cd 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -21,9 +21,6 @@ HEADERS += \
kernel/qplatformthemefactory_qpa_p.h \
kernel/qplatformthemeplugin_qpa.h \
kernel/qplatformwindow_qpa.h \
- kernel/qplatformopenglcontext_qpa.h \
- kernel/qopenglcontext.h \
- kernel/qopenglcontext_p.h \
kernel/qplatformcursor_qpa.h \
kernel/qplatformclipboard_qpa.h \
kernel/qplatformnativeinterface_qpa.h \
@@ -41,6 +38,8 @@ HEADERS += \
kernel/qdnd_p.h \
kernel/qevent.h \
kernel/qevent_p.h \
+ kernel/qinputmethod.h \
+ kernel/qinputmethod_p.h \
kernel/qinputpanel.h \
kernel/qinputpanel_p.h \
kernel/qkeysequence.h \
@@ -54,7 +53,9 @@ HEADERS += \
kernel/qscreen_p.h \
kernel/qstylehints.h \
kernel/qtouchdevice.h \
- kernel/qtouchdevice_p.h
+ kernel/qtouchdevice_p.h \
+ kernel/qplatformsharedgraphicscache_qpa.h \
+ kernel/qplatformdialoghelper_qpa.h
SOURCES += \
kernel/qclipboard_qpa.cpp \
@@ -71,8 +72,6 @@ SOURCES += \
kernel/qplatformthemefactory_qpa.cpp \
kernel/qplatformthemeplugin_qpa.cpp \
kernel/qplatformwindow_qpa.cpp \
- kernel/qplatformopenglcontext_qpa.cpp \
- kernel/qopenglcontext.cpp \
kernel/qplatformcursor_qpa.cpp \
kernel/qplatformclipboard_qpa.cpp \
kernel/qplatformnativeinterface_qpa.cpp \
@@ -87,7 +86,7 @@ SOURCES += \
kernel/qdrag.cpp \
kernel/qdnd.cpp \
kernel/qevent.cpp \
- kernel/qinputpanel.cpp \
+ kernel/qinputmethod.cpp \
kernel/qkeysequence.cpp \
kernel/qkeymapper.cpp \
kernel/qkeymapper_qpa.cpp \
@@ -96,6 +95,19 @@ SOURCES += \
kernel/qscreen.cpp \
kernel/qshortcutmap.cpp \
kernel/qstylehints.cpp \
- kernel/qtouchdevice.cpp
+ kernel/qtouchdevice.cpp \
+ kernel/qplatformsharedgraphicscache_qpa.cpp \
+ kernel/qplatformdialoghelper_qpa.cpp
+
+contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, egl) {
+ HEADERS += \
+ kernel/qplatformopenglcontext_qpa.h \
+ kernel/qopenglcontext.h \
+ kernel/qopenglcontext_p.h
+
+ SOURCES += \
+ kernel/qplatformopenglcontext_qpa.cpp \
+ kernel/qopenglcontext.cpp
+}
win32:HEADERS+=kernel/qwindowdefs_win.h
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index 341b042328..8e881aabc7 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qclipboard.h b/src/gui/kernel/qclipboard.h
index b909889815..5a251dd0ef 100644
--- a/src/gui/kernel/qclipboard.h
+++ b/src/gui/kernel/qclipboard.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_CLIPBOARD
diff --git a/src/gui/kernel/qclipboard_qpa.cpp b/src/gui/kernel/qclipboard_qpa.cpp
index edcf21babc..ec940385b8 100644
--- a/src/gui/kernel/qclipboard_qpa.cpp
+++ b/src/gui/kernel/qclipboard_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index bd327e1eb1..77eb1e1e9c 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index 7437da4aba..00b709b308 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QVariant;
diff --git a/src/gui/kernel/qcursor_p.h b/src/gui/kernel/qcursor_p.h
index a904260388..8623c22200 100644
--- a/src/gui/kernel/qcursor_p.h
+++ b/src/gui/kernel/qcursor_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qcursor_qpa.cpp b/src/gui/kernel/qcursor_qpa.cpp
index 6a12f977d3..7ba2e1c580 100644
--- a/src/gui/kernel/qcursor_qpa.cpp
+++ b/src/gui/kernel/qcursor_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index 4010fd73ff..b9f0fe4f5b 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index 47018edde8..857be34d10 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp
index 284b1e5c1b..694b12a180 100644
--- a/src/gui/kernel/qdrag.cpp
+++ b/src/gui/kernel/qdrag.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qdrag.h b/src/gui/kernel/qdrag.h
index ccadd8f1cc..0a1ddff2d9 100644
--- a/src/gui/kernel/qdrag.h
+++ b/src/gui/kernel/qdrag.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_DRAGANDDROP
class QMimeData;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 61ccaa5cfd..543f5453ff 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -1510,7 +1510,7 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
Cursor attributes and render them as specified.
\endlist
- \sa QInputContext
+ \sa QInputMethod
*/
/*!
@@ -1872,14 +1872,13 @@ QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery query) const
\sa pos() globalPos() device() pressure() xTilt() yTilt() uniqueId(), rotation(), tangentialPressure(), z()
*/
-QTabletEvent::QTabletEvent(Type type, const QPoint &pos, const QPoint &globalPos,
- const QPointF &hiResGlobalPos, int device, int pointerType,
+QTabletEvent::QTabletEvent(Type type, const QPointF &pos, const QPointF &globalPos,
+ int device, int pointerType,
qreal pressure, int xTilt, int yTilt, qreal tangentialPressure,
qreal rotation, int z, Qt::KeyboardModifiers keyState, qint64 uniqueID)
: QInputEvent(type, keyState),
mPos(pos),
mGPos(globalPos),
- mHiResGlobalPos(hiResGlobalPos),
mDev(device),
mPointerType(pointerType),
mXT(xTilt),
@@ -2208,7 +2207,7 @@ QDragMoveEvent::~QDragMoveEvent()
The states of the mouse buttons and keyboard modifiers at the time of
the drop are specified by \a buttons and \a modifiers.
*/ // ### pos is in which coordinate system?
-QDropEvent::QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
+QDropEvent::QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type)
: QEvent(type), p(pos), mouseState(buttons),
modState(modifiers), act(actions),
@@ -2743,7 +2742,7 @@ QShowEvent::~QShowEvent()
This event is only used to notify the application of a request.
It may be safely ignored.
- \note This class is currently supported for Mac OS X and Symbian only.
+ \note This class is currently supported for Mac OS X only.
*/
QFileOpenEventPrivate::~QFileOpenEventPrivate()
@@ -2807,8 +2806,6 @@ QUrl QFileOpenEvent::url() const
This is necessary as some files cannot be opened by name, but require specific
information stored in this event.
- For example, if this QFileOpenEvent contains a request to open a Symbian data caged file,
- the QFile could only be opened from the Symbian RFile used in the construction of this event.
\since 4.8
*/
@@ -3570,9 +3567,8 @@ QTouchEvent::TouchPoint::~TouchPoint()
/*!
Returns the id number of this touch point.
- Id numbers are globally sequential, starting at zero, meaning the
- first touch point in the application has id 0, the second has id 1,
- and so on.
+ Do not assume that id numbers start at zero or that they are sequential.
+ Such an assumption is often false due to the way the underlying drivers work.
*/
int QTouchEvent::TouchPoint::id() const
{
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a59b178cec..93dea41de9 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -61,7 +61,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QAction;
#ifndef QT_NO_GESTURES
@@ -183,21 +182,27 @@ public:
enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
XFreeEraser /*internal*/, RotationStylus };
enum PointerType { UnknownPointer, Pen, Cursor, Eraser };
- QTabletEvent(Type t, const QPoint &pos, const QPoint &globalPos, const QPointF &hiResGlobalPos,
+ QTabletEvent(Type t, const QPointF &pos, const QPointF &globalPos,
int device, int pointerType, qreal pressure, int xTilt, int yTilt,
qreal tangentialPressure, qreal rotation, int z,
Qt::KeyboardModifiers keyState, qint64 uniqueID);
~QTabletEvent();
- inline const QPoint &pos() const { return mPos; }
- inline const QPoint &globalPos() const { return mGPos; }
- inline const QPointF &hiResGlobalPos() const { return mHiResGlobalPos; }
- inline int x() const { return mPos.x(); }
- inline int y() const { return mPos.y(); }
- inline int globalX() const { return mGPos.x(); }
- inline int globalY() const { return mGPos.y(); }
- inline qreal hiResGlobalX() const { return mHiResGlobalPos.x(); }
- inline qreal hiResGlobalY() const { return mHiResGlobalPos.y(); }
+ inline const QPoint pos() const { return mPos.toPoint(); }
+ inline const QPoint globalPos() const { return mGPos.toPoint(); }
+#if QT_DEPRECATED_SINCE(5,0)
+ QT_DEPRECATED inline const QPointF &hiResGlobalPos() const { return mPos; }
+#endif
+
+ inline const QPointF &posF() const { return mPos; }
+ inline const QPointF &globalPosF() const { return mGPos; }
+
+ inline int x() const { return qRound(mPos.x()); }
+ inline int y() const { return qRound(mPos.y()); }
+ inline int globalX() const { return qRound(mGPos.x()); }
+ inline int globalY() const { return qRound(mGPos.y()); }
+ inline qreal hiResGlobalX() const { return mGPos.x(); }
+ inline qreal hiResGlobalY() const { return mGPos.y(); }
inline TabletDevice device() const { return TabletDevice(mDev); }
inline PointerType pointerType() const { return PointerType(mPointerType); }
inline qint64 uniqueId() const { return mUnique; }
@@ -209,8 +214,7 @@ public:
inline int yTilt() const { return mYT; }
protected:
- QPoint mPos, mGPos;
- QPointF mHiResGlobalPos;
+ QPointF mPos, mGPos;
int mDev, mPointerType, mXT, mYT, mZ;
qreal mPress, mTangential, mRot;
qint64 mUnique;
@@ -477,11 +481,12 @@ class QMimeData;
class Q_GUI_EXPORT QDropEvent : public QEvent
{
public:
- QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
+ QDropEvent(const QPointF& pos, Qt::DropActions actions, const QMimeData *data,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop);
~QDropEvent();
- inline const QPoint &pos() const { return p; }
+ inline const QPoint pos() const { return p.toPoint(); }
+ inline const QPointF &posF() const { return p; }
inline Qt::MouseButtons mouseButtons() const { return mouseState; }
inline Qt::KeyboardModifiers keyboardModifiers() const { return modState; }
@@ -497,7 +502,7 @@ public:
protected:
friend class QApplication;
- QPoint p;
+ QPointF p;
Qt::MouseButtons mouseState;
Qt::KeyboardModifiers modState;
Qt::DropActions act;
@@ -759,10 +764,12 @@ public:
friend class QApplicationPrivate;
};
+#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED enum DeviceType {
TouchScreen,
TouchPad
};
+#endif
QTouchEvent(QEvent::Type eventType,
QTouchDevice *device = 0,
@@ -773,7 +780,9 @@ public:
inline QWindow *window() const { return _window; }
inline QObject *target() const { return _target; }
+#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); }
+#endif
inline Qt::TouchPointStates touchPointStates() const { return _touchPointStates; }
inline const QList<QTouchEvent::TouchPoint> &touchPoints() const { return _touchPoints; }
inline QTouchDevice *device() const { return _device; }
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 6dff55ca14..3f354c14e4 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qgenericplugin_qpa.cpp b/src/gui/kernel/qgenericplugin_qpa.cpp
index 23733e3ea9..493fc770b5 100644
--- a/src/gui/kernel/qgenericplugin_qpa.cpp
+++ b/src/gui/kernel/qgenericplugin_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qgenericplugin_qpa.h b/src/gui/kernel/qgenericplugin_qpa.h
index 196304d2a4..0b74250170 100644
--- a/src/gui/kernel/qgenericplugin_qpa.h
+++ b/src/gui/kernel/qgenericplugin_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_LIBRARY
@@ -60,7 +59,7 @@ QT_MODULE(Gui)
virtual QObject* create(const QString &name, const QString &spec) = 0;
};
-#define QGenericPluginFactoryInterface_iid "com.trolltech.Qt.QGenericPluginFactoryInterface"
+#define QGenericPluginFactoryInterface_iid "org.qt-project.Qt.QGenericPluginFactoryInterface"
Q_DECLARE_INTERFACE(QGenericPluginFactoryInterface, QGenericPluginFactoryInterface_iid)
class Q_GUI_EXPORT QGenericPlugin : public QObject, public QGenericPluginFactoryInterface
diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
index 4735604837..d4a7a9c20e 100644
--- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp
+++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.h b/src/gui/kernel/qgenericpluginfactory_qpa.h
index 2d1550ffac..a7c227f44a 100644
--- a/src/gui/kernel/qgenericpluginfactory_qpa.h
+++ b/src/gui/kernel/qgenericpluginfactory_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QString;
class QObject;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f92e66b38e..b1cbb5fcae 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,6 +54,7 @@
#include <QtCore/private/qabstracteventdispatcher_p.h>
#include <QtCore/qmutex.h>
#include <QtCore/private/qthread_p.h>
+#include <QtCore/qdir.h>
#include <QtDebug>
#include <qpalette.h>
#include <qscreen.h>
@@ -107,13 +108,12 @@ int QGuiApplicationPrivate::mousePressX = 0;
int QGuiApplicationPrivate::mousePressY = 0;
int QGuiApplicationPrivate::mouse_double_click_distance = 5;
-bool QGuiApplicationPrivate::quitOnLastWindowClosed = true;
-
static Qt::LayoutDirection layout_direction = Qt::LeftToRight;
static bool force_reverse = false;
QGuiApplicationPrivate *QGuiApplicationPrivate::self = 0;
QTouchDevice *QGuiApplicationPrivate::m_fakeTouchDevice = 0;
+int QGuiApplicationPrivate::m_fakeMouseSourcePointId = 0;
#ifndef QT_NO_CLIPBOARD
QClipboard *QGuiApplicationPrivate::qt_clipboard = 0;
@@ -124,7 +124,7 @@ QList<QScreen *> QGuiApplicationPrivate::screen_list;
QWindowList QGuiApplicationPrivate::window_list;
QWindow *QGuiApplicationPrivate::focus_window = 0;
-Q_GLOBAL_STATIC(QMutex, applicationFontMutex)
+static QBasicMutex applicationFontMutex;
QFont *QGuiApplicationPrivate::app_font = 0;
extern void qRegisterGuiVariant();
@@ -184,7 +184,7 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags)
: QCoreApplicationPrivate(argc, argv, flags),
styleHints(0),
- inputPanel(0)
+ inputMethod(0)
{
self = this;
application_type = QCoreApplication::GuiClient;
@@ -195,11 +195,56 @@ QWindow *QGuiApplication::focusWindow()
return QGuiApplicationPrivate::focus_window;
}
-QWindowList QGuiApplication::topLevelWindows()
+/*!
+ \fn QGuiApplication::focusObjectChanged(QObject *focusObject)
+
+ This signal is emitted when final receiver of events tied to focus is changed.
+ \sa focusObject()
+*/
+
+/*!
+ Returns the QObject in currently active window that will be final receiver of events
+ tied focus, such as key events.
+ */
+QObject *QGuiApplication::focusObject()
+{
+ if (focusWindow())
+ return focusWindow()->focusObject();
+ return 0;
+}
+
+/*!
+ \fn QGuiApplication::allWindows()
+
+ Returns a list of all the windows in the application.
+
+ The list is empty if there are no windows.
+
+ \sa topLevelWindows()
+ */
+QWindowList QGuiApplication::allWindows()
{
return QGuiApplicationPrivate::window_list;
}
+/*!
+ \fn QGuiApplication::topLevelWindows()
+
+ Returns a list of the top-level windows in the application.
+
+ \sa allWindows()
+ */
+QWindowList QGuiApplication::topLevelWindows()
+{
+ const QWindowList &list = QGuiApplicationPrivate::window_list;
+ QWindowList topLevelWindows;
+ for (int i = 0; i < list.size(); i++) {
+ if (!list.at(i)->parent())
+ topLevelWindows.prepend(list.at(i));
+ }
+ return topLevelWindows;
+}
+
QScreen *QGuiApplication::primaryScreen()
{
if (QGuiApplicationPrivate::screen_list.isEmpty())
@@ -340,8 +385,9 @@ void QGuiApplicationPrivate::createPlatformIntegration()
// TODO (msorvig): Create proper cross-platform solution for loading
// deployed platform plugins
#ifdef Q_OS_MAC
- if (platformPluginPath.isEmpty()) {
- platformPluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/");
+ const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/");
+ if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) {
+ platformPluginPath = bundlePluginPath;
}
#endif
@@ -437,8 +483,6 @@ void QGuiApplicationPrivate::init()
if (platform_integration == 0)
createPlatformIntegration();
- init_plugins(pluginList);
-
// Set up which span functions should be used in raster engine...
qInitDrawhelperAsm();
// and QImage conversion functions
@@ -454,6 +498,8 @@ void QGuiApplicationPrivate::init()
qRegisterGuiVariant();
is_app_running = true;
+ init_plugins(pluginList);
+ QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents);
}
QGuiApplicationPrivate::~QGuiApplicationPrivate()
@@ -465,6 +511,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
delete generic_plugin_list.at(i);
generic_plugin_list.clear();
+ delete app_font;
+ app_font = 0;
QFont::cleanup();
#ifndef QT_NO_CURSOR
@@ -476,7 +524,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
cleanupThreadData();
delete styleHints;
- delete inputPanel;
+ delete inputMethod;
delete platform_integration;
platform_integration = 0;
@@ -552,6 +600,11 @@ bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEvent
return QCoreApplication::compressEvent(event, receiver, postedEvents);
}
+bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)
+{
+ return window->nativeEvent(eventType, message, result);
+}
+
void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
{
switch(e->type) {
@@ -791,9 +844,13 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
if (previous == QGuiApplicationPrivate::focus_window)
return;
+ QObject *previousFocusObject = previous ? previous->focusObject() : 0;
+
if (previous) {
QFocusEvent focusOut(QEvent::FocusOut);
QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
+ QObject::disconnect(previous, SIGNAL(focusObjectChanged(QObject*)),
+ qApp, SIGNAL(focusObjectChanged(QObject*)));
} else {
QEvent appActivate(QEvent::ApplicationActivate);
qApp->sendSpontaneousEvent(qApp, &appActivate);
@@ -802,6 +859,8 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
if (QGuiApplicationPrivate::focus_window) {
QFocusEvent focusIn(QEvent::FocusIn);
QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn);
+ QObject::connect(QGuiApplicationPrivate::focus_window, SIGNAL(focusObjectChanged(QObject*)),
+ qApp, SIGNAL(focusObjectChanged(QObject*)));
} else {
QEvent appActivate(QEvent::ApplicationDeactivate);
qApp->sendSpontaneousEvent(qApp, &appActivate);
@@ -809,6 +868,9 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
if (self)
self->notifyActiveWindowChange(previous);
+
+ if (previousFocusObject != qApp->focusObject())
+ emit qApp->focusObjectChanged(qApp->focusObject());
}
void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse)
@@ -1036,11 +1098,22 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (touchEvent.device()->type() != QTouchDevice::TouchPad) {
Qt::MouseButtons b = eventType == QEvent::TouchEnd ? Qt::NoButton : Qt::LeftButton;
- const QTouchEvent::TouchPoint &touchPoint = touchEvent.touchPoints().first();
-
- QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp, touchPoint.pos(), touchPoint.screenPos(), b, e->modifiers);
- fake.synthetic = true;
- processMouseEvent(&fake);
+ QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints();
+ if (eventType == QEvent::TouchBegin)
+ m_fakeMouseSourcePointId = touchPoints.first().id();
+
+ for (int i = 0; i < touchPoints.count(); ++i) {
+ const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
+ if (touchPoint.id() == m_fakeMouseSourcePointId) {
+ QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
+ touchPoint.pos(),
+ touchPoint.screenPos(),
+ b, e->modifiers);
+ fake.synthetic = true;
+ processMouseEvent(&fake);
+ break;
+ }
+ }
}
}
}
@@ -1066,11 +1139,16 @@ void QGuiApplicationPrivate::reportScreenOrientationChange(QWindowSystemInterfac
return;
QScreen *s = e->screen.data();
- s->d_func()->currentOrientation = e->orientation;
+ s->d_func()->orientation = e->orientation;
- emit s->currentOrientationChanged(s->currentOrientation());
+ reportScreenOrientationChange(s);
+}
- QScreenOrientationChangeEvent event(s, s->currentOrientation());
+void QGuiApplicationPrivate::reportScreenOrientationChange(QScreen *s)
+{
+ emit s->orientationChanged(s->orientation());
+
+ QScreenOrientationChangeEvent event(s, s->orientation());
QCoreApplication::sendEvent(QCoreApplication::instance(), &event);
}
@@ -1086,6 +1164,10 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate:
QScreen *s = e->screen.data();
s->d_func()->geometry = e->geometry;
+ Qt::ScreenOrientation primaryOrientation = s->primaryOrientation();
+ Qt::ScreenOrientation orientation = s->orientation();
+ s->d_func()->updatePrimaryOrientation();
+
emit s->sizeChanged(s->size());
emit s->geometryChanged(s->geometry());
emit s->physicalDotsPerInchXChanged(s->physicalDotsPerInchX());
@@ -1093,6 +1175,12 @@ void QGuiApplicationPrivate::reportGeometryChange(QWindowSystemInterfacePrivate:
emit s->physicalDotsPerInchChanged(s->physicalDotsPerInch());
emit s->availableSizeChanged(s->availableSize());
emit s->availableGeometryChanged(s->availableGeometry());
+
+ if (s->primaryOrientation() != primaryOrientation)
+ emit s->primaryOrientationChanged(s->primaryOrientation());
+
+ if (s->orientation() != orientation)
+ reportScreenOrientationChange(s);
}
void QGuiApplicationPrivate::reportAvailableGeometryChange(
@@ -1241,7 +1329,7 @@ void QGuiApplication::setPalette(const QPalette &pal)
QFont QGuiApplication::font()
{
- QMutexLocker locker(applicationFontMutex());
+ QMutexLocker locker(&applicationFontMutex);
if (!QGuiApplicationPrivate::app_font)
QGuiApplicationPrivate::app_font =
new QFont(QGuiApplicationPrivate::platformIntegration()->fontDatabase()->defaultFont());
@@ -1250,7 +1338,7 @@ QFont QGuiApplication::font()
void QGuiApplication::setFont(const QFont &font)
{
- QMutexLocker locker(applicationFontMutex());
+ QMutexLocker locker(&applicationFontMutex);
if (!QGuiApplicationPrivate::app_font)
QGuiApplicationPrivate::app_font = new QFont(font);
else
@@ -1300,14 +1388,14 @@ void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *)
void QGuiApplication::setQuitOnLastWindowClosed(bool quit)
{
- QGuiApplicationPrivate::quitOnLastWindowClosed = quit;
+ QCoreApplication::setQuitLockEnabled(quit);
}
bool QGuiApplication::quitOnLastWindowClosed()
{
- return QGuiApplicationPrivate::quitOnLastWindowClosed;
+ return QCoreApplication::isQuitLockEnabled();
}
@@ -1315,11 +1403,6 @@ bool QGuiApplication::quitOnLastWindowClosed()
void QGuiApplicationPrivate::emitLastWindowClosed()
{
if (qGuiApp && qGuiApp->d_func()->in_exec) {
- if (QGuiApplicationPrivate::quitOnLastWindowClosed) {
- // get ready to quit, this event might be removed if the
- // event loop is re-entered, however
- QGuiApplication::postEvent(qApp, new QEvent(QEvent::Quit));
- }
emit qGuiApp->lastWindowClosed();
}
}
@@ -1491,12 +1574,17 @@ QStyleHints *QGuiApplication::styleHints() const
\sa QInputPanel
*/
-QInputPanel *QGuiApplication::inputPanel() const
+QInputMethod *QGuiApplication::inputMethod() const
{
Q_D(const QGuiApplication);
- if (!d->inputPanel)
- const_cast<QGuiApplicationPrivate *>(d)->inputPanel = new QInputPanel();
- return d->inputPanel;
+ if (!d->inputMethod)
+ const_cast<QGuiApplicationPrivate *>(d)->inputMethod = new QInputMethod();
+ return d->inputMethod;
+}
+
+QInputPanel *QGuiApplication::inputPanel() const
+{
+ return inputMethod();
}
@@ -1521,28 +1609,6 @@ uint QGuiApplicationPrivate::currentKeyPlatform()
}
/*!
- \since 4.2
- \obsolete
-
- Returns the current keyboard input locale. Replaced with QInputPanel::locale()
-*/
-QLocale QGuiApplication::keyboardInputLocale()
-{
- return qApp ? qApp->inputPanel()->locale() : QLocale::c();
-}
-
-/*!
- \since 4.2
- \obsolete
-
- Returns the current keyboard input direction. Replaced with QInputPanel::inputDirection()
-*/
-Qt::LayoutDirection QGuiApplication::keyboardInputDirection()
-{
- return qApp ? qApp->inputPanel()->inputDirection() : Qt::LeftToRight;
-}
-
-/*!
\since 4.5
\fn void QGuiApplication::fontDatabaseChanged()
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index dd7b1f8806..75046d8767 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -44,6 +44,7 @@
#include <QtCore/qcoreapplication.h>
#include <QtGui/qwindowdefs.h>
+#include <QtGui/qinputpanel.h>
#include <QtCore/qlocale.h>
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
@@ -52,14 +53,12 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QGuiApplicationPrivate;
class QPlatformNativeInterface;
class QPalette;
class QScreen;
class QStyleHints;
-class QInputPanel;
#if defined(qApp)
#undef qApp
@@ -82,6 +81,7 @@ public:
QGuiApplication(int &argc, char **argv, int = ApplicationFlags);
virtual ~QGuiApplication();
+ static QWindowList allWindows();
static QWindowList topLevelWindows();
static QWindow *topLevelAt(const QPoint &pos);
@@ -89,6 +89,7 @@ public:
static QT_DEPRECATED QWindow *activeWindow() { return focusWindow(); }
#endif
static QWindow *focusWindow();
+ static QObject *focusObject();
static QScreen *primaryScreen();
static QList<QScreen *> screens();
@@ -119,11 +120,9 @@ public:
static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
- QT_DEPRECATED static QLocale keyboardInputLocale();
- QT_DEPRECATED static Qt::LayoutDirection keyboardInputDirection();
-
QStyleHints *styleHints() const;
- QInputPanel *inputPanel() const;
+ QT_DEPRECATED QInputPanel *inputPanel() const;
+ QInputMethod *inputMethod() const;
static QPlatformNativeInterface *platformNativeInterface();
@@ -137,6 +136,7 @@ Q_SIGNALS:
void fontDatabaseChanged();
void screenAdded(QScreen *screen);
void lastWindowClosed();
+ void focusObjectChanged(QObject *focusObject);
protected:
bool event(QEvent *);
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 9c965cd109..d9444ebe95 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QGuiApplicationPrivate : public QCoreApplicationPrivate
{
@@ -96,7 +95,6 @@ public:
KB_KDE = 8,
KB_Gnome = 16,
KB_CDE = 32,
- KB_S60 = 64,
KB_All = 0xffff
};
@@ -122,6 +120,7 @@ public:
static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e);
+ static void reportScreenOrientationChange(QScreen *screen);
static void reportScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e);
static void reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e);
static void reportAvailableGeometryChange(QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *e);
@@ -135,6 +134,8 @@ public:
static Qt::DropAction processDrag(QWindow *w, QMimeData *dropData, const QPoint &p);
static Qt::DropAction processDrop(QWindow *w, QMimeData *dropData, const QPoint &p);
+ static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result);
+
static inline Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
{
if (!(alignment & Qt::AlignHorizontal_Mask))
@@ -180,9 +181,7 @@ public:
static QFont *app_font;
QStyleHints *styleHints;
- QInputPanel *inputPanel;
-
- static bool quitOnLastWindowClosed;
+ QInputMethod *inputMethod;
static QList<QObject *> generic_plugin_list;
#ifndef QT_NO_SHORTCUT
@@ -206,6 +205,7 @@ private:
static QGuiApplicationPrivate *self;
static QTouchDevice *m_fakeTouchDevice;
+ static int m_fakeMouseSourcePointId;
};
Q_GUI_EXPORT uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k);
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 532a5353e2..8378650dcb 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -99,46 +99,46 @@ Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler();
namespace {
template<typename T>
-struct TypeDefiniton {
+struct TypeDefinition {
static const bool IsAvailable = true;
};
// Ignore these types, as incomplete
#ifdef QT_NO_GEOM_VARIANT
-template<> struct TypeDefiniton<QRect> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QRectF> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QSize> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QSizeF> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QLine> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QLineF> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QPoint> { static const bool IsAvailable = false; };
-template<> struct TypeDefiniton<QPointF> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QRect> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QRectF> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QSize> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QSizeF> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QLine> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QLineF> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QPoint> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QPointF> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_SHORTCUT
-template<> struct TypeDefiniton<QKeySequence> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QKeySequence> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_CURSOR
-template<> struct TypeDefiniton<QCursor> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QCursor> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_MATRIX4X4
-template<> struct TypeDefiniton<QMatrix4x4> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QMatrix4x4> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR2D
-template<> struct TypeDefiniton<QVector2D> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QVector2D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR3D
-template<> struct TypeDefiniton<QVector3D> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QVector3D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_VECTOR4D
-template<> struct TypeDefiniton<QVector4D> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QVector4D> { static const bool IsAvailable = false; };
#endif
#ifdef QT_NO_QUATERNION
-template<> struct TypeDefiniton<QQuaternion> { static const bool IsAvailable = false; };
+template<> struct TypeDefinition<QQuaternion> { static const bool IsAvailable = false; };
#endif
struct GuiTypesFilter {
template<typename T>
struct Acceptor {
- static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && TypeDefiniton<T>::IsAvailable;
+ static const bool IsAccepted = QTypeModuleInfo<T>::IsGui && TypeDefinition<T>::IsAvailable;
};
};
} // namespace used to hide TypeDefinition
diff --git a/src/gui/kernel/qinputpanel.cpp b/src/gui/kernel/qinputmethod.cpp
index d6dd55b651..de00396e40 100644
--- a/src/gui/kernel/qinputpanel.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,45 +34,51 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <qinputpanel.h>
-#include <private/qinputpanel_p.h>
+#include <qinputmethod.h>
+#include <private/qinputmethod_p.h>
+#include <qguiapplication.h>
+#include <qtimer.h>
QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QInputPanel::QInputPanel()
- : QObject(*new QInputPanelPrivate)
+QInputMethod::QInputMethod()
+ : QObject(*new QInputMethodPrivate)
{
+ // might be instantiated before QGuiApplication is fully done, need to connect later
+ QTimer::singleShot(0, this, SLOT(q_connectFocusObject()));
}
/*!
\internal
*/
-QInputPanel::~QInputPanel()
+QInputMethod::~QInputMethod()
{
}
/*!
- \class QInputPanel
- \brief The QInputPanel class provides access to the active text input method.
+ \class QInputMethod
+ \brief The QInputMethod class provides access to the active text input method.
- QInputPanel is used by the text editors for integrating to the platform text input
+ QInputMethod is used by the text editors for integrating to the platform text input
methods and more commonly by application views for querying various text input method-related
information like virtual keyboard visibility and keyboard dimensions.
- Qt Quick also provides access to QInputPanel in QML through \l{QmlGlobalQtObject}{Qt global object}
+ Qt Quick also provides access to QInputMethod in QML through \l{QmlGlobalQtObject}{Qt global object}
as \c Qt.application.inputPanel property.
*/
/*!
- \property QInputPanel::inputItem
+ \property QInputMethod::inputItem
\brief Focused item that accepts text input
+ \obsolete
Input item is set and unset by the focused window. In QML Scene Graph this is done by
QQuickCanvas and the input item is either TextInput or TextEdit element. Any QObject can
@@ -82,15 +87,15 @@ QInputPanel::~QInputPanel()
\sa inputItemTransform, inputWindow, QInputMethodQueryEvent, QInputMethodEvent
*/
-QObject *QInputPanel::inputItem() const
+QObject *QInputMethod::inputItem() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
return d->inputItem.data();
}
-void QInputPanel::setInputItem(QObject *inputItem)
+void QInputMethod::setInputItem(QObject *inputItem)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
if (d->inputItem.data() == inputItem)
return;
@@ -101,8 +106,10 @@ void QInputPanel::setInputItem(QObject *inputItem)
/*!
Returns the currently focused window containing the input item.
+
+ \obsolete
*/
-QWindow *QInputPanel::inputWindow() const
+QWindow *QInputMethod::inputWindow() const
{
return qApp->activeWindow();
}
@@ -110,9 +117,9 @@ QWindow *QInputPanel::inputWindow() const
/*!
Returns the transformation from input item coordinates to the window coordinates.
*/
-QTransform QInputPanel::inputItemTransform() const
+QTransform QInputMethod::inputItemTransform() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
return d->inputItemTransform;
}
@@ -121,9 +128,9 @@ QTransform QInputPanel::inputItemTransform() const
Item transform needs to be updated by the focused window like QQuickCanvas whenever
item is moved inside the scene.
*/
-void QInputPanel::setInputItemTransform(const QTransform &transform)
+void QInputMethod::setInputItemTransform(const QTransform &transform)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
if (d->inputItemTransform == transform)
return;
@@ -132,15 +139,15 @@ void QInputPanel::setInputItemTransform(const QTransform &transform)
}
/*!
- \property QInputPanel::cursorRectangle
+ \property QInputMethod::cursorRectangle
\brief Input item's cursor rectangle in window coordinates.
Cursor rectangle is often used by various text editing controls
like text prediction popups for following the text being typed.
*/
-QRectF QInputPanel::cursorRectangle() const
+QRectF QInputMethod::cursorRectangle() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
if (!d->inputItem)
return QRectF();
@@ -155,12 +162,12 @@ QRectF QInputPanel::cursorRectangle() const
}
/*!
- \property QInputPanel::keyboardRectangle
+ \property QInputMethod::keyboardRectangle
\brief Virtual keyboard's geometry in window coordinates.
*/
-QRectF QInputPanel::keyboardRectangle() const
+QRectF QInputMethod::keyboardRectangle() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->keyboardRect();
@@ -176,9 +183,9 @@ QRectF QInputPanel::keyboardRectangle() const
function, keyboard should automatically open when
the text editor gains focus.
*/
-void QInputPanel::show()
+void QInputMethod::show()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->showInputPanel();
@@ -191,26 +198,26 @@ void QInputPanel::show()
keyboard should automatically close when the text editor loses
focus, for example when the parent view is closed.
*/
-void QInputPanel::hide()
+void QInputMethod::hide()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->hideInputPanel();
}
/*!
- \property QInputPanel::visible
+ \property QInputMethod::visible
\brief Virtual keyboard's visibility on the screen
- Input panel visibility remains false for devices
+ Input method visibility remains false for devices
with no virtual keyboards.
\sa show(), hide()
*/
-bool QInputPanel::visible() const
+bool QInputMethod::visible() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->isInputPanelVisible();
@@ -223,13 +230,13 @@ bool QInputPanel::visible() const
\sa show(), hide()
*/
-void QInputPanel::setVisible(bool visible)
+void QInputMethod::setVisible(bool visible)
{
visible ? show() : hide();
}
/*!
- \property QInputPanel::animating
+ \property QInputMethod::animating
\brief True when the virtual keyboard is being opened or closed.
Animating is false when keyboard is fully open or closed.
@@ -238,9 +245,9 @@ void QInputPanel::setVisible(bool visible)
false keyboard is being closed.
*/
-bool QInputPanel::isAnimating() const
+bool QInputMethod::isAnimating() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->isAnimating();
@@ -248,12 +255,12 @@ bool QInputPanel::isAnimating() const
}
/*!
- \property QInputPanel::locale
+ \property QInputMethod::locale
\brief Current input locale.
*/
-QLocale QInputPanel::locale() const
+QLocale QInputMethod::locale() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->locale();
@@ -261,12 +268,12 @@ QLocale QInputPanel::locale() const
}
/*!
- \property QInputPanel::inputDirection
+ \property QInputMethod::inputDirection
\brief Current input direction.
*/
-Qt::LayoutDirection QInputPanel::inputDirection() const
+Qt::LayoutDirection QInputMethod::inputDirection() const
{
- Q_D(const QInputPanel);
+ Q_D(const QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
return ic->inputDirection();
@@ -284,12 +291,12 @@ Qt::LayoutDirection QInputPanel::inputDirection() const
to change as well. The attributes that often change together with cursor position
have been grouped in Qt::ImQueryInput value for convenience.
*/
-void QInputPanel::update(Qt::InputMethodQueries queries)
+void QInputMethod::update(Qt::InputMethodQueries queries)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
- if (!d->inputItem)
- return;
+ if (queries & Qt::ImEnabled)
+ d->q_checkFocusObject(qApp->focusObject());
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
@@ -305,9 +312,9 @@ void QInputPanel::update(Qt::InputMethodQueries queries)
Input method resets automatically when the focused editor changes.
*/
-void QInputPanel::reset()
+void QInputMethod::reset()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->reset();
@@ -321,9 +328,9 @@ void QInputPanel::reset()
interrupts the text composing needs to flush the composing state by calling the
commit() function, for example when the cursor is moved elsewhere.
*/
-void QInputPanel::commit()
+void QInputMethod::commit()
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->commit();
@@ -334,14 +341,36 @@ void QInputPanel::commit()
the user. Input methods often use this information to offer more word
suggestions to the user.
*/
-void QInputPanel::invokeAction(Action a, int cursorPosition)
+void QInputMethod::invokeAction(Action a, int cursorPosition)
{
- Q_D(QInputPanel);
+ Q_D(QInputMethod);
QPlatformInputContext *ic = d->platformInputContext();
if (ic)
ic->invokeAction(a, cursorPosition);
}
+// temporary handlers for updating focus item based on application focus
+void QInputMethodPrivate::q_connectFocusObject()
+{
+ Q_Q(QInputMethod);
+ QObject::connect(qApp, SIGNAL(focusObjectChanged(QObject*)),
+ q, SLOT(q_checkFocusObject(QObject*)));
+ q_checkFocusObject(qApp->focusObject());
+}
+
+void QInputMethodPrivate::q_checkFocusObject(QObject *object)
+{
+ Q_Q(QInputMethod);
+
+ bool enabled = false;
+ if (object) {
+ QInputMethodQueryEvent query(Qt::ImEnabled);
+ QGuiApplication::sendEvent(object, &query);
+ enabled = query.value(Qt::ImEnabled).toBool();
+ }
+ q->setInputItem(enabled ? object : 0);
+}
+
QT_END_NAMESPACE
-#include "moc_qinputpanel.cpp"
+#include "moc_qinputmethod.cpp"
diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h
new file mode 100644
index 0000000000..0acddc05e2
--- /dev/null
+++ b/src/gui/kernel/qinputmethod.h
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** 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 QINPUTMETHOD_H
+#define QINPUTMETHOD_H
+
+#include <QtCore/qobject.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QInputMethodPrivate;
+class QWindow;
+class QRectF;
+class QTransform;
+
+class Q_GUI_EXPORT QInputMethod : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QInputMethod)
+ Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
+ Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
+ Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
+ Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
+ Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
+ Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
+ Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
+
+ Q_ENUMS(Action)
+public:
+ QT_DEPRECATED QObject *inputItem() const;
+ QT_DEPRECATED void setInputItem(QObject *inputItemChanged);
+
+ // the window containing the editor
+ QT_DEPRECATED QWindow *inputWindow() const;
+
+ QTransform inputItemTransform() const;
+ void setInputItemTransform(const QTransform &transform);
+
+ // in window coordinates
+ QRectF cursorRectangle() const; // ### what if we have rotations for the item?
+
+ // keyboard geometry in window coords
+ QRectF keyboardRectangle() const;
+
+ enum Action {
+ Click,
+ ContextMenu
+ };
+
+ bool visible() const;
+ void setVisible(bool visible);
+
+ bool isAnimating() const;
+
+ QLocale locale() const;
+ Qt::LayoutDirection inputDirection() const;
+
+public Q_SLOTS:
+ void show();
+ void hide();
+
+ void update(Qt::InputMethodQueries queries);
+ void reset();
+ void commit();
+
+ void invokeAction(Action a, int cursorPosition);
+
+Q_SIGNALS:
+ void inputItemChanged();
+ void cursorRectangleChanged();
+ void keyboardRectangleChanged();
+ void visibleChanged();
+ void animatingChanged();
+ void localeChanged();
+ void inputDirectionChanged(Qt::LayoutDirection newDirection);
+
+private:
+ friend class QGuiApplication;
+ friend class QGuiApplicationPrivate;
+ friend class QPlatformInputContext;
+ QInputMethod();
+ ~QInputMethod();
+
+ Q_PRIVATE_SLOT(d_func(), void q_connectFocusObject())
+ Q_PRIVATE_SLOT(d_func(), void q_checkFocusObject(QObject* object))
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif
diff --git a/src/gui/image/qtiffhandler_p.h b/src/gui/kernel/qinputmethod_p.h
index 16e68b0ad6..862764d1bc 100644
--- a/src/gui/image/qtiffhandler_p.h
+++ b/src/gui/kernel/qinputmethod_p.h
@@ -1,10 +1,9 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
@@ -35,44 +34,50 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef QTIFFHANDLER_P_H
-#define QTIFFHANDLER_P_H
+#ifndef QINPUTMETHOD_P_H
+#define QINPUTMETHOD_P_H
+
+#include <qinputmethod.h>
+#include <private/qobject_p.h>
+#include <QtCore/QWeakPointer>
+#include <QTransform>
+#include <qplatforminputcontext_qpa.h>
+#include <private/qguiapplication_p.h>
-#include <QtGui/qimageiohandler.h>
+QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QTiffHandler : public QImageIOHandler
+class QInputMethodPrivate : public QObjectPrivate
{
-public:
- QTiffHandler();
-
- bool canRead() const;
- bool read(QImage *image);
- bool write(const QImage &image);
+ Q_DECLARE_PUBLIC(QInputMethod)
- QByteArray name() const;
-
- static bool canRead(QIODevice *device);
-
- QVariant option(ImageOption option) const;
- void setOption(ImageOption option, const QVariant &value);
- bool supportsOption(ImageOption option) const;
+public:
+ inline QInputMethodPrivate() : testContext(0)
+ {}
+ QPlatformInputContext *platformInputContext() const
+ {
+ return testContext ? testContext : QGuiApplicationPrivate::platformIntegration()->inputContext();
+ }
+ static inline QInputMethodPrivate *get(QInputMethod *inputMethod)
+ {
+ return inputMethod->d_func();
+ }
+ void q_connectFocusObject();
+ void q_checkFocusObject(QObject *object);
- enum Compression {
- NoCompression = 0,
- LzwCompression = 1
- };
-private:
- void convert32BitOrder(void *buffer, int width);
- void convert32BitOrderBigEndian(void *buffer, int width);
- int compression;
+ QTransform inputItemTransform;
+ QWeakPointer<QObject> inputItem;
+ QPlatformInputContext *testContext;
};
QT_END_NAMESPACE
-#endif // QTIFFHANDLER_P_H
+QT_END_HEADER
+
+#endif
diff --git a/src/gui/kernel/qinputpanel.h b/src/gui/kernel/qinputpanel.h
index c33bd13451..95be71d7b5 100644
--- a/src/gui/kernel/qinputpanel.h
+++ b/src/gui/kernel/qinputpanel.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,87 +42,16 @@
#ifndef QINPUTPANEL_H
#define QINPUTPANEL_H
-#include <QtCore/qobject.h>
+#include <QtGui/qinputmethod.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
-
-class QInputPanelPrivate;
-class QWindow;
-class QRectF;
-class QTransform;
-
-class Q_GUI_EXPORT QInputPanel : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QInputPanel)
- Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged)
- Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
- Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
- Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
- Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
- Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
- Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
-
- Q_ENUMS(Action)
-public:
- QObject *inputItem() const;
- void setInputItem(QObject *inputItemChanged);
-
- // the window containing the editor
- QWindow *inputWindow() const;
-
- QTransform inputItemTransform() const;
- void setInputItemTransform(const QTransform &transform);
-
- // in window coordinates
- QRectF cursorRectangle() const; // ### what if we have rotations for the item?
-
- // keyboard geometry in window coords
- QRectF keyboardRectangle() const;
-
- enum Action {
- Click,
- ContextMenu
- };
-
- bool visible() const;
- void setVisible(bool visible);
-
- bool isAnimating() const;
-
- QLocale locale() const;
- Qt::LayoutDirection inputDirection() const;
-
-public Q_SLOTS:
- void show();
- void hide();
-
- void update(Qt::InputMethodQueries queries);
- void reset();
- void commit();
-
- void invokeAction(Action a, int cursorPosition);
-
-Q_SIGNALS:
- void inputItemChanged();
- void cursorRectangleChanged();
- void keyboardRectangleChanged();
- void visibleChanged();
- void animatingChanged();
- void localeChanged();
- void inputDirectionChanged(Qt::LayoutDirection newDirection);
-
-private:
- friend class QGuiApplication;
- friend class QGuiApplicationPrivate;
- friend class QPlatformInputContext;
- QInputPanel();
- ~QInputPanel();
-};
+#if 0
+#pragma qt_class(QInputPanel)
+#endif
+#define QInputPanel QInputMethod
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qinputpanel_p.h b/src/gui/kernel/qinputpanel_p.h
index f30c8a1b80..a4f24505c6 100644
--- a/src/gui/kernel/qinputpanel_p.h
+++ b/src/gui/kernel/qinputpanel_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,35 +42,16 @@
#ifndef QINPUTPANEL_P_H
#define QINPUTPANEL_P_H
-#include <qinputpanel.h>
-#include <private/qobject_p.h>
-#include <QtCore/QWeakPointer>
-#include <QTransform>
-#include <qplatforminputcontext_qpa.h>
-#include <private/qguiapplication_p.h>
+#include <private/qinputmethod_p.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QInputPanelPrivate : public QObjectPrivate
-{
-public:
- inline QInputPanelPrivate() : testContext(0)
- {}
- QPlatformInputContext *platformInputContext() const
- {
- return testContext ? testContext : QGuiApplicationPrivate::platformIntegration()->inputContext();
- }
- static inline QInputPanelPrivate *get(QInputPanel *inputPanel)
- {
- return inputPanel->d_func();
- }
-
- QTransform inputItemTransform;
- QWeakPointer<QObject> inputItem;
- QPlatformInputContext *testContext;
-};
+#if 0
+#pragma qt_class(QInputPanelPrivate)
+#endif
+#define QInputPanelPrivate QInputMethodPrivate
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qkeymapper.cpp b/src/gui/kernel/qkeymapper.cpp
index a411ee5904..9085579856 100644
--- a/src/gui/kernel/qkeymapper.cpp
+++ b/src/gui/kernel/qkeymapper.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qkeymapper_p.h b/src/gui/kernel/qkeymapper_p.h
index bf19f1d80a..a09cdd1244 100644
--- a/src/gui/kernel/qkeymapper_p.h
+++ b/src/gui/kernel/qkeymapper_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qkeymapper_qpa.cpp b/src/gui/kernel/qkeymapper_qpa.cpp
index fd04ff234c..8f029c9110 100644
--- a/src/gui/kernel/qkeymapper_qpa.cpp
+++ b/src/gui/kernel/qkeymapper_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 986701bd7b..021135b6fe 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -224,72 +224,72 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
corresponds to the \key Control keys.
\table
- \header \i StandardKey \i Windows \i Mac OS X \i KDE \i GNOME \i S60
- \row \i HelpContents \i F1 \i Ctrl+? \i F1 \i F1 \i F2
- \row \i WhatsThis \i Shift+F1 \i Shift+F1 \i Shift+F1 \i Shift+F1 \i Shift+F1
- \row \i Open \i Ctrl+O \i Ctrl+O \i Ctrl+O \i Ctrl+O \i (none)
- \row \i Close \i Ctrl+F4, Ctrl+W \i Ctrl+W, Ctrl+F4 \i Ctrl+W \i Ctrl+W \i (none)
- \row \i Save \i Ctrl+S \i Ctrl+S \i Ctrl+S \i Ctrl+S \i (none)
- \row \i Quit \i \i Ctrl+Q \i Qtrl+Q \i Qtrl+Q \i (none)
- \row \i SaveAs \i \i Ctrl+Shift+S \i \i Ctrl+Shift+S \i (none)
- \row \i New \i Ctrl+N \i Ctrl+N \i Ctrl+N \i Ctrl+N \i (none)
- \row \i Delete \i Del \i Del, Meta+D \i Del, Ctrl+D \i Del, Ctrl+D \i Del
- \row \i Cut \i Ctrl+X, Shift+Del \i Ctrl+X \i Ctrl+X, F20, Shift+Del \i Ctrl+X, F20, Shift+Del \i Ctrl+X
- \row \i Copy \i Ctrl+C, Ctrl+Ins \i Ctrl+C \i Ctrl+C, F16, Ctrl+Ins \i Ctrl+C, F16, Ctrl+Ins \i Ctrl+C
- \row \i Paste \i Ctrl+V, Shift+Ins \i Ctrl+V \i Ctrl+V, F18, Shift+Ins \i Ctrl+V, F18, Shift+Ins \i Ctrl+V
- \row \i Preferences \i \i Ctrl+, \i \i \i (none)
- \row \i Undo \i Ctrl+Z, Alt+Backspace \i Ctrl+Z \i Ctrl+Z, F14 \i Ctrl+Z, F14 \i Ctrl+Z
- \row \i Redo \i Ctrl+Y, Shift+Ctrl+Z, Alt+Shift+Backspace \i Ctrl+Shift+Z \i Ctrl+Shift+Z \i Ctrl+Shift+Z \i (none)
- \row \i Back \i Alt+Left, Backspace \i Ctrl+[ \i Alt+Left \i Alt+Left \i (none)
- \row \i Forward \i Alt+Right, Shift+Backspace \i Ctrl+] \i Alt+Right \i Alt+Right \i (none)
- \row \i Refresh \i F5 \i F5 \i F5 \i Ctrl+R, F5 \i (none)
- \row \i ZoomIn \i Ctrl+Plus \i Ctrl+Plus \i Ctrl+Plus \i Ctrl+Plus \i (none)
- \row \i ZoomOut \i Ctrl+Minus \i Ctrl+Minus \i Ctrl+Minus \i Ctrl+Minus \i (none)
- \row \i Print \i Ctrl+P \i Ctrl+P \i Ctrl+P \i Ctrl+P \i (none)
- \row \i AddTab \i Ctrl+T \i Ctrl+T \i Ctrl+Shift+N, Ctrl+T \i Ctrl+T \i (none)
- \row \i NextChild \i Ctrl+Tab, Forward, Ctrl+F6 \i Ctrl+}, Forward, Ctrl+Tab \i Ctrl+Tab, Forward, Ctrl+Comma \i Ctrl+Tab, Forward \i (none)
- \row \i PreviousChild \i Ctrl+Shift+Tab, Back, Ctrl+Shift+F6 \i Ctrl+{, Back, Ctrl+Shift+Tab \i Ctrl+Shift+Tab, Back, Ctrl+Period \i Ctrl+Shift+Tab, Back \i (none)
- \row \i Find \i Ctrl+F \i Ctrl+F \i Ctrl+F \i Ctrl+F \i (none)
- \row \i FindNext \i F3, Ctrl+G \i Ctrl+G \i F3 \i Ctrl+G, F3 \i (none)
- \row \i FindPrevious \i Shift+F3, Ctrl+Shift+G \i Ctrl+Shift+G \i Shift+F3 \i Ctrl+Shift+G, Shift+F3 \i (none)
- \row \i Replace \i Ctrl+H \i (none) \i Ctrl+R \i Ctrl+H \i (none)
- \row \i SelectAll \i Ctrl+A \i Ctrl+A \i Ctrl+A \i Ctrl+A \i (none)
- \row \i Bold \i Ctrl+B \i Ctrl+B \i Ctrl+B \i Ctrl+B \i (none)
- \row \i Italic \i Ctrl+I \i Ctrl+I \i Ctrl+I \i Ctrl+I \i (none)
- \row \i Underline \i Ctrl+U \i Ctrl+U \i Ctrl+U \i Ctrl+U \i (none)
- \row \i MoveToNextChar \i Right \i Right \i Right \i Right \i Right
- \row \i MoveToPreviousChar \i Left \i Left \i Left \i Left \i Left
- \row \i MoveToNextWord \i Ctrl+Right \i Alt+Right \i Ctrl+Right \i Ctrl+Right \i Ctrl+Right
- \row \i MoveToPreviousWord \i Ctrl+Left \i Alt+Left \i Ctrl+Left \i Ctrl+Left \i Ctrl+Left
- \row \i MoveToNextLine \i Down \i Down \i Down \i Down \i Down
- \row \i MoveToPreviousLine \i Up \i Up \i Up \i Up \i Up
- \row \i MoveToNextPage \i PgDown \i PgDown, Alt+PgDown, Meta+Down, Meta+PgDown\i PgDown \i PgDown \i PgDown
- \row \i MoveToPreviousPage \i PgUp \i PgUp, Alt+PgUp, Meta+Up, Meta+PgUp \i PgUp \i PgUp \i PgUp
- \row \i MoveToStartOfLine \i Home \i Ctrl+Left, Meta+Left \i Home \i Home \i Home
- \row \i MoveToEndOfLine \i End \i Ctrl+Right, Meta+Right \i End \i End \i End
- \row \i MoveToStartOfBlock \i (none) \i Alt+Up, Meta+A \i (none) \i (none) \i (none)
- \row \i MoveToEndOfBlock \i (none) \i Alt+Down, Meta+E \i (none) \i (none) \i (none)
- \row \i MoveToStartOfDocument\i Ctrl+Home \i Ctrl+Up, Home \i Ctrl+Home \i Ctrl+Home \i Ctrl+Home
- \row \i MoveToEndOfDocument \i Ctrl+End \i Ctrl+Down, End \i Ctrl+End \i Ctrl+End \i Ctrl+End
- \row \i SelectNextChar \i Shift+Right \i Shift+Right \i Shift+Right \i Shift+Right \i Shift+Right
- \row \i SelectPreviousChar \i Shift+Left \i Shift+Left \i Shift+Left \i Shift+Left \i Shift+Left
- \row \i SelectNextWord \i Ctrl+Shift+Right \i Alt+Shift+Right \i Ctrl+Shift+Right \i Ctrl+Shift+Right \i Ctrl+Shift+Right
- \row \i SelectPreviousWord \i Ctrl+Shift+Left \i Alt+Shift+Left \i Ctrl+Shift+Left \i Ctrl+Shift+Left \i Ctrl+Shift+Left
- \row \i SelectNextLine \i Shift+Down \i Shift+Down \i Shift+Down \i Shift+Down \i Shift+Down
- \row \i SelectPreviousLine \i Shift+Up \i Shift+Up \i Shift+Up \i Shift+Up \i Shift+Up
- \row \i SelectNextPage \i Shift+PgDown \i Shift+PgDown \i Shift+PgDown \i Shift+PgDown \i Shift+PgDown
- \row \i SelectPreviousPage \i Shift+PgUp \i Shift+PgUp \i Shift+PgUp \i Shift+PgUp \i Shift+PgUp
- \row \i SelectStartOfLine \i Shift+Home \i Ctrl+Shift+Left \i Shift+Home \i Shift+Home \i Shift+Home
- \row \i SelectEndOfLine \i Shift+End \i Ctrl+Shift+Right \i Shift+End \i Shift+End \i Shift+End
- \row \i SelectStartOfBlock \i (none) \i Alt+Shift+Up, Meta+Shift+A \i (none) \i (none) \i (none)
- \row \i SelectEndOfBlock \i (none) \i Alt+Shift+Down, Meta+Shift+E \i (none) \i (none) \i (none)
- \row \i SelectStartOfDocument\i Ctrl+Shift+Home \i Ctrl+Shift+Up, Shift+Home \i Ctrl+Shift+Home\i Ctrl+Shift+Home \i Ctrl+Shift+Home
- \row \i SelectEndOfDocument \i Ctrl+Shift+End \i Ctrl+Shift+Down, Shift+End \i Ctrl+Shift+End \i Ctrl+Shift+End \i Ctrl+Shift+End
- \row \i DeleteStartOfWord \i Ctrl+Backspace \i Alt+Backspace \i Ctrl+Backspace \i Ctrl+Backspace \i (none)
- \row \i DeleteEndOfWord \i Ctrl+Del \i (none) \i Ctrl+Del \i Ctrl+Del \i (none)
- \row \i DeleteEndOfLine \i (none) \i (none) \i Ctrl+K \i Ctrl+K \i (none)
- \row \i InsertParagraphSeparator \i Enter \i Enter \i Enter \i Enter \i (none)
- \row \i InsertLineSeparator \i Shift+Enter \i Meta+Enter \i Shift+Enter \i Shift+Enter \i (none)
+ \header \i StandardKey \i Windows \i Mac OS X \i KDE \i GNOME
+ \row \i HelpContents \i F1 \i Ctrl+? \i F1 \i F1
+ \row \i WhatsThis \i Shift+F1 \i Shift+F1 \i Shift+F1 \i Shift+F1
+ \row \i Open \i Ctrl+O \i Ctrl+O \i Ctrl+O \i Ctrl+O
+ \row \i Close \i Ctrl+F4, Ctrl+W \i Ctrl+W, Ctrl+F4 \i Ctrl+W \i Ctrl+W
+ \row \i Save \i Ctrl+S \i Ctrl+S \i Ctrl+S \i Ctrl+S
+ \row \i Quit \i \i Ctrl+Q \i Qtrl+Q \i Qtrl+Q
+ \row \i SaveAs \i \i Ctrl+Shift+S \i \i Ctrl+Shift+S
+ \row \i New \i Ctrl+N \i Ctrl+N \i Ctrl+N \i Ctrl+N
+ \row \i Delete \i Del \i Del, Meta+D \i Del, Ctrl+D \i Del, Ctrl+D
+ \row \i Cut \i Ctrl+X, Shift+Del \i Ctrl+X \i Ctrl+X, F20, Shift+Del \i Ctrl+X, F20, Shift+Del
+ \row \i Copy \i Ctrl+C, Ctrl+Ins \i Ctrl+C \i Ctrl+C, F16, Ctrl+Ins \i Ctrl+C, F16, Ctrl+Ins
+ \row \i Paste \i Ctrl+V, Shift+Ins \i Ctrl+V \i Ctrl+V, F18, Shift+Ins \i Ctrl+V, F18, Shift+Ins
+ \row \i Preferences \i \i Ctrl+, \i \i
+ \row \i Undo \i Ctrl+Z, Alt+Backspace \i Ctrl+Z \i Ctrl+Z, F14 \i Ctrl+Z, F14
+ \row \i Redo \i Ctrl+Y, Shift+Ctrl+Z, Alt+Shift+Backspace \i Ctrl+Shift+Z \i Ctrl+Shift+Z \i Ctrl+Shift+Z
+ \row \i Back \i Alt+Left, Backspace \i Ctrl+[ \i Alt+Left \i Alt+Left
+ \row \i Forward \i Alt+Right, Shift+Backspace \i Ctrl+] \i Alt+Right \i Alt+Right
+ \row \i Refresh \i F5 \i F5 \i F5 \i Ctrl+R, F5
+ \row \i ZoomIn \i Ctrl+Plus \i Ctrl+Plus \i Ctrl+Plus \i Ctrl+Plus
+ \row \i ZoomOut \i Ctrl+Minus \i Ctrl+Minus \i Ctrl+Minus \i Ctrl+Minus
+ \row \i Print \i Ctrl+P \i Ctrl+P \i Ctrl+P \i Ctrl+P
+ \row \i AddTab \i Ctrl+T \i Ctrl+T \i Ctrl+Shift+N, Ctrl+T \i Ctrl+T
+ \row \i NextChild \i Ctrl+Tab, Forward, Ctrl+F6 \i Ctrl+}, Forward, Ctrl+Tab \i Ctrl+Tab, Forward, Ctrl+Comma \i Ctrl+Tab, Forward
+ \row \i PreviousChild \i Ctrl+Shift+Tab, Back, Ctrl+Shift+F6 \i Ctrl+{, Back, Ctrl+Shift+Tab \i Ctrl+Shift+Tab, Back, Ctrl+Period \i Ctrl+Shift+Tab, Back
+ \row \i Find \i Ctrl+F \i Ctrl+F \i Ctrl+F \i Ctrl+F
+ \row \i FindNext \i F3, Ctrl+G \i Ctrl+G \i F3 \i Ctrl+G, F3
+ \row \i FindPrevious \i Shift+F3, Ctrl+Shift+G \i Ctrl+Shift+G \i Shift+F3 \i Ctrl+Shift+G, Shift+F3
+ \row \i Replace \i Ctrl+H \i (none) \i Ctrl+R \i Ctrl+H
+ \row \i SelectAll \i Ctrl+A \i Ctrl+A \i Ctrl+A \i Ctrl+A
+ \row \i Bold \i Ctrl+B \i Ctrl+B \i Ctrl+B \i Ctrl+B
+ \row \i Italic \i Ctrl+I \i Ctrl+I \i Ctrl+I \i Ctrl+I
+ \row \i Underline \i Ctrl+U \i Ctrl+U \i Ctrl+U \i Ctrl+U
+ \row \i MoveToNextChar \i Right \i Right \i Right \i Right
+ \row \i MoveToPreviousChar \i Left \i Left \i Left \i Left
+ \row \i MoveToNextWord \i Ctrl+Right \i Alt+Right \i Ctrl+Right \i Ctrl+Right
+ \row \i MoveToPreviousWord \i Ctrl+Left \i Alt+Left \i Ctrl+Left \i Ctrl+Left
+ \row \i MoveToNextLine \i Down \i Down \i Down \i Down
+ \row \i MoveToPreviousLine \i Up \i Up \i Up \i Up
+ \row \i MoveToNextPage \i PgDown \i PgDown, Alt+PgDown, Meta+Down, Meta+PgDown\i PgDown \i PgDown
+ \row \i MoveToPreviousPage \i PgUp \i PgUp, Alt+PgUp, Meta+Up, Meta+PgUp \i PgUp \i PgUp
+ \row \i MoveToStartOfLine \i Home \i Ctrl+Left, Meta+Left \i Home \i Home
+ \row \i MoveToEndOfLine \i End \i Ctrl+Right, Meta+Right \i End \i End
+ \row \i MoveToStartOfBlock \i (none) \i Alt+Up, Meta+A \i (none) \i (none)
+ \row \i MoveToEndOfBlock \i (none) \i Alt+Down, Meta+E \i (none) \i (none)
+ \row \i MoveToStartOfDocument\i Ctrl+Home \i Ctrl+Up, Home \i Ctrl+Home \i Ctrl+Home
+ \row \i MoveToEndOfDocument \i Ctrl+End \i Ctrl+Down, End \i Ctrl+End \i Ctrl+End
+ \row \i SelectNextChar \i Shift+Right \i Shift+Right \i Shift+Right \i Shift+Right
+ \row \i SelectPreviousChar \i Shift+Left \i Shift+Left \i Shift+Left \i Shift+Left
+ \row \i SelectNextWord \i Ctrl+Shift+Right \i Alt+Shift+Right \i Ctrl+Shift+Right \i Ctrl+Shift+Right
+ \row \i SelectPreviousWord \i Ctrl+Shift+Left \i Alt+Shift+Left \i Ctrl+Shift+Left \i Ctrl+Shift+Left
+ \row \i SelectNextLine \i Shift+Down \i Shift+Down \i Shift+Down \i Shift+Down
+ \row \i SelectPreviousLine \i Shift+Up \i Shift+Up \i Shift+Up \i Shift+Up
+ \row \i SelectNextPage \i Shift+PgDown \i Shift+PgDown \i Shift+PgDown \i Shift+PgDown
+ \row \i SelectPreviousPage \i Shift+PgUp \i Shift+PgUp \i Shift+PgUp \i Shift+PgUp
+ \row \i SelectStartOfLine \i Shift+Home \i Ctrl+Shift+Left \i Shift+Home \i Shift+Home
+ \row \i SelectEndOfLine \i Shift+End \i Ctrl+Shift+Right \i Shift+End \i Shift+End
+ \row \i SelectStartOfBlock \i (none) \i Alt+Shift+Up, Meta+Shift+A \i (none) \i (none)
+ \row \i SelectEndOfBlock \i (none) \i Alt+Shift+Down, Meta+Shift+E \i (none) \i (none)
+ \row \i SelectStartOfDocument\i Ctrl+Shift+Home \i Ctrl+Shift+Up, Shift+Home \i Ctrl+Shift+Home\i Ctrl+Shift+Home
+ \row \i SelectEndOfDocument \i Ctrl+Shift+End \i Ctrl+Shift+Down, Shift+End \i Ctrl+Shift+End \i Ctrl+Shift+End
+ \row \i DeleteStartOfWord \i Ctrl+Backspace \i Alt+Backspace \i Ctrl+Backspace \i Ctrl+Backspace
+ \row \i DeleteEndOfWord \i Ctrl+Del \i (none) \i Ctrl+Del \i Ctrl+Del
+ \row \i DeleteEndOfLine \i (none) \i (none) \i Ctrl+K \i Ctrl+K
+ \row \i InsertParagraphSeparator \i Enter \i Enter \i Enter \i Enter
+ \row \i InsertLineSeparator \i Shift+Enter \i Meta+Enter \i Shift+Enter \i Shift+Enter
\endtable
Note that, since the key sequences used for the standard shortcuts differ
@@ -646,9 +646,9 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::InsertParagraphSeparator,0, Qt::Key_Return, QGuiApplicationPrivate::KB_All},
{QKeySequence::InsertParagraphSeparator,0, Qt::Key_Enter, QGuiApplicationPrivate::KB_All},
{QKeySequence::Delete, 1, Qt::Key_Delete, QGuiApplicationPrivate::KB_All},
- {QKeySequence::MoveToStartOfLine, 0, Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::MoveToStartOfLine, 0, Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::MoveToStartOfDocument, 0, Qt::Key_Home, QGuiApplicationPrivate::KB_Mac},
- {QKeySequence::MoveToEndOfLine, 0, Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::MoveToEndOfLine, 0, Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::MoveToEndOfDocument, 0, Qt::Key_End, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::MoveToPreviousChar, 0, Qt::Key_Left, QGuiApplicationPrivate::KB_All},
{QKeySequence::MoveToPreviousLine, 0, Qt::Key_Up, QGuiApplicationPrivate::KB_All},
@@ -657,7 +657,6 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::MoveToPreviousPage, 1, Qt::Key_PageUp, QGuiApplicationPrivate::KB_All},
{QKeySequence::MoveToNextPage, 1, Qt::Key_PageDown, QGuiApplicationPrivate::KB_All},
{QKeySequence::HelpContents, 0, Qt::Key_F1, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
- {QKeySequence::HelpContents, 0, Qt::Key_F2, QGuiApplicationPrivate::KB_S60},
{QKeySequence::FindNext, 0, Qt::Key_F3, QGuiApplicationPrivate::KB_X11},
{QKeySequence::FindNext, 1, Qt::Key_F3, QGuiApplicationPrivate::KB_Win},
{QKeySequence::Refresh, 0, Qt::Key_F5, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
@@ -668,14 +667,13 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::PreviousChild, 0, Qt::Key_Back, QGuiApplicationPrivate::KB_All},
{QKeySequence::NextChild, 0, Qt::Key_Forward, QGuiApplicationPrivate::KB_All},
{QKeySequence::Forward, 0, Qt::SHIFT | Qt::Key_Backspace, QGuiApplicationPrivate::KB_Win},
- {QKeySequence::Delete, 0, Qt::SHIFT | Qt::Key_Backspace, QGuiApplicationPrivate::KB_S60},
{QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Return, QGuiApplicationPrivate::KB_All},
{QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Enter, QGuiApplicationPrivate::KB_All},
{QKeySequence::Paste, 0, Qt::SHIFT | Qt::Key_Insert, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::Cut, 0, Qt::SHIFT | Qt::Key_Delete, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11}, //## Check if this should work on mac
- {QKeySequence::SelectStartOfLine, 0, Qt::SHIFT | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::SelectStartOfLine, 0, Qt::SHIFT | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfDocument, 0, Qt::SHIFT | Qt::Key_Home, QGuiApplicationPrivate::KB_Mac},
- {QKeySequence::SelectEndOfLine, 0, Qt::SHIFT | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::SelectEndOfLine, 0, Qt::SHIFT | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::SelectEndOfDocument, 0, Qt::SHIFT | Qt::Key_End, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::SelectPreviousChar, 0, Qt::SHIFT | Qt::Key_Left, QGuiApplicationPrivate::KB_All},
{QKeySequence::SelectPreviousLine, 0, Qt::SHIFT | Qt::Key_Up, QGuiApplicationPrivate::KB_All},
@@ -716,7 +714,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_W, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QGuiApplicationPrivate::KB_All},
- {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QGuiApplicationPrivate::KB_Win},
{QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QGuiApplicationPrivate::KB_All},
{QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::Forward, 1, Qt::CTRL | Qt::Key_BracketRight, QGuiApplicationPrivate::KB_Mac},
@@ -727,15 +725,15 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::DeleteStartOfWord, 0, Qt::CTRL | Qt::Key_Backspace, QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_Win},
{QKeySequence::Copy, 0, Qt::CTRL | Qt::Key_Insert, QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_Win},
{QKeySequence::DeleteEndOfWord, 0, Qt::CTRL | Qt::Key_Delete, QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_Win},
- {QKeySequence::MoveToStartOfDocument, 0, Qt::CTRL | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
- {QKeySequence::MoveToEndOfDocument, 0, Qt::CTRL | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::MoveToStartOfDocument, 0, Qt::CTRL | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
+ {QKeySequence::MoveToEndOfDocument, 0, Qt::CTRL | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::Back, 0, Qt::CTRL | Qt::Key_Left, QGuiApplicationPrivate::KB_Mac},
- {QKeySequence::MoveToPreviousWord, 0, Qt::CTRL | Qt::Key_Left, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::MoveToPreviousWord, 0, Qt::CTRL | Qt::Key_Left, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::MoveToStartOfLine, 0, Qt::CTRL | Qt::Key_Left, QGuiApplicationPrivate::KB_Mac },
{QKeySequence::MoveToStartOfDocument, 1, Qt::CTRL | Qt::Key_Up, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::Forward, 0, Qt::CTRL | Qt::Key_Right, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::MoveToEndOfLine, 0, Qt::CTRL | Qt::Key_Right, QGuiApplicationPrivate::KB_Mac },
- {QKeySequence::MoveToNextWord, 0, Qt::CTRL | Qt::Key_Right, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::MoveToNextWord, 0, Qt::CTRL | Qt::Key_Right, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::MoveToEndOfDocument, 1, Qt::CTRL | Qt::Key_Down, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_F4, QGuiApplicationPrivate::KB_Win},
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_F4, QGuiApplicationPrivate::KB_Mac},
@@ -744,17 +742,17 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QGuiApplicationPrivate::KB_Win},
{QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QGuiApplicationPrivate::KB_KDE},
{QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, QGuiApplicationPrivate::KB_Gnome | QGuiApplicationPrivate::KB_Mac},
- {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QGuiApplicationPrivate::KB_Mac },//different priority from above
{QKeySequence::Paste, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Insert, QGuiApplicationPrivate::KB_X11},
- {QKeySequence::SelectStartOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
- {QKeySequence::SelectEndOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
- {QKeySequence::SelectPreviousWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::SelectStartOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Home, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
+ {QKeySequence::SelectEndOfDocument, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_End, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
+ {QKeySequence::SelectPreviousWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::SelectStartOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Left, QGuiApplicationPrivate::KB_Mac },
{QKeySequence::SelectStartOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Up, QGuiApplicationPrivate::KB_Mac},
- {QKeySequence::SelectNextWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11 | QGuiApplicationPrivate::KB_S60},
+ {QKeySequence::SelectNextWord, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QGuiApplicationPrivate::KB_Win | QGuiApplicationPrivate::KB_X11},
{QKeySequence::SelectEndOfLine, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Right, QGuiApplicationPrivate::KB_Mac },
{QKeySequence::SelectEndOfDocument, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Down, QGuiApplicationPrivate::KB_Mac},
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F6, QGuiApplicationPrivate::KB_Win},
@@ -1040,7 +1038,7 @@ void QKeySequence::setKey(int key, int index)
Returns the number of keys in the key sequence.
The maximum is 4.
*/
-uint QKeySequence::count() const
+int QKeySequence::count() const
{
if (!d->key[0])
return 0;
@@ -1255,10 +1253,21 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
int lastI = 0;
while ((i = sl.indexOf(QLatin1Char('+'), i + 1)) != -1) {
const QString sub = sl.mid(lastI, i - lastI + 1);
- // Just shortcut the check here if we only have one character.
- // Rational: A modifier will contain the name AND +, so longer than 1, a length of 1 is just
- // the remaining part of the shortcut (ei. The 'C' in "Ctrl+C"), so no need to check that.
- if (sub.length() > 1) {
+ // If we get here the shortcuts contains at least one '+'. We break up
+ // along the following strategy:
+ // Meta+Ctrl++ ( "Meta+", "Ctrl+", "+" )
+ // Super+Shift+A ( "Super+", "Shift+" )
+ // 4+3+2=1 ( "4+", "3+" )
+ // In other words, everything we try to handle HAS to be a modifier
+ // except for a single '+' at the end of the string.
+
+ // Only '+' can have length 1.
+ if (sub.length() == 1) {
+ // Make sure we only encounter a single '+' at the end of the accel
+ if (accel.lastIndexOf(QLatin1Char('+')) != accel.length()-1)
+ return Qt::Key_unknown;
+ } else {
+ // Identify the modifier
bool validModifier = false;
for (int j = 0; j < modifs.size(); ++j) {
const QModifKeyName &mkf = modifs.at(j);
@@ -1268,9 +1277,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
break; // Shortcut, since if we find an other it would/should just be a dup
}
}
- // We couldn't match the string with a modifier. This is only
- // possible if this part is the key. The key is never followed by a
- // '+'. And if the key is '+' the if() above would have skipped it.
+
if (!validModifier)
return Qt::Key_unknown;
}
@@ -1478,7 +1485,8 @@ QKeySequence::SequenceMatch QKeySequence::matches(const QKeySequence &seq) const
}
-/*!
+/*! \fn QKeySequence::operator QString() const
+
\obsolete
Use toString() instead.
@@ -1487,10 +1495,6 @@ QKeySequence::SequenceMatch QKeySequence::matches(const QKeySequence &seq) const
calling toString(QKeySequence::NativeText). Note that the
result is not platform independent.
*/
-QKeySequence::operator QString() const
-{
- return QKeySequence::toString(QKeySequence::NativeText);
-}
/*!
Returns the key sequence as a QVariant
@@ -1500,18 +1504,12 @@ QKeySequence::operator QVariant() const
return QVariant(QVariant::KeySequence, this);
}
-/*!
+/*! \fn QKeySequence::operator int () const
+
\obsolete
For backward compatibility: returns the first keycode
as integer. If the key sequence is empty, 0 is returned.
*/
-QKeySequence::operator int () const
-{
- if (1 <= count())
- return d->key[0];
- return 0;
-}
-
/*!
Returns a reference to the element at position \a index in the key
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index 1127e8afca..d1e7d06653 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_SHORTCUT
@@ -154,7 +153,7 @@ public:
QKeySequence(StandardKey key);
~QKeySequence();
- uint count() const; // ### Qt 5: return 'int'
+ int count() const;
bool isEmpty() const;
enum SequenceMatch {
@@ -170,10 +169,11 @@ public:
static QKeySequence mnemonic(const QString &text);
static QList<QKeySequence> keyBindings(StandardKey key);
- // ### Qt 5: kill 'operator QString' - it's evil
- operator QString() const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ QT_DEPRECATED operator QString() const { return toString(QKeySequence::NativeText); }
+ QT_DEPRECATED operator int() const { if (1 <= count()) return operator [](0); return 0; }
+#endif
operator QVariant() const;
- operator int() const;
int operator[](uint i) const;
QKeySequence &operator=(const QKeySequence &other);
#ifdef Q_COMPILER_RVALUE_REFS
diff --git a/src/gui/kernel/qkeysequence_p.h b/src/gui/kernel/qkeysequence_p.h
index 57f6e1927f..68cbb8778b 100644
--- a/src/gui/kernel/qkeysequence_p.h
+++ b/src/gui/kernel/qkeysequence_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 93a4b3582b..1b6d1d34c4 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -68,6 +68,11 @@ public:
static QThreadStorage<QGuiGLThreadContext *> qwindow_context_storage;
+#ifndef QT_NO_DEBUG
+QHash<QOpenGLContext *, bool> QOpenGLContextPrivate::makeCurrentTracker;
+QMutex QOpenGLContextPrivate::makeCurrentTrackerMutex;
+#endif
+
void QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context)
{
QGuiGLThreadContext *threadContext = qwindow_context_storage.localData();
@@ -163,6 +168,8 @@ bool QOpenGLContext::create()
Q_D(QOpenGLContext);
d->platformGLContext = QGuiApplicationPrivate::platformIntegration()->createPlatformOpenGLContext(this);
+ if (!d->platformGLContext)
+ return false;
d->platformGLContext->setContext(this);
if (!d->platformGLContext->isSharing())
d->shareContext = 0;
@@ -204,6 +211,10 @@ void QOpenGLContext::destroy()
QOpenGLContext::~QOpenGLContext()
{
destroy();
+
+#ifndef QT_NO_DEBUG
+ QOpenGLContextPrivate::cleanMakeCurrentTracker(this);
+#endif
}
/*!
@@ -230,6 +241,29 @@ QOpenGLFunctions *QOpenGLContext::functions() const
}
/*!
+ Call this to get the default framebuffer object for the current surface.
+
+ On some platforms the default framebuffer object depends on the surface being rendered to,
+ and might be different from 0. Thus, instead of calling glBindFramebuffer(0), you should
+ call glBindFramebuffer(ctx->defaultFramebufferObject()) if you want your application to
+ work across different Qt platforms.
+
+ If you use the glBindFramebuffer() in QOpenGLFunctions you do not have to worry about this,
+ as it automatically binds the current context's defaultFramebufferObject() when 0 is passed.
+*/
+GLuint QOpenGLContext::defaultFramebufferObject() const
+{
+ if (!isValid())
+ return 0;
+
+ Q_D(const QOpenGLContext);
+ if (!d->surface || !d->surface->surfaceHandle())
+ return 0;
+
+ return d->platformGLContext->defaultFramebufferObject(d->surface->surfaceHandle());
+}
+
+/*!
If surface is 0 this is equivalent to calling doneCurrent().
Do not call this function from a different thread than the one the QOpenGLContext instance lives in. If
@@ -254,12 +288,22 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
if (!surface->surfaceHandle())
return false;
+ if (surface->surfaceType() != QSurface::OpenGLSurface) {
+ qWarning() << "QOpenGLContext::makeBuffers() called with non-opengl surface";
+ return false;
+ }
+
+
if (d->platformGLContext->makeCurrent(surface->surfaceHandle())) {
QOpenGLContextPrivate::setCurrentContext(this);
d->surface = surface;
d->shareGroup->d_func()->deletePendingResources(this);
+#ifndef QT_NO_DEBUG
+ QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true);
+#endif
+
return true;
}
@@ -294,6 +338,17 @@ QSurface *QOpenGLContext::surface() const
}
+/*!
+ Swap the back and front buffers of the given surface.
+
+ Call this to finish a frame of OpenGL rendering, and make sure to
+ call makeCurrent() again before you begin a new frame.
+
+ If you have bound a non-default framebuffer object, you need to
+ use bindDefaultFramebufferObject() to make sure that the default
+ framebuffer object is bound before calling swapBuffers(), as
+ some Qt platforms assume that the default framebuffer object is bound.
+*/
void QOpenGLContext::swapBuffers(QSurface *surface)
{
Q_D(QOpenGLContext);
@@ -305,9 +360,34 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
return;
}
+ if (surface->surfaceType() != QSurface::OpenGLSurface) {
+ qWarning() << "QOpenGLContext::swapBuffers() called with non-opengl surface";
+ return;
+ }
+
QPlatformSurface *surfaceHandle = surface->surfaceHandle();
- if (surfaceHandle)
- d->platformGLContext->swapBuffers(surfaceHandle);
+ if (!surfaceHandle)
+ return;
+
+#if !defined(QT_NO_DEBUG)
+ if (currentContext() != this)
+ qWarning() << "QOpenGLContext::swapBuffers() called with non-current surface";
+ else if (!QOpenGLContextPrivate::toggleMakeCurrentTracker(this, false))
+ qWarning() << "QOpenGLContext::swapBuffers() called without corresponding makeCurrent()";
+
+#ifndef GL_FRAMEBUFFER_BINDING
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#endif
+
+ GLint framebufferBinding = 0;
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &framebufferBinding);
+
+ GLint platformFramebuffer = GLint(d->platformGLContext->defaultFramebufferObject(surfaceHandle));
+ if (framebufferBinding != platformFramebuffer)
+ qWarning() << "QOpenGLContext::swapBuffers() called with non-default framebuffer object bound";
+#endif
+
+ d->platformGLContext->swapBuffers(surfaceHandle);
}
QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName)
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index a8ac39c7d5..52f94a8a10 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,18 +42,25 @@
#ifndef QOPENGLCONTEXT_H
#define QOPENGLCONTEXT_H
+#ifndef QT_NO_OPENGL
+
#include <QtCore/qnamespace.h>
#include <QtCore/QObject>
#include <QtCore/QScopedPointer>
#include <QtGui/QSurfaceFormat>
+#ifdef __GLEW_H__
+#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
+#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
+#endif
+
+#include <QtGui/qopengl.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
-
class QOpenGLContextPrivate;
class QOpenGLContextGroupPrivate;
class QOpenGLFunctions;
@@ -102,6 +109,8 @@ public:
QOpenGLContextGroup *shareGroup() const;
QScreen *screen() const;
+ GLuint defaultFramebufferObject() const;
+
bool makeCurrent(QSurface *surface);
void doneCurrent();
@@ -146,4 +155,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif // QGUIGLCONTEXT_H
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 7040b883bf..7b4e880ade 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -47,11 +47,14 @@
#include <private/qobject_p.h>
#include <qmutex.h>
+#ifndef QT_NO_DEBUG
+#include <QtCore/QHash>
+#endif
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLFunctions;
class QOpenGLContext;
@@ -186,7 +189,6 @@ public:
, surface(0)
, functions(0)
, current_fbo(0)
- , default_fbo(0)
, workaround_brokenFBOReadBack(false)
, workaround_brokenTexSubImage(false)
, active_engine(0)
@@ -211,7 +213,6 @@ public:
QOpenGLFunctions *functions;
GLuint current_fbo;
- GLuint default_fbo;
bool workaround_brokenFBOReadBack;
bool workaround_brokenTexSubImage;
@@ -221,6 +222,23 @@ public:
static void setCurrentContext(QOpenGLContext *context);
int maxTextureSize() const { return 1024; }
+
+#if !defined(QT_NO_DEBUG)
+ static bool toggleMakeCurrentTracker(QOpenGLContext *context, bool value)
+ {
+ QMutexLocker locker(&makeCurrentTrackerMutex);
+ bool old = makeCurrentTracker.value(context, false);
+ makeCurrentTracker.insert(context, value);
+ return old;
+ }
+ static void cleanMakeCurrentTracker(QOpenGLContext *context)
+ {
+ QMutexLocker locker(&makeCurrentTrackerMutex);
+ makeCurrentTracker.remove(context);
+ }
+ static QHash<QOpenGLContext *, bool> makeCurrentTracker;
+ static QMutex makeCurrentTrackerMutex;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 2dd2ef00c5..627731ff20 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index d47854df07..cc710fa67a 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPalettePrivate;
class QVariant;
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index 4d8d65de0a..9e0c60b3f6 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard_qpa.h
index 643733fdf7..4dd672b21e 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.h
+++ b/src/gui/kernel/qplatformclipboard_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QPlatformClipboard
{
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index a3824381d3..fd7bcdcf18 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtOpenVG module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h
index a2026425db..a8cbb282fa 100644
--- a/src/gui/kernel/qplatformcursor_qpa.h
+++ b/src/gui/kernel/qplatformcursor_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtOpenVG module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
// Cursor graphics management
class Q_GUI_EXPORT QPlatformCursorImage {
diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.cpp b/src/gui/kernel/qplatformdialoghelper_qpa.cpp
new file mode 100644
index 0000000000..385484828a
--- /dev/null
+++ b/src/gui/kernel/qplatformdialoghelper_qpa.cpp
@@ -0,0 +1,556 @@
+/****************************************************************************
+**
+** 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 "qplatformdialoghelper_qpa.h"
+
+#include <QtCore/QVariant>
+#include <QtCore/QSharedData>
+#include <QtCore/QSettings>
+#include <QtCore/QHash>
+#include <QtCore/QUrl>
+#include <QtGui/QColor>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QPlatformDialogHelper
+ \since 5.0
+ \internal
+ \brief The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
+
+*/
+
+/*!
+ \enum QPlatformDialogHelper::StyleHint
+
+ This enum type specifies platform-specific style hints.
+
+ \value SnapToDefaultButton Snap the mouse to the center of the default
+ button. There is corresponding system
+ setting on Windows.
+
+ \sa styleHint()
+*/
+
+QPlatformDialogHelper::QPlatformDialogHelper()
+{
+}
+
+QPlatformDialogHelper::~QPlatformDialogHelper()
+{
+}
+
+QVariant QPlatformDialogHelper::styleHint(StyleHint hint) const
+{
+ return QPlatformDialogHelper::defaultStyleHint(hint);
+}
+
+QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHint hint)
+{
+ switch (hint) {
+ case QPlatformDialogHelper::SnapToDefaultButton:
+ return QVariant(false);
+ }
+ return QVariant();
+}
+
+void QPlatformDialogHelper::emitLaunchNativeAppModalPanel()
+{
+ emit launchNativeAppModalPanel();
+}
+
+// Font dialog
+
+class QFontDialogOptionsPrivate : public QSharedData
+{
+public:
+ QFontDialogOptionsPrivate() : options(0) {}
+
+ QFontDialogOptions::FontDialogOptions options;
+ QString windowTitle;
+};
+
+QFontDialogOptions::QFontDialogOptions() : d(new QFontDialogOptionsPrivate)
+{
+}
+
+QFontDialogOptions::QFontDialogOptions(const QFontDialogOptions &rhs) : d(rhs.d)
+{
+}
+
+QFontDialogOptions &QFontDialogOptions::operator=(const QFontDialogOptions &rhs)
+{
+ if (this != &rhs)
+ d = rhs.d;
+ return *this;
+}
+
+QFontDialogOptions::~QFontDialogOptions()
+{
+}
+
+QString QFontDialogOptions::windowTitle() const
+{
+ return d->windowTitle;
+}
+
+void QFontDialogOptions::setWindowTitle(const QString &title)
+{
+ d->windowTitle = title;
+}
+
+void QFontDialogOptions::setOption(QFontDialogOptions::FontDialogOption option, bool on)
+{
+ if (!(d->options & option) != !on)
+ setOptions(d->options ^ option);
+}
+
+bool QFontDialogOptions::testOption(QFontDialogOptions::FontDialogOption option) const
+{
+ return d->options & option;
+}
+
+void QFontDialogOptions::setOptions(FontDialogOptions options)
+{
+ if (options != d->options)
+ d->options = options;
+}
+
+QFontDialogOptions::FontDialogOptions QFontDialogOptions::options() const
+{
+ return d->options;
+}
+
+const QSharedPointer<QFontDialogOptions> &QPlatformFontDialogHelper::options() const
+{
+ return m_options;
+}
+
+void QPlatformFontDialogHelper::setOptions(const QSharedPointer<QFontDialogOptions> &options)
+{
+ m_options = options;
+}
+
+// Color dialog
+
+class QColorDialogStaticData
+{
+public:
+ enum { CustomColorCount = 16, StandardColorCount = 6 * 8 };
+
+ QColorDialogStaticData();
+ inline void readSettings();
+ inline void writeSettings() const;
+
+ QRgb customRgb[CustomColorCount];
+ QRgb standardRgb[StandardColorCount];
+ bool customSet;
+};
+
+QColorDialogStaticData::QColorDialogStaticData() : customSet(false)
+{
+ int i = 0;
+ for (int g = 0; g < 4; ++g)
+ for (int r = 0; r < 4; ++r)
+ for (int b = 0; b < 3; ++b)
+ standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
+ qFill(customRgb, customRgb + CustomColorCount, 0xffffffff);
+ readSettings();
+}
+
+void QColorDialogStaticData::readSettings()
+{
+#ifndef QT_NO_SETTINGS
+ const QSettings settings(QSettings::UserScope, QStringLiteral("Trolltech"));
+ for (int i = 0; i < int(CustomColorCount); ++i) {
+ const QVariant v = settings.value(QStringLiteral("Qt/customColors/") + QString::number(i));
+ if (v.isValid())
+ customRgb[i] = v.toUInt();
+ }
+#endif
+}
+
+void QColorDialogStaticData::writeSettings() const
+{
+#ifndef QT_NO_SETTINGS
+ if (!customSet) {
+ QSettings settings(QSettings::UserScope, QStringLiteral("Trolltech"));
+ for (int i = 0; i < int(CustomColorCount); ++i)
+ settings.setValue(QStringLiteral("Qt/customColors/") + QString::number(i), customRgb[i]);
+ }
+#endif
+}
+
+Q_GLOBAL_STATIC(QColorDialogStaticData, qColorDialogStaticData)
+
+class QColorDialogOptionsPrivate : public QSharedData
+{
+public:
+ QColorDialogOptionsPrivate() : options(0) {}
+ // Write out settings around destruction of dialogs
+ ~QColorDialogOptionsPrivate() { qColorDialogStaticData()->writeSettings(); }
+
+ QColorDialogOptions::ColorDialogOptions options;
+ QString windowTitle;
+};
+
+QColorDialogOptions::QColorDialogOptions() : d(new QColorDialogOptionsPrivate)
+{
+}
+
+QColorDialogOptions::QColorDialogOptions(const QColorDialogOptions &rhs) : d(rhs.d)
+{
+}
+
+QColorDialogOptions &QColorDialogOptions::operator=(const QColorDialogOptions &rhs)
+{
+ if (this != &rhs)
+ d = rhs.d;
+ return *this;
+}
+
+QColorDialogOptions::~QColorDialogOptions()
+{
+}
+
+QString QColorDialogOptions::windowTitle() const
+{
+ return d->windowTitle;
+}
+
+void QColorDialogOptions::setWindowTitle(const QString &title)
+{
+ d->windowTitle = title;
+}
+
+void QColorDialogOptions::setOption(QColorDialogOptions::ColorDialogOption option, bool on)
+{
+ if (!(d->options & option) != !on)
+ setOptions(d->options ^ option);
+}
+
+bool QColorDialogOptions::testOption(QColorDialogOptions::ColorDialogOption option) const
+{
+ return d->options & option;
+}
+
+void QColorDialogOptions::setOptions(ColorDialogOptions options)
+{
+ if (options != d->options)
+ d->options = options;
+}
+
+QColorDialogOptions::ColorDialogOptions QColorDialogOptions::options() const
+{
+ return d->options;
+}
+
+int QColorDialogOptions::customColorCount()
+{
+ return QColorDialogStaticData::CustomColorCount;
+}
+
+QRgb QColorDialogOptions::customColor(int index)
+{
+ if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount))
+ return qRgb(255, 255, 255);
+ return qColorDialogStaticData()->customRgb[index];
+}
+
+QRgb *QColorDialogOptions::customColors()
+{
+ return qColorDialogStaticData()->customRgb;
+}
+
+void QColorDialogOptions::setCustomColor(int index, QRgb color)
+{
+ if (uint(index) >= uint(QColorDialogStaticData::CustomColorCount))
+ return;
+ qColorDialogStaticData()->customSet;
+ qColorDialogStaticData()->customRgb[index] = color;
+}
+
+QRgb *QColorDialogOptions::standardColors()
+{
+ return qColorDialogStaticData()->standardRgb;
+}
+
+QRgb QColorDialogOptions::standardColor(int index)
+{
+ if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount))
+ return qRgb(255, 255, 255);
+ return qColorDialogStaticData()->standardRgb[index];
+}
+
+void QColorDialogOptions::setStandardColor(int index, QRgb color)
+{
+ if (uint(index) >= uint(QColorDialogStaticData::StandardColorCount))
+ return;
+ qColorDialogStaticData()->standardRgb[index] = color;
+}
+
+const QSharedPointer<QColorDialogOptions> &QPlatformColorDialogHelper::options() const
+{
+ return m_options;
+}
+
+void QPlatformColorDialogHelper::setOptions(const QSharedPointer<QColorDialogOptions> &options)
+{
+ m_options = options;
+}
+
+// File dialog
+
+class QFileDialogOptionsPrivate : public QSharedData
+{
+public:
+ QFileDialogOptionsPrivate() : options(0),
+ viewMode(QFileDialogOptions::Detail),
+ fileMode(QFileDialogOptions::AnyFile),
+ acceptMode(QFileDialogOptions::AcceptOpen),
+ filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs)
+ {}
+
+ QFileDialogOptions::FileDialogOptions options;
+ QString windowTitle;
+
+ QFileDialogOptions::ViewMode viewMode;
+ QFileDialogOptions::FileMode fileMode;
+ QFileDialogOptions::AcceptMode acceptMode;
+ QString labels[QFileDialogOptions::DialogLabelCount];
+ QDir::Filters filters;
+ QList<QUrl> sidebarUrls;
+ QStringList nameFilters;
+ QString defaultSuffix;
+ QStringList history;
+ QString initialDirectory;
+ QString initiallySelectedNameFilter;
+ QStringList initiallySelectedFiles;
+};
+
+QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate)
+{
+}
+
+QFileDialogOptions::QFileDialogOptions(const QFileDialogOptions &rhs) : d(rhs.d)
+{
+}
+
+QFileDialogOptions &QFileDialogOptions::operator=(const QFileDialogOptions &rhs)
+{
+ if (this != &rhs)
+ d = rhs.d;
+ return *this;
+}
+
+QFileDialogOptions::~QFileDialogOptions()
+{
+}
+
+QString QFileDialogOptions::windowTitle() const
+{
+ return d->windowTitle;
+}
+
+void QFileDialogOptions::setWindowTitle(const QString &title)
+{
+ d->windowTitle = title;
+}
+
+void QFileDialogOptions::setOption(QFileDialogOptions::FileDialogOption option, bool on)
+{
+ if (!(d->options & option) != !on)
+ setOptions(d->options ^ option);
+}
+
+bool QFileDialogOptions::testOption(QFileDialogOptions::FileDialogOption option) const
+{
+ return d->options & option;
+}
+
+void QFileDialogOptions::setOptions(FileDialogOptions options)
+{
+ if (options != d->options)
+ d->options = options;
+}
+
+QFileDialogOptions::FileDialogOptions QFileDialogOptions::options() const
+{
+ return d->options;
+}
+
+QDir::Filters QFileDialogOptions::filter() const
+{
+ return d->filters;
+}
+
+void QFileDialogOptions::setFilter(QDir::Filters filters)
+{
+ d->filters = filters;
+}
+
+void QFileDialogOptions::setViewMode(QFileDialogOptions::ViewMode mode)
+{
+ d->viewMode = mode;
+}
+
+QFileDialogOptions::ViewMode QFileDialogOptions::viewMode() const
+{
+ return d->viewMode;
+}
+
+void QFileDialogOptions::setFileMode(QFileDialogOptions::FileMode mode)
+{
+ d->fileMode = mode;
+}
+
+QFileDialogOptions::FileMode QFileDialogOptions::fileMode() const
+{
+ return d->fileMode;
+}
+
+void QFileDialogOptions::setAcceptMode(QFileDialogOptions::AcceptMode mode)
+{
+ d->acceptMode = mode;
+}
+
+QFileDialogOptions::AcceptMode QFileDialogOptions::acceptMode() const
+{
+ return d->acceptMode;
+}
+
+void QFileDialogOptions::setSidebarUrls(const QList<QUrl> &urls)
+{
+ d->sidebarUrls = urls;
+}
+
+QList<QUrl> QFileDialogOptions::sidebarUrls() const
+{
+ return d->sidebarUrls;
+}
+
+void QFileDialogOptions::setNameFilters(const QStringList &filters)
+{
+ d->nameFilters = filters;
+}
+
+QStringList QFileDialogOptions::nameFilters() const
+{
+ return d->nameFilters;
+}
+
+void QFileDialogOptions::setDefaultSuffix(const QString &suffix)
+{
+ d->defaultSuffix = suffix;
+}
+
+QString QFileDialogOptions::defaultSuffix() const
+{
+ return d->defaultSuffix;
+}
+
+void QFileDialogOptions::setHistory(const QStringList &paths)
+{
+ d->history = paths;
+}
+
+QStringList QFileDialogOptions::history() const
+{
+ return d->history;
+}
+
+void QFileDialogOptions::setLabelText(QFileDialogOptions::DialogLabel label, const QString &text)
+{
+ if (label >= 0 && label < DialogLabelCount)
+ d->labels[label] = text;
+}
+
+QString QFileDialogOptions::labelText(QFileDialogOptions::DialogLabel label) const
+{
+ return (label >= 0 && label < DialogLabelCount) ? d->labels[label] : QString();
+}
+
+bool QFileDialogOptions::isLabelExplicitlySet(DialogLabel label)
+{
+ return label >= 0 && label < DialogLabelCount && !d->labels[label].isEmpty();
+}
+
+QString QFileDialogOptions::initialDirectory() const
+{
+ return d->initialDirectory;
+}
+
+void QFileDialogOptions::setInitialDirectory(const QString &directory)
+{
+ d->initialDirectory = directory;
+}
+
+QString QFileDialogOptions::initiallySelectedNameFilter() const
+{
+ return d->initiallySelectedNameFilter;
+}
+
+void QFileDialogOptions::setInitiallySelectedNameFilter(const QString &filter)
+{
+ d->initiallySelectedNameFilter = filter;
+}
+
+QStringList QFileDialogOptions::initiallySelectedFiles() const
+{
+ return d->initiallySelectedFiles;
+}
+
+void QFileDialogOptions::setInitiallySelectedFiles(const QStringList &files)
+{
+ d->initiallySelectedFiles = files;
+}
+
+const QSharedPointer<QFileDialogOptions> &QPlatformFileDialogHelper::options() const
+{
+ return m_options;
+}
+
+void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptions> &options)
+{
+ m_options = options;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.h b/src/gui/kernel/qplatformdialoghelper_qpa.h
new file mode 100644
index 0000000000..5fdffae5cb
--- /dev/null
+++ b/src/gui/kernel/qplatformdialoghelper_qpa.h
@@ -0,0 +1,314 @@
+/****************************************************************************
+**
+** 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 QPLATFORMDIALOGHELPER_H
+#define QPLATFORMDIALOGHELPER_H
+
+#include <QtCore/QtGlobal>
+#include <QtCore/QObject>
+#include <QtCore/QList>
+#include <QtCore/QSharedDataPointer>
+#include <QtCore/QSharedPointer>
+#include <QtCore/QDir>
+#include <QtGui/QRgb>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+
+class QString;
+class QColor;
+class QFont;
+class QWindow;
+class QVariant;
+class QUrl;
+class QColorDialogOptionsPrivate;
+class QFontDialogOptionsPrivate;
+class QFileDialogOptionsPrivate;
+
+class Q_GUI_EXPORT QPlatformDialogHelper : public QObject
+{
+ Q_OBJECT
+public:
+ enum StyleHint {
+ SnapToDefaultButton
+ };
+ enum DialogCode { Rejected, Accepted };
+ enum ShowFlag {
+ ShowModal = 0x00000001
+ };
+
+ Q_DECLARE_FLAGS(ShowFlags, ShowFlag)
+
+ QPlatformDialogHelper();
+ virtual ~QPlatformDialogHelper();
+
+ virtual QVariant styleHint(StyleHint hint) const;
+
+ virtual void platformNativeDialogModalHelp() = 0;
+ virtual void _q_platformRunNativeAppModalPanel() = 0;
+
+ virtual void deleteNativeDialog_sys() = 0;
+ virtual bool show_sys(ShowFlags showFlags,
+ Qt::WindowFlags windowFlags,
+ QWindow *parent) = 0;
+ virtual void hide_sys() = 0;
+
+ virtual DialogCode dialogResultCode_sys() = 0;
+
+ static QVariant defaultStyleHint(QPlatformDialogHelper::StyleHint hint);
+
+Q_SIGNALS:
+ void launchNativeAppModalPanel();
+ void accept();
+ void reject();
+
+protected Q_SLOTS:
+ void emitLaunchNativeAppModalPanel();
+};
+
+class Q_GUI_EXPORT QColorDialogOptions
+{
+public:
+ enum ColorDialogOption {
+ ShowAlphaChannel = 0x00000001,
+ NoButtons = 0x00000002,
+ DontUseNativeDialog = 0x00000004
+ };
+
+ Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
+
+ QColorDialogOptions();
+ QColorDialogOptions(const QColorDialogOptions &rhs);
+ QColorDialogOptions &operator=(const QColorDialogOptions &rhs);
+ ~QColorDialogOptions();
+
+ QString windowTitle() const;
+ void setWindowTitle(const QString &);
+
+ void setOption(ColorDialogOption option, bool on = true);
+ bool testOption(ColorDialogOption option) const;
+ void setOptions(ColorDialogOptions options);
+ ColorDialogOptions options() const;
+
+ static int customColorCount();
+ static QRgb customColor(int index);
+ static QRgb *customColors();
+ static void setCustomColor(int index, QRgb color);
+
+ static QRgb *standardColors();
+ static QRgb standardColor(int index);
+ static void setStandardColor(int index, QRgb color);
+
+private:
+ QSharedDataPointer<QColorDialogOptionsPrivate> d;
+};
+
+class Q_GUI_EXPORT QPlatformColorDialogHelper : public QPlatformDialogHelper
+{
+ Q_OBJECT
+public:
+ const QSharedPointer<QColorDialogOptions> &options() const;
+ void setOptions(const QSharedPointer<QColorDialogOptions> &options);
+
+ virtual void setCurrentColor_sys(const QColor &) = 0;
+ virtual QColor currentColor_sys() const = 0;
+
+Q_SIGNALS:
+ void currentColorChanged(const QColor &color);
+ void colorSelected(const QColor &color);
+
+private:
+ QSharedPointer<QColorDialogOptions> m_options;
+};
+
+class Q_GUI_EXPORT QFontDialogOptions
+{
+public:
+ enum FontDialogOption {
+ NoButtons = 0x00000001,
+ DontUseNativeDialog = 0x00000002
+ };
+
+ Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
+
+ QFontDialogOptions();
+ QFontDialogOptions(const QFontDialogOptions &rhs);
+ QFontDialogOptions &operator=(const QFontDialogOptions &rhs);
+ ~QFontDialogOptions();
+
+ QString windowTitle() const;
+ void setWindowTitle(const QString &);
+
+ void setOption(FontDialogOption option, bool on = true);
+ bool testOption(FontDialogOption option) const;
+ void setOptions(FontDialogOptions options);
+ FontDialogOptions options() const;
+
+private:
+ QSharedDataPointer<QFontDialogOptionsPrivate> d;
+};
+
+class Q_GUI_EXPORT QPlatformFontDialogHelper : public QPlatformDialogHelper
+{
+ Q_OBJECT
+public:
+ virtual void setCurrentFont_sys(const QFont &) = 0;
+ virtual QFont currentFont_sys() const = 0;
+
+ const QSharedPointer<QFontDialogOptions> &options() const;
+ void setOptions(const QSharedPointer<QFontDialogOptions> &options);
+
+Q_SIGNALS:
+ void currentFontChanged(const QFont &font);
+ void fontSelected(const QFont &font);
+
+private:
+ QSharedPointer<QFontDialogOptions> m_options;
+};
+
+class Q_GUI_EXPORT QFileDialogOptions
+{
+public:
+ enum ViewMode { Detail, List };
+ enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
+ enum AcceptMode { AcceptOpen, AcceptSave };
+ enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount };
+
+ enum FileDialogOption
+ {
+ ShowDirsOnly = 0x00000001,
+ DontResolveSymlinks = 0x00000002,
+ DontConfirmOverwrite = 0x00000004,
+ DontUseSheet = 0x00000008,
+ DontUseNativeDialog = 0x00000010,
+ ReadOnly = 0x00000020,
+ HideNameFilterDetails = 0x00000040
+ };
+ Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption)
+
+ QFileDialogOptions();
+ QFileDialogOptions(const QFileDialogOptions &rhs);
+ QFileDialogOptions &operator=(const QFileDialogOptions &rhs);
+ ~QFileDialogOptions();
+
+ QString windowTitle() const;
+ void setWindowTitle(const QString &);
+
+ void setOption(FileDialogOption option, bool on = true);
+ bool testOption(FileDialogOption option) const;
+ void setOptions(FileDialogOptions options);
+ FileDialogOptions options() const;
+
+ QDir::Filters filter() const;
+ void setFilter(QDir::Filters filters);
+
+ void setViewMode(ViewMode mode);
+ ViewMode viewMode() const;
+
+ void setFileMode(FileMode mode);
+ FileMode fileMode() const;
+
+ void setAcceptMode(AcceptMode mode);
+ AcceptMode acceptMode() const;
+
+ void setSidebarUrls(const QList<QUrl> &urls);
+ QList<QUrl> sidebarUrls() const;
+
+ void setNameFilters(const QStringList &filters);
+ QStringList nameFilters() const;
+
+ void setDefaultSuffix(const QString &suffix);
+ QString defaultSuffix() const;
+
+ void setHistory(const QStringList &paths);
+ QStringList history() const;
+
+ void setLabelText(DialogLabel label, const QString &text);
+ QString labelText(DialogLabel label) const;
+ bool isLabelExplicitlySet(DialogLabel label);
+
+ QString initialDirectory() const;
+ void setInitialDirectory(const QString &);
+
+ QString initiallySelectedNameFilter() const;
+ void setInitiallySelectedNameFilter(const QString &);
+
+ QStringList initiallySelectedFiles() const;
+ void setInitiallySelectedFiles(const QStringList &);
+
+private:
+ QSharedDataPointer<QFileDialogOptionsPrivate> d;
+};
+
+class Q_GUI_EXPORT QPlatformFileDialogHelper : public QPlatformDialogHelper
+{
+ Q_OBJECT
+public:
+ virtual bool defaultNameFilterDisables() const = 0;
+ virtual void setDirectory_sys(const QString &directory) = 0;
+ virtual QString directory_sys() const = 0;
+ virtual void selectFile_sys(const QString &filename) = 0;
+ virtual QStringList selectedFiles_sys() const = 0;
+ virtual void setFilter_sys() = 0;
+ virtual void selectNameFilter_sys(const QString &filter) = 0;
+ virtual QString selectedNameFilter_sys() const = 0;
+
+ const QSharedPointer<QFileDialogOptions> &options() const;
+ void setOptions(const QSharedPointer<QFileDialogOptions> &options);
+
+Q_SIGNALS:
+ void fileSelected(const QString &file);
+ void filesSelected(const QStringList &files);
+ void currentChanged(const QString &path);
+ void directoryEntered(const QString &directory);
+ void filterSelected(const QString &filter);
+
+private:
+ QSharedPointer<QFileDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPLATFORMDIALOGHELPER_H
diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag_qpa.h
index fb71f29de9..0c215071d3 100644
--- a/src/gui/kernel/qplatformdrag_qpa.h
+++ b/src/gui/kernel/qplatformdrag_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QMimeData;
class QMouseEvent;
diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp
index 1e82507653..ee18f3ebd1 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa.cpp
+++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
QPlatformInputContext provides an interface the actual input methods
can derive from by reimplementing methods.
- \sa QInputPanel
+ \sa QInputMethod
*/
/*!
@@ -94,7 +94,7 @@ bool QPlatformInputContext::isValid() const
}
/*!
- Method to be called when input method needs to be reset. Called by QInputPanel::reset().
+ Method to be called when input method needs to be reset. Called by QInputMethod::reset().
No further QInputMethodEvents should be sent as response.
*/
void QPlatformInputContext::reset()
@@ -106,7 +106,7 @@ void QPlatformInputContext::commit()
}
/*!
- Notification on editor updates. Called by QInputPanel::update().
+ Notification on editor updates. Called by QInputMethod::update().
*/
void QPlatformInputContext::update(Qt::InputMethodQueries)
{
@@ -117,12 +117,12 @@ void QPlatformInputContext::update(Qt::InputMethodQueries)
the user. Input methods often use this information to offer more word
suggestions to the user.
*/
-void QPlatformInputContext::invokeAction(QInputPanel::Action action, int cursorPosition)
+void QPlatformInputContext::invokeAction(QInputMethod::Action action, int cursorPosition)
{
Q_UNUSED(cursorPosition)
// Default behavior for simple ephemeral input contexts. Some
// complex input contexts should not be reset here.
- if (action == QInputPanel::Click)
+ if (action == QInputMethod::Click)
reset();
}
@@ -148,17 +148,17 @@ QRectF QPlatformInputContext::keyboardRect() const
}
/*!
- Active QPlatformInputContext is responsible for providing keyboardRectangle property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing keyboardRectangle property to QInputMethod.
In addition of providing the value in keyboardRect function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitKeyboardRectChanged()
{
- emit qApp->inputPanel()->keyboardRectangleChanged();
+ emit qApp->inputMethod()->keyboardRectangleChanged();
}
/*!
- This function can be reimplemented to return true whenever input panel is animating
+ This function can be reimplemented to return true whenever input method is animating
shown or hidden. Default implementation returns false.
*/
bool QPlatformInputContext::isAnimating() const
@@ -167,13 +167,13 @@ bool QPlatformInputContext::isAnimating() const
}
/*!
- Active QPlatformInputContext is responsible for providing animating property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing animating property to QInputMethod.
In addition of providing the value in isAnimation function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitAnimatingChanged()
{
- emit qApp->inputPanel()->animatingChanged();
+ emit qApp->inputMethod()->animatingChanged();
}
/*!
@@ -199,13 +199,13 @@ bool QPlatformInputContext::isInputPanelVisible() const
}
/*!
- Active QPlatformInputContext is responsible for providing visible property to QInputPanel.
+ Active QPlatformInputContext is responsible for providing visible property to QInputMethod.
In addition of providing the value in isInputPanelVisible function, it also needs to call this emit
function whenever the property changes.
*/
void QPlatformInputContext::emitInputPanelVisibleChanged()
{
- emit qApp->inputPanel()->visibleChanged();
+ emit qApp->inputMethod()->visibleChanged();
}
QLocale QPlatformInputContext::locale() const
@@ -215,7 +215,7 @@ QLocale QPlatformInputContext::locale() const
void QPlatformInputContext::emitLocaleChanged()
{
- emit qApp->inputPanel()->localeChanged();
+ emit qApp->inputMethod()->localeChanged();
}
Qt::LayoutDirection QPlatformInputContext::inputDirection() const
@@ -225,7 +225,7 @@ Qt::LayoutDirection QPlatformInputContext::inputDirection() const
void QPlatformInputContext::emitInputDirectionChanged(Qt::LayoutDirection newDirection)
{
- emit qApp->inputPanel()->inputDirectionChanged(newDirection);
+ emit qApp->inputMethod()->inputDirectionChanged(newDirection);
}
diff --git a/src/gui/kernel/qplatforminputcontext_qpa.h b/src/gui/kernel/qplatforminputcontext_qpa.h
index 463238f336..77c3811d95 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa.h
+++ b/src/gui/kernel/qplatforminputcontext_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QWindow;
class QMouseEvent;
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 23ecf3add4..e867e4e588 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -172,6 +172,27 @@ QPlatformNativeInterface * QPlatformIntegration::nativeInterface() const
*/
/*!
+ \enum QPlatformIntegration::Capability
+
+ Capabilities are used to determing specific features of a platform integration
+
+ \value ThreadedPixmaps The platform uses a pixmap implementation that is reentrant
+ and can be used from multiple threads, like the raster paint engine and QImage based
+ pixmaps.
+
+ \value OpenGL The platform supports OpenGL
+
+ \value ThreadedOpenGL The platform supports using OpenGL outside the GUI thread.
+
+ \value SharedGraphicsCache The platform supports a shared graphics cache
+
+ \value BufferQueueingOpenGL The OpenGL implementation on the platform will queue
+ up buffers when swapBuffers() is called and block only when its buffer pipeline
+ is full, rather than block immediately.
+ */
+
+
+/*!
\fn QAbstractEventDispatcher *QPlatformIntegration::guiThreadEventDispatcher() const = 0
@@ -202,6 +223,17 @@ QPlatformOpenGLContext *QPlatformIntegration::createPlatformOpenGLContext(QOpenG
}
/*!
+ Factory function for QPlatformSharedGraphicsCache. This function will return 0 if the platform
+ integration does not support any shared graphics cache mechanism for the given \a cacheId.
+*/
+QPlatformSharedGraphicsCache *QPlatformIntegration::createPlatformSharedGraphicsCache(const char *cacheId) const
+{
+ qWarning("This plugin does not support createPlatformSharedGraphicsBuffer for cacheId: %s!",
+ cacheId);
+ return 0;
+}
+
+/*!
Returns the platforms input context.
The default implementation returns 0, implying no input method support.
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h
index 3975d82288..efaf495b81 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformWindow;
class QWindow;
@@ -65,6 +64,8 @@ class QAbstractEventDispatcher;
class QPlatformInputContext;
class QPlatformAccessibility;
class QPlatformTheme;
+class QPlatformDialogHelper;
+class QPlatformSharedGraphicsCache;
class Q_GUI_EXPORT QPlatformIntegration
{
@@ -72,7 +73,10 @@ public:
enum Capability {
ThreadedPixmaps = 1,
OpenGL = 2,
- ThreadedOpenGL = 3
+ ThreadedOpenGL = 3,
+ SharedGraphicsCache = 4,
+ BufferQueueingOpenGL = 5
+
};
virtual ~QPlatformIntegration() { }
@@ -83,6 +87,7 @@ public:
virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0;
virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0;
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
+ virtual QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const;
// Event dispatcher:
virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0;
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
index 7f2260b5f6..a84c243355 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
index 189b352139..4aae7898fa 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
+++ b/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformIntegration;
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
index a57b980ea3..7bd1caa1d3 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.h b/src/gui/kernel/qplatformintegrationplugin_qpa.h
index f53d66d1c8..84c2567bbd 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.h
+++ b/src/gui/kernel/qplatformintegrationplugin_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformIntegration;
diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.cpp b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
index f9ddd1f72a..7237849011 100644
--- a/src/gui/kernel/qplatformnativeinterface_qpa.cpp
+++ b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -106,4 +106,51 @@ void QPlatformNativeInterface::setWindowProperty(QPlatformWindow *window, const
Q_UNUSED(value);
}
+/*!
+ \typedef QPlatformNativeInterface::EventFilter
+ \since 5.0
+
+ A function with the following signature that can be used as an
+ event filter:
+
+ \code
+ bool myEventFilter(void *message, long *result);
+ \endcode
+
+ \sa setEventFilter()
+*/
+
+/*!
+ \fn EventFilter QPlatformNativeInterface::setEventFilter(const QByteArray &eventType, EventFilter filter)
+ \since 5.0
+
+ Replaces the event filter function for the native interface with
+ \a filter and returns the pointer to the replaced event filter
+ function. Only the current event filter function is called. If you
+ want to use both filter functions, save the replaced EventFilter
+ in a place where you can call it from.
+
+ The event filter function set here is called for all messages
+ received from the platform if they are given type \eventType.
+ It is \i not called for messages that are not meant for Qt objects.
+
+ The type of event is specific to the platform plugin chosen at run-time.
+
+ The event filter function should return \c true if the message should
+ be filtered, (i.e. stopped). It should return \c false to allow
+ processing the message to continue.
+
+ By default, no event filter function is set. For example, this function
+ returns a null EventFilter the first time it is called.
+
+ \note The filter function here receives native messages,
+ for example, MSG or XEvent structs. It is called by the platform plugin.
+*/
+QPlatformNativeInterface::EventFilter QPlatformNativeInterface::setEventFilter(const QByteArray &eventType, QPlatformNativeInterface::EventFilter filter)
+{
+ Q_UNUSED(eventType);
+ Q_UNUSED(filter);
+ return 0;
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.h b/src/gui/kernel/qplatformnativeinterface_qpa.h
index 47e2f82810..b25ebf0fe9 100644
--- a/src/gui/kernel/qplatformnativeinterface_qpa.h
+++ b/src/gui/kernel/qplatformnativeinterface_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLContext;
class QWindow;
@@ -70,6 +69,9 @@ public:
virtual QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const;
virtual void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value);
+ typedef bool (*EventFilter)(void *message, long *result);
+ virtual EventFilter setEventFilter(const QByteArray &eventType, EventFilter filter);
+
Q_SIGNALS:
void windowPropertyChanged(QPlatformWindow *window, const QString &propertyName);
};
diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.cpp b/src/gui/kernel/qplatformopenglcontext_qpa.cpp
index 7c5e8245df..33adc26482 100644
--- a/src/gui/kernel/qplatformopenglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformopenglcontext_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,12 +34,15 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qplatformopenglcontext_qpa.h"
+#include <QOpenGLFunctions>
+
QT_BEGIN_NAMESPACE
/*!
@@ -94,6 +96,16 @@ QPlatformOpenGLContext::~QPlatformOpenGLContext()
{
}
+/*!
+ Reimplement in subclass if your platform uses framebuffer objects for surfaces.
+
+ The default implementation returns 0.
+*/
+GLuint QPlatformOpenGLContext::defaultFramebufferObject(QPlatformSurface *) const
+{
+ return 0;
+}
+
QOpenGLContext *QPlatformOpenGLContext::context() const
{
Q_D(const QPlatformOpenGLContext);
diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.h b/src/gui/kernel/qplatformopenglcontext_qpa.h
index ac5cf969d9..17d4e96f8e 100644
--- a/src/gui/kernel/qplatformopenglcontext_qpa.h
+++ b/src/gui/kernel/qplatformopenglcontext_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,12 +45,12 @@
#include <QtCore/qnamespace.h>
#include <QtGui/qsurfaceformat.h>
#include <QtGui/qwindow.h>
+#include <QtGui/qopengl.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformOpenGLContextPrivate;
@@ -65,6 +65,8 @@ public:
virtual void swapBuffers(QPlatformSurface *surface) = 0;
+ virtual GLuint defaultFramebufferObject(QPlatformSurface *surface) const;
+
virtual bool makeCurrent(QPlatformSurface *surface) = 0;
virtual void doneCurrent() = 0;
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index 26c685ff1a..b8f1430d1b 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -160,36 +160,15 @@ QDpi QPlatformScreen::logicalDpi() const
}
/*!
- Reimplement this function in subclass to return the primary orientation
- of the screen, i.e. the orientation the display controller or equivalent
- expects.
-
- The default implementation returns Qt::PortraitOrientation if the
- geometry's height is greater or Qt::LandscapeOrientation if the geometry's
- width is greater.
-*/
-Qt::ScreenOrientation QPlatformScreen::primaryOrientation() const
-{
- return geometry().height() > geometry().width() ? Qt::PortraitOrientation :
- Qt::LandscapeOrientation;
-}
-
-/*!
Reimplement this function in subclass to return the current orientation
of the screen, for example based on accelerometer data to determine
- the physical screen orientation.
-
- The current orientation is only a hint to the application saying
- what the preferred application orientation should be, the application
- is free to limit itself to a certain set of supported orientations.
-
- The default implementation returns the same as primaryOrientation().
+ the device orientation.
- \sa primaryOrientation()
+ The default implementation returns Qt::PrimaryOrientation.
*/
-Qt::ScreenOrientation QPlatformScreen::currentOrientation() const
+Qt::ScreenOrientation QPlatformScreen::orientation() const
{
- return primaryOrientation();
+ return Qt::PrimaryOrientation;
}
QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window)
diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h
index 586a29279c..e4b9b762b1 100644
--- a/src/gui/kernel/qplatformscreen_qpa.h
+++ b/src/gui/kernel/qplatformscreen_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -58,7 +58,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformBackingStore;
class QPlatformOpenGLContext;
@@ -99,8 +98,7 @@ public:
virtual QSizeF physicalSize() const;
virtual QDpi logicalDpi() const;
- virtual Qt::ScreenOrientation currentOrientation() const;
- virtual Qt::ScreenOrientation primaryOrientation() const;
+ virtual Qt::ScreenOrientation orientation() const;
virtual QWindow *topLevelAt(const QPoint &point) const;
virtual QList<QPlatformScreen *> virtualSiblings() const;
diff --git a/src/gui/kernel/qplatformscreen_qpa_p.h b/src/gui/kernel/qplatformscreen_qpa_p.h
index 67c222bdf3..ced66be8d7 100644
--- a/src/gui/kernel/qplatformscreen_qpa_p.h
+++ b/src/gui/kernel/qplatformscreen_qpa_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp
new file mode 100644
index 0000000000..539bb1458f
--- /dev/null
+++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 "qplatformsharedgraphicscache_qpa.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QPlatformSharedGraphicsCache
+ \since 5.0
+ \internal
+ \preliminary
+ \ingroup qpa
+ \brief The QPlatformSharedGraphicsCache is an abstraction of a cross-process graphics cache.
+
+ If supported, it is possible to retrieve a QPlatformSharedGraphicsCache object from the
+ platform integration. This is typically used to store graphical items which should be shared
+ between several processes.
+
+ Items are requested from the cache by calling requestItems(). If the cache contains the
+ requested items in the requested cache, the itemsAvailable() signal is emitted with the ID of
+ the graphical buffer and each item's coordinates inside the buffer. Before requesting items
+ from a cache, the user must call ensureCacheInitialized() to set the correct parameters for
+ the cache.
+
+ If the cache does not yet contain the requested items, it will emit a similar itemsMissing()
+ signal. The client can then call updateItems() with rasterizations of the items and they will be
+ entered into the shared cache. As the items are rendered into the cache, itemsAvailable() signals
+ will be emitted for each of the items which have previously been requested and which have not
+ yet been reported as ready.
+*/
+
+/*!
+ \enum BufferType
+
+ Defines how the type of buffer required to contain a cache.
+
+ \value OpenGLTexture The buffer will be allocated in graphics memory, and an OpenGL texture
+ for a buffer belonging to the cache can be requested using
+ textureIdForBuffer().
+*/
+
+/*!
+ \enum PixelFormat
+
+ Defines the pixel format of a cache.
+
+ \value Alpha8 The cache will use 8 bits to represent the alpha value of each pixel. If an
+ OpenGL texture is created for a buffer belong to the cache, it will have the
+ pixel format GL_ALPHA.
+*/
+
+/*!
+ \fn void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType, PixelFormat pixelFormat)
+
+ Initializes a cache named \a cacheId if it has not yet been initialized. The \a bufferType and
+ \a pixelFormat gives the format of the buffers that will be used to contain the items in the
+ cache. If a cache with the same \a cacheId has previously been initialized, the call will be
+ ignored. The cache will keep its previously set buffer type and pixel format.
+*/
+
+/*!
+ \fn void QPlatformSharedGraphicsCache::requestItems(const QByteArray &cacheId, const QVector<quint32> &itemIds)
+
+ Requests all the items in \a itemIds from the cache with the name \a cacheId.
+
+ If any or all of the items are available in the cache, one or more itemsAvailable() signals will be
+ emitted corresponding to the items. If the cache does not contain all of the items in question,
+ then an itemsMissing() signal will be emitted corresponding to the missing items. The user
+ is at this point expected to call insertItems() to insert the missing items into the cache. If
+ the inserted items have previously been requested by the user, at which point an itemsAvailable()
+ signal will be emitted corresponding to the items.
+
+ Before requesting items from a cache, the user must call ensureCacheInitialized() with the
+ correct parameters for the cache.
+*/
+
+/*!
+ \fn void QPlatformSharedGraphicsCache::insertItems(const QByteArray &cacheId, const QVector<quint32> &itemIds, const QVector<QImage> &items)
+
+ Inserts the items in \a itemIds into the cache named \a cacheId. The appearance of
+ each item is stored in \a items. The format of the QImage objects is expected to match the
+ pixel format of the cache as it was initialized in ensureCacheInitialized().
+
+ When the items have been successfully entered into the cache, one or more itemsAvailable() signals
+ will be emitted for the items.
+
+ If the cache already contains the items, the behavior is implementation-specific. The
+ implementation may choose to ignore the items or it may overwrite the existing instances in
+ the cache. Either way, itemsAvailable() signals corresponding to the inserted items will be
+ emitted.
+*/
+
+/*!
+ \fn void QPlatformSharedGraphicsCache::releaseItems(const QByteArray &cacheId, const QVector<quint32> &itemIds)
+
+ Releases the reference to the items in \a itemIds from the cache named \a cacheId. This should
+ only be called when all references to the items have been released by the user, and they are no
+ longer needed.
+*/
+
+/*!
+ \fn void itemsMissing(const QByteArray &cacheId, const QVector<quint32> *itemIds)
+
+ This signal is emitted when requestItems() has been called for one or more items in the
+ cache named \a cacheId which are not yet available in the cache. The user is then expected to
+ call insertItems() to update the cache with the respective items, at which point they will
+ become available to all clients of the shared cache.
+
+ The vector \a itemIds contains the IDs of the items that need to be inserted into the cache.
+
+ \sa itemsAvailable(), insertItems(), requestItems()
+*/
+
+/*!
+ \fn void itemsAvailable(const QByteArray &cacheId, void *bufferId, const QSize &bufferSize, const QVector<quint32> &itemIds, const QVector<QPoint> &positionsInBuffer)
+
+ This signal can be emitted at any time when either requestItems() or insertItems() has been
+ called by the application for one or more items in the cache named \a cacheId, as long as
+ releaseItems() has not subsequently been called for the same items. It instructs the application
+ on where to find the items that have been entered into the cache. When the application receives
+ a buffer, it is expected to reference it using referenceBuffer() on it if it keeps a reference
+ to the buffer.
+
+ The \a bufferId is an ID for the buffer that contains the items. The \a bufferId can be
+ converted to a format usable by the application depending on which format it was given at
+ initialization. If it is a OpenGLTexture, its texture ID can be requested using the
+ textureIdForBuffer() function. The dimensions of the buffer are given by \a bufferSize.
+
+ The items provided by the cache are identified in the \a itemIds vector. The
+ \a positionsInBuffer vector contains the locations inside the buffer of each item. Each entry in
+ \a positionsInBuffer corresponds to an item in \a itemIds.
+
+ The buffer and the items' locations within the buffer can be considered valid until an
+ itemsInvalidated() signal has been emitted for the items, or until releaseItems() is called
+ for the items.
+
+ \sa itemsMissing(), requestItems(), bufferType()
+*/
+
+/*!
+ \fn void itemsUpdated(const QByteArray &cacheId, void *bufferId, const QSize &bufferSize, const QVector<quint32> &itemIds, const QVector<QPoint> &positionsInBuffer)
+
+ This signal is similar in usage to the itemsAvailable() signal, but will be emitted when
+ the location of a previously requested or inserted item has been updated. The application
+ must update its data for the respective items and release any references to old buffers held
+ by the items.
+
+ If the application no longer holds any references to previously referenced items in a given
+ cache, it should call releaseItems() for these items, at which point it will no longer receive
+ any itemsUpdated() signal for these items.
+
+ \sa requestItems(), insertItems(), itemsAvailable()
+*/
+
+/*!
+ \fn void itemsInvalidated(const QByteArray &cacheId, const QVector<quint32> &itemIds)
+
+ This signal is emitted when the items given by \a itemIds in the cache named \a cacheId have
+ been removed from the cache and the previously reported information about them is considered
+ invalid. It will only be emitted for items for which a buffer has previously been identified
+ through the itemsAvailable() signal (either as response to a requestItems() call or an
+ insertItems() call.)
+
+ The application is expected to throw away information about the items in the \a itemIds array
+ and drop any references it might have to the memory held by the buffer. If the items are still
+ required by the application, it can re-commit them to the cache using the insertItems() function.
+
+ If the application no longer holds any references to previously referenced items in a given
+ cache, it should call releaseItems() for these items, at which point it will no longer receive
+ any itemsInvalidated() signal for these items.
+*/
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
new file mode 100644
index 0000000000..d59cd7c3c8
--- /dev/null
+++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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 QPLATFORMSHAREDGRAPHICSCACHE_QPA_H
+#define QPLATFORMSHAREDGRAPHICSCACHE_QPA_H
+
+#include <QtCore/qobject.h>
+#include <QtGui/qimage.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class Q_GUI_EXPORT QPlatformSharedGraphicsCache: public QObject
+{
+ Q_OBJECT
+public:
+ enum PixelFormat
+ {
+ Alpha8
+ };
+
+ enum BufferType
+ {
+ OpenGLTexture
+ };
+
+ QPlatformSharedGraphicsCache(QObject *parent = 0) : QObject(parent) {}
+
+ Q_INVOKABLE virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType,
+ PixelFormat pixelFormat) = 0;
+
+ Q_INVOKABLE virtual void requestItems(const QByteArray &cacheId, const QVector<quint32> &itemIds) = 0;
+ Q_INVOKABLE virtual void insertItems(const QByteArray &cacheId,
+ const QVector<quint32> &itemIds,
+ const QVector<QImage> &items) = 0;
+ Q_INVOKABLE virtual void releaseItems(const QByteArray &cacheId, const QVector<quint32> &itemIds) = 0;
+
+ virtual void serializeBuffer(void *bufferId, QByteArray *serializedData, int *fileDescriptor) const = 0;
+ virtual uint textureIdForBuffer(void *bufferId) = 0;
+ virtual void referenceBuffer(void *bufferId) = 0;
+ virtual bool dereferenceBuffer(void *bufferId) = 0;
+
+Q_SIGNALS:
+ void itemsMissing(const QByteArray &cacheId, const QVector<quint32> &itemIds);
+ void itemsAvailable(const QByteArray &cacheId, void *bufferId, const QSize &bufferSize,
+ const QVector<quint32> &itemIds, const QVector<QPoint> &positionsInBuffer);
+ void itemsInvalidated(const QByteArray &cacheId, const QVector<quint32> &itemIds);
+ void itemsUpdated(const QByteArray &cacheId, void *bufferId, const QSize &bufferSize,
+ const QVector<quint32> &itemIds, const QVector<QPoint> &positionsInBuffer);
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QPLATFORMSHAREDGRAPHICSCACHE_QPA_H
diff --git a/src/gui/kernel/qplatformsurface_qpa.cpp b/src/gui/kernel/qplatformsurface_qpa.cpp
index 3347f7984f..aeb73da2a3 100644
--- a/src/gui/kernel/qplatformsurface_qpa.cpp
+++ b/src/gui/kernel/qplatformsurface_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,12 +43,12 @@
QT_BEGIN_NAMESPACE
-QSurface::SurfaceType QPlatformSurface::surfaceType() const
+QSurface::SurfaceClass QPlatformSurface::surfaceClass() const
{
return m_type;
}
-QPlatformSurface::QPlatformSurface(QSurface::SurfaceType type) : m_type(type)
+QPlatformSurface::QPlatformSurface(QSurface::SurfaceClass type) : m_type(type)
{
}
diff --git a/src/gui/kernel/qplatformsurface_qpa.h b/src/gui/kernel/qplatformsurface_qpa.h
index 7ceb39f049..af23ad3a85 100644
--- a/src/gui/kernel/qplatformsurface_qpa.h
+++ b/src/gui/kernel/qplatformsurface_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,19 +50,18 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QPlatformSurface
{
public:
virtual QSurfaceFormat format() const = 0;
- QSurface::SurfaceType surfaceType() const;
+ QSurface::SurfaceClass surfaceClass() const;
private:
- QPlatformSurface(QSurface::SurfaceType type);
+ QPlatformSurface(QSurface::SurfaceClass type);
- QSurface::SurfaceType m_type;
+ QSurface::SurfaceClass m_type;
friend class QPlatformWindow;
};
diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp
index 22d4452f4e..d2ff804ddf 100644
--- a/src/gui/kernel/qplatformtheme_qpa.cpp
+++ b/src/gui/kernel/qplatformtheme_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -83,15 +83,15 @@ QPlatformMenuBar *QPlatformTheme::createPlatformMenuBar(QMenuBar *menuBar) const
return 0;
}
-bool QPlatformTheme::usePlatformNativeDialog(const QDialog *dialog) const
+bool QPlatformTheme::usePlatformNativeDialog(DialogType type) const
{
- Q_UNUSED(dialog);
+ Q_UNUSED(type);
return false;
}
-QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(QDialog *dialog) const
+QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(DialogType type) const
{
- Q_UNUSED(dialog);
+ Q_UNUSED(type);
return 0;
}
diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme_qpa.h
index c3e5b677a2..2b87e63287 100644
--- a/src/gui/kernel/qplatformtheme_qpa.h
+++ b/src/gui/kernel/qplatformtheme_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,14 +48,12 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QMenu;
class QMenuBar;
class QPlatformMenu;
class QPlatformMenuBar;
class QPlatformDialogHelper;
-class QDialog;
class QVariant;
class Q_GUI_EXPORT QPlatformTheme
@@ -67,11 +65,17 @@ public:
MaximumScrollBarDragDistance
};
+ enum DialogType {
+ FileDialog,
+ ColorDialog,
+ FontDialog
+ };
+
virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const;
virtual QPlatformMenuBar *createPlatformMenuBar(QMenuBar *menuBar = 0) const;
- virtual bool usePlatformNativeDialog(const QDialog *dialog = 0) const;
- virtual QPlatformDialogHelper *createPlatformDialogHelper(QDialog *dialog = 0) const;
+ virtual bool usePlatformNativeDialog(DialogType type) const;
+ virtual QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const;
virtual QVariant themeHint(ThemeHint hint) const;
};
diff --git a/src/gui/kernel/qplatformthemefactory_qpa.cpp b/src/gui/kernel/qplatformthemefactory_qpa.cpp
index c278f41411..c023a73e7e 100644
--- a/src/gui/kernel/qplatformthemefactory_qpa.cpp
+++ b/src/gui/kernel/qplatformthemefactory_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformthemefactory_qpa_p.h b/src/gui/kernel/qplatformthemefactory_qpa_p.h
index 71987aa723..4d659812dc 100644
--- a/src/gui/kernel/qplatformthemefactory_qpa_p.h
+++ b/src/gui/kernel/qplatformthemefactory_qpa_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformTheme;
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.cpp b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
index c51d4e9fc5..8383c9b948 100644
--- a/src/gui/kernel/qplatformthemeplugin_qpa.cpp
+++ b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.h b/src/gui/kernel/qplatformthemeplugin_qpa.h
index 89348deae0..fb4f9f9b7c 100644
--- a/src/gui/kernel/qplatformthemeplugin_qpa.h
+++ b/src/gui/kernel/qplatformthemeplugin_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformTheme;
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index d69cb0e64e..c52a1cf757 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -239,17 +239,42 @@ void QPlatformWindow::requestActivateWindow()
}
/*!
- Set the orientation of the platform window's contents.
+ Handle changes to the orientation of the platform window's contents.
This is a hint to the window manager in case it needs to display
additional content like popups, dialogs, status bars, or similar
in relation to the window.
- \sa QWindow::setOrientation()
+ \sa QWindow::reportContentOrientationChange()
+*/
+void QPlatformWindow::handleContentOrientationChange(Qt::ScreenOrientation orientation)
+{
+ Q_UNUSED(orientation);
+}
+
+/*!
+ Request a different orientation of the platform window.
+
+ This tells the window manager how the window wants to be rotated in order
+ to be displayed, and how input events should be translated.
+
+ As an example, a portrait compositor might rotate the window by 90 degrees,
+ if the window is in landscape. It will also rotate input coordinates from
+ portrait to landscape such that top right in portrait gets mapped to top
+ left in landscape.
+
+ If the implementation doesn't support the requested orientation it should
+ signal this by returning an actual supported orientation.
+
+ If the implementation doesn't support rotating the window at all it should
+ return Qt::PrimaryOrientation, this is also the default value.
+
+ \sa QWindow::requestWindowOrientation()
*/
-void QPlatformWindow::setOrientation(Qt::ScreenOrientation orientation)
+Qt::ScreenOrientation QPlatformWindow::requestWindowOrientation(Qt::ScreenOrientation orientation)
{
Q_UNUSED(orientation);
+ return Qt::PrimaryOrientation;
}
bool QPlatformWindow::setKeyboardGrabEnabled(bool grab)
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow_qpa.h
index 7605a5a4aa..88bf633425 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformScreen;
class QPlatformWindowPrivate;
@@ -95,7 +94,8 @@ public:
virtual void setOpacity(qreal level);
virtual void requestActivateWindow();
- virtual void setOrientation(Qt::ScreenOrientation orientation);
+ virtual void handleContentOrientationChange(Qt::ScreenOrientation orientation);
+ virtual Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation);
virtual bool setKeyboardGrabEnabled(bool grab);
virtual bool setMouseGrabEnabled(bool grab);
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index a1ed3014d0..67eb991b19 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -343,35 +343,38 @@ QRect QScreen::availableVirtualGeometry() const
}
/*!
- \property QScreen::primaryOrientation
- \brief the primary screen orientation
+ \property QScreen::orientation
+ \brief the screen orientation
+
+ The screen orientation represents the physical orientation
+ of the display. For example, the screen orientation of a mobile device
+ will change based on the device is being held, and a desktop display
+ might be rotated so that it's in portrait mode.
+
+ Qt::PrimaryOrientation is never returned.
- The primary screen orientation is the orientation that corresponds
- to an un-rotated screen buffer. When the current orientation is equal
- to the primary orientation no rotation needs to be done by the
- application.
+ \sa primaryOrientation(), orientationChanged()
*/
-Qt::ScreenOrientation QScreen::primaryOrientation() const
+Qt::ScreenOrientation QScreen::orientation() const
{
Q_D(const QScreen);
- return d->platformScreen->primaryOrientation();
+ return d->orientation == Qt::PrimaryOrientation ? primaryOrientation() : d->orientation;
}
/*!
\property QScreen::primaryOrientation
- \brief the current screen orientation
+ \brief the primary screen orientation
- The current orientation is a hint to the application saying
- what the preferred application orientation should be, based on the
- current orientation of the physical display and / or other factors.
+ The primary screen orientation is Qt::LandscapeOrientation
+ if the screen geometry's width is greater than or equal to its
+ height, or Qt::PortraitOrientation otherwise.
- \sa primaryOrientation()
- \sa currentOrientationChanged()
+ \sa primaryOrientationChanged()
*/
-Qt::ScreenOrientation QScreen::currentOrientation() const
+Qt::ScreenOrientation QScreen::primaryOrientation() const
{
Q_D(const QScreen);
- return d->currentOrientation;
+ return d->primaryOrientation;
}
// i must be power of two
@@ -393,10 +396,18 @@ static int log2(uint i)
rotation \a a to rotation \a b.
The result will be 0, 90, 180, or 270.
+
+ Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
{
- if (a == Qt::UnknownOrientation || b == Qt::UnknownOrientation || a == b)
+ if (a == Qt::PrimaryOrientation)
+ a = primaryOrientation();
+
+ if (b == Qt::PrimaryOrientation)
+ b = primaryOrientation();
+
+ if (a == b)
return 0;
int ia = log2(uint(a));
@@ -420,10 +431,18 @@ int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
the resulting transform will be such that the point QPoint(0, 0) is mapped to QPoint(0, w),
and QPoint(h, w) is mapped to QPoint(0, h). Thus, the landscape coordinate system QRect(0, 0, h, w)
is mapped (with a 90 degree rotation) into the portrait coordinate system QRect(0, 0, w, h).
+
+ Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target)
{
- if (a == Qt::UnknownOrientation || b == Qt::UnknownOrientation || a == b)
+ if (a == Qt::PrimaryOrientation)
+ a = primaryOrientation();
+
+ if (b == Qt::PrimaryOrientation)
+ b = primaryOrientation();
+
+ if (a == b)
return QTransform();
int angle = angleBetween(a, b);
@@ -453,10 +472,18 @@ QTransform QScreen::transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientat
This will flip the x and y dimensions of the rectangle if orientation \a is
Qt::PortraitOrientation or Qt::InvertedPortraitOrientation and orientation \b is
Qt::LandscapeOrientation or Qt::InvertedLandscapeOrientation, or vice versa.
+
+ Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
*/
QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect)
{
- if (a == Qt::UnknownOrientation || b == Qt::UnknownOrientation || a == b)
+ if (a == Qt::PrimaryOrientation)
+ a = primaryOrientation();
+
+ if (b == Qt::PrimaryOrientation)
+ b = primaryOrientation();
+
+ if (a == b)
return rect;
if ((a == Qt::PortraitOrientation || a == Qt::InvertedPortraitOrientation)
@@ -469,14 +496,50 @@ QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, cons
}
/*!
- \fn QScreen::currentOrientationChanged(Qt::ScreenOrientation orientation)
+ Convenience function to check if a screen orientation is either portrait
+ or inverted portrait.
- This signal is emitted when the current orientation of the screen
- changes. The current orientation is a hint to the application saying
- what the preferred application orientation should be, based on the
- current orientation of the physical display and / or other factors.
+ Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
+*/
+bool QScreen::isPortrait(Qt::ScreenOrientation o)
+{
+ return o == Qt::PortraitOrientation || o == Qt::InvertedPortraitOrientation
+ || (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::PortraitOrientation);
+}
+
+/*!
+ Convenience function to check if a screen orientation is either landscape
+ or inverted landscape.
+
+ Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().
+*/
+bool QScreen::isLandscape(Qt::ScreenOrientation o)
+{
+ return o == Qt::LandscapeOrientation || o == Qt::InvertedLandscapeOrientation
+ || (o == Qt::PrimaryOrientation && primaryOrientation() == Qt::LandscapeOrientation);
+}
+
+/*!
+ \fn QScreen::orientationChanged(Qt::ScreenOrientation orientation)
+
+ This signal is emitted when the orientation of the screen
+ changes.
- \sa currentOrientation()
+ \sa orientation()
*/
+/*!
+ \fn QScreen::primaryOrientationChanged(Qt::ScreenOrientation orientation)
+
+ This signal is emitted when the primary orientation of the screen
+ changes.
+
+ \sa primaryOrientation()
+*/
+
+void QScreenPrivate::updatePrimaryOrientation()
+{
+ primaryOrientation = geometry.width() >= geometry.height() ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 7291e2ad7b..f73cd0836f 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -56,7 +56,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformScreen;
class QScreenPrivate;
@@ -81,8 +80,8 @@ class Q_GUI_EXPORT QScreen : public QObject
Q_PROPERTY(qreal logicalDotsPerInch READ logicalDotsPerInch NOTIFY logicalDotsPerInchChanged)
Q_PROPERTY(QSize availableSize READ availableSize NOTIFY availableSizeChanged)
Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
- Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation CONSTANT)
- Q_PROPERTY(Qt::ScreenOrientation currentOrientation READ currentOrientation NOTIFY currentOrientationChanged)
+ Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ orientation NOTIFY primaryOrientationChanged)
+ Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
public:
QPlatformScreen *handle() const;
@@ -116,11 +115,14 @@ public:
QRect availableVirtualGeometry() const;
Qt::ScreenOrientation primaryOrientation() const;
- Qt::ScreenOrientation currentOrientation() const;
+ Qt::ScreenOrientation orientation() const;
+
+ int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
+ QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
+ QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);
- static int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
- static QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
- static QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);
+ bool isPortrait(Qt::ScreenOrientation orientation);
+ bool isLandscape(Qt::ScreenOrientation orientation);
Q_SIGNALS:
void sizeChanged(const QSize &size);
@@ -133,7 +135,8 @@ Q_SIGNALS:
void logicalDotsPerInchChanged(qreal dpi);
void availableSizeChanged(const QSize &size);
void availableGeometryChanged(const QRect &rect);
- void currentOrientationChanged(Qt::ScreenOrientation orientation);
+ void primaryOrientationChanged(Qt::ScreenOrientation orientation);
+ void orientationChanged(Qt::ScreenOrientation orientation);
private:
QScreen(QPlatformScreen *screen);
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h
index 50742c9f6b..c6bf37e87a 100644
--- a/src/gui/kernel/qscreen_p.h
+++ b/src/gui/kernel/qscreen_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,13 +59,18 @@ public:
QScreenPrivate(QPlatformScreen *screen)
: platformScreen(screen)
{
- currentOrientation = screen->currentOrientation();
+ orientation = screen->orientation();
geometry = screen->geometry();
availableGeometry = screen->availableGeometry();
logicalDpi = screen->logicalDpi();
+
+ updatePrimaryOrientation();
}
- Qt::ScreenOrientation currentOrientation;
+ void updatePrimaryOrientation();
+
+ Qt::ScreenOrientation orientation;
+ Qt::ScreenOrientation primaryOrientation;
QRect geometry;
QRect availableGeometry;
QDpi logicalDpi;
diff --git a/src/gui/kernel/qsessionmanager.h b/src/gui/kernel/qsessionmanager.h
index 89c5cf47b6..529b726a5b 100644
--- a/src/gui/kernel/qsessionmanager.h
+++ b/src/gui/kernel/qsessionmanager.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QGuiApplication;
diff --git a/src/gui/kernel/qsessionmanager_qpa.cpp b/src/gui/kernel/qsessionmanager_qpa.cpp
index 9b6ec26ff4..2db2e75de9 100644
--- a/src/gui/kernel/qsessionmanager_qpa.cpp
+++ b/src/gui/kernel/qsessionmanager_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 2bacac9598..a750082219 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qshortcutmap_p.h b/src/gui/kernel/qshortcutmap_p.h
index e447507b87..a7918eb239 100644
--- a/src/gui/kernel/qshortcutmap_p.h
+++ b/src/gui/kernel/qshortcutmap_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index eb0f055270..c98158b6b6 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index 6fa72110fb..0fc7e776b5 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformIntegration;
diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp
index bfdb772cfb..eb2676802b 100644
--- a/src/gui/kernel/qsurface.cpp
+++ b/src/gui/kernel/qsurface.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,12 +43,53 @@
QT_BEGIN_NAMESPACE
-QSurface::QSurface(SurfaceType type)
- : m_type(type)
+
+/*!
+ \class QSurface
+ \brief The QSurface class is an abstraction of renderable surfaces in Qt.
+
+ The size of the surface is accessible with the size() function. The rendering
+ specific attributes of the surface are accessible through the format() function.
+ */
+
+
+/*!
+ \enum QSurface::SurfaceClass
+
+ The SurfaceClass enum describes the actual subclass of the surface.
+
+ \value Window The surface is an instance of QWindow.
+ */
+
+
+/*!
+ \enum QSurface::SurfaceType
+
+ The SurfaceType enum describes what type of surface the.
+
+ \value RasterSurface The surface is is composed of pixels and can be rendered to using
+ a software rasterizer like Qt's raster paint engine.
+ \value OpenGLSurface The surface is an OpenGL compatible surface and can be used
+ in conjunction with QOpenGLContext.
+ */
+
+
+/*!
+ QSize QSurface::size() const
+
+ Returns the size of the surface in pixels.
+ */
+
+
+
+QSurface::QSurface(SurfaceClass type)
+ : m_type(type), m_reserved(0)
{
}
-QSurface::SurfaceType QSurface::surfaceType() const
+
+
+QSurface::SurfaceClass QSurface::surfaceClass() const
{
return m_type;
}
diff --git a/src/gui/kernel/qsurface.h b/src/gui/kernel/qsurface.h
index fba1690af4..a8900fde33 100644
--- a/src/gui/kernel/qsurface.h
+++ b/src/gui/kernel/qsurface.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -45,34 +45,46 @@
#include <QtCore/qnamespace.h>
#include <QtGui/qsurfaceformat.h>
+#include <QtCore/qsize.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPlatformSurface;
+class QSurfacePrivate;
+
class Q_GUI_EXPORT QSurface
{
public:
- enum SurfaceType {
+ enum SurfaceClass {
Window
};
+ enum SurfaceType {
+ RasterSurface,
+ OpenGLSurface
+ };
+
virtual ~QSurface();
- SurfaceType surfaceType() const;
+ SurfaceClass surfaceClass() const;
virtual QSurfaceFormat format() const = 0;
virtual QPlatformSurface *surfaceHandle() const = 0;
-private:
- QSurface(SurfaceType type);
+ virtual SurfaceType surfaceType() const = 0;
+
+ virtual QSize size() const = 0;
+
+protected:
+ QSurface(SurfaceClass type);
- SurfaceType m_type;
+ SurfaceClass m_type;
- friend class QWindow;
+ QSurfacePrivate *m_reserved;
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 39b2d491a3..b97852dc1d 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h
index 3d3bfeb30b..6daa08095e 100644
--- a/src/gui/kernel/qsurfaceformat.h
+++ b/src/gui/kernel/qsurfaceformat.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -47,7 +47,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLContext;
class QSurfaceFormatPrivate;
diff --git a/src/gui/kernel/qt_gui_pch.h b/src/gui/kernel/qt_gui_pch.h
index 98a516f54e..ba708f4d69 100644
--- a/src/gui/kernel/qt_gui_pch.h
+++ b/src/gui/kernel/qt_gui_pch.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index b8d4d01655..b0543819df 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -177,11 +177,11 @@ void QTouchDevice::setName(const QString &name)
typedef QList<QTouchDevice *> TouchDevices;
Q_GLOBAL_STATIC(TouchDevices, deviceList)
-Q_GLOBAL_STATIC(QMutex, devicesMutex)
+static QBasicMutex devicesMutex;
static void cleanupDevicesList()
{
- QMutexLocker lock(devicesMutex());
+ QMutexLocker lock(&devicesMutex);
qDeleteAll(*deviceList());
deviceList()->clear();
}
@@ -193,7 +193,7 @@ static void cleanupDevicesList()
*/
QList<const QTouchDevice *> QTouchDevice::devices()
{
- QMutexLocker lock(devicesMutex());
+ QMutexLocker lock(&devicesMutex);
QList<QTouchDevice *> *devList = deviceList();
QList<const QTouchDevice *> constDevList;
for (int i = 0, count = devList->count(); i != count; ++i)
@@ -206,7 +206,7 @@ QList<const QTouchDevice *> QTouchDevice::devices()
*/
bool QTouchDevicePrivate::isRegistered(QTouchDevice *dev)
{
- QMutexLocker lock(devicesMutex());
+ QMutexLocker lock(&devicesMutex);
return deviceList()->contains(dev);
}
@@ -215,7 +215,7 @@ bool QTouchDevicePrivate::isRegistered(QTouchDevice *dev)
*/
void QTouchDevicePrivate::registerDevice(QTouchDevice *dev)
{
- QMutexLocker lock(devicesMutex());
+ QMutexLocker lock(&devicesMutex);
if (deviceList()->isEmpty())
qAddPostRoutine(cleanupDevicesList);
deviceList()->append(dev);
diff --git a/src/gui/kernel/qtouchdevice.h b/src/gui/kernel/qtouchdevice.h
index 6efa7814c9..3023a1759a 100644
--- a/src/gui/kernel/qtouchdevice.h
+++ b/src/gui/kernel/qtouchdevice.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTouchDevicePrivate;
diff --git a/src/gui/kernel/qtouchdevice_p.h b/src/gui/kernel/qtouchdevice_p.h
index c37e4a8bf5..4697a85e58 100644
--- a/src/gui/kernel/qtouchdevice_p.h
+++ b/src/gui/kernel/qtouchdevice_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTouchDevicePrivate
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 97c6b0cbc9..4436884359 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,8 +43,10 @@
#include "qplatformwindow_qpa.h"
#include "qsurfaceformat.h"
+#ifndef QT_NO_OPENGL
#include "qplatformopenglcontext_qpa.h"
#include "qopenglcontext.h"
+#endif
#include "qscreen.h"
#include "qwindow_p.h"
@@ -60,7 +62,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QWindow
- \brief The QWindow class encapsulates an independent windw in a Windowing System.
+ \brief The QWindow class encapsulates an independent window in a Windowing System.
A window that is supplied a parent become a native child window of
their parent window.
@@ -70,8 +72,24 @@ QT_BEGIN_NAMESPACE
to support double and triple buffering. To release a windows memory
resources, the destroy() function.
- */
-
+ \section1 Window and content orientation
+
+ QWindow has reportContentOrientationChange() and
+ requestWindowOrientation() that can be used to specify the
+ layout of the window contents in relation to the screen. The
+ window orientation determines the actual buffer layout of the
+ window, and the windowing system uses this value to rotate the
+ window before it ends up on the display, and to ensure that input
+ coordinates are in the correct coordinate space relative to the
+ application.
+
+ On the other hand, the content orientation is simply a hint to the
+ windowing system about which orientation the window contents are in.
+ It's useful when you wish to keep the same buffer layout, but rotate
+ the contents instead, especially when doing rotation animations
+ between different orientations. The windowing system might use this
+ value to determine the layout of system popups or dialogs.
+*/
QWindow::QWindow(QScreen *targetScreen)
: QObject(*new QWindowPrivate(), 0)
, QSurface(QSurface::Window)
@@ -147,6 +165,14 @@ void QWindow::setVisible(bool visible)
return;
d->visible = visible;
emit visibleChanged(visible);
+ if (QCoreApplication::instance() && !transientParent()) {
+ QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance()));
+ if (visible) {
+ applicationPrivate->ref();
+ } else {
+ applicationPrivate->deref();
+ }
+ }
if (!d->platformWindow)
create();
@@ -373,42 +399,86 @@ bool QWindow::isActive() const
}
/*!
- Returns the window's currently set orientation.
+ Reports that the orientation of the window's contents have changed.
+
+ This is a hint to the window manager in case it needs to display
+ additional content like popups, dialogs, status bars, or similar
+ in relation to the window.
- The default value is Qt::UnknownOrientation.
+ The recommended orientation is QScreen::orientation() but
+ an application doesn't have to support all possible orientations,
+ and thus can opt to ignore the current screen orientation.
- \sa setOrientation(), QScreen::currentOrientation()
+ The difference between the window and the content orientation
+ determines how much to rotate the content by. QScreen::angleBetween(),
+ QScreen::transformBetween(), and QScreen::mapBetween() can be used
+ to compute the necessary transform.
+
+ \sa requestWindowOrientation(), QScreen::orientation()
*/
-Qt::ScreenOrientation QWindow::orientation() const
+void QWindow::reportContentOrientationChange(Qt::ScreenOrientation orientation)
+{
+ Q_D(QWindow);
+ if (d->contentOrientation == orientation)
+ return;
+ if (!d->platformWindow)
+ create();
+ Q_ASSERT(d->platformWindow);
+ d->contentOrientation = orientation;
+ d->platformWindow->handleContentOrientationChange(orientation);
+ emit contentOrientationChanged(orientation);
+}
+
+/*!
+ Returns the actual content orientation.
+
+ This is the last value set with reportContentOrientationChange(). It defaults
+ to Qt::PrimaryOrientation.
+*/
+Qt::ScreenOrientation QWindow::contentOrientation() const
{
Q_D(const QWindow);
- return d->orientation;
+ return d->contentOrientation;
}
/*!
- Set the orientation of the window's contents.
+ Requests the given window orientation.
- This is a hint to the window manager in case it needs to display
- additional content like popups, dialogs, status bars, or similar
- in relation to the window.
+ The window orientation specifies how the window should be rotated
+ by the window manager in order to be displayed. Input events will
+ be correctly mapped to the given orientation.
- The recommended orientation is QScreen::currentOrientation() but
- an application doesn't have to support all possible orientations,
- and thus can opt to ignore the current screen orientation.
+ The return value is false if the system doesn't support the given
+ orientation (for example when requesting a portrait orientation
+ on a device that only handles landscape buffers, typically a desktop
+ system).
+
+ If the return value is false, call windowOrientation() to get the actual
+ supported orientation.
- \sa QScreen::currentOrientation()
+ \sa windowOrientation(), reportContentOrientationChange(), QScreen::orientation()
*/
-void QWindow::setOrientation(Qt::ScreenOrientation orientation)
+bool QWindow::requestWindowOrientation(Qt::ScreenOrientation orientation)
{
Q_D(QWindow);
- if (orientation == d->orientation)
- return;
+ if (!d->platformWindow)
+ create();
+ Q_ASSERT(d->platformWindow);
+ d->windowOrientation = d->platformWindow->requestWindowOrientation(orientation);
+ return d->windowOrientation == orientation;
+}
- d->orientation = orientation;
- if (d->platformWindow) {
- d->platformWindow->setOrientation(orientation);
- }
- emit orientationChanged(orientation);
+/*!
+ Returns the actual window orientation.
+
+ The default value is Qt::PrimaryOrientation.
+
+ \sa requestWindowOrientation()
+*/
+Qt::ScreenOrientation QWindow::windowOrientation() const
+{
+ Q_D(const QWindow);
+ return d->windowOrientation;
}
Qt::WindowState QWindow::windowState() const
@@ -437,7 +507,19 @@ void QWindow::setWindowState(Qt::WindowState state)
void QWindow::setTransientParent(QWindow *parent)
{
Q_D(QWindow);
+
+ QWindow *previousParent = d->transientParent;
+
d->transientParent = parent;
+
+ if (QCoreApplication::instance() && d->visible) {
+ QCoreApplicationPrivate *applicationPrivate = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(QCoreApplication::instance()));
+ if (parent && !previousParent) {
+ applicationPrivate->deref();
+ } else if (!parent && previousParent) {
+ applicationPrivate->ref();
+ }
+ }
}
QWindow *QWindow::transientParent() const
@@ -735,6 +817,13 @@ QAccessibleInterface *QWindow::accessibleRoot() const
}
/*!
+ \fn QWindow::focusObjectChanged(QObject *focusObject)
+
+ This signal is emitted when final receiver of events tied to focus is changed.
+ \sa focusObject()
+*/
+
+/*!
Returns the QObject that will be the final receiver of events tied focus, such
as key events.
*/
@@ -783,8 +872,28 @@ void QWindow::showNormal()
bool QWindow::close()
{
- //should we have close?
- qDebug() << "unimplemented:" << __FILE__ << __LINE__;
+ Q_D(QWindow);
+
+ // Do not close non top level windows
+ if (parent())
+ return false;
+
+ if (QGuiApplicationPrivate::focus_window == this)
+ QGuiApplicationPrivate::focus_window = 0;
+
+ QObjectList childrenWindows = children();
+ for (int i = 0; i < childrenWindows.size(); i++) {
+ QObject *object = childrenWindows.at(i);
+ if (object->isWindowType()) {
+ QWindow *w = static_cast<QWindow*>(object);
+ QGuiApplicationPrivate::window_list.removeAll(w);
+ w->destroy();
+ }
+ }
+
+ QGuiApplicationPrivate::window_list.removeAll(this);
+ destroy();
+ d->maybeQuitOnLastWindowClosed();
return true;
}
@@ -946,6 +1055,14 @@ void QWindow::touchEvent(QTouchEvent *ev)
ev->ignore();
}
+bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result)
+{
+ Q_UNUSED(eventType);
+ Q_UNUSED(message);
+ Q_UNUSED(result);
+ return false;
+}
+
/*!
\fn QPoint QWindow::mapToGlobal(const QPoint &pos) const
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 4d161658c6..98b468b142 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -57,7 +57,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QWindowPrivate;
@@ -91,10 +90,9 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
- Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
+ Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
public:
- enum SurfaceType { RasterSurface, OpenGLSurface };
QWindow(QScreen *screen = 0);
QWindow(QWindow *parent);
@@ -133,8 +131,11 @@ public:
bool isActive() const;
- Qt::ScreenOrientation orientation() const;
- void setOrientation(Qt::ScreenOrientation orientation);
+ void reportContentOrientationChange(Qt::ScreenOrientation orientation);
+ Qt::ScreenOrientation contentOrientation() const;
+
+ bool requestWindowOrientation(Qt::ScreenOrientation orientation);
+ Qt::ScreenOrientation windowOrientation() const;
Qt::WindowState windowState() const;
void setWindowState(Qt::WindowState state);
@@ -252,16 +253,15 @@ Q_SIGNALS:
void screenChanged(QScreen *screen);
void xChanged(int arg);
-
void yChanged(int arg);
void widthChanged(int arg);
-
void heightChanged(int arg);
void visibleChanged(bool arg);
+ void contentOrientationChanged(Qt::ScreenOrientation orientation);
- void orientationChanged(Qt::ScreenOrientation arg);
+ void focusObjectChanged(QObject *object);
private Q_SLOTS:
void screenDestroyed(QObject *screen);
@@ -287,6 +287,7 @@ protected:
virtual void wheelEvent(QWheelEvent *);
#endif
virtual void touchEvent(QTouchEvent *);
+ virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
QWindow(QWindowPrivate &dd, QWindow *parent);
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index d3b6868aa5..7f3958b3ff 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#define QWINDOWSIZE_MAX ((1<<24)-1)
@@ -76,7 +75,8 @@ public:
, windowState(Qt::WindowNoState)
, resizeEventPending(true)
, positionPolicy(WindowFrameExclusive)
- , orientation(Qt::UnknownOrientation)
+ , contentOrientation(Qt::PrimaryOrientation)
+ , windowOrientation(Qt::PrimaryOrientation)
, maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX)
, modality(Qt::NonModal)
, transientParent(0)
@@ -111,7 +111,8 @@ public:
Qt::WindowState windowState;
bool resizeEventPending;
PositionPolicy positionPolicy;
- Qt::ScreenOrientation orientation;
+ Qt::ScreenOrientation contentOrientation;
+ Qt::ScreenOrientation windowOrientation;
QSize minimumSize;
QSize maximumSize;
diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h
index 3366606036..82cce0394b 100644
--- a/src/gui/kernel/qwindowdefs.h
+++ b/src/gui/kernel/qwindowdefs.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
// Class forward definitions
diff --git a/src/gui/kernel/qwindowdefs_win.h b/src/gui/kernel/qwindowdefs_win.h
index 2db1a4649f..2dad28cf45 100644
--- a/src/gui/kernel/qwindowdefs_win.h
+++ b/src/gui/kernel/qwindowdefs_win.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index 4a7ebd1c0c..ae94b75076 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,6 +60,17 @@ QMutex QWindowSystemInterfacePrivate::queueMutex;
extern QPointer<QWindow> qt_last_mouse_receiver;
+/*!
+ \class QWindowSystemInterface
+ \since 5.0
+ \internal
+ \preliminary
+ \ingroup qpa
+ \brief The QWindowSystemInterface provides an event queue for the QPA platform.
+
+ The platform plugins call the various functions to notify about events. The events are queued
+ until sendWindowSystemEvents() is called by the event dispatcher.
+*/
void QWindowSystemInterface::handleEnterEvent(QWindow *tlw)
{
@@ -379,4 +390,17 @@ Qt::DropAction QWindowSystemInterface::handleDrop(QWindow *w, QMimeData *dropDat
return QGuiApplicationPrivate::processDrop(w, dropData, p);
}
+/*!
+ \fn static QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)
+ \brief Passes a native event identified by \a eventType to the \a window.
+
+ \note This function can only be called from the GUI thread.
+ \sa QPlatformNativeInterface::setEventFilter()
+*/
+
+bool QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)
+{
+ return QGuiApplicationPrivate::processNativeEvent(window, eventType, message, result);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h
index 4a17fb9035..b99363eda7 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,6 @@ QT_BEGIN_NAMESPACE
class QMimeData;
class QTouchDevice;
-QT_MODULE(Gui)
class Q_GUI_EXPORT QWindowSystemInterface
{
@@ -121,6 +120,8 @@ public:
static Qt::DropAction handleDrag(QWindow *w, QMimeData *dropData, const QPoint &p);
static Qt::DropAction handleDrop(QWindow *w, QMimeData *dropData, const QPoint &p);
+ static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result);
+
// Changes to the screen
static void handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation newOrientation);
static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry);
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
index b5614eb38e..0bd9ba017a 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -73,6 +73,7 @@ public:
public:
explicit WindowSystemEvent(EventType t)
: type(t), synthetic(false) { }
+ virtual ~WindowSystemEvent() { }
EventType type;
bool synthetic;
};
diff --git a/src/gui/math3d/qgenericmatrix.cpp b/src/gui/math3d/qgenericmatrix.cpp
index 88682702de..113b767e9f 100644
--- a/src/gui/math3d/qgenericmatrix.cpp
+++ b/src/gui/math3d/qgenericmatrix.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index c992415426..0a2446587a 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
template <int N, int M, typename T>
class QGenericMatrix
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index b6b60e7072..068b2e36f7 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 98f967f63c..b80fc86f45 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_MATRIX4X4
@@ -1089,7 +1088,7 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QMatrix4x4 &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QMatrix4x4 &);
#endif
-#ifdef QT_DEPRECATED
+#if QT_DEPRECATED_SINCE(5, 0)
template <int N, int M>
QT_DEPRECATED QMatrix4x4 qGenericMatrixToMatrix4x4(const QGenericMatrix<N, M, qreal>& matrix)
{
diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp
index 53e01323d9..e61dc4bb1d 100644
--- a/src/gui/math3d/qquaternion.cpp
+++ b/src/gui/math3d/qquaternion.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index 78b2d91d13..0a1552f045 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_QUATERNION
diff --git a/src/gui/math3d/qvector2d.cpp b/src/gui/math3d/qvector2d.cpp
index a1c7ac048f..897fa356d3 100644
--- a/src/gui/math3d/qvector2d.cpp
+++ b/src/gui/math3d/qvector2d.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h
index df435bcf49..882845db1b 100644
--- a/src/gui/math3d/qvector2d.h
+++ b/src/gui/math3d/qvector2d.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QVector3D;
class QVector4D;
diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp
index 096d14223c..5251f9c015 100644
--- a/src/gui/math3d/qvector3d.cpp
+++ b/src/gui/math3d/qvector3d.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h
index 55c0e36ca2..d02fa7de8f 100644
--- a/src/gui/math3d/qvector3d.h
+++ b/src/gui/math3d/qvector3d.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QMatrix4x4;
class QVector2D;
diff --git a/src/gui/math3d/qvector4d.cpp b/src/gui/math3d/qvector4d.cpp
index ce3d410b39..e7ee46b88b 100644
--- a/src/gui/math3d/qvector4d.cpp
+++ b/src/gui/math3d/qvector4d.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h
index ceff21163f..384dd6a2a6 100644
--- a/src/gui/math3d/qvector4d.h
+++ b/src/gui/math3d/qvector4d.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QMatrix4x4;
class QVector2D;
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 3c5ab932ba..f0d9000fb6 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -4,43 +4,47 @@ contains(QT_CONFIG, opengl):CONFIG += opengl
contains(QT_CONFIG, opengles2):CONFIG += opengles2
contains(QT_CONFIG, egl):CONFIG += egl
-HEADERS += opengl/qopengl.h \
- opengl/qopengl_p.h \
- opengl/qopenglfunctions.h \
- opengl/qopenglframebufferobject.h \
- opengl/qopenglframebufferobject_p.h \
- opengl/qopenglpaintdevice.h \
- opengl/qopenglbuffer.h \
- opengl/qopenglshaderprogram.h \
- opengl/qopenglextensions_p.h \
- opengl/qopenglgradientcache_p.h \
- opengl/qopengltexturecache_p.h \
- opengl/qopenglengineshadermanager_p.h \
- opengl/qopengl2pexvertexarray_p.h \
- opengl/qopenglpaintengine_p.h \
- opengl/qopenglengineshadersource_p.h \
- opengl/qopenglcustomshaderstage_p.h \
- opengl/qopengltriangulatingstroker_p.h \
- opengl/qopengltextureglyphcache_p.h \
- opengl/qopenglshadercache_p.h \
- opengl/qopenglshadercache_meego_p.h \
- opengl/qtriangulator_p.h \
- opengl/qrbtree_p.h
+contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, egl) {
-SOURCES += opengl/qopengl.cpp \
- opengl/qopenglfunctions.cpp \
- opengl/qopenglframebufferobject.cpp \
- opengl/qopenglpaintdevice.cpp \
- opengl/qopenglbuffer.cpp \
- opengl/qopenglshaderprogram.cpp \
- opengl/qopenglgradientcache.cpp \
- opengl/qopengltexturecache.cpp \
- opengl/qopenglengineshadermanager.cpp \
- opengl/qopengl2pexvertexarray.cpp \
- opengl/qopenglpaintengine.cpp \
- opengl/qopenglcustomshaderstage.cpp \
- opengl/qopengltriangulatingstroker.cpp \
- opengl/qopengltextureglyphcache.cpp \
- opengl/qtriangulator.cpp
+ HEADERS += opengl/qopengl.h \
+ opengl/qopengl_p.h \
+ opengl/qopenglfunctions.h \
+ opengl/qopenglframebufferobject.h \
+ opengl/qopenglframebufferobject_p.h \
+ opengl/qopenglpaintdevice.h \
+ opengl/qopenglbuffer.h \
+ opengl/qopenglshaderprogram.h \
+ opengl/qopenglextensions_p.h \
+ opengl/qopenglgradientcache_p.h \
+ opengl/qopengltexturecache_p.h \
+ opengl/qopenglengineshadermanager_p.h \
+ opengl/qopengl2pexvertexarray_p.h \
+ opengl/qopenglpaintengine_p.h \
+ opengl/qopenglengineshadersource_p.h \
+ opengl/qopenglcustomshaderstage_p.h \
+ opengl/qopengltriangulatingstroker_p.h \
+ opengl/qopengltextureglyphcache_p.h \
+ opengl/qopenglshadercache_p.h \
+ opengl/qopenglshadercache_meego_p.h \
+ opengl/qtriangulator_p.h \
+ opengl/qrbtree_p.h
+
+ SOURCES += opengl/qopengl.cpp \
+ opengl/qopenglfunctions.cpp \
+ opengl/qopenglframebufferobject.cpp \
+ opengl/qopenglpaintdevice.cpp \
+ opengl/qopenglbuffer.cpp \
+ opengl/qopenglshaderprogram.cpp \
+ opengl/qopenglgradientcache.cpp \
+ opengl/qopengltexturecache.cpp \
+ opengl/qopenglengineshadermanager.cpp \
+ opengl/qopengl2pexvertexarray.cpp \
+ opengl/qopenglpaintengine.cpp \
+ opengl/qopenglcustomshaderstage.cpp \
+ opengl/qopengltriangulatingstroker.cpp \
+ opengl/qopengltextureglyphcache.cpp \
+ opengl/qtriangulator.cpp
+
+}
#INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp
index 246d4dfa24..f39dc12239 100644
--- a/src/gui/opengl/qopengl.cpp
+++ b/src/gui/opengl/qopengl.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index a3ec59cef1..5fb30c0c41 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGL_H
#define QOPENGL_H
+#ifndef QT_NO_OPENGL
+
#include <QtCore/qglobal.h>
QT_BEGIN_HEADER
@@ -73,10 +75,11 @@ typedef GLfloat GLdouble;
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif // QOPENGL_H
diff --git a/src/gui/opengl/qopengl2pexvertexarray.cpp b/src/gui/opengl/qopengl2pexvertexarray.cpp
index 1db2223667..c9faf98a97 100644
--- a/src/gui/opengl/qopengl2pexvertexarray.cpp
+++ b/src/gui/opengl/qopengl2pexvertexarray.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengl2pexvertexarray_p.h b/src/gui/opengl/qopengl2pexvertexarray_p.h
index 779fa5a545..7043f43e02 100644
--- a/src/gui/opengl/qopengl2pexvertexarray_p.h
+++ b/src/gui/opengl/qopengl2pexvertexarray_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h
index 5323604ce5..1860fb1683 100644
--- a/src/gui/opengl/qopengl_p.h
+++ b/src/gui/opengl/qopengl_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp
index 6bf4fedc8e..e0ab98df21 100644
--- a/src/gui/opengl/qopenglbuffer.cpp
+++ b/src/gui/opengl/qopenglbuffer.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h
index 83ad5cda51..d8e0a69308 100644
--- a/src/gui/opengl/qopenglbuffer.h
+++ b/src/gui/opengl/qopenglbuffer.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGLBUFFER_H
#define QOPENGLBUFFER_H
+#ifndef QT_NO_OPENGL
+
#include <QtCore/qscopedpointer.h>
#include <QtGui/qopengl.h>
@@ -49,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLBufferPrivate;
@@ -129,4 +130,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif
diff --git a/src/gui/opengl/qopenglcustomshaderstage.cpp b/src/gui/opengl/qopenglcustomshaderstage.cpp
index 25a07b2a4c..c7ad2d9adf 100644
--- a/src/gui/opengl/qopenglcustomshaderstage.cpp
+++ b/src/gui/opengl/qopenglcustomshaderstage.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglcustomshaderstage_p.h b/src/gui/opengl/qopenglcustomshaderstage_p.h
index 35c59a9e9b..3e015ccc5b 100644
--- a/src/gui/opengl/qopenglcustomshaderstage_p.h
+++ b/src/gui/opengl/qopenglcustomshaderstage_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPainter;
class QOpenGLCustomShaderStagePrivate;
diff --git a/src/gui/opengl/qopenglengineshadermanager.cpp b/src/gui/opengl/qopenglengineshadermanager.cpp
index 9520f07fcc..9b4d6e02cc 100644
--- a/src/gui/opengl/qopenglengineshadermanager.cpp
+++ b/src/gui/opengl/qopenglengineshadermanager.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglengineshadermanager_p.h b/src/gui/opengl/qopenglengineshadermanager_p.h
index 39cd2e4d70..72ae1f9073 100644
--- a/src/gui/opengl/qopenglengineshadermanager_p.h
+++ b/src/gui/opengl/qopenglengineshadermanager_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -232,7 +232,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
/*
diff --git a/src/gui/opengl/qopenglengineshadersource_p.h b/src/gui/opengl/qopenglengineshadersource_p.h
index 65e3fc54a5..985e54d542 100644
--- a/src/gui/opengl/qopenglengineshadersource_p.h
+++ b/src/gui/opengl/qopenglengineshadersource_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
static const char* const qopenglslMainVertexShader = "\n\
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index b66af217a6..cc8454603c 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#if 0
#ifndef GL_ARB_vertex_buffer_object
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 261a6df27d..5e22554303 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -412,8 +412,18 @@ void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSi
glBindTexture(target, texture);
glTexImage2D(target, 0, internal_format, size.width(), size.height(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- if (mipmap)
- funcs.glGenerateMipmap(GL_TEXTURE_2D);
+ if (mipmap) {
+ int width = size.width();
+ int height = size.height();
+ int level = 0;
+ while (width > 1 || height > 1) {
+ width = (width + 1) >> 1;
+ height = (height + 1) >> 1;
+ ++level;
+ glTexImage2D(target, level, internal_format, width, height, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ }
+ }
glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -882,8 +892,8 @@ bool QOpenGLFramebufferObject::release()
#endif
if (current) {
- current->d_func()->current_fbo = current->d_func()->default_fbo;
- d->funcs.glBindFramebuffer(GL_FRAMEBUFFER, current->d_func()->default_fbo);
+ current->d_func()->current_fbo = current->defaultFramebufferObject();
+ d->funcs.glBindFramebuffer(GL_FRAMEBUFFER, current->d_func()->current_fbo);
}
return true;
@@ -1047,8 +1057,8 @@ bool QOpenGLFramebufferObject::bindDefault()
QOpenGLFunctions functions(ctx);
if (ctx) {
- ctx->d_func()->current_fbo = ctx->d_func()->default_fbo;
- functions.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->default_fbo);
+ ctx->d_func()->current_fbo = ctx->defaultFramebufferObject();
+ functions.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->current_fbo);
#ifdef QT_DEBUG
} else {
qWarning("QOpenGLFramebufferObject::bindDefault() called without current context.");
@@ -1132,8 +1142,24 @@ void QOpenGLFramebufferObject::blitFramebuffer(QOpenGLFramebufferObject *target,
QOpenGLFramebufferObject *source,
GLbitfield buffers, GLenum filter)
{
- blitFramebuffer(target, QRect(QPoint(0, 0), target->size()),
- source, QRect(QPoint(0, 0), source->size()),
+ if (!target && !source)
+ return;
+
+ QSize targetSize;
+ QSize sourceSize;
+
+ if (target)
+ targetSize = target->size();
+ if (source)
+ sourceSize = source->size();
+
+ if (targetSize.isEmpty())
+ targetSize = sourceSize;
+ else if (sourceSize.isEmpty())
+ sourceSize = targetSize;
+
+ blitFramebuffer(target, QRect(QPoint(0, 0), targetSize),
+ source, QRect(QPoint(0, 0), sourceSize),
buffers, filter);
}
diff --git a/src/gui/opengl/qopenglframebufferobject.h b/src/gui/opengl/qopenglframebufferobject.h
index acce7d7391..0b2ead1cbb 100644
--- a/src/gui/opengl/qopenglframebufferobject.h
+++ b/src/gui/opengl/qopenglframebufferobject.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGLFRAMEBUFFEROBJECT_H
#define QOPENGLFRAMEBUFFEROBJECT_H
+#ifndef QT_NO_OPENGL
+
#include <QtGui/qopengl.h>
#include <QtGui/qpaintdevice.h>
@@ -51,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLFramebufferObjectPrivate;
class QOpenGLFramebufferObjectFormat;
@@ -159,4 +160,7 @@ private:
QT_END_NAMESPACE
QT_END_HEADER
+
+#endif // QT_NO_OPENGL
+
#endif // QOPENGLFRAMEBUFFEROBJECT_H
diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h
index aeaa2a0e7d..78d9d93ffe 100644
--- a/src/gui/opengl/qopenglframebufferobject_p.h
+++ b/src/gui/opengl/qopenglframebufferobject_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index a34dfc193c..13f91e2ad8 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -478,6 +478,9 @@ void QOpenGLFunctions::initializeGLFunctions()
Convenience function that calls glBindFramebuffer(\a target, \a framebuffer).
+ Note that Qt will translate a \a framebuffer argument of 0 to the currently
+ bound QOpenGLContext's defaultFramebufferObject().
+
For more information, see the OpenGL/ES 2.0 documentation for
\l{http://www.khronos.org/opengles/sdk/docs/man/glBindFramebuffer.xml}{glBindFramebuffer()}.
*/
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index 2f4b5b18cb..881c27f2c9 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGLFUNCTIONS_H
#define QOPENGLFUNCTIONS_H
+#ifndef QT_NO_OPENGL
+
#ifdef __GLEW_H__
#warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
#warning To use GLEW with Qt, do not include <qopengl.h> or <QOpenGLFunctions> after glew.h
@@ -71,7 +73,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
// Types that aren't defined in all system's gl.h files.
typedef ptrdiff_t qopengl_GLintptr;
@@ -477,6 +478,8 @@ inline void QOpenGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
inline void QOpenGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
+ if (framebuffer == 0)
+ framebuffer = QOpenGLContext::currentContext()->defaultFramebufferObject();
#if defined(QT_OPENGL_ES_2)
::glBindFramebuffer(target, framebuffer);
#else
@@ -2420,4 +2423,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif
diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp
index dde5eaf93e..ec958085ed 100644
--- a/src/gui/opengl/qopenglgradientcache.cpp
+++ b/src/gui/opengl/qopenglgradientcache.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglgradientcache_p.h b/src/gui/opengl/qopenglgradientcache_p.h
index 055798fcd8..4035689abd 100644
--- a/src/gui/opengl/qopenglgradientcache_p.h
+++ b/src/gui/opengl/qopenglgradientcache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index 35ef609529..118fe63122 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglpaintdevice.h b/src/gui/opengl/qopenglpaintdevice.h
index 0a7bb3c9f3..ce3e7cf278 100644
--- a/src/gui/opengl/qopenglpaintdevice.h
+++ b/src/gui/opengl/qopenglpaintdevice.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGLPAINTDEVICE_H
#define QOPENGLPAINTDEVICE_H
+#ifndef QT_NO_OPENGL
+
//
// W A R N I N G
// -------------
@@ -62,7 +64,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLPaintDevicePrivate;
@@ -100,4 +101,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif // QOPENGLPAINTDEVICE_H
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index 834beda977..eb32ac162f 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -1581,7 +1581,7 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type
transferMode(TextDrawingMode);
- int margin = cache->glyphMargin();
+ int margin = fe->glyphMargin(glyphType);
GLfloat dx = 1.0 / cache->width();
GLfloat dy = 1.0 / cache->height();
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 9f125eb616..0a6ef2a4d2 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglshadercache_meego_p.h b/src/gui/opengl/qopenglshadercache_meego_p.h
index 02a1c84336..44efa66117 100644
--- a/src/gui/opengl/qopenglshadercache_meego_p.h
+++ b/src/gui/opengl/qopenglshadercache_meego_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -400,7 +400,6 @@ static bool qt_cache_shader(const QOpenGLShaderProgram *shader, QOpenGLContext *
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class CachedShader
{
diff --git a/src/gui/opengl/qopenglshadercache_p.h b/src/gui/opengl/qopenglshadercache_p.h
index 64435eb1c2..219c2bfb99 100644
--- a/src/gui/opengl/qopenglshadercache_p.h
+++ b/src/gui/opengl/qopenglshadercache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -63,7 +63,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLShaderProgram;
class QOpenGLContext;
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index fab764ed6e..69b4fc9858 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h
index f6244cd12c..5ca2ead45e 100644
--- a/src/gui/opengl/qopenglshaderprogram.h
+++ b/src/gui/opengl/qopenglshaderprogram.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -42,6 +42,8 @@
#ifndef QOPENGLSHADERPROGRAM_H
#define QOPENGLSHADERPROGRAM_H
+#ifndef QT_NO_OPENGL
+
#include <QtGui/qopengl.h>
#include <QtGui/qvector2d.h>
#include <QtGui/qvector3d.h>
@@ -52,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QOpenGLContext;
class QOpenGLShaderProgram;
@@ -314,4 +315,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_OPENGL
+
#endif
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index a93ae91354..e4d5ff974d 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h
index c6e46dd6cb..549a2f4eab 100644
--- a/src/gui/opengl/qopengltexturecache_p.h
+++ b/src/gui/opengl/qopengltexturecache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index 9f5ce46854..b37e8fb972 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 5da8d1ce4b..1b4f4f7429 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengltriangulatingstroker.cpp b/src/gui/opengl/qopengltriangulatingstroker.cpp
index 65ee8753c4..ccf4eb30e7 100644
--- a/src/gui/opengl/qopengltriangulatingstroker.cpp
+++ b/src/gui/opengl/qopengltriangulatingstroker.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qopengltriangulatingstroker_p.h b/src/gui/opengl/qopengltriangulatingstroker_p.h
index 965fce6157..27f414748e 100644
--- a/src/gui/opengl/qopengltriangulatingstroker_p.h
+++ b/src/gui/opengl/qopengltriangulatingstroker_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-class QTriangulatingStroker
+class Q_GUI_EXPORT QTriangulatingStroker
{
public:
QTriangulatingStroker() : m_vertices(0) {}
diff --git a/src/gui/opengl/qrbtree_p.h b/src/gui/opengl/qrbtree_p.h
index dbcf037193..161eed93d0 100644
--- a/src/gui/opengl/qrbtree_p.h
+++ b/src/gui/opengl/qrbtree_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qtriangulator.cpp b/src/gui/opengl/qtriangulator.cpp
index c4b8aba9a7..c82b2a4ca8 100644
--- a/src/gui/opengl/qtriangulator.cpp
+++ b/src/gui/opengl/qtriangulator.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/opengl/qtriangulator_p.h b/src/gui/opengl/qtriangulator_p.h
index 96dedd5eca..5cd1a1899b 100644
--- a/src/gui/opengl/qtriangulator_p.h
+++ b/src/gui/opengl/qtriangulator_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 1481cb8520..61a25e9ac8 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -103,19 +103,6 @@ if(mmx|3dnow|sse|sse2|iwmmxt) {
IWMMXT_SOURCES += painting/qdrawhelper_iwmmxt.cpp
}
-symbian {
- HEADERS += painting/qdrawhelper_arm_simd_p.h
- armccIfdefBlock = \
- "$${LITERAL_HASH}if defined(ARMV6)" \
- "MACRO QT_HAVE_ARM_SIMD" \
- "SOURCEPATH painting" \
- "SOURCE qdrawhelper_arm_simd.cpp" \
- "$${LITERAL_HASH}endif"
-
- MMP_RULES += armccIfdefBlock
- QMAKE_CXXFLAGS.ARMCC *= -O3
-}
-
NEON_SOURCES += painting/qdrawhelper_neon.cpp
NEON_HEADERS += painting/qdrawhelper_neon_p.h
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 08f809ed88..37446f4f80 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qbackingstore.h b/src/gui/painting/qbackingstore.h
index 0172a78d85..db6884f58d 100644
--- a/src/gui/painting/qbackingstore.h
+++ b/src/gui/painting/qbackingstore.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QRegion;
class QRect;
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 75a75ead7d..57dc5710fa 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h
index 368ae7e483..8481348bd0 100644
--- a/src/gui/painting/qbezier_p.h
+++ b/src/gui/painting/qbezier_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 40047d8c94..a83cadb161 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h
index 412be40d67..83abf01fd8 100644
--- a/src/gui/painting/qblendfunctions_p.h
+++ b/src/gui/painting/qblendfunctions_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qblittable.cpp b/src/gui/painting/qblittable.cpp
index 020eba0235..2009fd1010 100644
--- a/src/gui/painting/qblittable.cpp
+++ b/src/gui/painting/qblittable.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index c704c86452..0d2f6983d4 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 66f0395582..c8dc370a8b 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index 060d11fd79..b4cffc45db 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -65,7 +65,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
struct QBrushData;
class QPixmap;
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 5f15ccbc63..2c95434843 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index ac525cb068..1b253395a4 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QColor;
class QColormap;
diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp
index 14b984978c..a055018353 100644
--- a/src/gui/painting/qcolor_p.cpp
+++ b/src/gui/painting/qcolor_p.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qcolor_p.h b/src/gui/painting/qcolor_p.h
index f1a4d313e3..18224e370a 100644
--- a/src/gui/painting/qcolor_p.h
+++ b/src/gui/painting/qcolor_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index c59399c905..6f7b69f7b0 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index a7742769bd..86e811c5f6 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QCosmeticStroker;
diff --git a/src/gui/painting/qcssutil.cpp b/src/gui/painting/qcssutil.cpp
index 4758a1362c..a3efb8133f 100644
--- a/src/gui/painting/qcssutil.cpp
+++ b/src/gui/painting/qcssutil.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qcssutil_p.h b/src/gui/painting/qcssutil_p.h
index e555788343..fcccee6ce3 100644
--- a/src/gui/painting/qcssutil_p.h
+++ b/src/gui/painting/qcssutil_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h
index 6c0f5d57c6..e2855c80d0 100644
--- a/src/gui/painting/qdatabuffer_p.h
+++ b/src/gui/painting/qdatabuffer_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 26fe6df3d4..13b8c8cae5 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_arm_simd.cpp b/src/gui/painting/qdrawhelper_arm_simd.cpp
deleted file mode 100644
index e1784e049f..0000000000
--- a/src/gui/painting/qdrawhelper_arm_simd.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "qdrawhelper_arm_simd_p.h"
-
-#include <private/qpaintengine_raster_p.h>
-#include <private/qblendfunctions_p.h>
-
-#ifdef QT_HAVE_ARM_SIMD
-
-
-
-// TODO: add GNU assembler instructions and support for other platforms.
-// Default to C code for now
-
-void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- if (const_alpha == 256) {
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = src[x];
- if (s >= 0xff000000)
- dst[x] = s;
- else if (s != 0)
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- } else if (const_alpha != 0) {
- const_alpha = (const_alpha * 255) >> 8;
- for (int y=0; y<h; ++y) {
- for (int x=0; x<w; ++x) {
- uint s = BYTE_MUL(src[x], const_alpha);
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
- }
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- }
-}
-
-void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha)
-{
- if (const_alpha != 256) {
- qt_blend_argb32_on_argb32_arm_simd(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- return;
- }
-
- const uint *src = (const uint *) srcPixels;
- uint *dst = (uint *) destPixels;
- if (w <= 64) {
- for (int y=0; y<h; ++y) {
- qt_memconvert(dst, src, w);
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- } else {
- int len = w * 4;
- for (int y=0; y<h; ++y) {
- memcpy(dst, src, len);
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
- }
- }
-}
-
-
-#endif // QT_HAVE_ARMV_SIMD
diff --git a/src/gui/painting/qdrawhelper_arm_simd_p.h b/src/gui/painting/qdrawhelper_arm_simd_p.h
deleted file mode 100644
index e920456d45..0000000000
--- a/src/gui/painting/qdrawhelper_arm_simd_p.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 QDRAWHELPER_ARM_SIMD_P_H
-#define QDRAWHELPER_ARM_SIMD_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qdrawhelper_p.h>
-
-QT_BEGIN_NAMESPACE
-
-#if defined(QT_HAVE_ARM_SIMD)
-
-void qt_blend_argb32_on_argb32_arm_simd(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
-
-void qt_blend_rgb32_on_rgb32_arm_simd(uchar *destPixels, int dbpl,
- const uchar *srcPixels, int sbpl,
- int w, int h,
- int const_alpha);
-
-#endif // QT_HAVE_ARM_SIMD
-
-QT_END_NAMESPACE
-
-#endif // QDRAWHELPER_ARM_SIMD_P_H
diff --git a/src/gui/painting/qdrawhelper_iwmmxt.cpp b/src/gui/painting/qdrawhelper_iwmmxt.cpp
index 59b9f28dcd..83764b41f2 100644
--- a/src/gui/painting/qdrawhelper_iwmmxt.cpp
+++ b/src/gui/painting/qdrawhelper_iwmmxt.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_mmx.cpp b/src/gui/painting/qdrawhelper_mmx.cpp
index 261cf06a42..520ce6efd0 100644
--- a/src/gui/painting/qdrawhelper_mmx.cpp
+++ b/src/gui/painting/qdrawhelper_mmx.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_mmx3dnow.cpp b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
index 7bec5ec336..71469b65c0 100644
--- a/src/gui/painting/qdrawhelper_mmx3dnow.cpp
+++ b/src/gui/painting/qdrawhelper_mmx3dnow.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_mmx_p.h b/src/gui/painting/qdrawhelper_mmx_p.h
index d6f7056669..5038292029 100644
--- a/src/gui/painting/qdrawhelper_mmx_p.h
+++ b/src/gui/painting/qdrawhelper_mmx_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 09eba9103b..c3dd4fb1ef 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_neon_asm.S b/src/gui/painting/qdrawhelper_neon_asm.S
index d1e6e585c4..4f8b204b23 100644
--- a/src/gui/painting/qdrawhelper_neon_asm.S
+++ b/src/gui/painting/qdrawhelper_neon_asm.S
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_neon_p.h b/src/gui/painting/qdrawhelper_neon_p.h
index 6ce1d5e59e..d62c73196f 100644
--- a/src/gui/painting/qdrawhelper_neon_p.h
+++ b/src/gui/painting/qdrawhelper_neon_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 52f50240a4..bf8eadcc03 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_sse.cpp b/src/gui/painting/qdrawhelper_sse.cpp
index 4e17c32c17..dd83098fe5 100644
--- a/src/gui/painting/qdrawhelper_sse.cpp
+++ b/src/gui/painting/qdrawhelper_sse.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index f974b586d0..17b249a235 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_sse3dnow.cpp b/src/gui/painting/qdrawhelper_sse3dnow.cpp
index 42061feac3..1cca6b6c1d 100644
--- a/src/gui/painting/qdrawhelper_sse3dnow.cpp
+++ b/src/gui/painting/qdrawhelper_sse3dnow.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_sse_p.h b/src/gui/painting/qdrawhelper_sse_p.h
index 99ef917e71..81a5001fb3 100644
--- a/src/gui/painting/qdrawhelper_sse_p.h
+++ b/src/gui/painting/qdrawhelper_sse_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index 1281d4d526..bc88e397da 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawhelper_x86_p.h b/src/gui/painting/qdrawhelper_x86_p.h
index 20d0f7a36b..ada0bec0e3 100644
--- a/src/gui/painting/qdrawhelper_x86_p.h
+++ b/src/gui/painting/qdrawhelper_x86_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 28b9ceee8a..25d025eb39 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp
index 3e40d25ec8..b7ced4e2c7 100644
--- a/src/gui/painting/qemulationpaintengine.cpp
+++ b/src/gui/painting/qemulationpaintengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qemulationpaintengine_p.h b/src/gui/painting/qemulationpaintengine_p.h
index b49ce2bdaf..0e1f09ad22 100644
--- a/src/gui/painting/qemulationpaintengine_p.h
+++ b/src/gui/painting/qemulationpaintengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -59,7 +59,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QEmulationPaintEngine : public QPaintEngineEx
{
diff --git a/src/gui/painting/qfixed_p.h b/src/gui/painting/qfixed_p.h
index dba52f75b4..d30328b0fa 100644
--- a/src/gui/painting/qfixed_p.h
+++ b/src/gui/painting/qfixed_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 50ec22e73a..babc08bebc 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qgrayraster_p.h b/src/gui/painting/qgrayraster_p.h
index 11470ab279..ee30b786c8 100644
--- a/src/gui/painting/qgrayraster_p.h
+++ b/src/gui/painting/qgrayraster_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp
index 83cd9ad970..94442532be 100644
--- a/src/gui/painting/qimagescale.cpp
+++ b/src/gui/painting/qimagescale.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qimagescale_p.h b/src/gui/painting/qimagescale_p.h
index 654602cefe..815598e6f0 100644
--- a/src/gui/painting/qimagescale_p.h
+++ b/src/gui/painting/qimagescale_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qmath_p.h b/src/gui/painting/qmath_p.h
index 21bbeeeaed..4efbbcabe6 100644
--- a/src/gui/painting/qmath_p.h
+++ b/src/gui/painting/qmath_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index cf99e31b90..6b5eb14f5f 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -923,15 +923,6 @@ QMatrix &QMatrix::rotate(qreal a)
*/
/*!
- \obsolete
- \fn qreal QMatrix::det() const
-
- Returns the matrix's determinant.
-
- \sa determinant()
-*/
-
-/*!
\since 4.6
\fn qreal QMatrix::determinant() const
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index e963b90a44..7acc962afa 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPainterPath;
class QVariant;
@@ -102,9 +101,6 @@ public:
bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
qreal determinant() const { return _m11*_m22 - _m12*_m21; }
-#ifdef QT_DEPRECATED
- QT_DEPRECATED qreal det() const { return _m11*_m22 - _m12*_m21; }
-#endif
QMatrix inverted(bool *invertible = 0) const;
diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp
index 478d6470b2..5d027b669b 100644
--- a/src/gui/painting/qmemrotate.cpp
+++ b/src/gui/painting/qmemrotate.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qmemrotate_p.h b/src/gui/painting/qmemrotate_p.h
index d9793b2404..4c4bc94767 100644
--- a/src/gui/painting/qmemrotate_p.h
+++ b/src/gui/painting/qmemrotate_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index da77722491..08ed08abb1 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index ceb70f1a7b..12ffb7c565 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index 038852a842..7195ab8394 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index f113534956..b137bcc6b8 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPagedPaintDevicePrivate;
diff --git a/src/gui/painting/qpagedpaintdevice_p.h b/src/gui/painting/qpagedpaintdevice_p.h
index 28a2c80b94..8f5817480c 100644
--- a/src/gui/painting/qpagedpaintdevice_p.h
+++ b/src/gui/painting/qpagedpaintdevice_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp
index a4edba9299..9a57404169 100644
--- a/src/gui/painting/qpaintbuffer.cpp
+++ b/src/gui/painting/qpaintbuffer.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h
index 536d5c8a61..0a049fa06e 100644
--- a/src/gui/painting/qpaintbuffer_p.h
+++ b/src/gui/painting/qpaintbuffer_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index b094019c84..d1dfa7001f 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index fdceaa1886..4053e89a1c 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPaintEngine;
diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc
index 747047d53a..47c518ce10 100644
--- a/src/gui/painting/qpaintdevice.qdoc
+++ b/src/gui/painting/qpaintdevice.qdoc
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the documentation of the Qt Toolkit.
**
@@ -21,6 +20,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintdevice_qpa.cpp b/src/gui/painting/qpaintdevice_qpa.cpp
index eb7408dbff..e469a5f10f 100644
--- a/src/gui/painting/qpaintdevice_qpa.cpp
+++ b/src/gui/painting/qpaintdevice_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 8364218b6e..eb6d186f78 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h
index ee08ef1fbd..bc792a32e3 100644
--- a/src/gui/painting/qpaintengine.h
+++ b/src/gui/painting/qpaintengine.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QFontEngine;
class QLineF;
diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp
index 37c158a3d9..55d46f3b63 100644
--- a/src/gui/painting/qpaintengine_blitter.cpp
+++ b/src/gui/painting/qpaintengine_blitter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index dba0bad9ef..957d1a546d 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index 57075fed90..594259367c 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5100393c69..f2aac442dc 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -71,17 +71,17 @@
// #include "qbezier_p.h"
#include "qoutlinemapper_p.h"
-#if defined(Q_OS_WIN)
-# include <qt_windows.h>
+#include <limits.h>
+
+#ifdef Q_OS_WIN
# include <qvarlengtharray.h>
# include <private/qfontengine_p.h>
+# include <qt_windows.h>
+#ifdef Q_OS_WIN64
+# include <malloc.h>
+# endif
#endif
-#if defined(Q_OS_WIN64)
-# include <malloc.h>
-#endif
-#include <limits.h>
-
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
@@ -2747,7 +2747,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs,
else if (depth == 1)
rightShift = 3; // divide by 8
- int margin = cache->glyphMargin();
+ int margin = fontEngine->glyphMargin(glyphType);
const QFixed offs = QFixed::fromReal(aliasedCoordinateDelta);
const uchar *bits = image.bits();
for (int i=0; i<numGlyphs; ++i) {
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index aa454c0509..7b353188a3 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index e5e14c9135..93f36ba0ab 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 33a6081570..62c5d972de 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -65,7 +65,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPainterState;
class QPaintEngineExPrivate;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 77c3fc183f..43429abe8a 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index ba9a9fbb97..67b05eeca5 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -64,7 +64,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QBrush;
class QFontInfo;
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 0fb3069ee0..fecf8bd960 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 9c69644033..25dd134401 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index 46af341df3..40456bc163 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QFont;
class QPainterPathPrivate;
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 1cf00bbae3..23e8332f19 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 03f48d8fda..6e8bc2ac74 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index daf97884c0..85b66a1515 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -64,7 +64,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QWingedEdge;
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 62f4b9b3f6..843551d51f 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index 32b59e92e8..7dd1386ec6 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index 23be05c49c..f9a969c166 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpdfwriter.h b/src/gui/painting/qpdfwriter.h
index dfe49b403a..7b0547ad45 100644
--- a/src/gui/painting/qpdfwriter.h
+++ b/src/gui/painting/qpdfwriter.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QIODevice;
class QPdfWriterPrivate;
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 3654c6f007..b6966b12c3 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h
index 708f131ece..35b3f5eec6 100644
--- a/src/gui/painting/qpen.h
+++ b/src/gui/painting/qpen.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QVariant;
class QPenPrivate;
diff --git a/src/gui/painting/qpen_p.h b/src/gui/painting/qpen_p.h
index 4610026e2f..37979239fb 100644
--- a/src/gui/painting/qpen_p.h
+++ b/src/gui/painting/qpen_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qplatformbackingstore_qpa.cpp b/src/gui/painting/qplatformbackingstore_qpa.cpp
index 9d855735f4..485190d301 100644
--- a/src/gui/painting/qplatformbackingstore_qpa.cpp
+++ b/src/gui/painting/qplatformbackingstore_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qplatformbackingstore_qpa.h b/src/gui/painting/qplatformbackingstore_qpa.h
index a47106771e..8049c64c25 100644
--- a/src/gui/painting/qplatformbackingstore_qpa.h
+++ b/src/gui/painting/qplatformbackingstore_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QRegion;
class QRect;
diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp
index b745e1a6ee..3a4860a559 100644
--- a/src/gui/painting/qpolygon.cpp
+++ b/src/gui/painting/qpolygon.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index 348cf9eef7..0a089d3cf3 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QMatrix;
class QTransform;
diff --git a/src/gui/painting/qpolygonclipper_p.h b/src/gui/painting/qpolygonclipper_p.h
index 6512a3a0ed..1344270b9e 100644
--- a/src/gui/painting/qpolygonclipper_p.h
+++ b/src/gui/painting/qpolygonclipper_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qrasterdefs_p.h b/src/gui/painting/qrasterdefs_p.h
index a113ab0abf..b6a52c2e2c 100644
--- a/src/gui/painting/qrasterdefs_p.h
+++ b/src/gui/painting/qrasterdefs_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 5a46d1ba48..3ccfb08973 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qrasterizer_p.h b/src/gui/painting/qrasterizer_p.h
index ed7d4eb957..f335b4c395 100644
--- a/src/gui/painting/qrasterizer_p.h
+++ b/src/gui/painting/qrasterizer_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 68338602e2..48b0c00014 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -3930,7 +3930,7 @@ void QRegion::translate(int dx, int dy)
OffsetRegion(*d->qt_rgn, dx, dy);
}
-QRegion QRegion::unite(const QRegion &r) const
+QRegion QRegion::united(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn))
return r;
@@ -3993,7 +3993,7 @@ QRegion& QRegion::operator+=(const QRegion &r)
}
}
-QRegion QRegion::unite(const QRect &r) const
+QRegion QRegion::united(const QRect &r) const
{
if (isEmptyHelper(d->qt_rgn))
return r;
@@ -4054,7 +4054,7 @@ QRegion& QRegion::operator+=(const QRect &r)
}
}
-QRegion QRegion::intersect(const QRegion &r) const
+QRegion QRegion::intersected(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn) || isEmptyHelper(r.d->qt_rgn)
|| !EXTENTCHECK(&d->qt_rgn->extents, &r.d->qt_rgn->extents))
@@ -4099,7 +4099,7 @@ QRegion QRegion::intersect(const QRegion &r) const
return result;
}
-QRegion QRegion::intersect(const QRect &r) const
+QRegion QRegion::intersected(const QRect &r) const
{
if (isEmptyHelper(d->qt_rgn) || r.isEmpty()
|| !EXTENTCHECK(&d->qt_rgn->extents, &r))
@@ -4125,7 +4125,7 @@ QRegion QRegion::intersect(const QRect &r) const
return result;
}
-QRegion QRegion::subtract(const QRegion &r) const
+QRegion QRegion::subtracted(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn) || isEmptyHelper(r.d->qt_rgn))
return *this;
@@ -4150,7 +4150,7 @@ QRegion QRegion::subtract(const QRegion &r) const
return result;
}
-QRegion QRegion::eor(const QRegion &r) const
+QRegion QRegion::xored(const QRegion &r) const
{
if (isEmptyHelper(d->qt_rgn)) {
return r;
@@ -4257,11 +4257,6 @@ void QRegion::setRects(const QRect *rects, int num)
}
}
-int QRegion::numRects() const
-{
- return (d->qt_rgn ? d->qt_rgn->numRects : 0);
-}
-
int QRegion::rectCount() const
{
return (d->qt_rgn ? d->qt_rgn->numRects : 0);
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 834a015ceb..aa8b21b624 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
template <class T> class QVector;
class QVariant;
@@ -92,20 +91,21 @@ public:
QRegion translated(int dx, int dy) const;
inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
- // ### Qt 5: make these four functions QT4_SUPPORT
- QRegion unite(const QRegion &r) const;
- QRegion unite(const QRect &r) const;
- QRegion intersect(const QRegion &r) const;
- QRegion intersect(const QRect &r) const;
- QRegion subtract(const QRegion &r) const;
- QRegion eor(const QRegion &r) const;
-
- inline QRegion united(const QRegion &r) const { return unite(r); }
- inline QRegion united(const QRect &r) const { return unite(r); }
- inline QRegion intersected(const QRegion &r) const { return intersect(r); }
- inline QRegion intersected(const QRect &r) const { return intersect(r); }
- inline QRegion subtracted(const QRegion &r) const { return subtract(r); }
- inline QRegion xored(const QRegion &r) const { return eor(r); }
+ QRegion united(const QRegion &r) const;
+ QRegion united(const QRect &r) const;
+ QRegion intersected(const QRegion &r) const;
+ QRegion intersected(const QRect &r) const;
+ QRegion subtracted(const QRegion &r) const;
+ QRegion xored(const QRegion &r) const;
+
+#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED QRegion unite(const QRegion &r) const { return united(r); }
+ inline QT_DEPRECATED QRegion unite(const QRect &r) const { return united(r); }
+ inline QT_DEPRECATED QRegion intersect(const QRegion &r) const { return intersected(r); }
+ inline QT_DEPRECATED QRegion intersect(const QRect &r) const { return intersected(r); }
+ inline QT_DEPRECATED QRegion subtract(const QRegion &r) const { return subtracted(r); }
+ inline QT_DEPRECATED QRegion eor(const QRegion &r) const { return xored(r); }
+#endif
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;
@@ -113,9 +113,6 @@ public:
QRect boundingRect() const;
QVector<QRect> rects() const;
void setRects(const QRect *rect, int num);
-#ifdef QT_DEPRECATED
- QT_DEPRECATED int numRects() const;
-#endif
int rectCount() const;
const QRegion operator|(const QRegion &r) const;
diff --git a/src/gui/painting/qrgb.h b/src/gui/painting/qrgb.h
index b982707344..6d046be1d5 100644
--- a/src/gui/painting/qrgb.h
+++ b/src/gui/painting/qrgb.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
typedef unsigned int QRgb; // RGB triplet
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index f7e50c82c0..ddf828982a 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index b6cae1d2a0..30953d304b 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 0743804319..dacedbdfc8 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -108,7 +108,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
#endif
m_current_fontengine = fontEngine;
- const int margin = glyphMargin();
+ const int margin = m_current_fontengine->glyphMargin(m_type);
const int paddingDoubled = glyphPadding() * 2;
bool supportsSubPixelPositions = fontEngine->supportsSubPixelPositions();
@@ -274,7 +274,7 @@ void QTextureGlyphCache::fillInPendingGlyphs()
QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const
{
if (m_type == QFontEngineGlyphCache::Raster_RGBMask)
- return m_current_fontengine->alphaRGBMapForGlyph(g, subPixelPosition, glyphMargin(), m_transform);
+ return m_current_fontengine->alphaRGBMapForGlyph(g, subPixelPosition, m_transform);
else
return m_current_fontengine->alphaMapForGlyph(g, subPixelPosition, m_transform);
@@ -311,11 +311,6 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
}
}
-int QImageTextureGlyphCache::glyphMargin() const
-{
- return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0;
-}
-
void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subPixelPosition)
{
QImage mask = textureMapForGlyph(g, subPixelPosition);
@@ -400,7 +395,8 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
#ifdef CACHE_DEBUG
// QPainter p(&m_image);
// p.drawLine(
- QPoint base(c.x + glyphMargin(), c.y + glyphMargin() + c.baseLineY-1);
+ int margin = m_current_fontengine ? m_current_fontengine->glyphMargin(m_type) : 0;
+ QPoint base(c.x + margin, c.y + margin + c.baseLineY-1);
if (m_image.rect().contains(base))
m_image.setPixel(base, 255);
m_image.save(QString::fromLatin1("cache-%1.png").arg(qint64(this)));
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index d29a31f4f3..dc9eef13e8 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -120,7 +120,6 @@ public:
virtual void createTextureData(int width, int height) = 0;
virtual void resizeTextureData(int width, int height) = 0;
- virtual int glyphMargin() const { return 0; }
virtual int glyphPadding() const { return 0; }
virtual void fillTexture(const Coord &coord, glyph_t glyph, QFixed subPixelPosition) = 0;
@@ -170,7 +169,6 @@ class Q_GUI_EXPORT QImageTextureGlyphCache : public QTextureGlyphCache
public:
QImageTextureGlyphCache(QFontEngineGlyphCache::Type type, const QTransform &matrix)
: QTextureGlyphCache(type, matrix) { }
- virtual int glyphMargin() const;
virtual void createTextureData(int width, int height);
virtual void resizeTextureData(int width, int height);
virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition);
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index f9948bf8d1..363dd26bbf 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 08a4861100..2e56da1873 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -58,7 +58,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QVariant;
diff --git a/src/gui/painting/qvectorpath_p.h b/src/gui/painting/qvectorpath_p.h
index 8a54e65aed..2ee7d86b97 100644
--- a/src/gui/painting/qvectorpath_p.h
+++ b/src/gui/painting/qvectorpath_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -64,7 +64,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QPaintEngineEx;
diff --git a/src/gui/text/qabstractfontengine_p.h b/src/gui/text/qabstractfontengine_p.h
index 7d0eaa7b42..5200fd3c8f 100644
--- a/src/gui/text/qabstractfontengine_p.h
+++ b/src/gui/text/qabstractfontengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qabstracttextdocumentlayout.cpp b/src/gui/text/qabstracttextdocumentlayout.cpp
index 5dd29e6548..2c22b72846 100644
--- a/src/gui/text/qabstracttextdocumentlayout.cpp
+++ b/src/gui/text/qabstracttextdocumentlayout.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index 1362640b4f..126a9ac996 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QAbstractTextDocumentLayoutPrivate;
class QTextBlock;
@@ -123,7 +122,6 @@ protected:
private:
friend class QWidgetTextControl;
- friend class QTextControl;
friend class QTextDocument;
friend class QTextDocumentPrivate;
friend class QTextEngine;
@@ -142,7 +140,7 @@ public:
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
};
-Q_DECLARE_INTERFACE(QTextObjectInterface, "com.trolltech.Qt.QTextObjectInterface")
+Q_DECLARE_INTERFACE(QTextObjectInterface, "org.qt-project.Qt.QTextObjectInterface")
QT_END_NAMESPACE
diff --git a/src/gui/text/qabstracttextdocumentlayout_p.h b/src/gui/text/qabstracttextdocumentlayout_p.h
index 6f8f113bff..8982826347 100644
--- a/src/gui/text/qabstracttextdocumentlayout_p.h
+++ b/src/gui/text/qabstracttextdocumentlayout_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 06a88f02ee..38070458b7 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index fa60a3fd2e..d50b87dcd5 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qcssscanner.cpp b/src/gui/text/qcssscanner.cpp
index 07928a62af..8b13125233 100644
--- a/src/gui/text/qcssscanner.cpp
+++ b/src/gui/text/qcssscanner.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 1ac398967d..a347c62629 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -692,7 +692,7 @@ QFont::QFont()
If \a pointSize is zero or negative, the point size of the font
is set to a system-dependent default value. Generally, this is
- 12 points, except on Symbian where it is 7 points.
+ 12 points.
The \a family name may optionally also include a foundry name,
e.g. "Helvetica [Cronyx]". If the \a family is
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index afeea3ce65..9cc61198a5 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QFontPrivate; /* don't touch */
class QStringList;
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index b57af5f213..e26a98aaf2 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp
index 2f5b6f7660..7fcbe98b6f 100644
--- a/src/gui/text/qfont_qpa.cpp
+++ b/src/gui/text/qfont_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index e7cbe2a8a8..3ef28b8e50 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -552,15 +552,6 @@ public:
struct ApplicationFont {
QString fileName;
QByteArray data;
-#if defined(Q_OS_WIN)
- HANDLE handle;
- bool memoryFont;
- QVector<FONTSIGNATURE> signatures;
-#elif defined(Q_OS_SYMBIAN)
- QString temporaryFileName;
- TInt screenDeviceFontFileId;
- TUid fontStoreFontFileUid;
-#endif
QStringList families;
};
QVector<ApplicationFont> applicationFonts;
@@ -2197,8 +2188,6 @@ bool QFontDatabasePrivate::isApplicationFont(const QString &fileName)
\note Adding application fonts on Unix/X11 platforms without fontconfig is
currently not supported.
- \note On Symbian, the font family names get truncated to a length of 20 characters.
-
\sa addApplicationFontFromData(), applicationFontFamilies(), removeApplicationFont()
*/
int QFontDatabase::addApplicationFont(const QString &fileName)
@@ -2229,8 +2218,6 @@ int QFontDatabase::addApplicationFont(const QString &fileName)
\bold{Note:} Adding application fonts on Unix/X11 platforms without fontconfig is
currently not supported.
- \note On Symbian, the font family names get truncated to a length of 20 characters.
-
\sa addApplicationFont(), applicationFontFamilies(), removeApplicationFont()
*/
int QFontDatabase::addApplicationFontFromData(const QByteArray &fontData)
diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h
index 3bfc07fbfd..b30f7da48d 100644
--- a/src/gui/text/qfontdatabase.h
+++ b/src/gui/text/qfontdatabase.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QStringList;
template <class T> class QList;
@@ -162,7 +161,6 @@ private:
friend class QFontDialogPrivate;
friend class QFontEngineMultiXLFD;
friend class QFontEngineMultiQWS;
- friend class QFontEngineMultiS60;
friend class QFontEngineMultiQPA;
#ifdef QT_BUILD_INTERNAL
friend class ::tst_QFont;
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index a5cb923460..16777d593c 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index d569cb58b9..156a4a1e59 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -618,7 +618,7 @@ QImage QFontEngine::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, con
return i;
}
-QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed /*subPixelPosition*/, int /* margin */, const QTransform &t)
+QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed /*subPixelPosition*/, const QTransform &t)
{
QImage alphaMask = alphaMapForGlyph(glyph, t);
QImage rgbMask(alphaMask.width(), alphaMask.height(), QImage::Format_RGB32);
@@ -664,7 +664,7 @@ QImage *QFontEngine::lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPositi
if (neededFormat != Format_A32)
currentlyLockedAlphaMap = alphaMapForGlyph(glyph, subPixelPosition, t);
else
- currentlyLockedAlphaMap = alphaRGBMapForGlyph(glyph, subPixelPosition, 0, t);
+ currentlyLockedAlphaMap = alphaRGBMapForGlyph(glyph, subPixelPosition, t);
if (offset != 0)
*offset = QPoint(0, 0);
@@ -1747,11 +1747,11 @@ QImage QFontEngineMulti::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition
return engine(which)->alphaMapForGlyph(stripped(glyph), subPixelPosition, t);
}
-QImage QFontEngineMulti::alphaRGBMapForGlyph(glyph_t glyph, QFixed subPixelPosition, int margin, const QTransform &t)
+QImage QFontEngineMulti::alphaRGBMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t)
{
const int which = highByte(glyph);
Q_ASSERT(which < engines.size());
- return engine(which)->alphaRGBMapForGlyph(stripped(glyph), subPixelPosition, margin, t);
+ return engine(which)->alphaRGBMapForGlyph(stripped(glyph), subPixelPosition, t);
}
QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index e41c0a93c7..cecf9d1feb 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -205,6 +205,8 @@ HB_Error QFreetypeFace::getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 p
return HB_Err_Ok;
}
+extern QByteArray qt_fontdata_from_index(int);
+
/*
* One font file can contain more than one font (bold/italic for example)
* find the right one and return it.
@@ -232,7 +234,6 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id,
QFile file(QString::fromUtf8(face_id.filename));
if (face_id.filename.startsWith(":qmemoryfonts/")) {
// from qfontdatabase.cpp
- extern QByteArray qt_fontdata_from_index(int);
QByteArray idx = face_id.filename;
idx.remove(0, 14); // remove ':qmemoryfonts/'
bool ok = false;
@@ -1896,17 +1897,17 @@ QImage QFontEngineFT::alphaMapForGlyph(glyph_t g, QFixed subPixelPosition)
return img;
}
-QImage QFontEngineFT::alphaRGBMapForGlyph(glyph_t g, QFixed subPixelPosition, int margin, const QTransform &t)
+QImage QFontEngineFT::alphaRGBMapForGlyph(glyph_t g, QFixed subPixelPosition, const QTransform &t)
{
if (t.type() > QTransform::TxTranslate)
- return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, margin, t);
+ return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, t);
lockFace();
Glyph *glyph = loadGlyphFor(g, subPixelPosition, Format_A32);
if (!glyph) {
unlockFace();
- return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, margin, t);
+ return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, t);
}
QImage img(glyph->width, glyph->height, QImage::Format_RGB32);
@@ -2058,7 +2059,7 @@ bool QFontEngineFT::initFromFontEngine(const QFontEngineFT *fe)
QFontEngine *QFontEngineFT::cloneWithSize(qreal pixelSize) const
{
- QFontDef fontDef;
+ QFontDef fontDef(this->fontDef);
fontDef.pixelSize = pixelSize;
QFontEngineFT *fe = new QFontEngineFT(fontDef);
if (!fe->initFromFontEngine(this)) {
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index c84c11163a..a9e67c10e8 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -255,7 +255,7 @@ private:
virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const;
virtual QImage alphaMapForGlyph(glyph_t g) { return alphaMapForGlyph(g, 0); }
virtual QImage alphaMapForGlyph(glyph_t, QFixed);
- virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t);
+ virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph,
QFixed subPixelPosition,
const QTransform &matrix,
@@ -267,6 +267,7 @@ private:
virtual void unlockAlphaMapForGlyph();
virtual void removeGlyphFromCache(glyph_t glyph);
+ virtual int glyphMargin(QFontEngineGlyphCache::Type /* type */) { return 0; }
virtual int glyphCount() const;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 02523ada82..c0bd1afb80 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -105,9 +105,6 @@ public:
QPF2,
Proxy,
- // S60 types
- S60FontEngine, // Cannot be simply called "S60". Reason is qt_s60Data.h
-
DirectWrite,
TestFontEngine = 0x1000
@@ -189,7 +186,7 @@ public:
virtual QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
virtual QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
- virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t);
+ virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
virtual QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
GlyphFormat neededFormat,
const QTransform &t = QTransform(),
@@ -231,6 +228,7 @@ public:
virtual Type type() const = 0;
virtual int glyphCount() const;
+ virtual int glyphMargin(QFontEngineGlyphCache::Type type) { return type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; }
virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return 0; }
@@ -370,7 +368,7 @@ public:
virtual QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition);
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
virtual QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
- virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t);
+ virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
virtual QFixed lineThickness() const;
virtual QFixed underlinePosition() const;
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp
index 3408d3a2a8..33657367fa 100644
--- a/src/gui/text/qfontengine_qpa.cpp
+++ b/src/gui/text/qfontengine_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontengine_qpa_p.h b/src/gui/text/qfontengine_qpa_p.h
index d09692bc57..6a73b9d309 100644
--- a/src/gui/text/qfontengine_qpa_p.h
+++ b/src/gui/text/qfontengine_qpa_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index bedc54f92a..fb898a850f 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontengine_qpf_p.h b/src/gui/text/qfontengine_qpf_p.h
index 8a79f65814..a31d578805 100644
--- a/src/gui/text/qfontengine_qpf_p.h
+++ b/src/gui/text/qfontengine_qpf_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontenginedirectwrite.cpp b/src/gui/text/qfontenginedirectwrite.cpp
index 438d30a913..afbc41daeb 100644
--- a/src/gui/text/qfontenginedirectwrite.cpp
+++ b/src/gui/text/qfontenginedirectwrite.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -641,10 +641,11 @@ QImage QFontEngineDirectWrite::imageForGlyph(glyph_t t,
QImage QFontEngineDirectWrite::alphaRGBMapForGlyph(glyph_t t,
QFixed subPixelPosition,
- int margin,
const QTransform &xform)
{
- QImage mask = imageForGlyph(t, subPixelPosition, margin, xform);
+ QImage mask = imageForGlyph(t, subPixelPosition,
+ glyphMargin(QFontEngineGlyphCache::Raster_RGBMask),
+ xform);
return mask.depth() == 32
? mask
: mask.convertToFormat(QImage::Format_RGB32);
diff --git a/src/gui/text/qfontenginedirectwrite_p.h b/src/gui/text/qfontenginedirectwrite_p.h
index 26198e64ee..ecbbf4fb37 100644
--- a/src/gui/text/qfontenginedirectwrite_p.h
+++ b/src/gui/text/qfontenginedirectwrite_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -102,8 +102,7 @@ public:
bool supportsSubPixelPositions() const;
QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
- QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin,
- const QTransform &xform);
+ QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform);
QFontEngine *cloneWithSize(qreal pixelSize) const;
diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h
index 855c4a0aa0..f23d6a7860 100644
--- a/src/gui/text/qfontengineglyphcache_p.h
+++ b/src/gui/text/qfontengineglyphcache_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontinfo.h b/src/gui/text/qfontinfo.h
index 88e1d9f65d..edaed281fe 100644
--- a/src/gui/text/qfontinfo.h
+++ b/src/gui/text/qfontinfo.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class Q_GUI_EXPORT QFontInfo
{
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 11e41ad685..a2f0dd724a 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index f5184aacba..7ddc8975e4 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -52,7 +52,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextCodec;
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 91d8264f76..b015f71b57 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfontsubset_p.h b/src/gui/text/qfontsubset_p.h
index 3dabec5f0b..5605c2a4a2 100644
--- a/src/gui/text/qfontsubset_p.h
+++ b/src/gui/text/qfontsubset_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfragmentmap.cpp b/src/gui/text/qfragmentmap.cpp
index ac923bb639..35679cef48 100644
--- a/src/gui/text/qfragmentmap.cpp
+++ b/src/gui/text/qfragmentmap.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qfragmentmap_p.h b/src/gui/text/qfragmentmap_p.h
index e6da236552..776a03c9c5 100644
--- a/src/gui/text/qfragmentmap_p.h
+++ b/src/gui/text/qfragmentmap_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index 3f9989090a..813e0a804a 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index 0c47c6f4bc..847b7e4852 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QGlyphRunPrivate;
class Q_GUI_EXPORT QGlyphRun
diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h
index c3b6cf40be..b75862b762 100644
--- a/src/gui/text/qglyphrun_p.h
+++ b/src/gui/text/qglyphrun_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qlinecontrol.cpp b/src/gui/text/qlinecontrol.cpp
deleted file mode 100644
index fc8bcafed4..0000000000
--- a/src/gui/text/qlinecontrol.cpp
+++ /dev/null
@@ -1,1729 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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$
-**
-****************************************************************************/
-
-// ###
-#define QT_NO_ACCESSIBILITY
-
-#include "qlinecontrol_p.h"
-
-#ifndef QT_NO_LINEEDIT
-
-#include "qclipboard.h"
-#ifndef QT_NO_ACCESSIBILITY
-#include "qaccessible.h"
-#endif
-#include "qguiapplication.h"
-#include "qstylehints.h"
-
-QT_BEGIN_NAMESPACE
-
-// ### these should come from QStyleHints
-const int textCursorWidth = 1;
-const bool fullWidthSelection = true;
-
-/*!
- \internal
-
- Updates the display text based of the current edit text
- If the text has changed will emit displayTextChanged()
-*/
-void QLineControl::updateDisplayText(bool forceUpdate)
-{
- QString orig = m_textLayout.text();
- QString str;
- if (m_echoMode == NoEcho)
- str = QString::fromLatin1("");
- else
- str = m_text;
-
- if (m_echoMode == Password || (m_echoMode == PasswordEchoOnEdit
- && !m_passwordEchoEditing))
- str.fill(m_passwordCharacter);
-
- // replace certain non-printable characters with spaces (to avoid
- // drawing boxes when using fonts that don't have glyphs for such
- // characters)
- QChar* uc = str.data();
- for (int i = 0; i < (int)str.length(); ++i) {
- if ((uc[i] < 0x20 && uc[i] != 0x09)
- || uc[i] == QChar::LineSeparator
- || uc[i] == QChar::ParagraphSeparator
- || uc[i] == QChar::ObjectReplacementCharacter)
- uc[i] = QChar(0x0020);
- }
-
- m_textLayout.setText(str);
-
- QTextOption option = m_textLayout.textOption();
- option.setTextDirection(m_layoutDirection);
- option.setFlags(QTextOption::IncludeTrailingSpaces);
- m_textLayout.setTextOption(option);
-
- m_textLayout.beginLayout();
- QTextLine l = m_textLayout.createLine();
- m_textLayout.endLayout();
- m_ascent = qRound(l.ascent());
-
- if (str != orig || forceUpdate)
- emit displayTextChanged(str);
-}
-
-#ifndef QT_NO_CLIPBOARD
-/*!
- \internal
-
- Copies the currently selected text into the clipboard using the given
- \a mode.
-
- \note If the echo mode is set to a mode other than Normal then copy
- will not work. This is to prevent using copy as a method of bypassing
- password features of the line control.
-*/
-void QLineControl::copy(QClipboard::Mode mode) const
-{
- QString t = selectedText();
- if (!t.isEmpty() && m_echoMode == Normal) {
- disconnect(QGuiApplication::clipboard(), SIGNAL(selectionChanged()), this, 0);
- QGuiApplication::clipboard()->setText(t, mode);
- connect(QGuiApplication::clipboard(), SIGNAL(selectionChanged()),
- this, SLOT(_q_clipboardChanged()));
- }
-}
-
-/*!
- \internal
-
- Inserts the text stored in the application clipboard into the line
- control.
-
- \sa insert()
-*/
-void QLineControl::paste(QClipboard::Mode clipboardMode)
-{
- QString clip = QGuiApplication::clipboard()->text(clipboardMode);
- if (!clip.isEmpty() || hasSelectedText()) {
- separate(); //make it a separate undo/redo command
- insert(clip);
- separate();
- }
-}
-
-#endif // !QT_NO_CLIPBOARD
-
-/*!
- \internal
-
- Exits preedit mode and commits parts marked as tentative commit
-*/
-void QLineControl::commitPreedit()
-{
- if (!composeMode())
- return;
-
- qApp->inputPanel()->reset();
-
- if (!m_tentativeCommit.isEmpty()) {
- internalInsert(m_tentativeCommit);
- m_tentativeCommit.clear();
- finishChange(-1, true/*not used, not documented*/, false);
- }
-
- m_preeditCursor = 0;
- setPreeditArea(-1, QString());
- m_textLayout.clearAdditionalFormats();
- updateDisplayText(/*force*/ true);
-}
-
-/*!
- \internal
-
- Handles the behavior for the backspace key or function.
- Removes the current selection if there is a selection, otherwise
- removes the character prior to the cursor position.
-
- \sa del()
-*/
-void QLineControl::backspace()
-{
- int priorState = m_undoState;
- if (hasSelectedText()) {
- removeSelectedText();
- } else if (m_cursor) {
- --m_cursor;
- if (m_maskData)
- m_cursor = prevMaskBlank(m_cursor);
- QChar uc = m_text.at(m_cursor);
- if (m_cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
- // second half of a surrogate, check if we have the first half as well,
- // if yes delete both at once
- uc = m_text.at(m_cursor - 1);
- if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) {
- internalDelete(true);
- --m_cursor;
- }
- }
- internalDelete(true);
- }
- finishChange(priorState);
-}
-
-/*!
- \internal
-
- Handles the behavior for the delete key or function.
- Removes the current selection if there is a selection, otherwise
- removes the character after the cursor position.
-
- \sa del()
-*/
-void QLineControl::del()
-{
- int priorState = m_undoState;
- if (hasSelectedText()) {
- removeSelectedText();
- } else {
- int n = m_textLayout.nextCursorPosition(m_cursor) - m_cursor;
- while (n--)
- internalDelete();
- }
- finishChange(priorState);
-}
-
-/*!
- \internal
-
- Inserts the given \a newText at the current cursor position.
- If there is any selected text it is removed prior to insertion of
- the new text.
-*/
-void QLineControl::insert(const QString &newText)
-{
- int priorState = m_undoState;
- removeSelectedText();
- internalInsert(newText);
- finishChange(priorState);
-}
-
-/*!
- \internal
-
- Clears the line control text.
-*/
-void QLineControl::clear()
-{
- int priorState = m_undoState;
- m_selstart = 0;
- m_selend = m_text.length();
- removeSelectedText();
- separate();
- finishChange(priorState, /*update*/false, /*edited*/false);
-}
-
-/*!
- \internal
-
- Sets \a length characters from the given \a start position as selected.
- The given \a start position must be within the current text for
- the line control. If \a length characters cannot be selected, then
- the selection will extend to the end of the current text.
-*/
-void QLineControl::setSelection(int start, int length)
-{
- commitPreedit();
-
- if(start < 0 || start > (int)m_text.length()){
- qWarning("QLineControl::setSelection: Invalid start position");
- return;
- }
-
- if (length > 0) {
- if (start == m_selstart && start + length == m_selend && m_cursor == m_selend)
- return;
- m_selstart = start;
- m_selend = qMin(start + length, (int)m_text.length());
- m_cursor = m_selend;
- } else if (length < 0){
- if (start == m_selend && start + length == m_selstart && m_cursor == m_selstart)
- return;
- m_selstart = qMax(start + length, 0);
- m_selend = start;
- m_cursor = m_selstart;
- } else if (m_selstart != m_selend) {
- m_selstart = 0;
- m_selend = 0;
- m_cursor = start;
- } else {
- m_cursor = start;
- emitCursorPositionChanged();
- return;
- }
- emit selectionChanged();
- emitCursorPositionChanged();
-}
-
-void QLineControl::_q_clipboardChanged()
-{
-}
-
-void QLineControl::_q_deleteSelected()
-{
- if (!hasSelectedText())
- return;
-
- int priorState = m_undoState;
- emit resetInputContext();
- removeSelectedText();
- separate();
- finishChange(priorState);
-}
-
-/*!
- \internal
-
- Initializes the line control with a starting text value of \a txt.
-*/
-void QLineControl::init(const QString &txt)
-{
- m_text = txt;
-
- updateDisplayText();
- m_cursor = m_text.length();
-}
-
-/*!
- \internal
-
- Sets the password echo editing to \a editing. If password echo editing
- is true, then the text of the password is displayed even if the echo
- mode is set to QLineEdit::PasswordEchoOnEdit. Password echoing editing
- does not affect other echo modes.
-*/
-void QLineControl::updatePasswordEchoEditing(bool editing)
-{
- m_passwordEchoEditing = editing;
- updateDisplayText();
-}
-
-/*!
- \internal
-
- Returns the cursor position of the given \a x pixel value in relation
- to the displayed text. The given \a betweenOrOn specified what kind
- of cursor position is requested.
-*/
-int QLineControl::xToPos(int x, QTextLine::CursorPosition betweenOrOn) const
-{
- return m_textLayout.lineAt(0).xToCursor(x, betweenOrOn);
-}
-
-/*!
- \internal
-
- Returns the bounds of the current cursor, as defined as a
- between characters cursor.
-*/
-QRect QLineControl::cursorRect() const
-{
- QTextLine l = m_textLayout.lineAt(0);
- int c = m_cursor;
- if (m_preeditCursor != -1)
- c += m_preeditCursor;
- int cix = qRound(l.cursorToX(c));
- int w = m_cursorWidth;
- int ch = l.height() + 1;
-
- return QRect(cix-5, 0, w+9, ch);
-}
-
-QString QLineControl::text() const
-{
- QString content = m_text;
- if (!m_tentativeCommit.isEmpty())
- content.insert(m_cursor, m_tentativeCommit);
- QString res = m_maskData ? stripString(content) : content;
- return (res.isNull() ? QString::fromLatin1("") : res);
-}
-
-// like text() but doesn't include preedit
-QString QLineControl::realText() const
-{
- QString res = m_maskData ? stripString(m_text) : m_text;
- return (res.isNull() ? QString::fromLatin1("") : res);
-}
-
-void QLineControl::setText(const QString &txt)
-{
- if (composeMode())
- qApp->inputPanel()->reset();
- m_tentativeCommit.clear();
- internalSetText(txt, -1, false);
-}
-
-/*!
- \internal
-
- Fixes the current text so that it is valid given any set validators.
-
- Returns true if the text was changed. Otherwise returns false.
-*/
-bool QLineControl::fixup() // this function assumes that validate currently returns != Acceptable
-{
-#ifndef QT_NO_VALIDATOR
- if (m_validator) {
- QString textCopy = m_text;
- int cursorCopy = m_cursor;
- m_validator->fixup(textCopy);
- if (m_validator->validate(textCopy, cursorCopy) == QValidator::Acceptable) {
- if (textCopy != m_text || cursorCopy != m_cursor)
- internalSetText(textCopy, cursorCopy);
- return true;
- }
- }
-#endif
- return false;
-}
-
-/*!
- \internal
-
- Moves the cursor to the given position \a pos. If \a mark is true will
- adjust the currently selected text.
-*/
-void QLineControl::moveCursor(int pos, bool mark)
-{
- commitPreedit();
-
- if (pos != m_cursor) {
- separate();
- if (m_maskData)
- pos = pos > m_cursor ? nextMaskBlank(pos) : prevMaskBlank(pos);
- }
- if (mark) {
- int anchor;
- if (m_selend > m_selstart && m_cursor == m_selstart)
- anchor = m_selend;
- else if (m_selend > m_selstart && m_cursor == m_selend)
- anchor = m_selstart;
- else
- anchor = m_cursor;
- m_selstart = qMin(anchor, pos);
- m_selend = qMax(anchor, pos);
- updateDisplayText();
- } else {
- internalDeselect();
- }
- m_cursor = pos;
- if (mark || m_selDirty) {
- m_selDirty = false;
- emit selectionChanged();
- }
- emitCursorPositionChanged();
-}
-
-/*!
- \internal
-
- Applies the given input method event \a event to the text of the line
- control
-*/
-void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
-{
- int priorState = -1;
- bool isGettingInput = !event->commitString().isEmpty()
- || event->preeditString() != preeditAreaText()
- || event->replacementLength() > 0;
- bool cursorPositionChanged = false;
- bool selectionChange = false;
-
- if (isGettingInput) {
- // If any text is being input, remove selected text.
- priorState = m_undoState;
- if (echoMode() == PasswordEchoOnEdit && !passwordEchoEditing()) {
- updatePasswordEchoEditing(true);
- m_selstart = 0;
- m_selend = m_text.length();
- }
- removeSelectedText();
- }
-
- int c = m_cursor; // cursor position after insertion of commit string
- if (event->replacementStart() <= 0)
- c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength());
-
- m_cursor += event->replacementStart();
- if (m_cursor < 0)
- m_cursor = 0;
-
- // insert commit string
- if (event->replacementLength()) {
- m_selstart = m_cursor;
- m_selend = m_selstart + event->replacementLength();
- removeSelectedText();
- }
- if (!event->commitString().isEmpty()) {
- internalInsert(event->commitString());
- cursorPositionChanged = true;
- }
-
- m_cursor = qBound(0, c, m_text.length());
-
- for (int i = 0; i < event->attributes().size(); ++i) {
- const QInputMethodEvent::Attribute &a = event->attributes().at(i);
- if (a.type == QInputMethodEvent::Selection) {
- m_cursor = qBound(0, a.start + a.length, m_text.length());
- if (a.length) {
- m_selstart = qMax(0, qMin(a.start, m_text.length()));
- m_selend = m_cursor;
- if (m_selend < m_selstart) {
- qSwap(m_selstart, m_selend);
- }
- selectionChange = true;
- } else {
- m_selstart = m_selend = 0;
- }
- cursorPositionChanged = true;
- }
- }
-#ifndef QT_NO_IM
- setPreeditArea(m_cursor, event->preeditString());
-#endif //QT_NO_IM
- const int oldPreeditCursor = m_preeditCursor;
- m_preeditCursor = event->preeditString().length();
- m_hideCursor = false;
- QList<QTextLayout::FormatRange> formats;
- for (int i = 0; i < event->attributes().size(); ++i) {
- const QInputMethodEvent::Attribute &a = event->attributes().at(i);
- if (a.type == QInputMethodEvent::Cursor) {
- m_preeditCursor = a.start;
- m_hideCursor = !a.length;
- } else if (a.type == QInputMethodEvent::TextFormat) {
- QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat();
- if (f.isValid()) {
- QTextLayout::FormatRange o;
- o.start = a.start + m_cursor;
- o.length = a.length;
- o.format = f;
- formats.append(o);
- }
- }
- }
- m_textLayout.setAdditionalFormats(formats);
- updateDisplayText(/*force*/ true);
- if (cursorPositionChanged)
- emitCursorPositionChanged();
- else if (m_preeditCursor != oldPreeditCursor)
- emit updateMicroFocus();
-
- bool tentativeCommitChanged = (m_tentativeCommit != event->tentativeCommitString());
-
- if (tentativeCommitChanged) {
- m_textDirty = true;
- m_tentativeCommit = event->tentativeCommitString();
- }
-
- if (isGettingInput || tentativeCommitChanged)
- finishChange(priorState);
-
- if (selectionChange)
- emit selectionChanged();
-}
-
-/*!
- \internal
-
- Draws the display text for the line control using the given
- \a painter, \a clip, and \a offset. Which aspects of the display text
- are drawn is specified by the given \a flags.
-
- If the flags contain DrawSelections, then the selection or input mask
- backgrounds and foregrounds will be applied before drawing the text.
-
- If the flags contain DrawCursor a cursor of the current cursorWidth()
- will be drawn after drawing the text.
-
- The display text will only be drawn if the flags contain DrawText
-*/
-void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &clip, int flags)
-{
- QVector<QTextLayout::FormatRange> selections;
- if (flags & DrawSelections) {
- QTextLayout::FormatRange o;
- if (m_selstart < m_selend) {
- o.start = m_selstart;
- o.length = m_selend - m_selstart;
- o.format.setBackground(m_palette.brush(QPalette::Highlight));
- o.format.setForeground(m_palette.brush(QPalette::HighlightedText));
- } else {
- // mask selection
- if(!m_blinkPeriod || m_blinkStatus){
- o.start = m_cursor;
- o.length = 1;
- o.format.setBackground(m_palette.brush(QPalette::Text));
- o.format.setForeground(m_palette.brush(QPalette::Window));
- }
- }
- selections.append(o);
- }
-
- if (flags & DrawText)
- m_textLayout.draw(painter, offset, selections, clip);
-
- if (flags & DrawCursor){
- int cursor = m_cursor;
- if (m_preeditCursor != -1)
- cursor += m_preeditCursor;
- if (!m_hideCursor && (!m_blinkPeriod || m_blinkStatus))
- m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth);
- }
-}
-
-/*!
- \internal
-
- Sets the selection to cover the word at the given cursor position.
- The word boundaries are defined by the behavior of QTextLayout::SkipWords
- cursor mode.
-*/
-void QLineControl::selectWordAtPos(int cursor)
-{
- int next = cursor + 1;
- if(next > end())
- --next;
- int c = m_textLayout.previousCursorPosition(next, QTextLayout::SkipWords);
- moveCursor(c, false);
- // ## text layout should support end of words.
- int end = m_textLayout.nextCursorPosition(c, QTextLayout::SkipWords);
- while (end > cursor && m_text[end-1].isSpace())
- --end;
- moveCursor(end, true);
-}
-
-/*!
- \internal
-
- Completes a change to the line control text. If the change is not valid
- will undo the line control state back to the given \a validateFromState.
-
- If \a edited is true and the change is valid, will emit textEdited() in
- addition to textChanged(). Otherwise only emits textChanged() on a valid
- change.
-
- The \a update value is currently unused.
-*/
-bool QLineControl::finishChange(int validateFromState, bool update, bool edited)
-{
- Q_UNUSED(update)
-
- if (m_textDirty) {
- // do validation
- bool wasValidInput = m_validInput;
- m_validInput = true;
-#ifndef QT_NO_VALIDATOR
- if (m_validator) {
- QString textCopy = m_text;
- int cursorCopy = m_cursor;
- m_validInput = (m_validator->validate(textCopy, cursorCopy) != QValidator::Invalid);
- if (m_validInput) {
- if (m_text != textCopy) {
- internalSetText(textCopy, cursorCopy);
- return true;
- }
- m_cursor = cursorCopy;
-
- if (!m_tentativeCommit.isEmpty()) {
- textCopy.insert(m_cursor, m_tentativeCommit);
- bool validInput = (m_validator->validate(textCopy, cursorCopy) != QValidator::Invalid);
- if (!validInput)
- m_tentativeCommit.clear();
- }
- } else {
- m_tentativeCommit.clear();
- }
- }
-#endif
- if (validateFromState >= 0 && wasValidInput && !m_validInput) {
- if (m_transactions.count())
- return false;
- internalUndo(validateFromState);
- m_history.resize(m_undoState);
- if (m_modifiedState > m_undoState)
- m_modifiedState = -1;
- m_validInput = true;
- m_textDirty = false;
- }
- updateDisplayText();
-
- if (m_textDirty) {
- m_textDirty = false;
- QString actualText = text();
- if (edited)
- emit textEdited(actualText);
- emit textChanged(actualText);
- }
- }
- if (m_selDirty) {
- m_selDirty = false;
- emit selectionChanged();
- }
- emitCursorPositionChanged();
- return true;
-}
-
-/*!
- \internal
-
- An internal function for setting the text of the line control.
-*/
-void QLineControl::internalSetText(const QString &txt, int pos, bool edited)
-{
- internalDeselect();
- emit resetInputContext();
- QString oldText = m_text;
- if (m_maskData) {
- m_text = maskString(0, txt, true);
- m_text += clearString(m_text.length(), m_maxLength - m_text.length());
- } else {
- m_text = txt.isEmpty() ? txt : txt.left(m_maxLength);
- }
- m_history.clear();
- m_modifiedState = m_undoState = 0;
- m_cursor = (pos < 0 || pos > m_text.length()) ? m_text.length() : pos;
- m_textDirty = (oldText != m_text);
-
- bool changed = finishChange(-1, true, edited);
-#ifdef QT_NO_ACCESSIBILITY
- Q_UNUSED(changed)
-#else
- if (changed)
- QAccessible::updateAccessibility(parent(), 0, QAccessible::TextUpdated);
-#endif
-}
-
-
-/*!
- \internal
-
- Adds the given \a command to the undo history
- of the line control. Does not apply the command.
-*/
-void QLineControl::addCommand(const Command &cmd)
-{
- if (m_separator && m_undoState && m_history[m_undoState - 1].type != Separator) {
- m_history.resize(m_undoState + 2);
- m_history[m_undoState++] = Command(Separator, m_cursor, 0, m_selstart, m_selend);
- } else {
- m_history.resize(m_undoState + 1);
- }
- m_separator = false;
- m_history[m_undoState++] = cmd;
-}
-
-/*!
- \internal
-
- Inserts the given string \a s into the line
- control.
-
- Also adds the appropriate commands into the undo history.
- This function does not call finishChange(), and may leave the text
- in an invalid state.
-*/
-void QLineControl::internalInsert(const QString &s)
-{
- if (hasSelectedText())
- addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
- if (m_maskData) {
- QString ms = maskString(m_cursor, s);
- for (int i = 0; i < (int) ms.length(); ++i) {
- addCommand (Command(DeleteSelection, m_cursor + i, m_text.at(m_cursor + i), -1, -1));
- addCommand(Command(Insert, m_cursor + i, ms.at(i), -1, -1));
- }
- m_text.replace(m_cursor, ms.length(), ms);
- m_cursor += ms.length();
- m_cursor = nextMaskBlank(m_cursor);
- m_textDirty = true;
- } else {
- int remaining = m_maxLength - m_text.length();
- if (remaining != 0) {
- m_text.insert(m_cursor, s.left(remaining));
- for (int i = 0; i < (int) s.left(remaining).length(); ++i)
- addCommand(Command(Insert, m_cursor++, s.at(i), -1, -1));
- m_textDirty = true;
- }
- }
-}
-
-/*!
- \internal
-
- deletes a single character from the current text. If \a wasBackspace,
- the character prior to the cursor is removed. Otherwise the character
- after the cursor is removed.
-
- Also adds the appropriate commands into the undo history.
- This function does not call finishChange(), and may leave the text
- in an invalid state.
-*/
-void QLineControl::internalDelete(bool wasBackspace)
-{
- if (m_cursor < (int) m_text.length()) {
- if (hasSelectedText())
- addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
- addCommand(Command((CommandType)((m_maskData ? 2 : 0) + (wasBackspace ? Remove : Delete)),
- m_cursor, m_text.at(m_cursor), -1, -1));
- if (m_maskData) {
- m_text.replace(m_cursor, 1, clearString(m_cursor, 1));
- addCommand(Command(Insert, m_cursor, m_text.at(m_cursor), -1, -1));
- } else {
- m_text.remove(m_cursor, 1);
- }
- m_textDirty = true;
- }
-}
-
-/*!
- \internal
-
- removes the currently selected text from the line control.
-
- Also adds the appropriate commands into the undo history.
- This function does not call finishChange(), and may leave the text
- in an invalid state.
-*/
-void QLineControl::removeSelectedText()
-{
- if (m_selstart < m_selend && m_selend <= (int) m_text.length()) {
- separate();
- int i ;
- addCommand(Command(SetSelection, m_cursor, 0, m_selstart, m_selend));
- if (m_selstart <= m_cursor && m_cursor < m_selend) {
- // cursor is within the selection. Split up the commands
- // to be able to restore the correct cursor position
- for (i = m_cursor; i >= m_selstart; --i)
- addCommand (Command(DeleteSelection, i, m_text.at(i), -1, 1));
- for (i = m_selend - 1; i > m_cursor; --i)
- addCommand (Command(DeleteSelection, i - m_cursor + m_selstart - 1, m_text.at(i), -1, -1));
- } else {
- for (i = m_selend-1; i >= m_selstart; --i)
- addCommand (Command(RemoveSelection, i, m_text.at(i), -1, -1));
- }
- if (m_maskData) {
- m_text.replace(m_selstart, m_selend - m_selstart, clearString(m_selstart, m_selend - m_selstart));
- for (int i = 0; i < m_selend - m_selstart; ++i)
- addCommand(Command(Insert, m_selstart + i, m_text.at(m_selstart + i), -1, -1));
- } else {
- m_text.remove(m_selstart, m_selend - m_selstart);
- }
- if (m_cursor > m_selstart)
- m_cursor -= qMin(m_cursor, m_selend) - m_selstart;
- internalDeselect();
- m_textDirty = true;
- }
-}
-
-/*!
- \internal
-
- Parses the input mask specified by \a maskFields to generate
- the mask data used to handle input masks.
-*/
-void QLineControl::parseInputMask(const QString &maskFields)
-{
- int delimiter = maskFields.indexOf(QLatin1Char(';'));
- if (maskFields.isEmpty() || delimiter == 0) {
- if (m_maskData) {
- delete [] m_maskData;
- m_maskData = 0;
- m_maxLength = 32767;
- internalSetText(QString());
- }
- return;
- }
-
- if (delimiter == -1) {
- m_blank = QLatin1Char(' ');
- m_inputMask = maskFields;
- } else {
- m_inputMask = maskFields.left(delimiter);
- m_blank = (delimiter + 1 < maskFields.length()) ? maskFields[delimiter + 1] : QLatin1Char(' ');
- }
-
- // calculate m_maxLength / m_maskData length
- m_maxLength = 0;
- QChar c = 0;
- for (int i=0; i<m_inputMask.length(); i++) {
- c = m_inputMask.at(i);
- if (i > 0 && m_inputMask.at(i-1) == QLatin1Char('\\')) {
- m_maxLength++;
- continue;
- }
- if (c != QLatin1Char('\\') && c != QLatin1Char('!') &&
- c != QLatin1Char('<') && c != QLatin1Char('>') &&
- c != QLatin1Char('{') && c != QLatin1Char('}') &&
- c != QLatin1Char('[') && c != QLatin1Char(']'))
- m_maxLength++;
- }
-
- delete [] m_maskData;
- m_maskData = new MaskInputData[m_maxLength];
-
- MaskInputData::Casemode m = MaskInputData::NoCaseMode;
- c = 0;
- bool s;
- bool escape = false;
- int index = 0;
- for (int i = 0; i < m_inputMask.length(); i++) {
- c = m_inputMask.at(i);
- if (escape) {
- s = true;
- m_maskData[index].maskChar = c;
- m_maskData[index].separator = s;
- m_maskData[index].caseMode = m;
- index++;
- escape = false;
- } else if (c == QLatin1Char('<')) {
- m = MaskInputData::Lower;
- } else if (c == QLatin1Char('>')) {
- m = MaskInputData::Upper;
- } else if (c == QLatin1Char('!')) {
- m = MaskInputData::NoCaseMode;
- } else if (c != QLatin1Char('{') && c != QLatin1Char('}') && c != QLatin1Char('[') && c != QLatin1Char(']')) {
- switch (c.unicode()) {
- case 'A':
- case 'a':
- case 'N':
- case 'n':
- case 'X':
- case 'x':
- case '9':
- case '0':
- case 'D':
- case 'd':
- case '#':
- case 'H':
- case 'h':
- case 'B':
- case 'b':
- s = false;
- break;
- case '\\':
- escape = true;
- default:
- s = true;
- break;
- }
-
- if (!escape) {
- m_maskData[index].maskChar = c;
- m_maskData[index].separator = s;
- m_maskData[index].caseMode = m;
- index++;
- }
- }
- }
- internalSetText(m_text);
-}
-
-
-/*!
- \internal
-
- checks if the key is valid compared to the inputMask
-*/
-bool QLineControl::isValidInput(QChar key, QChar mask) const
-{
- switch (mask.unicode()) {
- case 'A':
- if (key.isLetter())
- return true;
- break;
- case 'a':
- if (key.isLetter() || key == m_blank)
- return true;
- break;
- case 'N':
- if (key.isLetterOrNumber())
- return true;
- break;
- case 'n':
- if (key.isLetterOrNumber() || key == m_blank)
- return true;
- break;
- case 'X':
- if (key.isPrint())
- return true;
- break;
- case 'x':
- if (key.isPrint() || key == m_blank)
- return true;
- break;
- case '9':
- if (key.isNumber())
- return true;
- break;
- case '0':
- if (key.isNumber() || key == m_blank)
- return true;
- break;
- case 'D':
- if (key.isNumber() && key.digitValue() > 0)
- return true;
- break;
- case 'd':
- if ((key.isNumber() && key.digitValue() > 0) || key == m_blank)
- return true;
- break;
- case '#':
- if (key.isNumber() || key == QLatin1Char('+') || key == QLatin1Char('-') || key == m_blank)
- return true;
- break;
- case 'B':
- if (key == QLatin1Char('0') || key == QLatin1Char('1'))
- return true;
- break;
- case 'b':
- if (key == QLatin1Char('0') || key == QLatin1Char('1') || key == m_blank)
- return true;
- break;
- case 'H':
- if (key.isNumber() || (key >= QLatin1Char('a') && key <= QLatin1Char('f')) || (key >= QLatin1Char('A') && key <= QLatin1Char('F')))
- return true;
- break;
- case 'h':
- if (key.isNumber() || (key >= QLatin1Char('a') && key <= QLatin1Char('f')) || (key >= QLatin1Char('A') && key <= QLatin1Char('F')) || key == m_blank)
- return true;
- break;
- default:
- break;
- }
- return false;
-}
-
-/*!
- \internal
-
- Returns true if the given text \a str is valid for any
- validator or input mask set for the line control.
-
- Otherwise returns false
-*/
-bool QLineControl::hasAcceptableInput(const QString &str) const
-{
-#ifndef QT_NO_VALIDATOR
- QString textCopy = str;
- int cursorCopy = m_cursor;
- if (m_validator && m_validator->validate(textCopy, cursorCopy)
- != QValidator::Acceptable)
- return false;
-#endif
-
- if (!m_maskData)
- return true;
-
- if (str.length() != m_maxLength)
- return false;
-
- for (int i=0; i < m_maxLength; ++i) {
- if (m_maskData[i].separator) {
- if (str.at(i) != m_maskData[i].maskChar)
- return false;
- } else {
- if (!isValidInput(str.at(i), m_maskData[i].maskChar))
- return false;
- }
- }
- return true;
-}
-
-/*!
- \internal
-
- Applies the inputMask on \a str starting from position \a pos in the mask. \a clear
- specifies from where characters should be gotten when a separator is met in \a str - true means
- that blanks will be used, false that previous input is used.
- Calling this when no inputMask is set is undefined.
-*/
-QString QLineControl::maskString(uint pos, const QString &str, bool clear) const
-{
- if (pos >= (uint)m_maxLength)
- return QString::fromLatin1("");
-
- QString fill;
- fill = clear ? clearString(0, m_maxLength) : m_text;
-
- int strIndex = 0;
- QString s = QString::fromLatin1("");
- int i = pos;
- while (i < m_maxLength) {
- if (strIndex < str.length()) {
- if (m_maskData[i].separator) {
- s += m_maskData[i].maskChar;
- if (str[(int)strIndex] == m_maskData[i].maskChar)
- strIndex++;
- ++i;
- } else {
- if (isValidInput(str[(int)strIndex], m_maskData[i].maskChar)) {
- switch (m_maskData[i].caseMode) {
- case MaskInputData::Upper:
- s += str[(int)strIndex].toUpper();
- break;
- case MaskInputData::Lower:
- s += str[(int)strIndex].toLower();
- break;
- default:
- s += str[(int)strIndex];
- }
- ++i;
- } else {
- // search for separator first
- int n = findInMask(i, true, true, str[(int)strIndex]);
- if (n != -1) {
- if (str.length() != 1 || i == 0 || (i > 0 && (!m_maskData[i-1].separator || m_maskData[i-1].maskChar != str[(int)strIndex]))) {
- s += fill.mid(i, n-i+1);
- i = n + 1; // update i to find + 1
- }
- } else {
- // search for valid m_blank if not
- n = findInMask(i, true, false, str[(int)strIndex]);
- if (n != -1) {
- s += fill.mid(i, n-i);
- switch (m_maskData[n].caseMode) {
- case MaskInputData::Upper:
- s += str[(int)strIndex].toUpper();
- break;
- case MaskInputData::Lower:
- s += str[(int)strIndex].toLower();
- break;
- default:
- s += str[(int)strIndex];
- }
- i = n + 1; // updates i to find + 1
- }
- }
- }
- ++strIndex;
- }
- } else
- break;
- }
-
- return s;
-}
-
-
-
-/*!
- \internal
-
- Returns a "cleared" string with only separators and blank chars.
- Calling this when no inputMask is set is undefined.
-*/
-QString QLineControl::clearString(uint pos, uint len) const
-{
- if (pos >= (uint)m_maxLength)
- return QString();
-
- QString s;
- int end = qMin((uint)m_maxLength, pos + len);
- for (int i = pos; i < end; ++i)
- if (m_maskData[i].separator)
- s += m_maskData[i].maskChar;
- else
- s += m_blank;
-
- return s;
-}
-
-/*!
- \internal
-
- Strips blank parts of the input in a QLineControl when an inputMask is set,
- separators are still included. Typically "127.0__.0__.1__" becomes "127.0.0.1".
-*/
-QString QLineControl::stripString(const QString &str) const
-{
- if (!m_maskData)
- return str;
-
- QString s;
- int end = qMin(m_maxLength, (int)str.length());
- for (int i = 0; i < end; ++i)
- if (m_maskData[i].separator)
- s += m_maskData[i].maskChar;
- else
- if (str[i] != m_blank)
- s += str[i];
-
- return s;
-}
-
-/*!
- \internal
- searches forward/backward in m_maskData for either a separator or a m_blank
-*/
-int QLineControl::findInMask(int pos, bool forward, bool findSeparator, QChar searchChar) const
-{
- if (pos >= m_maxLength || pos < 0)
- return -1;
-
- int end = forward ? m_maxLength : -1;
- int step = forward ? 1 : -1;
- int i = pos;
-
- while (i != end) {
- if (findSeparator) {
- if (m_maskData[i].separator && m_maskData[i].maskChar == searchChar)
- return i;
- } else {
- if (!m_maskData[i].separator) {
- if (searchChar.isNull())
- return i;
- else if (isValidInput(searchChar, m_maskData[i].maskChar))
- return i;
- }
- }
- i += step;
- }
- return -1;
-}
-
-void QLineControl::internalUndo(int until)
-{
- if (!isUndoAvailable())
- return;
- internalDeselect();
- while (m_undoState && m_undoState > until) {
- Command& cmd = m_history[--m_undoState];
- switch (cmd.type) {
- case Insert:
- m_text.remove(cmd.pos, 1);
- m_cursor = cmd.pos;
- break;
- case SetSelection:
- m_selstart = cmd.selStart;
- m_selend = cmd.selEnd;
- m_cursor = cmd.pos;
- break;
- case Remove:
- case RemoveSelection:
- m_text.insert(cmd.pos, cmd.uc);
- m_cursor = cmd.pos + 1;
- break;
- case Delete:
- case DeleteSelection:
- m_text.insert(cmd.pos, cmd.uc);
- m_cursor = cmd.pos;
- break;
- case Separator:
- continue;
- }
- if (until < 0 && m_undoState) {
- Command& next = m_history[m_undoState-1];
- if (next.type != cmd.type && next.type < RemoveSelection
- && (cmd.type < RemoveSelection || next.type == Separator))
- break;
- }
- }
- m_textDirty = true;
- emitCursorPositionChanged();
-}
-
-void QLineControl::internalRedo()
-{
- if (!isRedoAvailable())
- return;
- internalDeselect();
- while (m_undoState < (int)m_history.size()) {
- Command& cmd = m_history[m_undoState++];
- switch (cmd.type) {
- case Insert:
- m_text.insert(cmd.pos, cmd.uc);
- m_cursor = cmd.pos + 1;
- break;
- case SetSelection:
- m_selstart = cmd.selStart;
- m_selend = cmd.selEnd;
- m_cursor = cmd.pos;
- break;
- case Remove:
- case Delete:
- case RemoveSelection:
- case DeleteSelection:
- m_text.remove(cmd.pos, 1);
- m_selstart = cmd.selStart;
- m_selend = cmd.selEnd;
- m_cursor = cmd.pos;
- break;
- case Separator:
- m_selstart = cmd.selStart;
- m_selend = cmd.selEnd;
- m_cursor = cmd.pos;
- break;
- }
- if (m_undoState < (int)m_history.size()) {
- Command& next = m_history[m_undoState];
- if (next.type != cmd.type && cmd.type < RemoveSelection && next.type != Separator
- && (next.type < RemoveSelection || cmd.type == Separator))
- break;
- }
- }
- m_textDirty = true;
- emitCursorPositionChanged();
-}
-
-/*!
- \internal
-
- If the current cursor position differs from the last emitted cursor
- position, emits cursorPositionChanged().
-*/
-void QLineControl::emitCursorPositionChanged()
-{
- if (m_cursor != m_lastCursorPos) {
- const int oldLast = m_lastCursorPos;
- m_lastCursorPos = m_cursor;
- cursorPositionChanged(oldLast, m_cursor);
-#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(parent(), 0, QAccessible::TextCaretMoved);
-#endif
- }
-}
-
-
-void QLineControl::setCursorBlinkPeriod(int msec)
-{
- if (msec == m_blinkPeriod)
- return;
- if (m_blinkTimer) {
- killTimer(m_blinkTimer);
- }
- if (msec) {
- m_blinkTimer = startTimer(msec / 2);
- m_blinkStatus = 1;
- } else {
- m_blinkTimer = 0;
- if (m_blinkStatus == 1)
- emit updateNeeded(inputMask().isEmpty() ? cursorRect() : QRect());
- }
- m_blinkPeriod = msec;
-}
-
-void QLineControl::resetCursorBlinkTimer()
-{
- if (m_blinkPeriod == 0 || m_blinkTimer == 0)
- return;
- killTimer(m_blinkTimer);
- m_blinkTimer = startTimer(m_blinkPeriod / 2);
- m_blinkStatus = 1;
-}
-
-void QLineControl::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() == m_blinkTimer) {
- m_blinkStatus = !m_blinkStatus;
- emit updateNeeded(inputMask().isEmpty() ? cursorRect() : QRect());
- } else if (event->timerId() == m_deleteAllTimer) {
- killTimer(m_deleteAllTimer);
- m_deleteAllTimer = 0;
- clear();
- } else if (event->timerId() == m_tripleClickTimer) {
- killTimer(m_tripleClickTimer);
- m_tripleClickTimer = 0;
- }
-}
-
-bool QLineControl::processEvent(QEvent* ev)
-{
-#ifdef QT_KEYPAD_NAVIGATION
- if (QGuiApplication::keypadNavigationEnabled()) {
- if ((ev->type() == QEvent::KeyPress) || (ev->type() == QEvent::KeyRelease)) {
- QKeyEvent *ke = (QKeyEvent *)ev;
- if (ke->key() == Qt::Key_Back) {
- if (ke->isAutoRepeat()) {
- // Swallow it. We don't want back keys running amok.
- ke->accept();
- return true;
- }
- if ((ev->type() == QEvent::KeyRelease)
- && !isReadOnly()
- && m_deleteAllTimer) {
- killTimer(m_deleteAllTimer);
- m_deleteAllTimer = 0;
- backspace();
- ke->accept();
- return true;
- }
- }
- }
- }
-#endif
- switch(ev->type()){
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseMove:
- processMouseEvent(static_cast<QMouseEvent*>(ev)); break;
- case QEvent::KeyPress:
- case QEvent::KeyRelease:
- processKeyEvent(static_cast<QKeyEvent*>(ev)); break;
- case QEvent::InputMethod:
- processInputMethodEvent(static_cast<QInputMethodEvent*>(ev)); break;
-#ifndef QT_NO_SHORTCUT
- case QEvent::ShortcutOverride:{
- if (isReadOnly())
- return false;
- QKeyEvent* ke = static_cast<QKeyEvent*>(ev);
- if (ke == QKeySequence::Copy
- || ke == QKeySequence::Paste
- || ke == QKeySequence::Cut
- || ke == QKeySequence::Redo
- || ke == QKeySequence::Undo
- || ke == QKeySequence::MoveToNextWord
- || ke == QKeySequence::MoveToPreviousWord
- || ke == QKeySequence::MoveToStartOfDocument
- || ke == QKeySequence::MoveToEndOfDocument
- || ke == QKeySequence::SelectNextWord
- || ke == QKeySequence::SelectPreviousWord
- || ke == QKeySequence::SelectStartOfLine
- || ke == QKeySequence::SelectEndOfLine
- || ke == QKeySequence::SelectStartOfBlock
- || ke == QKeySequence::SelectEndOfBlock
- || ke == QKeySequence::SelectStartOfDocument
- || ke == QKeySequence::SelectAll
- || ke == QKeySequence::SelectEndOfDocument) {
- ke->accept();
- } else if (ke->modifiers() == Qt::NoModifier || ke->modifiers() == Qt::ShiftModifier
- || ke->modifiers() == Qt::KeypadModifier) {
- if (ke->key() < Qt::Key_Escape) {
- ke->accept();
- } else {
- switch (ke->key()) {
- case Qt::Key_Delete:
- case Qt::Key_Home:
- case Qt::Key_End:
- case Qt::Key_Backspace:
- case Qt::Key_Left:
- case Qt::Key_Right:
- ke->accept();
- default:
- break;
- }
- }
- }
- }
-#endif
- default:
- return false;
- }
- return true;
-}
-
-void QLineControl::processMouseEvent(QMouseEvent* ev)
-{
-
- switch (ev->type()) {
- case QEvent::MouseButtonPress:{
- if (m_tripleClickTimer
- && (ev->pos() - m_tripleClick).manhattanLength() < qApp->styleHints()->startDragDistance()) {
- selectAll();
- return;
- }
- if (ev->button() == Qt::RightButton)
- return;
-
- bool mark = ev->modifiers() & Qt::ShiftModifier;
- int cursor = xToPos(ev->pos().x());
- moveCursor(cursor, mark);
- break;
- }
- case QEvent::MouseButtonDblClick:
- if (ev->button() == Qt::LeftButton) {
- selectWordAtPos(xToPos(ev->pos().x()));
- if (m_tripleClickTimer)
- killTimer(m_tripleClickTimer);
- m_tripleClickTimer = startTimer(qApp->styleHints()->mouseDoubleClickInterval());
- m_tripleClick = ev->pos();
- }
- break;
- case QEvent::MouseButtonRelease:
-#ifndef QT_NO_CLIPBOARD
- if (QGuiApplication::clipboard()->supportsSelection()) {
- if (ev->button() == Qt::LeftButton) {
- copy(QClipboard::Selection);
- } else if (!isReadOnly() && ev->button() == Qt::MidButton) {
- deselect();
- insert(QGuiApplication::clipboard()->text(QClipboard::Selection));
- }
- }
-#endif
- break;
- case QEvent::MouseMove:
- if (ev->buttons() & Qt::LeftButton) {
- moveCursor(xToPos(ev->pos().x()), true);
- }
- break;
- default:
- break;
- }
-}
-
-void QLineControl::processKeyEvent(QKeyEvent* event)
-{
- bool inlineCompletionAccepted = false;
-
- if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
- if (hasAcceptableInput() || fixup()) {
- emit accepted();
- emit editingFinished();
- }
- if (inlineCompletionAccepted)
- event->accept();
- else
- event->ignore();
- return;
- }
-
- if (echoMode() == PasswordEchoOnEdit
- && !passwordEchoEditing()
- && !isReadOnly()
- && !event->text().isEmpty()
-#ifdef QT_KEYPAD_NAVIGATION
- && event->key() != Qt::Key_Select
- && event->key() != Qt::Key_Up
- && event->key() != Qt::Key_Down
- && event->key() != Qt::Key_Back
-#endif
- && !(event->modifiers() & Qt::ControlModifier)) {
- // Clear the edit and reset to normal echo mode while editing; the
- // echo mode switches back when the edit loses focus
- // ### resets current content. dubious code; you can
- // navigate with keys up, down, back, and select(?), but if you press
- // "left" or "right" it clears?
- updatePasswordEchoEditing(true);
- clear();
- }
-
- bool unknown = false;
- bool visual = cursorMoveStyle() == Qt::VisualMoveStyle;
-
- if (false) {
- }
-#ifndef QT_NO_SHORTCUT
- else if (event == QKeySequence::Undo) {
- if (!isReadOnly())
- undo();
- }
- else if (event == QKeySequence::Redo) {
- if (!isReadOnly())
- redo();
- }
- else if (event == QKeySequence::SelectAll) {
- selectAll();
- }
-#ifndef QT_NO_CLIPBOARD
- else if (event == QKeySequence::Copy) {
- copy();
- }
- else if (event == QKeySequence::Paste) {
- if (!isReadOnly()) {
- QClipboard::Mode mode = QClipboard::Clipboard;
- paste(mode);
- }
- }
- else if (event == QKeySequence::Cut) {
- if (!isReadOnly()) {
- copy();
- del();
- }
- }
- else if (event == QKeySequence::DeleteEndOfLine) {
- if (!isReadOnly()) {
- setSelection(cursor(), end());
- copy();
- del();
- }
- }
-#endif //QT_NO_CLIPBOARD
- else if (event == QKeySequence::MoveToStartOfLine || event == QKeySequence::MoveToStartOfBlock) {
- home(0);
- }
- else if (event == QKeySequence::MoveToEndOfLine || event == QKeySequence::MoveToEndOfBlock) {
- end(0);
- }
- else if (event == QKeySequence::SelectStartOfLine || event == QKeySequence::SelectStartOfBlock) {
- home(1);
- }
- else if (event == QKeySequence::SelectEndOfLine || event == QKeySequence::SelectEndOfBlock) {
- end(1);
- }
- else if (event == QKeySequence::MoveToNextChar) {
- if (hasSelectedText()) {
- moveCursor(selectionEnd(), false);
- } else {
- cursorForward(0, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
- }
- }
- else if (event == QKeySequence::SelectNextChar) {
- cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
- }
- else if (event == QKeySequence::MoveToPreviousChar) {
- if (hasSelectedText()) {
- moveCursor(selectionStart(), false);
- } else {
- cursorForward(0, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));
- }
- }
- else if (event == QKeySequence::SelectPreviousChar) {
- cursorForward(1, visual ? -1 : (layoutDirection() == Qt::LeftToRight ? -1 : 1));
- }
- else if (event == QKeySequence::MoveToNextWord) {
- if (echoMode() == Normal)
- layoutDirection() == Qt::LeftToRight ? cursorWordForward(0) : cursorWordBackward(0);
- else
- layoutDirection() == Qt::LeftToRight ? end(0) : home(0);
- }
- else if (event == QKeySequence::MoveToPreviousWord) {
- if (echoMode() == Normal)
- layoutDirection() == Qt::LeftToRight ? cursorWordBackward(0) : cursorWordForward(0);
- else if (!isReadOnly()) {
- layoutDirection() == Qt::LeftToRight ? home(0) : end(0);
- }
- }
- else if (event == QKeySequence::SelectNextWord) {
- if (echoMode() == Normal)
- layoutDirection() == Qt::LeftToRight ? cursorWordForward(1) : cursorWordBackward(1);
- else
- layoutDirection() == Qt::LeftToRight ? end(1) : home(1);
- }
- else if (event == QKeySequence::SelectPreviousWord) {
- if (echoMode() == Normal)
- layoutDirection() == Qt::LeftToRight ? cursorWordBackward(1) : cursorWordForward(1);
- else
- layoutDirection() == Qt::LeftToRight ? home(1) : end(1);
- }
- else if (event == QKeySequence::Delete) {
- if (!isReadOnly())
- del();
- }
- else if (event == QKeySequence::DeleteEndOfWord) {
- if (!isReadOnly()) {
- cursorWordForward(true);
- del();
- }
- }
- else if (event == QKeySequence::DeleteStartOfWord) {
- if (!isReadOnly()) {
- cursorWordBackward(true);
- del();
- }
- }
-#endif // QT_NO_SHORTCUT
- else {
- bool handled = false;
- if (event->modifiers() & Qt::ControlModifier) {
- switch (event->key()) {
- case Qt::Key_Backspace:
- if (!isReadOnly()) {
- cursorWordBackward(true);
- del();
- }
- break;
- default:
- if (!handled)
- unknown = true;
- }
- } else { // ### check for *no* modifier
- switch (event->key()) {
- case Qt::Key_Backspace:
- if (!isReadOnly()) {
- backspace();
- }
- break;
-#ifdef QT_KEYPAD_NAVIGATION
- case Qt::Key_Back:
- if (QGuiApplication::keypadNavigationEnabled() && !event->isAutoRepeat()
- && !isReadOnly()) {
- if (text().length() == 0) {
- setText(m_cancelText);
-
- if (passwordEchoEditing())
- updatePasswordEchoEditing(false);
-
- emit editFocusChange(false);
- } else if (!m_deleteAllTimer) {
- m_deleteAllTimer = startTimer(750);
- }
- } else {
- unknown = true;
- }
- break;
-#endif
- default:
- if (!handled)
- unknown = true;
- }
- }
- }
-
- if (event->key() == Qt::Key_Direction_L || event->key() == Qt::Key_Direction_R) {
- setLayoutDirection((event->key() == Qt::Key_Direction_L) ? Qt::LeftToRight : Qt::RightToLeft);
- unknown = false;
- }
-
- if (unknown && !isReadOnly()) {
- QString t = event->text();
- if (!t.isEmpty() && t.at(0).isPrint()) {
- insert(t);
- event->accept();
- return;
- }
- }
-
- if (unknown)
- event->ignore();
- else
- event->accept();
-}
-
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/gui/text/qlinecontrol_p.h b/src/gui/text/qlinecontrol_p.h
deleted file mode 100644
index fb14df27bb..0000000000
--- a/src/gui/text/qlinecontrol_p.h
+++ /dev/null
@@ -1,456 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 QLINECONTROL_P_H
-#define QLINECONTROL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "QtCore/qglobal.h"
-
-#include "QtGui/qtextlayout.h"
-#include "QtCore/qpointer.h"
-#include "QtGui/qclipboard.h"
-#include "QtGui/qvalidator.h"
-#include "QtGui/qpalette.h"
-#include "QtGui/qguiapplication.h"
-#include "QtGui/qinputpanel.h"
-#include "QtCore/qpoint.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class Q_GUI_EXPORT QLineControl : public QObject
-{
- Q_OBJECT
-
-public:
- QLineControl(const QString &txt = QString())
- : m_cursor(0), m_preeditCursor(0), m_cursorWidth(0), m_layoutDirection(Qt::LayoutDirectionAuto),
- m_hideCursor(false), m_separator(0), m_readOnly(0),
- m_dragEnabled(0), m_echoMode(Normal), m_textDirty(0), m_selDirty(0),
- m_validInput(1), m_blinkStatus(0), m_blinkPeriod(0), m_blinkTimer(0), m_deleteAllTimer(0),
- m_ascent(0), m_maxLength(32767), m_lastCursorPos(-1),
- m_tripleClickTimer(0), m_maskData(0), m_modifiedState(0), m_undoState(0),
- m_selstart(0), m_selend(0), m_passwordEchoEditing(false)
- {
- init(txt);
- }
-
- enum EchoMode {
- Normal,
- NoEcho,
- Password,
- PasswordEchoOnEdit
- };
-
-
- ~QLineControl()
- {
- delete [] m_maskData;
- }
-
- int nextMaskBlank(int pos)
- {
- int c = findInMask(pos, true, false);
- m_separator |= (c != pos);
- return (c != -1 ? c : m_maxLength);
- }
-
- int prevMaskBlank(int pos)
- {
- int c = findInMask(pos, false, false);
- m_separator |= (c != pos);
- return (c != -1 ? c : 0);
- }
-
- bool isUndoAvailable() const { return !m_readOnly && m_undoState; }
- bool isRedoAvailable() const { return !m_readOnly && m_undoState < (int)m_history.size(); }
- void clearUndo() { m_history.clear(); m_modifiedState = m_undoState = 0; }
-
- bool isModified() const { return m_modifiedState != m_undoState; }
- void setModified(bool modified) { m_modifiedState = modified ? -1 : m_undoState; }
-
- bool allSelected() const { return !m_text.isEmpty() && m_selstart == 0 && m_selend == (int)m_text.length(); }
- bool hasSelectedText() const { return !m_text.isEmpty() && m_selend > m_selstart; }
-
- int width() const { return qRound(m_textLayout.lineAt(0).width()) + 1; }
- int height() const { return qRound(m_textLayout.lineAt(0).height()) + 1; }
- int ascent() const { return m_ascent; }
- qreal naturalTextWidth() const { return m_textLayout.lineAt(0).naturalTextWidth(); }
-
- void setSelection(int start, int length);
-
- inline QString selectedText() const { return hasSelectedText() ? m_text.mid(m_selstart, m_selend - m_selstart) : QString(); }
- QString textBeforeSelection() const { return hasSelectedText() ? m_text.left(m_selstart) : QString(); }
- QString textAfterSelection() const { return hasSelectedText() ? m_text.mid(m_selend) : QString(); }
-
- int selectionStart() const { return hasSelectedText() ? m_selstart : -1; }
- int selectionEnd() const { return hasSelectedText() ? m_selend : -1; }
- bool inSelection(int x) const
- {
- if (m_selstart >= m_selend)
- return false;
- int pos = xToPos(x, QTextLine::CursorOnCharacter);
- return pos >= m_selstart && pos < m_selend;
- }
-
- void removeSelection()
- {
- int priorState = m_undoState;
- removeSelectedText();
- finishChange(priorState);
- }
-
- int start() const { return 0; }
- int end() const { return m_text.length(); }
-
-#ifndef QT_NO_CLIPBOARD
- void copy(QClipboard::Mode mode = QClipboard::Clipboard) const;
- void paste(QClipboard::Mode mode = QClipboard::Clipboard);
-#endif
-
- int cursor() const{ return m_cursor; }
- int preeditCursor() const { return m_preeditCursor; }
-
- int cursorWidth() const { return m_cursorWidth; }
- void setCursorWidth(int value) { m_cursorWidth = value; }
-
- Qt::CursorMoveStyle cursorMoveStyle() const { return m_textLayout.cursorMoveStyle(); }
- void setCursorMoveStyle(Qt::CursorMoveStyle style) { m_textLayout.setCursorMoveStyle(style); }
-
- void moveCursor(int pos, bool mark = false);
- void cursorForward(bool mark, int steps)
- {
- int c = m_cursor;
- if (steps > 0) {
- while (steps--)
- c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.rightCursorPosition(c)
- : m_textLayout.nextCursorPosition(c);
- } else if (steps < 0) {
- while (steps++)
- c = cursorMoveStyle() == Qt::VisualMoveStyle ? m_textLayout.leftCursorPosition(c)
- : m_textLayout.previousCursorPosition(c);
- }
- moveCursor(c, mark);
- }
-
- void cursorWordForward(bool mark) { moveCursor(m_textLayout.nextCursorPosition(m_cursor, QTextLayout::SkipWords), mark); }
- void cursorWordBackward(bool mark) { moveCursor(m_textLayout.previousCursorPosition(m_cursor, QTextLayout::SkipWords), mark); }
-
- void home(bool mark) { moveCursor(0, mark); }
- void end(bool mark) { moveCursor(text().length(), mark); }
-
- int xToPos(int x, QTextLine::CursorPosition = QTextLine::CursorBetweenCharacters) const;
- QRect cursorRect() const;
-
- qreal cursorToX(int cursor) const { return m_textLayout.lineAt(0).cursorToX(cursor); }
- qreal cursorToX() const
- {
- int cursor = m_cursor;
- if (m_preeditCursor != -1)
- cursor += m_preeditCursor;
- return cursorToX(cursor);
- }
-
- bool isReadOnly() const { return m_readOnly; }
- void setReadOnly(bool enable) { m_readOnly = enable; }
-
- QString text() const;
- QString realText() const;
- void setText(const QString &txt);
- void commitPreedit();
-
- QString displayText() const { return m_textLayout.text(); }
-
- void backspace();
- void del();
- void deselect() { internalDeselect(); finishChange(); }
- void selectAll() { m_selstart = m_selend = m_cursor = 0; moveCursor(m_text.length(), true); }
-
- void insert(const QString &);
- void clear();
- void undo() { internalUndo(); finishChange(-1, true); }
- void redo() { internalRedo(); finishChange(); }
- void selectWordAtPos(int);
-
- EchoMode echoMode() const { return EchoMode(m_echoMode); }
- void setEchoMode(EchoMode mode)
- {
- m_echoMode = mode;
- m_passwordEchoEditing = false;
- updateDisplayText();
- }
-
- int maxLength() const { return m_maxLength; }
- void setMaxLength(int maxLength)
- {
- if (m_maskData)
- return;
- m_maxLength = maxLength;
- setText(m_text);
- }
-
-#ifndef QT_NO_VALIDATOR
- const QValidator *validator() const { return m_validator; }
- void setValidator(const QValidator *v) { m_validator = const_cast<QValidator*>(v); }
-#endif
-
- int cursorPosition() const { return m_cursor; }
- void setCursorPosition(int pos) { if (pos <= m_text.length()) moveCursor(qMax(0, pos)); }
-
- bool hasAcceptableInput() const { return hasAcceptableInput(m_text); }
- bool fixup();
-
- QString inputMask() const { return m_maskData ? m_inputMask + QLatin1Char(';') + m_blank : QString(); }
- void setInputMask(const QString &mask)
- {
- parseInputMask(mask);
- if (m_maskData)
- moveCursor(nextMaskBlank(0));
- }
-
- // input methods
-#ifndef QT_NO_IM
- bool composeMode() const { return !m_textLayout.preeditAreaText().isEmpty(); }
- void setPreeditArea(int cursor, const QString &text) { m_textLayout.setPreeditArea(cursor, text); }
-#endif
-
- QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
-
- void updatePasswordEchoEditing(bool editing);
- bool passwordEchoEditing() const { return m_passwordEchoEditing; }
-
- QChar passwordCharacter() const { return m_passwordCharacter; }
- void setPasswordCharacter(const QChar &character) { m_passwordCharacter = character; updateDisplayText(); }
-
- Qt::LayoutDirection layoutDirection() const {
- if (m_layoutDirection == Qt::LayoutDirectionAuto) {
- if (m_text.isEmpty())
- return qApp->inputPanel()->inputDirection();
- return m_text.isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight;
- }
- return m_layoutDirection;
- }
- void setLayoutDirection(Qt::LayoutDirection direction)
- {
- if (direction != m_layoutDirection) {
- m_layoutDirection = direction;
- updateDisplayText();
- }
- }
-
- void setFont(const QFont &font) { m_textLayout.setFont(font); updateDisplayText(); }
-
- void processInputMethodEvent(QInputMethodEvent *event);
- void processMouseEvent(QMouseEvent* ev);
- void processKeyEvent(QKeyEvent* ev);
-
- int cursorBlinkPeriod() const { return m_blinkPeriod; }
- void setCursorBlinkPeriod(int msec);
- void resetCursorBlinkTimer();
-
- bool cursorBlinkStatus() const { return m_blinkStatus; }
-
- QString cancelText() const { return m_cancelText; }
- void setCancelText(const QString &text) { m_cancelText = text; }
-
- const QPalette &palette() const { return m_palette; }
- void setPalette(const QPalette &p) { m_palette = p; }
-
- enum DrawFlags {
- DrawText = 0x01,
- DrawSelections = 0x02,
- DrawCursor = 0x04,
- DrawAll = DrawText | DrawSelections | DrawCursor
- };
- void draw(QPainter *, const QPoint &, const QRect &, int flags = DrawAll);
-
- bool processEvent(QEvent *ev);
-
- QTextLayout *textLayout()
- {
- return &m_textLayout;
- }
-
-private:
- void init(const QString &txt);
- void removeSelectedText();
- void internalSetText(const QString &txt, int pos = -1, bool edited = true);
- void updateDisplayText(bool forceUpdate = false);
-
- void internalInsert(const QString &s);
- void internalDelete(bool wasBackspace = false);
- void internalRemove(int pos);
-
- inline void internalDeselect()
- {
- m_selDirty |= (m_selend > m_selstart);
- m_selstart = m_selend = 0;
- }
-
- void internalUndo(int until = -1);
- void internalRedo();
-
- QString m_text;
- QPalette m_palette;
- int m_cursor;
- int m_preeditCursor;
- int m_cursorWidth;
- QString m_tentativeCommit;
- Qt::LayoutDirection m_layoutDirection;
- uint m_hideCursor : 1; // used to hide the m_cursor inside preedit areas
- uint m_separator : 1;
- uint m_readOnly : 1;
- uint m_dragEnabled : 1;
- uint m_echoMode : 2;
- uint m_textDirty : 1;
- uint m_selDirty : 1;
- uint m_validInput : 1;
- uint m_blinkStatus : 1;
- int m_blinkPeriod; // 0 for non-blinking cursor
- int m_blinkTimer;
- int m_deleteAllTimer;
- int m_ascent;
- int m_maxLength;
- int m_lastCursorPos;
- QList<int> m_transactions;
- QPoint m_tripleClick;
- int m_tripleClickTimer;
- QString m_cancelText;
-
- void emitCursorPositionChanged();
-
- bool finishChange(int validateFromState = -1, bool update = false, bool edited = true);
-
-#ifndef QT_NO_VALIDATOR
- QPointer<QValidator> m_validator;
-#endif
-
- struct MaskInputData {
- enum Casemode { NoCaseMode, Upper, Lower };
- QChar maskChar; // either the separator char or the inputmask
- bool separator;
- Casemode caseMode;
- };
- QString m_inputMask;
- QChar m_blank;
- MaskInputData *m_maskData;
-
- // undo/redo handling
- enum CommandType { Separator, Insert, Remove, Delete, RemoveSelection, DeleteSelection, SetSelection };
- struct Command {
- inline Command() {}
- inline Command(CommandType t, int p, QChar c, int ss, int se) : type(t),uc(c),pos(p),selStart(ss),selEnd(se) {}
- uint type : 4;
- QChar uc;
- int pos, selStart, selEnd;
- };
- int m_modifiedState;
- int m_undoState;
- QVector<Command> m_history;
- void addCommand(const Command& cmd);
-
- inline void separate() { m_separator = true; }
-
- // selection
- int m_selstart;
- int m_selend;
-
- // masking
- void parseInputMask(const QString &maskFields);
- bool isValidInput(QChar key, QChar mask) const;
- bool hasAcceptableInput(const QString &text) const;
- QString maskString(uint pos, const QString &str, bool clear = false) const;
- QString clearString(uint pos, uint len) const;
- QString stripString(const QString &str) const;
- int findInMask(int pos, bool forward, bool findSeparator, QChar searchChar = QChar()) const;
-
- // complex text layout
- QTextLayout m_textLayout;
-
- bool m_passwordEchoEditing;
- QChar m_passwordCharacter;
-
-Q_SIGNALS:
- void cursorPositionChanged(int, int);
- void selectionChanged();
-
- void displayTextChanged(const QString &);
- void textChanged(const QString &);
- void textEdited(const QString &);
-
- void resetInputContext();
- void updateMicroFocus();
-
- void accepted();
- void editingFinished();
- void updateNeeded(const QRect &);
-
-#ifdef QT_KEYPAD_NAVIGATION
- void editFocusChange(bool);
-#endif
-protected:
- virtual void timerEvent(QTimerEvent *event);
-
-private Q_SLOTS:
- void _q_clipboardChanged();
- void _q_deleteSelected();
-
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QLineControl_P_H
diff --git a/src/gui/text/qpfutil.cpp b/src/gui/text/qpfutil.cpp
index f60b358dbe..a3d8c0746a 100644
--- a/src/gui/text/qpfutil.cpp
+++ b/src/gui/text/qpfutil.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index fbd9cb09cf..f9cc97cbc7 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h
index 9ee2bfd76a..151442c5e1 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.h
+++ b/src/gui/text/qplatformfontdatabase_qpa.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QWritingSystemsPrivate;
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 65d9797374..a5879e3407 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE
also have accessors to some relevant data in the physical font.
QRawFont only provides support for the main font technologies: GDI and DirectWrite on Windows
- platforms, FreeType on Symbian and Linux platforms and CoreText on Mac OS X. For other
+ platforms, FreeType on Linux platforms and CoreText on Mac OS X. For other
font back-ends, the APIs will be disabled.
QRawFont can be constructed in a number of ways:
@@ -250,7 +250,7 @@ QImage QRawFont::alphaMapForGlyph(quint32 glyphIndex, AntialiasingType antialias
return QImage();
if (antialiasingType == SubPixelAntialiasing)
- return d->fontEngine->alphaRGBMapForGlyph(glyphIndex, QFixed(), 0, transform);
+ return d->fontEngine->alphaRGBMapForGlyph(glyphIndex, QFixed(), transform);
return d->fontEngine->alphaMapForGlyph(glyphIndex, QFixed(), transform);
}
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 87f4a75bc7..453f01ff11 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -57,7 +57,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QRawFontPrivate;
class Q_GUI_EXPORT QRawFont
diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp
index f0251b28f6..b54a7a3ac3 100644
--- a/src/gui/text/qrawfont_ft.cpp
+++ b/src/gui/text/qrawfont_ft.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qrawfont_p.h b/src/gui/text/qrawfont_p.h
index b1a71d96ab..8f6341601d 100644
--- a/src/gui/text/qrawfont_p.h
+++ b/src/gui/text/qrawfont_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qrawfont_qpa.cpp b/src/gui/text/qrawfont_qpa.cpp
index 444efd0a0b..e9515fdf97 100644
--- a/src/gui/text/qrawfont_qpa.cpp
+++ b/src/gui/text/qrawfont_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index c356aa7e99..5bee2a9915 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index ad55c6a05d..a67d4ca595 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QStaticTextPrivate;
class Q_GUI_EXPORT QStaticText
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 2607bcfe8a..994825ce22 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index d9bdeeddfe..c6810ad61f 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qsyntaxhighlighter.h b/src/gui/text/qsyntaxhighlighter.h
index bd64de34bb..244f40b7ed 100644
--- a/src/gui/text/qsyntaxhighlighter.h
+++ b/src/gui/text/qsyntaxhighlighter.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -53,7 +53,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextDocument;
class QSyntaxHighlighterPrivate;
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
deleted file mode 100644
index b21dae5298..0000000000
--- a/src/gui/text/qtextcontrol.cpp
+++ /dev/null
@@ -1,2893 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 "qtextcontrol_p.h"
-#include "qtextcontrol_p_p.h"
-
-#ifndef QT_NO_TEXTCONTROL
-
-#include <qfont.h>
-#include <qpainter.h>
-#include <qevent.h>
-#include <qdebug.h>
-#include <qdrag.h>
-#include <qclipboard.h>
-#include <qtimer.h>
-#include <qinputpanel.h>
-#include "private/qtextdocumentlayout_p.h"
-#include "private/qabstracttextdocumentlayout_p.h"
-#include "qtextdocument.h"
-#include "private/qtextdocument_p.h"
-#include "qtextlist.h"
-#include "qtextdocumentwriter.h"
-#include "private/qtextcursor_p.h"
-#include "qpagedpaintdevice.h"
-#include "private/qpagedpaintdevice_p.h"
-
-#include <qtextformat.h>
-#include <qdatetime.h>
-#include <qbuffer.h>
-#include <qguiapplication.h>
-#include <limits.h>
-#include <qtexttable.h>
-#include <qvariant.h>
-#include <qurl.h>
-#include <qstylehints.h>
-
-// ### these should come from QStyleHints
-const int textCursorWidth = 1;
-const bool fullWidthSelection = true;
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_CONTEXTMENU
-#endif
-
-// could go into QTextCursor...
-static QTextLine currentTextLine(const QTextCursor &cursor)
-{
- const QTextBlock block = cursor.block();
- if (!block.isValid())
- return QTextLine();
-
- const QTextLayout *layout = block.layout();
- if (!layout)
- return QTextLine();
-
- const int relativePos = cursor.position() - block.position();
- return layout->lineForTextPosition(relativePos);
-}
-
-QTextControlPrivate::QTextControlPrivate()
- : doc(0), cursorOn(false), cursorIsFocusIndicator(false),
- interactionFlags(Qt::TextEditorInteraction),
- dragEnabled(true),
-#ifndef QT_NO_DRAGANDDROP
- mousePressed(false), mightStartDrag(false),
-#endif
- lastSelectionState(false), ignoreAutomaticScrollbarAdjustement(false),
- overwriteMode(false),
- acceptRichText(true),
- preeditCursor(0), hideCursor(false),
- hasFocus(false),
-#ifdef QT_KEYPAD_NAVIGATION
- hasEditFocus(false),
-#endif
- isEnabled(true),
- hadSelectionOnMousePress(false),
- ignoreUnusedNavigationEvents(false),
- openExternalLinks(false),
- wordSelectionEnabled(false)
-{}
-
-bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
-{
-#ifdef QT_NO_SHORTCUT
- Q_UNUSED(e);
-#endif
-
- Q_Q(QTextControl);
- if (cursor.isNull())
- return false;
-
- const QTextCursor oldSelection = cursor;
- const int oldCursorPos = cursor.position();
-
- QTextCursor::MoveMode mode = QTextCursor::MoveAnchor;
- QTextCursor::MoveOperation op = QTextCursor::NoMove;
-
- if (false) {
- }
-#ifndef QT_NO_SHORTCUT
- if (e == QKeySequence::MoveToNextChar) {
- op = QTextCursor::Right;
- }
- else if (e == QKeySequence::MoveToPreviousChar) {
- op = QTextCursor::Left;
- }
- else if (e == QKeySequence::SelectNextChar) {
- op = QTextCursor::Right;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectPreviousChar) {
- op = QTextCursor::Left;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectNextWord) {
- op = QTextCursor::WordRight;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectPreviousWord) {
- op = QTextCursor::WordLeft;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectStartOfLine) {
- op = QTextCursor::StartOfLine;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectEndOfLine) {
- op = QTextCursor::EndOfLine;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectStartOfBlock) {
- op = QTextCursor::StartOfBlock;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectEndOfBlock) {
- op = QTextCursor::EndOfBlock;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectStartOfDocument) {
- op = QTextCursor::Start;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectEndOfDocument) {
- op = QTextCursor::End;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectPreviousLine) {
- op = QTextCursor::Up;
- mode = QTextCursor::KeepAnchor;
- }
- else if (e == QKeySequence::SelectNextLine) {
- op = QTextCursor::Down;
- mode = QTextCursor::KeepAnchor;
- {
- QTextBlock block = cursor.block();
- QTextLine line = currentTextLine(cursor);
- if (!block.next().isValid()
- && line.isValid()
- && line.lineNumber() == block.layout()->lineCount() - 1)
- op = QTextCursor::End;
- }
- }
- else if (e == QKeySequence::MoveToNextWord) {
- op = QTextCursor::WordRight;
- }
- else if (e == QKeySequence::MoveToPreviousWord) {
- op = QTextCursor::WordLeft;
- }
- else if (e == QKeySequence::MoveToEndOfBlock) {
- op = QTextCursor::EndOfBlock;
- }
- else if (e == QKeySequence::MoveToStartOfBlock) {
- op = QTextCursor::StartOfBlock;
- }
- else if (e == QKeySequence::MoveToNextLine) {
- op = QTextCursor::Down;
- }
- else if (e == QKeySequence::MoveToPreviousLine) {
- op = QTextCursor::Up;
- }
- else if (e == QKeySequence::MoveToStartOfLine) {
- op = QTextCursor::StartOfLine;
- }
- else if (e == QKeySequence::MoveToEndOfLine) {
- op = QTextCursor::EndOfLine;
- }
- else if (e == QKeySequence::MoveToStartOfDocument) {
- op = QTextCursor::Start;
- }
- else if (e == QKeySequence::MoveToEndOfDocument) {
- op = QTextCursor::End;
- }
-#endif // QT_NO_SHORTCUT
- else {
- return false;
- }
-
-// Except for pageup and pagedown, Mac OS X has very different behavior, we don't do it all, but
-// here's the breakdown:
-// Shift still works as an anchor, but only one of the other keys can be down Ctrl (Command),
-// Alt (Option), or Meta (Control).
-// Command/Control + Left/Right -- Move to left or right of the line
-// + Up/Down -- Move to top bottom of the file. (Control doesn't move the cursor)
-// Option + Left/Right -- Move one word Left/right.
-// + Up/Down -- Begin/End of Paragraph.
-// Home/End Top/Bottom of file. (usually don't move the cursor, but will select)
-
- bool visualNavigation = cursor.visualNavigation();
- cursor.setVisualNavigation(true);
- const bool moved = cursor.movePosition(op, mode);
- cursor.setVisualNavigation(visualNavigation);
- q->ensureCursorVisible();
-
- bool ignoreNavigationEvents = ignoreUnusedNavigationEvents;
- bool isNavigationEvent = e->key() == Qt::Key_Up || e->key() == Qt::Key_Down;
-
-#ifdef QT_KEYPAD_NAVIGATION
- ignoreNavigationEvents = ignoreNavigationEvents || QGuiApplication::keypadNavigationEnabled();
- isNavigationEvent = isNavigationEvent ||
- (QGuiApplication::navigationMode() == Qt::NavigationModeKeypadDirectional
- && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right));
-#else
- isNavigationEvent = isNavigationEvent || e->key() == Qt::Key_Left || e->key() == Qt::Key_Right;
-#endif
-
- if (moved) {
- if (cursor.position() != oldCursorPos)
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- } else if (ignoreNavigationEvents && isNavigationEvent && oldSelection.anchor() == cursor.anchor()) {
- return false;
- }
-
- selectionChanged(/*forceEmitSelectionChanged =*/(mode == QTextCursor::KeepAnchor));
-
- repaintOldAndNewSelection(oldSelection);
-
- return true;
-}
-
-void QTextControlPrivate::updateCurrentCharFormat()
-{
- Q_Q(QTextControl);
-
- QTextCharFormat fmt = cursor.charFormat();
- if (fmt == lastCharFormat)
- return;
- lastCharFormat = fmt;
-
- emit q->currentCharFormatChanged(fmt);
- emit q->microFocusChanged();
-}
-
-void QTextControlPrivate::indent()
-{
- QTextBlockFormat blockFmt = cursor.blockFormat();
-
- QTextList *list = cursor.currentList();
- if (!list) {
- QTextBlockFormat modifier;
- modifier.setIndent(blockFmt.indent() + 1);
- cursor.mergeBlockFormat(modifier);
- } else {
- QTextListFormat format = list->format();
- format.setIndent(format.indent() + 1);
-
- if (list->itemNumber(cursor.block()) == 1)
- list->setFormat(format);
- else
- cursor.createList(format);
- }
-}
-
-void QTextControlPrivate::outdent()
-{
- QTextBlockFormat blockFmt = cursor.blockFormat();
-
- QTextList *list = cursor.currentList();
-
- if (!list) {
- QTextBlockFormat modifier;
- modifier.setIndent(blockFmt.indent() - 1);
- cursor.mergeBlockFormat(modifier);
- } else {
- QTextListFormat listFmt = list->format();
- listFmt.setIndent(listFmt.indent() - 1);
- list->setFormat(listFmt);
- }
-}
-
-void QTextControlPrivate::gotoNextTableCell()
-{
- QTextTable *table = cursor.currentTable();
- QTextTableCell cell = table->cellAt(cursor);
-
- int newColumn = cell.column() + cell.columnSpan();
- int newRow = cell.row();
-
- if (newColumn >= table->columns()) {
- newColumn = 0;
- ++newRow;
- if (newRow >= table->rows())
- table->insertRows(table->rows(), 1);
- }
-
- cell = table->cellAt(newRow, newColumn);
- cursor = cell.firstCursorPosition();
-}
-
-void QTextControlPrivate::gotoPreviousTableCell()
-{
- QTextTable *table = cursor.currentTable();
- QTextTableCell cell = table->cellAt(cursor);
-
- int newColumn = cell.column() - 1;
- int newRow = cell.row();
-
- if (newColumn < 0) {
- newColumn = table->columns() - 1;
- --newRow;
- if (newRow < 0)
- return;
- }
-
- cell = table->cellAt(newRow, newColumn);
- cursor = cell.firstCursorPosition();
-}
-
-void QTextControlPrivate::createAutoBulletList()
-{
- cursor.beginEditBlock();
-
- QTextBlockFormat blockFmt = cursor.blockFormat();
-
- QTextListFormat listFmt;
- listFmt.setStyle(QTextListFormat::ListDisc);
- listFmt.setIndent(blockFmt.indent() + 1);
-
- blockFmt.setIndent(0);
- cursor.setBlockFormat(blockFmt);
-
- cursor.createList(listFmt);
-
- cursor.endEditBlock();
-}
-
-void QTextControlPrivate::init(Qt::TextFormat format, const QString &text, QTextDocument *document)
-{
- Q_Q(QTextControl);
- setContent(format, text, document);
-
- doc->setUndoRedoEnabled(interactionFlags & Qt::TextEditable);
- q->setCursorWidth(-1);
-
- QObject::connect(q, SIGNAL(updateCursorRequest(QRectF)), q, SIGNAL(updateRequest(QRectF)));
-}
-
-void QTextControlPrivate::setContent(Qt::TextFormat format, const QString &text, QTextDocument *document)
-{
- Q_Q(QTextControl);
-
- // for use when called from setPlainText. we may want to re-use the currently
- // set char format then.
- const QTextCharFormat charFormatForInsertion = cursor.charFormat();
-
- bool clearDocument = true;
- if (!doc) {
- if (document) {
- doc = document;
- clearDocument = false;
- } else {
- palette = QGuiApplication::palette();
- doc = new QTextDocument(q);
- }
- _q_documentLayoutChanged();
- cursor = QTextCursor(doc);
-
-// #### doc->documentLayout()->setPaintDevice(viewport);
-
- QObject::connect(doc, SIGNAL(contentsChanged()), q, SLOT(_q_updateCurrentCharFormatAndSelection()));
- QObject::connect(doc, SIGNAL(cursorPositionChanged(QTextCursor)), q, SLOT(_q_emitCursorPosChanged(QTextCursor)));
- QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(_q_documentLayoutChanged()));
-
- // convenience signal forwards
- QObject::connect(doc, SIGNAL(undoAvailable(bool)), q, SIGNAL(undoAvailable(bool)));
- QObject::connect(doc, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool)));
- QObject::connect(doc, SIGNAL(modificationChanged(bool)), q, SIGNAL(modificationChanged(bool)));
- QObject::connect(doc, SIGNAL(blockCountChanged(int)), q, SIGNAL(blockCountChanged(int)));
- }
-
- bool previousUndoRedoState = doc->isUndoRedoEnabled();
- if (!document)
- doc->setUndoRedoEnabled(false);
-
- //Saving the index save some time.
- static int contentsChangedIndex = QTextDocument::staticMetaObject.indexOfSignal("contentsChanged()");
- static int textChangedIndex = QTextControl::staticMetaObject.indexOfSignal("textChanged()");
- // avoid multiple textChanged() signals being emitted
- QMetaObject::disconnect(doc, contentsChangedIndex, q, textChangedIndex);
-
- if (!text.isEmpty()) {
- // clear 'our' cursor for insertion to prevent
- // the emission of the cursorPositionChanged() signal.
- // instead we emit it only once at the end instead of
- // at the end of the document after loading and when
- // positioning the cursor again to the start of the
- // document.
- cursor = QTextCursor();
- if (format == Qt::PlainText) {
- QTextCursor formatCursor(doc);
- // put the setPlainText and the setCharFormat into one edit block,
- // so that the syntax highlight triggers only /once/ for the entire
- // document, not twice.
- formatCursor.beginEditBlock();
- doc->setPlainText(text);
- doc->setUndoRedoEnabled(false);
- formatCursor.select(QTextCursor::Document);
- formatCursor.setCharFormat(charFormatForInsertion);
- formatCursor.endEditBlock();
- } else {
-#ifndef QT_NO_TEXTHTMLPARSER
- doc->setHtml(text);
-#else
- doc->setPlainText(text);
-#endif
- doc->setUndoRedoEnabled(false);
- }
- cursor = QTextCursor(doc);
- } else if (clearDocument) {
- doc->clear();
- }
- cursor.setCharFormat(charFormatForInsertion);
-
- QMetaObject::connect(doc, contentsChangedIndex, q, textChangedIndex);
- emit q->textChanged();
- if (!document)
- doc->setUndoRedoEnabled(previousUndoRedoState);
- _q_updateCurrentCharFormatAndSelection();
- if (!document)
- doc->setModified(false);
-
- q->ensureCursorVisible();
- emit q->cursorPositionChanged();
-}
-
-void QTextControlPrivate::startDrag()
-{
-#ifndef QT_NO_DRAGANDDROP
- Q_Q(QTextControl);
- mousePressed = false;
- if (!contextObject)
- return;
- QMimeData *data = q->createMimeDataFromSelection();
-
- QDrag *drag = new QDrag(contextObject);
- drag->setMimeData(data);
-
- Qt::DropActions actions = Qt::CopyAction;
- Qt::DropAction action;
- if (interactionFlags & Qt::TextEditable) {
- actions |= Qt::MoveAction;
- action = drag->exec(actions, Qt::MoveAction);
- } else {
- action = drag->exec(actions, Qt::CopyAction);
- }
-
- if (action == Qt::MoveAction && drag->target() != contextObject)
- cursor.removeSelectedText();
-#endif
-}
-
-void QTextControlPrivate::setCursorPosition(const QPointF &pos)
-{
- Q_Q(QTextControl);
- const int cursorPos = q->hitTest(pos, Qt::FuzzyHit);
- if (cursorPos == -1)
- return;
- cursor.setPosition(cursorPos);
-}
-
-void QTextControlPrivate::setCursorPosition(int pos, QTextCursor::MoveMode mode)
-{
- cursor.setPosition(pos, mode);
-
- if (mode != QTextCursor::KeepAnchor) {
- selectedWordOnDoubleClick = QTextCursor();
- selectedBlockOnTrippleClick = QTextCursor();
- }
-}
-
-void QTextControlPrivate::repaintCursor()
-{
- Q_Q(QTextControl);
- emit q->updateCursorRequest(cursorRectPlusUnicodeDirectionMarkers(cursor));
-}
-
-void QTextControlPrivate::repaintOldAndNewSelection(const QTextCursor &oldSelection)
-{
- Q_Q(QTextControl);
- if (cursor.hasSelection()
- && oldSelection.hasSelection()
- && cursor.currentFrame() == oldSelection.currentFrame()
- && !cursor.hasComplexSelection()
- && !oldSelection.hasComplexSelection()
- && cursor.anchor() == oldSelection.anchor()
- ) {
- QTextCursor differenceSelection(doc);
- differenceSelection.setPosition(oldSelection.position());
- differenceSelection.setPosition(cursor.position(), QTextCursor::KeepAnchor);
- emit q->updateRequest(q->selectionRect(differenceSelection));
- } else {
- if (!oldSelection.hasSelection() && !cursor.hasSelection()) {
- if (!oldSelection.isNull())
- emit q->updateCursorRequest(q->selectionRect(oldSelection) | cursorRectPlusUnicodeDirectionMarkers(oldSelection));
- emit q->updateCursorRequest(q->selectionRect() | cursorRectPlusUnicodeDirectionMarkers(cursor));
-
- } else {
- if (!oldSelection.isNull())
- emit q->updateRequest(q->selectionRect(oldSelection) | cursorRectPlusUnicodeDirectionMarkers(oldSelection));
- emit q->updateRequest(q->selectionRect() | cursorRectPlusUnicodeDirectionMarkers(cursor));
- }
- }
-}
-
-void QTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=false*/)
-{
- Q_Q(QTextControl);
- if (forceEmitSelectionChanged)
- emit q->selectionChanged();
-
- bool current = cursor.hasSelection();
- if (current == lastSelectionState)
- return;
-
- lastSelectionState = current;
- emit q->copyAvailable(current);
- if (!forceEmitSelectionChanged)
- emit q->selectionChanged();
- emit q->microFocusChanged();
-}
-
-void QTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
-{
- updateCurrentCharFormat();
- selectionChanged();
-}
-
-#ifndef QT_NO_CLIPBOARD
-void QTextControlPrivate::setClipboardSelection()
-{
- QClipboard *clipboard = QGuiApplication::clipboard();
- if (!cursor.hasSelection() || !clipboard->supportsSelection())
- return;
- Q_Q(QTextControl);
- QMimeData *data = q->createMimeDataFromSelection();
- clipboard->setMimeData(data, QClipboard::Selection);
-}
-#endif
-
-void QTextControlPrivate::_q_emitCursorPosChanged(const QTextCursor &someCursor)
-{
- Q_Q(QTextControl);
- if (someCursor.isCopyOf(cursor)) {
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- }
-}
-
-void QTextControlPrivate::_q_documentLayoutChanged()
-{
- Q_Q(QTextControl);
- QAbstractTextDocumentLayout *layout = doc->documentLayout();
- QObject::connect(layout, SIGNAL(update(QRectF)), q, SIGNAL(updateRequest(QRectF)));
- QObject::connect(layout, SIGNAL(updateBlock(QTextBlock)), q, SLOT(_q_updateBlock(QTextBlock)));
- QObject::connect(layout, SIGNAL(documentSizeChanged(QSizeF)), q, SIGNAL(documentSizeChanged(QSizeF)));
-
-}
-
-void QTextControlPrivate::setBlinkingCursorEnabled(bool enable)
-{
- Q_Q(QTextControl);
-
- if (enable && qApp->styleHints()->cursorFlashTime() > 0)
- cursorBlinkTimer.start(qApp->styleHints()->cursorFlashTime() / 2, q);
- else
- cursorBlinkTimer.stop();
-
- cursorOn = enable;
-
- repaintCursor();
-}
-
-void QTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, qreal mouseXPosition)
-{
- Q_Q(QTextControl);
-
- // if inside the initial selected word keep that
- if (suggestedNewPosition >= selectedWordOnDoubleClick.selectionStart()
- && suggestedNewPosition <= selectedWordOnDoubleClick.selectionEnd()) {
- q->setTextCursor(selectedWordOnDoubleClick);
- return;
- }
-
- QTextCursor curs = selectedWordOnDoubleClick;
- curs.setPosition(suggestedNewPosition, QTextCursor::KeepAnchor);
-
- if (!curs.movePosition(QTextCursor::StartOfWord))
- return;
- const int wordStartPos = curs.position();
-
- const int blockPos = curs.block().position();
- const QPointF blockCoordinates = q->blockBoundingRect(curs.block()).topLeft();
-
- QTextLine line = currentTextLine(curs);
- if (!line.isValid())
- return;
-
- const qreal wordStartX = line.cursorToX(curs.position() - blockPos) + blockCoordinates.x();
-
- if (!curs.movePosition(QTextCursor::EndOfWord))
- return;
- const int wordEndPos = curs.position();
-
- const QTextLine otherLine = currentTextLine(curs);
- if (otherLine.textStart() != line.textStart()
- || wordEndPos == wordStartPos)
- return;
-
- const qreal wordEndX = line.cursorToX(curs.position() - blockPos) + blockCoordinates.x();
-
- if (!wordSelectionEnabled && (mouseXPosition < wordStartX || mouseXPosition > wordEndX))
- return;
-
- if (wordSelectionEnabled) {
- if (suggestedNewPosition < selectedWordOnDoubleClick.position()) {
- cursor.setPosition(selectedWordOnDoubleClick.selectionEnd());
- setCursorPosition(wordStartPos, QTextCursor::KeepAnchor);
- } else {
- cursor.setPosition(selectedWordOnDoubleClick.selectionStart());
- setCursorPosition(wordEndPos, QTextCursor::KeepAnchor);
- }
- } else {
- // keep the already selected word even when moving to the left
- // (#39164)
- if (suggestedNewPosition < selectedWordOnDoubleClick.position())
- cursor.setPosition(selectedWordOnDoubleClick.selectionEnd());
- else
- cursor.setPosition(selectedWordOnDoubleClick.selectionStart());
-
- const qreal differenceToStart = mouseXPosition - wordStartX;
- const qreal differenceToEnd = wordEndX - mouseXPosition;
-
- if (differenceToStart < differenceToEnd)
- setCursorPosition(wordStartPos, QTextCursor::KeepAnchor);
- else
- setCursorPosition(wordEndPos, QTextCursor::KeepAnchor);
- }
-
- if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
- setClipboardSelection();
-#endif
- selectionChanged(true);
- }
-}
-
-void QTextControlPrivate::extendBlockwiseSelection(int suggestedNewPosition)
-{
- Q_Q(QTextControl);
-
- // if inside the initial selected line keep that
- if (suggestedNewPosition >= selectedBlockOnTrippleClick.selectionStart()
- && suggestedNewPosition <= selectedBlockOnTrippleClick.selectionEnd()) {
- q->setTextCursor(selectedBlockOnTrippleClick);
- return;
- }
-
- if (suggestedNewPosition < selectedBlockOnTrippleClick.position()) {
- cursor.setPosition(selectedBlockOnTrippleClick.selectionEnd());
- cursor.setPosition(suggestedNewPosition, QTextCursor::KeepAnchor);
- cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
- } else {
- cursor.setPosition(selectedBlockOnTrippleClick.selectionStart());
- cursor.setPosition(suggestedNewPosition, QTextCursor::KeepAnchor);
- cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
- cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
- }
-
- if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
- setClipboardSelection();
-#endif
- selectionChanged(true);
- }
-}
-
-void QTextControlPrivate::_q_deleteSelected()
-{
- if (!(interactionFlags & Qt::TextEditable) || !cursor.hasSelection())
- return;
- cursor.removeSelectedText();
-}
-
-void QTextControl::undo()
-{
- Q_D(QTextControl);
- d->repaintSelection();
- const int oldCursorPos = d->cursor.position();
- d->doc->undo(&d->cursor);
- if (d->cursor.position() != oldCursorPos)
- emit cursorPositionChanged();
- emit microFocusChanged();
- ensureCursorVisible();
-}
-
-void QTextControl::redo()
-{
- Q_D(QTextControl);
- d->repaintSelection();
- const int oldCursorPos = d->cursor.position();
- d->doc->redo(&d->cursor);
- if (d->cursor.position() != oldCursorPos)
- emit cursorPositionChanged();
- emit microFocusChanged();
- ensureCursorVisible();
-}
-
-QTextControl::QTextControl(QObject *parent)
- : QObject(*new QTextControlPrivate, parent)
-{
- Q_D(QTextControl);
- d->init();
-}
-
-QTextControl::QTextControl(const QString &text, QObject *parent)
- : QObject(*new QTextControlPrivate, parent)
-{
- Q_D(QTextControl);
- d->init(Qt::RichText, text);
-}
-
-QTextControl::QTextControl(QTextDocument *doc, QObject *parent)
- : QObject(*new QTextControlPrivate, parent)
-{
- Q_D(QTextControl);
- d->init(Qt::RichText, QString(), doc);
-}
-
-QTextControl::~QTextControl()
-{
-}
-
-void QTextControl::setView(QObject *view)
-{
- Q_D(QTextControl);
- d->contextObject = view;
-}
-
-QObject *QTextControl::view() const
-{
- Q_D(const QTextControl);
- return d->contextObject;
-}
-
-void QTextControl::setDocument(QTextDocument *document)
-{
- Q_D(QTextControl);
- if (d->doc == document)
- return;
-
- d->doc->disconnect(this);
- d->doc->documentLayout()->disconnect(this);
- d->doc->documentLayout()->setPaintDevice(0);
-
- if (d->doc->parent() == this)
- delete d->doc;
-
- d->doc = 0;
- d->setContent(Qt::RichText, QString(), document);
-}
-
-QTextDocument *QTextControl::document() const
-{
- Q_D(const QTextControl);
- return d->doc;
-}
-
-void QTextControl::setTextCursor(const QTextCursor &cursor)
-{
- Q_D(QTextControl);
- d->cursorIsFocusIndicator = false;
- const bool posChanged = cursor.position() != d->cursor.position();
- const QTextCursor oldSelection = d->cursor;
- d->cursor = cursor;
- d->cursorOn = d->hasFocus && (d->interactionFlags & Qt::TextEditable);
- d->_q_updateCurrentCharFormatAndSelection();
- ensureCursorVisible();
- d->repaintOldAndNewSelection(oldSelection);
- if (posChanged)
- emit cursorPositionChanged();
-}
-
-QTextCursor QTextControl::textCursor() const
-{
- Q_D(const QTextControl);
- return d->cursor;
-}
-
-#ifndef QT_NO_CLIPBOARD
-
-void QTextControl::cut()
-{
- Q_D(QTextControl);
- if (!(d->interactionFlags & Qt::TextEditable) || !d->cursor.hasSelection())
- return;
- copy();
- d->cursor.removeSelectedText();
-}
-
-void QTextControl::copy()
-{
- Q_D(QTextControl);
- if (!d->cursor.hasSelection())
- return;
- QMimeData *data = createMimeDataFromSelection();
- QGuiApplication::clipboard()->setMimeData(data);
-}
-
-void QTextControl::paste(QClipboard::Mode mode)
-{
- const QMimeData *md = QGuiApplication::clipboard()->mimeData(mode);
- if (md)
- insertFromMimeData(md);
-}
-#endif
-
-void QTextControl::clear()
-{
- Q_D(QTextControl);
- // clears and sets empty content
- d->extraSelections.clear();
- d->setContent();
-}
-
-
-void QTextControl::selectAll()
-{
- Q_D(QTextControl);
- const int selectionLength = qAbs(d->cursor.position() - d->cursor.anchor());
- d->cursor.select(QTextCursor::Document);
- d->selectionChanged(selectionLength != qAbs(d->cursor.position() - d->cursor.anchor()));
- d->cursorIsFocusIndicator = false;
- emit updateRequest();
-}
-
-void QTextControl::processEvent(QEvent *e, const QPointF &coordinateOffset)
-{
- QMatrix m;
- m.translate(coordinateOffset.x(), coordinateOffset.y());
- processEvent(e, m);
-}
-
-void QTextControl::processEvent(QEvent *e, const QMatrix &matrix)
-{
- Q_D(QTextControl);
- if (d->interactionFlags == Qt::NoTextInteraction) {
- e->ignore();
- return;
- }
-
- switch (e->type()) {
- case QEvent::KeyPress:
- d->keyPressEvent(static_cast<QKeyEvent *>(e));
- break;
- case QEvent::MouseButtonPress: {
- QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mousePressEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
- ev->buttons(), ev->globalPos());
- break; }
- case QEvent::MouseMove: {
- QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseMoveEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
- ev->buttons(), ev->globalPos());
- break; }
- case QEvent::MouseButtonRelease: {
- QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseReleaseEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
- ev->buttons(), ev->globalPos());
- break; }
- case QEvent::MouseButtonDblClick: {
- QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseDoubleClickEvent(ev, ev->button(), matrix.map(ev->pos()), ev->modifiers(),
- ev->buttons(), ev->globalPos());
- break; }
- case QEvent::InputMethod:
- d->inputMethodEvent(static_cast<QInputMethodEvent *>(e));
- break;
- case QEvent::FocusIn:
- case QEvent::FocusOut:
- d->focusEvent(static_cast<QFocusEvent *>(e));
- break;
-
- case QEvent::EnabledChange:
- d->isEnabled = e->isAccepted();
- break;
-
-#ifndef QT_NO_DRAGANDDROP
- case QEvent::DragEnter: {
- QDragEnterEvent *ev = static_cast<QDragEnterEvent *>(e);
- if (d->dragEnterEvent(e, ev->mimeData()))
- ev->acceptProposedAction();
- break;
- }
- case QEvent::DragLeave:
- d->dragLeaveEvent();
- break;
- case QEvent::DragMove: {
- QDragMoveEvent *ev = static_cast<QDragMoveEvent *>(e);
- if (d->dragMoveEvent(e, ev->mimeData(), matrix.map(ev->pos())))
- ev->acceptProposedAction();
- break;
- }
- case QEvent::Drop: {
- QDropEvent *ev = static_cast<QDropEvent *>(e);
- if (d->dropEvent(ev->mimeData(), matrix.map(ev->pos()), ev->dropAction(), ev->source()))
- ev->acceptProposedAction();
- break;
- }
-#endif
-
-#ifdef QT_KEYPAD_NAVIGATION
- case QEvent::EnterEditFocus:
- case QEvent::LeaveEditFocus:
- if (QGuiApplication::keypadNavigationEnabled())
- d->editFocusEvent(e);
- break;
-#endif
- case QEvent::ShortcutOverride:
- if (d->interactionFlags & Qt::TextEditable) {
- QKeyEvent* ke = static_cast<QKeyEvent *>(e);
- if (ke->modifiers() == Qt::NoModifier
- || ke->modifiers() == Qt::ShiftModifier
- || ke->modifiers() == Qt::KeypadModifier) {
- if (ke->key() < Qt::Key_Escape) {
- ke->accept();
- } else {
- switch (ke->key()) {
- case Qt::Key_Return:
- case Qt::Key_Enter:
- case Qt::Key_Delete:
- case Qt::Key_Home:
- case Qt::Key_End:
- case Qt::Key_Backspace:
- case Qt::Key_Left:
- case Qt::Key_Right:
- case Qt::Key_Up:
- case Qt::Key_Down:
- case Qt::Key_Tab:
- ke->accept();
- default:
- break;
- }
- }
-#ifndef QT_NO_SHORTCUT
- } else if (ke == QKeySequence::Copy
- || ke == QKeySequence::Paste
- || ke == QKeySequence::Cut
- || ke == QKeySequence::Redo
- || ke == QKeySequence::Undo
- || ke == QKeySequence::MoveToNextWord
- || ke == QKeySequence::MoveToPreviousWord
- || ke == QKeySequence::MoveToStartOfDocument
- || ke == QKeySequence::MoveToEndOfDocument
- || ke == QKeySequence::SelectNextWord
- || ke == QKeySequence::SelectPreviousWord
- || ke == QKeySequence::SelectStartOfLine
- || ke == QKeySequence::SelectEndOfLine
- || ke == QKeySequence::SelectStartOfBlock
- || ke == QKeySequence::SelectEndOfBlock
- || ke == QKeySequence::SelectStartOfDocument
- || ke == QKeySequence::SelectEndOfDocument
- || ke == QKeySequence::SelectAll
- ) {
- ke->accept();
-#endif
- }
- }
- break;
- default:
- break;
- }
-}
-
-bool QTextControl::event(QEvent *e)
-{
- return QObject::event(e);
-}
-
-void QTextControl::timerEvent(QTimerEvent *e)
-{
- Q_D(QTextControl);
- if (e->timerId() == d->cursorBlinkTimer.timerId()) {
- d->cursorOn = !d->cursorOn;
-
- // ###
-// if (d->cursor.hasSelection())
-// d->cursorOn &= (QGuiApplication::style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected)
-// != 0);
-
- d->repaintCursor();
- } else if (e->timerId() == d->trippleClickTimer.timerId()) {
- d->trippleClickTimer.stop();
- }
-}
-
-void QTextControl::setPlainText(const QString &text)
-{
- Q_D(QTextControl);
- d->setContent(Qt::PlainText, text);
-}
-
-void QTextControl::setHtml(const QString &text)
-{
- Q_D(QTextControl);
- d->setContent(Qt::RichText, text);
-}
-
-void QTextControlPrivate::keyPressEvent(QKeyEvent *e)
-{
- Q_Q(QTextControl);
-#ifndef QT_NO_SHORTCUT
- if (e == QKeySequence::SelectAll) {
- e->accept();
- q->selectAll();
- return;
- }
-#ifndef QT_NO_CLIPBOARD
- else if (e == QKeySequence::Copy) {
- e->accept();
- q->copy();
- return;
- }
-#endif
-#endif // QT_NO_SHORTCUT
-
- if (interactionFlags & Qt::TextSelectableByKeyboard
- && cursorMoveKeyEvent(e))
- goto accept;
-
- if (interactionFlags & Qt::LinksAccessibleByKeyboard) {
- if ((e->key() == Qt::Key_Return
- || e->key() == Qt::Key_Enter
-#ifdef QT_KEYPAD_NAVIGATION
- || e->key() == Qt::Key_Select
-#endif
- )
- && cursor.hasSelection()) {
-
- e->accept();
- activateLinkUnderCursor();
- return;
- }
- }
-
- if (!(interactionFlags & Qt::TextEditable)) {
- e->ignore();
- return;
- }
-
- if (e->key() == Qt::Key_Direction_L || e->key() == Qt::Key_Direction_R) {
- QTextBlockFormat fmt;
- fmt.setLayoutDirection((e->key() == Qt::Key_Direction_L) ? Qt::LeftToRight : Qt::RightToLeft);
- cursor.mergeBlockFormat(fmt);
- goto accept;
- }
-
- // schedule a repaint of the region of the cursor, as when we move it we
- // want to make sure the old cursor disappears (not noticeable when moving
- // only a few pixels but noticeable when jumping between cells in tables for
- // example)
- repaintSelection();
-
- if (e->key() == Qt::Key_Backspace && !(e->modifiers() & ~Qt::ShiftModifier)) {
- QTextBlockFormat blockFmt = cursor.blockFormat();
- QTextList *list = cursor.currentList();
- if (list && cursor.atBlockStart() && !cursor.hasSelection()) {
- list->remove(cursor.block());
- } else if (cursor.atBlockStart() && blockFmt.indent() > 0) {
- blockFmt.setIndent(blockFmt.indent() - 1);
- cursor.setBlockFormat(blockFmt);
- } else {
- QTextCursor localCursor = cursor;
- localCursor.deletePreviousChar();
- }
- goto accept;
- }
-#ifndef QT_NO_SHORTCUT
- else if (e == QKeySequence::InsertParagraphSeparator) {
- cursor.insertBlock();
- e->accept();
- goto accept;
- } else if (e == QKeySequence::InsertLineSeparator) {
- cursor.insertText(QString(QChar::LineSeparator));
- e->accept();
- goto accept;
- }
-#endif
- if (false) {
- }
-#ifndef QT_NO_SHORTCUT
- else if (e == QKeySequence::Undo) {
- q->undo();
- }
- else if (e == QKeySequence::Redo) {
- q->redo();
- }
-#ifndef QT_NO_CLIPBOARD
- else if (e == QKeySequence::Cut) {
- q->cut();
- }
- else if (e == QKeySequence::Paste) {
- QClipboard::Mode mode = QClipboard::Clipboard;
- q->paste(mode);
- }
-#endif
- else if (e == QKeySequence::Delete) {
- QTextCursor localCursor = cursor;
- localCursor.deleteChar();
- }
- else if (e == QKeySequence::DeleteEndOfWord) {
- if (!cursor.hasSelection())
- cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor);
- cursor.removeSelectedText();
- }
- else if (e == QKeySequence::DeleteStartOfWord) {
- if (!cursor.hasSelection())
- cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor);
- cursor.removeSelectedText();
- }
- else if (e == QKeySequence::DeleteEndOfLine) {
- QTextBlock block = cursor.block();
- if (cursor.position() == block.position() + block.length() - 2)
- cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
- else
- cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
- cursor.removeSelectedText();
- }
-#endif // QT_NO_SHORTCUT
- else {
- goto process;
- }
- goto accept;
-
-process:
- {
- QString text = e->text();
- if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
- if (overwriteMode
- // no need to call deleteChar() if we have a selection, insertText
- // does it already
- && !cursor.hasSelection()
- && !cursor.atBlockEnd())
- cursor.deleteChar();
-
- cursor.insertText(text);
- selectionChanged();
- } else {
- e->ignore();
- return;
- }
- }
-
- accept:
-
- e->accept();
- cursorOn = true;
-
- q->ensureCursorVisible();
-
- updateCurrentCharFormat();
-}
-
-QVariant QTextControl::loadResource(int type, const QUrl &name)
-{
-#if 1
- Q_UNUSED(type);
- Q_UNUSED(name);
-#else
- if (QTextEdit *textEdit = qobject_cast<QTextEdit *>(parent())) {
- QUrl resolvedName = textEdit->d_func()->resolveUrl(name);
- return textEdit->loadResource(type, resolvedName);
- }
-#endif
- return QVariant();
-}
-
-void QTextControlPrivate::_q_updateBlock(const QTextBlock &block)
-{
- Q_Q(QTextControl);
- QRectF br = q->blockBoundingRect(block);
- br.setRight(qreal(INT_MAX)); // the block might have shrunk
- emit q->updateRequest(br);
-}
-
-QRectF QTextControlPrivate::rectForPosition(int position) const
-{
- Q_Q(const QTextControl);
- const QTextBlock block = doc->findBlock(position);
- if (!block.isValid())
- return QRectF();
- const QAbstractTextDocumentLayout *docLayout = doc->documentLayout();
- const QTextLayout *layout = block.layout();
- const QPointF layoutPos = q->blockBoundingRect(block).topLeft();
- int relativePos = position - block.position();
- if (preeditCursor != 0) {
- int preeditPos = layout->preeditAreaPosition();
- if (relativePos == preeditPos)
- relativePos += preeditCursor;
- else if (relativePos > preeditPos)
- relativePos += layout->preeditAreaText().length();
- }
- QTextLine line = layout->lineForTextPosition(relativePos);
-
- int cursorWidth;
- {
- bool ok = false;
-#ifndef QT_NO_PROPERTIES
- cursorWidth = docLayout->property("cursorWidth").toInt(&ok);
-#endif
- if (!ok)
- cursorWidth = 1;
- }
-
- QRectF r;
-
- if (line.isValid()) {
- qreal x = line.cursorToX(relativePos);
- qreal w = 0;
- if (overwriteMode) {
- if (relativePos < line.textLength() - line.textStart())
- w = line.cursorToX(relativePos + 1) - x;
- else
- w = QFontMetrics(block.layout()->font()).width(QLatin1Char(' ')); // in sync with QTextLine::draw()
- }
- r = QRectF(layoutPos.x() + x, layoutPos.y() + line.y(),
- cursorWidth + w, line.height());
- } else {
- r = QRectF(layoutPos.x(), layoutPos.y(), cursorWidth, 10); // #### correct height
- }
-
- return r;
-}
-
-static inline bool firstFramePosLessThanCursorPos(QTextFrame *frame, int position)
-{
- return frame->firstPosition() < position;
-}
-
-static inline bool cursorPosLessThanLastFramePos(int position, QTextFrame *frame)
-{
- return position < frame->lastPosition();
-}
-
-static QRectF boundingRectOfFloatsInSelection(const QTextCursor &cursor)
-{
- QRectF r;
- QTextFrame *frame = cursor.currentFrame();
- const QList<QTextFrame *> children = frame->childFrames();
-
- const QList<QTextFrame *>::ConstIterator firstFrame = qLowerBound(children.constBegin(), children.constEnd(),
- cursor.selectionStart(), firstFramePosLessThanCursorPos);
- const QList<QTextFrame *>::ConstIterator lastFrame = qUpperBound(children.constBegin(), children.constEnd(),
- cursor.selectionEnd(), cursorPosLessThanLastFramePos);
- for (QList<QTextFrame *>::ConstIterator it = firstFrame; it != lastFrame; ++it) {
- if ((*it)->frameFormat().position() != QTextFrameFormat::InFlow)
- r |= frame->document()->documentLayout()->frameBoundingRect(*it);
- }
- return r;
-}
-
-QRectF QTextControl::selectionRect(const QTextCursor &cursor) const
-{
- Q_D(const QTextControl);
-
- QRectF r = d->rectForPosition(cursor.selectionStart());
-
- if (cursor.hasComplexSelection() && cursor.currentTable()) {
- QTextTable *table = cursor.currentTable();
-
- r = d->doc->documentLayout()->frameBoundingRect(table);
- /*
- int firstRow, numRows, firstColumn, numColumns;
- cursor.selectedTableCells(&firstRow, &numRows, &firstColumn, &numColumns);
-
- const QTextTableCell firstCell = table->cellAt(firstRow, firstColumn);
- const QTextTableCell lastCell = table->cellAt(firstRow + numRows - 1, firstColumn + numColumns - 1);
-
- const QAbstractTextDocumentLayout * const layout = doc->documentLayout();
-
- QRectF tableSelRect = layout->blockBoundingRect(firstCell.firstCursorPosition().block());
-
- for (int col = firstColumn; col < firstColumn + numColumns; ++col) {
- const QTextTableCell cell = table->cellAt(firstRow, col);
- const qreal y = layout->blockBoundingRect(cell.firstCursorPosition().block()).top();
-
- tableSelRect.setTop(qMin(tableSelRect.top(), y));
- }
-
- for (int row = firstRow; row < firstRow + numRows; ++row) {
- const QTextTableCell cell = table->cellAt(row, firstColumn);
- const qreal x = layout->blockBoundingRect(cell.firstCursorPosition().block()).left();
-
- tableSelRect.setLeft(qMin(tableSelRect.left(), x));
- }
-
- for (int col = firstColumn; col < firstColumn + numColumns; ++col) {
- const QTextTableCell cell = table->cellAt(firstRow + numRows - 1, col);
- const qreal y = layout->blockBoundingRect(cell.lastCursorPosition().block()).bottom();
-
- tableSelRect.setBottom(qMax(tableSelRect.bottom(), y));
- }
-
- for (int row = firstRow; row < firstRow + numRows; ++row) {
- const QTextTableCell cell = table->cellAt(row, firstColumn + numColumns - 1);
- const qreal x = layout->blockBoundingRect(cell.lastCursorPosition().block()).right();
-
- tableSelRect.setRight(qMax(tableSelRect.right(), x));
- }
-
- r = tableSelRect.toRect();
- */
- } else if (cursor.hasSelection()) {
- const int position = cursor.selectionStart();
- const int anchor = cursor.selectionEnd();
- const QTextBlock posBlock = d->doc->findBlock(position);
- const QTextBlock anchorBlock = d->doc->findBlock(anchor);
- if (posBlock == anchorBlock && posBlock.isValid() && posBlock.layout()->lineCount()) {
- const QTextLine posLine = posBlock.layout()->lineForTextPosition(position - posBlock.position());
- const QTextLine anchorLine = anchorBlock.layout()->lineForTextPosition(anchor - anchorBlock.position());
-
- const int firstLine = qMin(posLine.lineNumber(), anchorLine.lineNumber());
- const int lastLine = qMax(posLine.lineNumber(), anchorLine.lineNumber());
- const QTextLayout *layout = posBlock.layout();
- r = QRectF();
- for (int i = firstLine; i <= lastLine; ++i) {
- r |= layout->lineAt(i).rect();
- r |= layout->lineAt(i).naturalTextRect(); // might be bigger in the case of wrap not enabled
- }
- r.translate(blockBoundingRect(posBlock).topLeft());
- } else {
- QRectF anchorRect = d->rectForPosition(cursor.selectionEnd());
- r |= anchorRect;
- r |= boundingRectOfFloatsInSelection(cursor);
- QRectF frameRect(d->doc->documentLayout()->frameBoundingRect(cursor.currentFrame()));
- r.setLeft(frameRect.left());
- r.setRight(frameRect.right());
- }
- if (r.isValid())
- r.adjust(-1, -1, 1, 1);
- }
-
- return r;
-}
-
-QRectF QTextControl::selectionRect() const
-{
- Q_D(const QTextControl);
- return selectionRect(d->cursor);
-}
-
-void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons, const QPoint &globalPos)
-{
- Q_Q(QTextControl);
-
- if (sendMouseEventToInputContext(
- e, QEvent::MouseButtonPress, button, pos, modifiers, buttons, globalPos)) {
- return;
- }
-
- if (interactionFlags & Qt::LinksAccessibleByMouse) {
- anchorOnMousePress = q->anchorAt(pos);
-
- if (cursorIsFocusIndicator) {
- cursorIsFocusIndicator = false;
- repaintSelection();
- cursor.clearSelection();
- }
- }
- if (!(button & Qt::LeftButton) ||
- !((interactionFlags & Qt::TextSelectableByMouse) || (interactionFlags & Qt::TextEditable))) {
- e->ignore();
- return;
- }
-
- cursorIsFocusIndicator = false;
- const QTextCursor oldSelection = cursor;
- const int oldCursorPos = cursor.position();
-
- mousePressed = (interactionFlags & Qt::TextSelectableByMouse);
-#ifndef QT_NO_DRAGANDDROP
- mightStartDrag = false;
-#endif
-
- if (trippleClickTimer.isActive()
- && ((pos - trippleClickPoint).toPoint().manhattanLength() < qApp->styleHints()->startDragDistance())) {
-
- cursor.movePosition(QTextCursor::StartOfBlock);
- cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
- cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor);
- selectedBlockOnTrippleClick = cursor;
-
- anchorOnMousePress = QString();
-
- trippleClickTimer.stop();
- } else {
- int cursorPos = q->hitTest(pos, Qt::FuzzyHit);
- if (cursorPos == -1) {
- e->ignore();
- return;
- }
-
- if (modifiers == Qt::ShiftModifier && (interactionFlags & Qt::TextSelectableByMouse)) {
- if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) {
- selectedWordOnDoubleClick = cursor;
- selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor);
- }
-
- if (selectedBlockOnTrippleClick.hasSelection())
- extendBlockwiseSelection(cursorPos);
- else if (selectedWordOnDoubleClick.hasSelection())
- extendWordwiseSelection(cursorPos, pos.x());
- else if (!wordSelectionEnabled)
- setCursorPosition(cursorPos, QTextCursor::KeepAnchor);
- } else {
-
- if (dragEnabled
- && cursor.hasSelection()
- && !cursorIsFocusIndicator
- && cursorPos >= cursor.selectionStart()
- && cursorPos <= cursor.selectionEnd()
- && q->hitTest(pos, Qt::ExactHit) != -1) {
-#ifndef QT_NO_DRAGANDDROP
- mightStartDrag = true;
- dragStartPos = pos.toPoint();
-#endif
- return;
- }
-
- setCursorPosition(cursorPos);
- }
- }
-
- if (interactionFlags & Qt::TextEditable) {
- q->ensureCursorVisible();
- if (cursor.position() != oldCursorPos)
- emit q->cursorPositionChanged();
- _q_updateCurrentCharFormatAndSelection();
- } else {
- if (cursor.position() != oldCursorPos) {
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- }
- selectionChanged();
- }
- repaintOldAndNewSelection(oldSelection);
- hadSelectionOnMousePress = cursor.hasSelection();
-}
-
-void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, const QPointF &mousePos, Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons, const QPoint &globalPos)
-{
- Q_Q(QTextControl);
-
- if (sendMouseEventToInputContext(
- e, QEvent::MouseMove, button, mousePos, modifiers, buttons, globalPos)) {
- return;
- }
-
- if (interactionFlags & Qt::LinksAccessibleByMouse) {
- QString anchor = q->anchorAt(mousePos);
- if (anchor != highlightedAnchor) {
- highlightedAnchor = anchor;
- emit q->linkHovered(anchor);
- }
- }
-
- if (!(buttons & Qt::LeftButton))
- return;
-
- const bool editable = interactionFlags & Qt::TextEditable;
-
- if (!(mousePressed
- || editable
- || mightStartDrag
- || selectedWordOnDoubleClick.hasSelection()
- || selectedBlockOnTrippleClick.hasSelection()))
- return;
-
- const QTextCursor oldSelection = cursor;
- const int oldCursorPos = cursor.position();
-
- if (mightStartDrag) {
- if ((mousePos.toPoint() - dragStartPos).manhattanLength() > qApp->styleHints()->startDragDistance())
- startDrag();
- return;
- }
-
- if (!mousePressed)
- return;
-
- const qreal mouseX = qreal(mousePos.x());
-
- int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit);
- if (newCursorPos == -1)
- return;
-
- if (wordSelectionEnabled && !selectedWordOnDoubleClick.hasSelection()) {
- selectedWordOnDoubleClick = cursor;
- selectedWordOnDoubleClick.select(QTextCursor::WordUnderCursor);
- }
-
- if (selectedBlockOnTrippleClick.hasSelection())
- extendBlockwiseSelection(newCursorPos);
- else if (selectedWordOnDoubleClick.hasSelection())
- extendWordwiseSelection(newCursorPos, mouseX);
- else
- setCursorPosition(newCursorPos, QTextCursor::KeepAnchor);
-
- if (interactionFlags & Qt::TextEditable) {
- // don't call ensureVisible for the visible cursor to avoid jumping
- // scrollbars. the autoscrolling ensures smooth scrolling if necessary.
- //q->ensureCursorVisible();
- if (cursor.position() != oldCursorPos)
- emit q->cursorPositionChanged();
- _q_updateCurrentCharFormatAndSelection();
- if (qGuiApp)
- qGuiApp->inputPanel()->update(Qt::ImQueryInput);
- } else {
- //emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1)));
- if (cursor.position() != oldCursorPos) {
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- }
- }
- selectionChanged(true);
- repaintOldAndNewSelection(oldSelection);
-}
-
-void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons, const QPoint &globalPos)
-{
- Q_Q(QTextControl);
-
- if (sendMouseEventToInputContext(
- e, QEvent::MouseButtonRelease, button, pos, modifiers, buttons, globalPos)) {
- return;
- }
-
- const QTextCursor oldSelection = cursor;
- const int oldCursorPos = cursor.position();
-
-#ifndef QT_NO_DRAGANDDROP
- if (mightStartDrag && (button & Qt::LeftButton)) {
- mousePressed = false;
- setCursorPosition(pos);
- cursor.clearSelection();
- selectionChanged();
- }
-#endif
- if (mousePressed) {
- mousePressed = false;
-#ifndef QT_NO_CLIPBOARD
- setClipboardSelection();
- selectionChanged(true);
- } else if (button == Qt::MidButton
- && (interactionFlags & Qt::TextEditable)
- && QGuiApplication::clipboard()->supportsSelection()) {
- setCursorPosition(pos);
- const QMimeData *md = QGuiApplication::clipboard()->mimeData(QClipboard::Selection);
- if (md)
- q->insertFromMimeData(md);
-#endif
- }
-
- repaintOldAndNewSelection(oldSelection);
-
- if (cursor.position() != oldCursorPos) {
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- }
-
- if (interactionFlags & Qt::LinksAccessibleByMouse) {
- if (!(button & Qt::LeftButton))
- return;
-
- const QString anchor = q->anchorAt(pos);
-
- if (anchor.isEmpty())
- return;
-
- if (!cursor.hasSelection()
- || (anchor == anchorOnMousePress && hadSelectionOnMousePress)) {
-
- const int anchorPos = q->hitTest(pos, Qt::ExactHit);
- if (anchorPos != -1) {
- cursor.setPosition(anchorPos);
-
- QString anchor = anchorOnMousePress;
- anchorOnMousePress = QString();
- activateLinkUnderCursor(anchor);
- }
- }
- }
-}
-
-void QTextControlPrivate::mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons, const QPoint &globalPos)
-{
- Q_Q(QTextControl);
-
- if (sendMouseEventToInputContext(
- e, QEvent::MouseButtonDblClick, button, pos, modifiers, buttons, globalPos)) {
- return;
- }
-
- if (button != Qt::LeftButton
- || !(interactionFlags & Qt::TextSelectableByMouse)) {
- e->ignore();
- return;
- }
-
-#ifndef QT_NO_DRAGANDDROP
- mightStartDrag = false;
-#endif
- const QTextCursor oldSelection = cursor;
- setCursorPosition(pos);
- QTextLine line = currentTextLine(cursor);
- bool doEmit = false;
- if (line.isValid() && line.textLength()) {
- cursor.select(QTextCursor::WordUnderCursor);
- doEmit = true;
- }
- repaintOldAndNewSelection(oldSelection);
-
- cursorIsFocusIndicator = false;
- selectedWordOnDoubleClick = cursor;
-
- trippleClickPoint = pos;
- trippleClickTimer.start(qApp->styleHints()->mouseDoubleClickInterval(), q);
- if (doEmit) {
- selectionChanged();
-#ifndef QT_NO_CLIPBOARD
- setClipboardSelection();
-#endif
- emit q->cursorPositionChanged();
- }
-}
-
-bool QTextControlPrivate::sendMouseEventToInputContext(
- QEvent *e, QEvent::Type eventType, Qt::MouseButton button, const QPointF &pos,
- Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
-{
-#if 0 // ### !defined(QT_NO_IM)
- Q_Q(QTextControl);
-
- QTextLayout *layout = cursor.block().layout();
- if (contextObject && layout && !layout->preeditAreaText().isEmpty()) {
- QInputContext *ctx = inputContext();
- int cursorPos = q->hitTest(pos, Qt::FuzzyHit) - cursor.position();
-
- if (cursorPos < 0 || cursorPos > layout->preeditAreaText().length()) {
- cursorPos = -1;
- // don't send move events outside the preedit area
- if (eventType == QEvent::MouseMove)
- return true;
- }
- if (ctx) {
- QMouseEvent ev(eventType, contextObject->mapFromGlobal(globalPos), globalPos,
- button, buttons, modifiers);
- ctx->mouseHandler(cursorPos, &ev);
- e->setAccepted(ev.isAccepted());
- }
- if (!layout->preeditAreaText().isEmpty())
- return true;
- }
-#else
- Q_UNUSED(e);
- Q_UNUSED(eventType);
- Q_UNUSED(button);
- Q_UNUSED(pos);
- Q_UNUSED(modifiers);
- Q_UNUSED(buttons);
- Q_UNUSED(globalPos);
-#endif
- return false;
-}
-
-bool QTextControlPrivate::dragEnterEvent(QEvent *e, const QMimeData *mimeData)
-{
- Q_Q(QTextControl);
- if (!(interactionFlags & Qt::TextEditable) || !q->canInsertFromMimeData(mimeData)) {
- e->ignore();
- return false;
- }
-
- dndFeedbackCursor = QTextCursor();
-
- return true; // accept proposed action
-}
-
-void QTextControlPrivate::dragLeaveEvent()
-{
- Q_Q(QTextControl);
-
- const QRectF crect = q->cursorRect(dndFeedbackCursor);
- dndFeedbackCursor = QTextCursor();
-
- if (crect.isValid())
- emit q->updateRequest(crect);
-}
-
-bool QTextControlPrivate::dragMoveEvent(QEvent *e, const QMimeData *mimeData, const QPointF &pos)
-{
- Q_Q(QTextControl);
- if (!(interactionFlags & Qt::TextEditable) || !q->canInsertFromMimeData(mimeData)) {
- e->ignore();
- return false;
- }
-
- const int cursorPos = q->hitTest(pos, Qt::FuzzyHit);
- if (cursorPos != -1) {
- QRectF crect = q->cursorRect(dndFeedbackCursor);
- if (crect.isValid())
- emit q->updateRequest(crect);
-
- dndFeedbackCursor = cursor;
- dndFeedbackCursor.setPosition(cursorPos);
-
- crect = q->cursorRect(dndFeedbackCursor);
- emit q->updateRequest(crect);
- }
-
- return true; // accept proposed action
-}
-
-bool QTextControlPrivate::dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QObject *source)
-{
- Q_Q(QTextControl);
- dndFeedbackCursor = QTextCursor();
-
- if (!(interactionFlags & Qt::TextEditable) || !q->canInsertFromMimeData(mimeData))
- return false;
-
- repaintSelection();
-
- QTextCursor insertionCursor = q->cursorForPosition(pos);
- insertionCursor.beginEditBlock();
-
- if (dropAction == Qt::MoveAction && source == contextObject)
- cursor.removeSelectedText();
-
- cursor = insertionCursor;
- q->insertFromMimeData(mimeData);
- insertionCursor.endEditBlock();
- q->ensureCursorVisible();
- return true; // accept proposed action
-}
-
-void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
-{
- Q_Q(QTextControl);
- if (!(interactionFlags & Qt::TextEditable) || cursor.isNull()) {
- e->ignore();
- return;
- }
- bool isGettingInput = !e->commitString().isEmpty()
- || e->preeditString() != cursor.block().layout()->preeditAreaText()
- || e->replacementLength() > 0;
- bool forceSelectionChanged = false;
-
- cursor.beginEditBlock();
- if (isGettingInput) {
- cursor.removeSelectedText();
- }
-
- // insert commit string
- if (!e->commitString().isEmpty() || e->replacementLength()) {
- QTextCursor c = cursor;
- c.setPosition(c.position() + e->replacementStart());
- c.setPosition(c.position() + e->replacementLength(), QTextCursor::KeepAnchor);
- c.insertText(e->commitString());
- }
-
- for (int i = 0; i < e->attributes().size(); ++i) {
- const QInputMethodEvent::Attribute &a = e->attributes().at(i);
- if (a.type == QInputMethodEvent::Selection) {
- QTextCursor oldCursor = cursor;
- int blockStart = a.start + cursor.block().position();
- cursor.setPosition(blockStart, QTextCursor::MoveAnchor);
- cursor.setPosition(blockStart + a.length, QTextCursor::KeepAnchor);
- q->ensureCursorVisible();
- repaintOldAndNewSelection(oldCursor);
- forceSelectionChanged = true;
- }
- }
-
- QTextBlock block = cursor.block();
- QTextLayout *layout = block.layout();
- if (isGettingInput)
- layout->setPreeditArea(cursor.position() - block.position(), e->preeditString());
- QList<QTextLayout::FormatRange> overrides;
- const int oldPreeditCursor = preeditCursor;
- preeditCursor = e->preeditString().length();
- hideCursor = false;
- for (int i = 0; i < e->attributes().size(); ++i) {
- const QInputMethodEvent::Attribute &a = e->attributes().at(i);
- if (a.type == QInputMethodEvent::Cursor) {
- preeditCursor = a.start;
- hideCursor = !a.length;
- } else if (a.type == QInputMethodEvent::TextFormat) {
- QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat();
- if (f.isValid()) {
- QTextLayout::FormatRange o;
- o.start = a.start + cursor.position() - block.position();
- o.length = a.length;
- o.format = f;
- overrides.append(o);
- }
- }
- }
- layout->setAdditionalFormats(overrides);
- cursor.endEditBlock();
- QTextCursorPrivate *cursor_d = QTextCursorPrivate::getPrivate(&cursor);
- if (cursor_d)
- cursor_d->setX();
- if (oldPreeditCursor != preeditCursor)
- emit q->microFocusChanged();
- selectionChanged(forceSelectionChanged);
-}
-
-QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const
-{
- Q_D(const QTextControl);
- QTextBlock block = d->cursor.block();
- switch(property) {
- case Qt::ImCursorRectangle:
- return cursorRect();
- case Qt::ImFont:
- return QVariant(d->cursor.charFormat().font());
- case Qt::ImCursorPosition:
- return QVariant(d->cursor.position() - block.position());
- case Qt::ImSurroundingText:
- return QVariant(block.text());
- case Qt::ImCurrentSelection:
- return QVariant(d->cursor.selectedText());
- case Qt::ImMaximumTextLength:
- return QVariant(); // No limit.
- case Qt::ImAnchorPosition:
- return QVariant(d->cursor.anchor() - block.position());
- default:
- return QVariant();
- }
-}
-
-void QTextControl::setFocus(bool focus, Qt::FocusReason reason)
-{
- QFocusEvent ev(focus ? QEvent::FocusIn : QEvent::FocusOut,
- reason);
- processEvent(&ev);
-}
-
-void QTextControlPrivate::focusEvent(QFocusEvent *e)
-{
- Q_Q(QTextControl);
- emit q->updateRequest(q->selectionRect());
- if (e->gotFocus()) {
-#ifdef QT_KEYPAD_NAVIGATION
- if (!QGuiApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason
- ))) {
-#endif
- setBlinkingCursorEnabled(interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard));
-#ifdef QT_KEYPAD_NAVIGATION
- }
-#endif
- } else {
- setBlinkingCursorEnabled(false);
-
- if (cursorIsFocusIndicator
- && e->reason() != Qt::ActiveWindowFocusReason
- && e->reason() != Qt::PopupFocusReason
- && cursor.hasSelection()) {
- cursor.clearSelection();
- }
- }
- hasFocus = e->gotFocus();
-}
-
-QString QTextControlPrivate::anchorForCursor(const QTextCursor &anchorCursor) const
-{
- if (anchorCursor.hasSelection()) {
- QTextCursor cursor = anchorCursor;
- if (cursor.selectionStart() != cursor.position())
- cursor.setPosition(cursor.selectionStart());
- cursor.movePosition(QTextCursor::NextCharacter);
- QTextCharFormat fmt = cursor.charFormat();
- if (fmt.isAnchor() && fmt.hasProperty(QTextFormat::AnchorHref))
- return fmt.stringProperty(QTextFormat::AnchorHref);
- }
- return QString();
-}
-
-#ifdef QT_KEYPAD_NAVIGATION
-void QTextControlPrivate::editFocusEvent(QEvent *e)
-{
- Q_Q(QTextControl);
-
- if (QGuiApplication::keypadNavigationEnabled()) {
- if (e->type() == QEvent::EnterEditFocus && interactionFlags & Qt::TextEditable) {
- const QTextCursor oldSelection = cursor;
- const int oldCursorPos = cursor.position();
- const bool moved = cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
- q->ensureCursorVisible();
- if (moved) {
- if (cursor.position() != oldCursorPos)
- emit q->cursorPositionChanged();
- emit q->microFocusChanged();
- }
- selectionChanged();
- repaintOldAndNewSelection(oldSelection);
-
- setBlinkingCursorEnabled(true);
- } else
- setBlinkingCursorEnabled(false);
- }
-
- hasEditFocus = e->type() == QEvent::EnterEditFocus ? true : false;
-}
-#endif
-
-QTextCursor QTextControl::cursorForPosition(const QPointF &pos) const
-{
- Q_D(const QTextControl);
- int cursorPos = hitTest(pos, Qt::FuzzyHit);
- if (cursorPos == -1)
- cursorPos = 0;
- QTextCursor c(d->doc);
- c.setPosition(cursorPos);
- return c;
-}
-
-QRectF QTextControl::cursorRect(const QTextCursor &cursor) const
-{
- Q_D(const QTextControl);
- if (cursor.isNull())
- return QRectF();
-
- return d->rectForPosition(cursor.position());
-}
-
-QRectF QTextControl::cursorRect() const
-{
- Q_D(const QTextControl);
- return cursorRect(d->cursor);
-}
-
-QRectF QTextControlPrivate::cursorRectPlusUnicodeDirectionMarkers(const QTextCursor &cursor) const
-{
- if (cursor.isNull())
- return QRectF();
-
- return rectForPosition(cursor.position()).adjusted(-4, 0, 4, 0);
-}
-
-QString QTextControl::anchorAt(const QPointF &pos) const
-{
- Q_D(const QTextControl);
- return d->doc->documentLayout()->anchorAt(pos);
-}
-
-QString QTextControl::anchorAtCursor() const
-{
- Q_D(const QTextControl);
-
- return d->anchorForCursor(d->cursor);
-}
-
-bool QTextControl::overwriteMode() const
-{
- Q_D(const QTextControl);
- return d->overwriteMode;
-}
-
-void QTextControl::setOverwriteMode(bool overwrite)
-{
- Q_D(QTextControl);
- d->overwriteMode = overwrite;
-}
-
-int QTextControl::cursorWidth() const
-{
-#ifndef QT_NO_PROPERTIES
- Q_D(const QTextControl);
- return d->doc->documentLayout()->property("cursorWidth").toInt();
-#else
- return 1;
-#endif
-}
-
-void QTextControl::setCursorWidth(int width)
-{
- Q_D(QTextControl);
-#ifdef QT_NO_PROPERTIES
- Q_UNUSED(width);
-#else
- if (width == -1)
- width = textCursorWidth;
- d->doc->documentLayout()->setProperty("cursorWidth", width);
-#endif
- d->repaintCursor();
-}
-
-bool QTextControl::acceptRichText() const
-{
- Q_D(const QTextControl);
- return d->acceptRichText;
-}
-
-void QTextControl::setAcceptRichText(bool accept)
-{
- Q_D(QTextControl);
- d->acceptRichText = accept;
-}
-
-void QTextControl::setExtraSelections(const QVector<QAbstractTextDocumentLayout::Selection> &selections)
-{
- Q_D(QTextControl);
-
- QHash<int, int> hash;
- for (int i = 0; i < d->extraSelections.count(); ++i) {
- const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(i);
- hash.insertMulti(esel.cursor.anchor(), i);
- }
-
- for (int i = 0; i < selections.count(); ++i) {
- const QAbstractTextDocumentLayout::Selection &sel = selections.at(i);
- QHash<int, int>::iterator it = hash.find(sel.cursor.anchor());
- if (it != hash.end()) {
- const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(it.value());
- if (esel.cursor.position() == sel.cursor.position()
- && esel.format == sel.format) {
- hash.erase(it);
- continue;
- }
- }
- QRectF r = selectionRect(sel.cursor);
- if (sel.format.boolProperty(QTextFormat::FullWidthSelection)) {
- r.setLeft(0);
- r.setWidth(qreal(INT_MAX));
- }
- emit updateRequest(r);
- }
-
- for (QHash<int, int>::iterator it = hash.begin(); it != hash.end(); ++it) {
- const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(it.value());
- QRectF r = selectionRect(esel.cursor);
- if (esel.format.boolProperty(QTextFormat::FullWidthSelection)) {
- r.setLeft(0);
- r.setWidth(qreal(INT_MAX));
- }
- emit updateRequest(r);
- }
-
- d->extraSelections = selections;
-}
-
-QVector<QAbstractTextDocumentLayout::Selection> QTextControl::extraSelections() const
-{
- Q_D(const QTextControl);
- return d->extraSelections;
-}
-
-void QTextControl::setTextWidth(qreal width)
-{
- Q_D(QTextControl);
- d->doc->setTextWidth(width);
-}
-
-qreal QTextControl::textWidth() const
-{
- Q_D(const QTextControl);
- return d->doc->textWidth();
-}
-
-QSizeF QTextControl::size() const
-{
- Q_D(const QTextControl);
- return d->doc->size();
-}
-
-void QTextControl::setOpenExternalLinks(bool open)
-{
- Q_D(QTextControl);
- d->openExternalLinks = open;
-}
-
-bool QTextControl::openExternalLinks() const
-{
- Q_D(const QTextControl);
- return d->openExternalLinks;
-}
-
-bool QTextControl::ignoreUnusedNavigationEvents() const
-{
- Q_D(const QTextControl);
- return d->ignoreUnusedNavigationEvents;
-}
-
-void QTextControl::setIgnoreUnusedNavigationEvents(bool ignore)
-{
- Q_D(QTextControl);
- d->ignoreUnusedNavigationEvents = ignore;
-}
-
-void QTextControl::moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode)
-{
- Q_D(QTextControl);
- const QTextCursor oldSelection = d->cursor;
- const bool moved = d->cursor.movePosition(op, mode);
- d->_q_updateCurrentCharFormatAndSelection();
- ensureCursorVisible();
- d->repaintOldAndNewSelection(oldSelection);
- if (moved)
- emit cursorPositionChanged();
-}
-
-bool QTextControl::canPaste() const
-{
-#ifndef QT_NO_CLIPBOARD
- Q_D(const QTextControl);
- if (d->interactionFlags & Qt::TextEditable) {
- const QMimeData *md = QGuiApplication::clipboard()->mimeData();
- return md && canInsertFromMimeData(md);
- }
-#endif
- return false;
-}
-
-void QTextControl::setCursorIsFocusIndicator(bool b)
-{
- Q_D(QTextControl);
- d->cursorIsFocusIndicator = b;
- d->repaintCursor();
-}
-
-bool QTextControl::cursorIsFocusIndicator() const
-{
- Q_D(const QTextControl);
- return d->cursorIsFocusIndicator;
-}
-
-
-void QTextControl::setDragEnabled(bool enabled)
-{
- Q_D(QTextControl);
- d->dragEnabled = enabled;
-}
-
-bool QTextControl::isDragEnabled() const
-{
- Q_D(const QTextControl);
- return d->dragEnabled;
-}
-
-void QTextControl::setWordSelectionEnabled(bool enabled)
-{
- Q_D(QTextControl);
- d->wordSelectionEnabled = enabled;
-}
-
-bool QTextControl::isWordSelectionEnabled() const
-{
- Q_D(const QTextControl);
- return d->wordSelectionEnabled;
-}
-
-void QTextControl::print(QPagedPaintDevice *printer) const
-{
- Q_D(const QTextControl);
- if (!printer)
- return;
- QTextDocument *tempDoc = 0;
- const QTextDocument *doc = d->doc;
- if (QPagedPaintDevicePrivate::get(printer)->printSelectionOnly) {
- if (!d->cursor.hasSelection())
- return;
- tempDoc = new QTextDocument(const_cast<QTextDocument *>(doc));
- tempDoc->setMetaInformation(QTextDocument::DocumentTitle, doc->metaInformation(QTextDocument::DocumentTitle));
- tempDoc->setPageSize(doc->pageSize());
- tempDoc->setDefaultFont(doc->defaultFont());
- tempDoc->setUseDesignMetrics(doc->useDesignMetrics());
- QTextCursor(tempDoc).insertFragment(d->cursor.selection());
- doc = tempDoc;
-
- // copy the custom object handlers
- doc->documentLayout()->d_func()->handlers = d->doc->documentLayout()->d_func()->handlers;
- }
- doc->print(printer);
- delete tempDoc;
-}
-
-QMimeData *QTextControl::createMimeDataFromSelection() const
-{
- Q_D(const QTextControl);
- const QTextDocumentFragment fragment(d->cursor);
- return new QTextEditMimeData(fragment);
-}
-
-bool QTextControl::canInsertFromMimeData(const QMimeData *source) const
-{
- Q_D(const QTextControl);
- if (d->acceptRichText)
- return (source->hasText() && !source->text().isEmpty())
- || source->hasHtml()
- || source->hasFormat(QLatin1String("application/x-qrichtext"))
- || source->hasFormat(QLatin1String("application/x-qt-richtext"));
- else
- return source->hasText() && !source->text().isEmpty();
-}
-
-void QTextControl::insertFromMimeData(const QMimeData *source)
-{
- Q_D(QTextControl);
- if (!(d->interactionFlags & Qt::TextEditable) || !source)
- return;
-
- bool hasData = false;
- QTextDocumentFragment fragment;
-#ifndef QT_NO_TEXTHTMLPARSER
- if (source->hasFormat(QLatin1String("application/x-qrichtext")) && d->acceptRichText) {
- // x-qrichtext is always UTF-8 (taken from Qt3 since we don't use it anymore).
- QString richtext = QString::fromUtf8(source->data(QLatin1String("application/x-qrichtext")));
- richtext.prepend(QLatin1String("<meta name=\"qrichtext\" content=\"1\" />"));
- fragment = QTextDocumentFragment::fromHtml(richtext, d->doc);
- hasData = true;
- } else if (source->hasHtml() && d->acceptRichText) {
- fragment = QTextDocumentFragment::fromHtml(source->html(), d->doc);
- hasData = true;
- } else {
- QString text = source->text();
- if (!text.isNull()) {
- fragment = QTextDocumentFragment::fromPlainText(text);
- hasData = true;
- }
- }
-#else
- fragment = QTextDocumentFragment::fromPlainText(source->text());
-#endif // QT_NO_TEXTHTMLPARSER
-
- if (hasData)
- d->cursor.insertFragment(fragment);
- ensureCursorVisible();
-}
-
-bool QTextControl::findNextPrevAnchor(const QTextCursor &startCursor, bool next, QTextCursor &newAnchor)
-{
- Q_D(QTextControl);
-
- int anchorStart = -1;
- QString anchorHref;
- int anchorEnd = -1;
-
- if (next) {
- const int startPos = startCursor.selectionEnd();
-
- QTextBlock block = d->doc->findBlock(startPos);
- QTextBlock::Iterator it = block.begin();
-
- while (!it.atEnd() && it.fragment().position() < startPos)
- ++it;
-
- while (block.isValid()) {
- anchorStart = -1;
-
- // find next anchor
- for (; !it.atEnd(); ++it) {
- const QTextFragment fragment = it.fragment();
- const QTextCharFormat fmt = fragment.charFormat();
-
- if (fmt.isAnchor() && fmt.hasProperty(QTextFormat::AnchorHref)) {
- anchorStart = fragment.position();
- anchorHref = fmt.anchorHref();
- break;
- }
- }
-
- if (anchorStart != -1) {
- anchorEnd = -1;
-
- // find next non-anchor fragment
- for (; !it.atEnd(); ++it) {
- const QTextFragment fragment = it.fragment();
- const QTextCharFormat fmt = fragment.charFormat();
-
- if (!fmt.isAnchor() || fmt.anchorHref() != anchorHref) {
- anchorEnd = fragment.position();
- break;
- }
- }
-
- if (anchorEnd == -1)
- anchorEnd = block.position() + block.length() - 1;
-
- // make found selection
- break;
- }
-
- block = block.next();
- it = block.begin();
- }
- } else {
- int startPos = startCursor.selectionStart();
- if (startPos > 0)
- --startPos;
-
- QTextBlock block = d->doc->findBlock(startPos);
- QTextBlock::Iterator blockStart = block.begin();
- QTextBlock::Iterator it = block.end();
-
- if (startPos == block.position()) {
- it = block.begin();
- } else {
- do {
- if (it == blockStart) {
- it = QTextBlock::Iterator();
- block = QTextBlock();
- } else {
- --it;
- }
- } while (!it.atEnd() && it.fragment().position() + it.fragment().length() - 1 > startPos);
- }
-
- while (block.isValid()) {
- anchorStart = -1;
-
- if (!it.atEnd()) {
- do {
- const QTextFragment fragment = it.fragment();
- const QTextCharFormat fmt = fragment.charFormat();
-
- if (fmt.isAnchor() && fmt.hasProperty(QTextFormat::AnchorHref)) {
- anchorStart = fragment.position() + fragment.length();
- anchorHref = fmt.anchorHref();
- break;
- }
-
- if (it == blockStart)
- it = QTextBlock::Iterator();
- else
- --it;
- } while (!it.atEnd());
- }
-
- if (anchorStart != -1 && !it.atEnd()) {
- anchorEnd = -1;
-
- do {
- const QTextFragment fragment = it.fragment();
- const QTextCharFormat fmt = fragment.charFormat();
-
- if (!fmt.isAnchor() || fmt.anchorHref() != anchorHref) {
- anchorEnd = fragment.position() + fragment.length();
- break;
- }
-
- if (it == blockStart)
- it = QTextBlock::Iterator();
- else
- --it;
- } while (!it.atEnd());
-
- if (anchorEnd == -1)
- anchorEnd = qMax(0, block.position());
-
- break;
- }
-
- block = block.previous();
- it = block.end();
- if (it != block.begin())
- --it;
- blockStart = block.begin();
- }
-
- }
-
- if (anchorStart != -1 && anchorEnd != -1) {
- newAnchor = d->cursor;
- newAnchor.setPosition(anchorStart);
- newAnchor.setPosition(anchorEnd, QTextCursor::KeepAnchor);
- return true;
- }
-
- return false;
-}
-
-void QTextControlPrivate::activateLinkUnderCursor(QString href)
-{
- QTextCursor oldCursor = cursor;
-
- if (href.isEmpty()) {
- QTextCursor tmp = cursor;
- if (tmp.selectionStart() != tmp.position())
- tmp.setPosition(tmp.selectionStart());
- tmp.movePosition(QTextCursor::NextCharacter);
- href = tmp.charFormat().anchorHref();
- }
- if (href.isEmpty())
- return;
-
- if (!cursor.hasSelection()) {
- QTextBlock block = cursor.block();
- const int cursorPos = cursor.position();
-
- QTextBlock::Iterator it = block.begin();
- QTextBlock::Iterator linkFragment;
-
- for (; !it.atEnd(); ++it) {
- QTextFragment fragment = it.fragment();
- const int fragmentPos = fragment.position();
- if (fragmentPos <= cursorPos &&
- fragmentPos + fragment.length() > cursorPos) {
- linkFragment = it;
- break;
- }
- }
-
- if (!linkFragment.atEnd()) {
- it = linkFragment;
- cursor.setPosition(it.fragment().position());
- if (it != block.begin()) {
- do {
- --it;
- QTextFragment fragment = it.fragment();
- if (fragment.charFormat().anchorHref() != href)
- break;
- cursor.setPosition(fragment.position());
- } while (it != block.begin());
- }
-
- for (it = linkFragment; !it.atEnd(); ++it) {
- QTextFragment fragment = it.fragment();
- if (fragment.charFormat().anchorHref() != href)
- break;
- cursor.setPosition(fragment.position() + fragment.length(), QTextCursor::KeepAnchor);
- }
- }
- }
-
- if (hasFocus) {
- cursorIsFocusIndicator = true;
- } else {
- cursorIsFocusIndicator = false;
- cursor.clearSelection();
- }
- repaintOldAndNewSelection(oldCursor);
-
-#if 0 // ###ndef QT_NO_DESKTOPSERVICES
- if (openExternalLinks)
- QDesktopServices::openUrl(href);
- else
-#endif
- emit q_func()->linkActivated(href);
-}
-
-bool QTextControl::setFocusToNextOrPreviousAnchor(bool next)
-{
- Q_D(QTextControl);
-
- if (!(d->interactionFlags & Qt::LinksAccessibleByKeyboard))
- return false;
-
- QRectF crect = selectionRect();
- emit updateRequest(crect);
-
- // If we don't have a current anchor, we start from the start/end
- if (!d->cursor.hasSelection()) {
- d->cursor = QTextCursor(d->doc);
- if (next)
- d->cursor.movePosition(QTextCursor::Start);
- else
- d->cursor.movePosition(QTextCursor::End);
- }
-
- QTextCursor newAnchor;
- if (findNextPrevAnchor(d->cursor, next, newAnchor)) {
- d->cursor = newAnchor;
- d->cursorIsFocusIndicator = true;
- } else {
- d->cursor.clearSelection();
- }
-
- if (d->cursor.hasSelection()) {
- crect = selectionRect();
- emit updateRequest(crect);
- emit visibilityRequest(crect);
- return true;
- } else {
- return false;
- }
-}
-
-bool QTextControl::setFocusToAnchor(const QTextCursor &newCursor)
-{
- Q_D(QTextControl);
-
- if (!(d->interactionFlags & Qt::LinksAccessibleByKeyboard))
- return false;
-
- // Verify that this is an anchor.
- const QString anchorHref = d->anchorForCursor(newCursor);
- if (anchorHref.isEmpty())
- return false;
-
- // and process it
- QRectF crect = selectionRect();
- emit updateRequest(crect);
-
- d->cursor.setPosition(newCursor.selectionStart());
- d->cursor.setPosition(newCursor.selectionEnd(), QTextCursor::KeepAnchor);
- d->cursorIsFocusIndicator = true;
-
- crect = selectionRect();
- emit updateRequest(crect);
- emit visibilityRequest(crect);
- return true;
-}
-
-void QTextControl::setTextInteractionFlags(Qt::TextInteractionFlags flags)
-{
- Q_D(QTextControl);
- if (flags == d->interactionFlags)
- return;
- d->interactionFlags = flags;
-
- if (d->hasFocus)
- d->setBlinkingCursorEnabled(flags & (Qt::TextEditable | Qt::TextSelectableByKeyboard));
-}
-
-Qt::TextInteractionFlags QTextControl::textInteractionFlags() const
-{
- Q_D(const QTextControl);
- return d->interactionFlags;
-}
-
-void QTextControl::mergeCurrentCharFormat(const QTextCharFormat &modifier)
-{
- Q_D(QTextControl);
- d->cursor.mergeCharFormat(modifier);
- d->updateCurrentCharFormat();
-}
-
-void QTextControl::setCurrentCharFormat(const QTextCharFormat &format)
-{
- Q_D(QTextControl);
- d->cursor.setCharFormat(format);
- d->updateCurrentCharFormat();
-}
-
-QTextCharFormat QTextControl::currentCharFormat() const
-{
- Q_D(const QTextControl);
- return d->cursor.charFormat();
-}
-
-void QTextControl::insertPlainText(const QString &text)
-{
- Q_D(QTextControl);
- d->cursor.insertText(text);
-}
-
-#ifndef QT_NO_TEXTHTMLPARSER
-void QTextControl::insertHtml(const QString &text)
-{
- Q_D(QTextControl);
- d->cursor.insertHtml(text);
-}
-#endif // QT_NO_TEXTHTMLPARSER
-
-QPointF QTextControl::anchorPosition(const QString &name) const
-{
- Q_D(const QTextControl);
- if (name.isEmpty())
- return QPointF();
-
- QRectF r;
- for (QTextBlock block = d->doc->begin(); block.isValid(); block = block.next()) {
- QTextCharFormat format = block.charFormat();
- if (format.isAnchor() && format.anchorNames().contains(name)) {
- r = d->rectForPosition(block.position());
- break;
- }
-
- for (QTextBlock::Iterator it = block.begin(); !it.atEnd(); ++it) {
- QTextFragment fragment = it.fragment();
- format = fragment.charFormat();
- if (format.isAnchor() && format.anchorNames().contains(name)) {
- r = d->rectForPosition(fragment.position());
- block = QTextBlock();
- break;
- }
- }
- }
- if (!r.isValid())
- return QPointF();
- return QPointF(0, r.top());
-}
-
-void QTextControl::adjustSize()
-{
- Q_D(QTextControl);
- d->doc->adjustSize();
-}
-
-bool QTextControl::find(const QString &exp, QTextDocument::FindFlags options)
-{
- Q_D(QTextControl);
- QTextCursor search = d->doc->find(exp, d->cursor, options);
- if (search.isNull())
- return false;
-
- setTextCursor(search);
- return true;
-}
-
-
-
-void QTextControlPrivate::append(const QString &text, Qt::TextFormat format)
-{
- QTextCursor tmp(doc);
- tmp.beginEditBlock();
- tmp.movePosition(QTextCursor::End);
-
- if (!doc->isEmpty())
- tmp.insertBlock(cursor.blockFormat(), cursor.charFormat());
- else
- tmp.setCharFormat(cursor.charFormat());
-
- // preserve the char format
- QTextCharFormat oldCharFormat = cursor.charFormat();
-
-#ifndef QT_NO_TEXTHTMLPARSER
- if (format == Qt::RichText || (format == Qt::AutoText && Qt::mightBeRichText(text))) {
- tmp.insertHtml(text);
- } else {
- tmp.insertText(text);
- }
-#else
- tmp.insertText(text);
-#endif // QT_NO_TEXTHTMLPARSER
- if (!cursor.hasSelection())
- cursor.setCharFormat(oldCharFormat);
-
- tmp.endEditBlock();
-}
-
-void QTextControl::append(const QString &text)
-{
- Q_D(QTextControl);
- d->append(text, Qt::AutoText);
-}
-
-void QTextControl::appendHtml(const QString &html)
-{
- Q_D(QTextControl);
- d->append(html, Qt::RichText);
-}
-
-void QTextControl::appendPlainText(const QString &text)
-{
- Q_D(QTextControl);
- d->append(text, Qt::PlainText);
-}
-
-
-void QTextControl::ensureCursorVisible()
-{
- Q_D(QTextControl);
- QRectF crect = d->rectForPosition(d->cursor.position()).adjusted(-5, 0, 5, 0);
- emit visibilityRequest(crect);
- emit microFocusChanged();
-}
-
-QPalette QTextControl::palette() const
-{
- Q_D(const QTextControl);
- return d->palette;
-}
-
-void QTextControl::setPalette(const QPalette &pal)
-{
- Q_D(QTextControl);
- d->palette = pal;
-}
-
-bool QTextControl::cursorOn() const
-{
- Q_D(const QTextControl);
- return d->cursorOn;
-}
-
-QAbstractTextDocumentLayout::PaintContext QTextControl::getPaintContext() const
-{
- Q_D(const QTextControl);
-
- QAbstractTextDocumentLayout::PaintContext ctx;
-
- ctx.selections = d->extraSelections;
- ctx.palette = d->palette;
- if (d->cursorOn && d->isEnabled) {
- if (d->hideCursor)
- ctx.cursorPosition = -1;
- else if (d->preeditCursor != 0)
- ctx.cursorPosition = - (d->preeditCursor + 2);
- else
- ctx.cursorPosition = d->cursor.position();
- }
-
- if (!d->dndFeedbackCursor.isNull())
- ctx.cursorPosition = d->dndFeedbackCursor.position();
-#ifdef QT_KEYPAD_NAVIGATION
- if (!QGuiApplication::keypadNavigationEnabled() || d->hasEditFocus)
-#endif
- if (d->cursor.hasSelection()) {
- QAbstractTextDocumentLayout::Selection selection;
- selection.cursor = d->cursor;
- if (0 && d->cursorIsFocusIndicator) {
-#if 0
- // ###
- QStyleOption opt;
- opt.palette = ctx.palette;
- QStyleHintReturnVariant ret;
- QStyle *style = QGuiApplication::style();
- if (widget)
- style = widget->style();
- style->styleHint(QStyle::SH_TextControl_FocusIndicatorTextCharFormat, &opt, widget, &ret);
- selection.format = qvariant_cast<QTextFormat>(ret.variant).toCharFormat();
-#endif
- } else {
- QPalette::ColorGroup cg = d->hasFocus ? QPalette::Active : QPalette::Inactive;
- selection.format.setBackground(ctx.palette.brush(cg, QPalette::Highlight));
- selection.format.setForeground(ctx.palette.brush(cg, QPalette::HighlightedText));
- if (fullWidthSelection)
- selection.format.setProperty(QTextFormat::FullWidthSelection, true);
- }
- ctx.selections.append(selection);
- }
-
- return ctx;
-}
-
-void QTextControl::drawContents(QPainter *p, const QRectF &rect)
-{
- Q_D(QTextControl);
- p->save();
- QAbstractTextDocumentLayout::PaintContext ctx = getPaintContext();
- if (rect.isValid())
- p->setClipRect(rect, Qt::IntersectClip);
- ctx.clip = rect;
-
- d->doc->documentLayout()->draw(p, ctx);
- p->restore();
-}
-
-void QTextControlPrivate::_q_copyLink()
-{
-#ifndef QT_NO_CLIPBOARD
- QMimeData *md = new QMimeData;
- md->setText(linkToCopy);
- QGuiApplication::clipboard()->setMimeData(md);
-#endif
-}
-
-QInputContext *QTextControlPrivate::inputContext()
-{
-#if 0
- // ###
- QInputContext *ctx = contextObject->inputContext();
- if (!ctx && contextObject->parentWidget())
- ctx = contextObject->parentWidget()->inputContext();
- return ctx;
-#else
- return 0;
-#endif
-}
-
-int QTextControl::hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const
-{
- Q_D(const QTextControl);
- return d->doc->documentLayout()->hitTest(point, accuracy);
-}
-
-QRectF QTextControl::blockBoundingRect(const QTextBlock &block) const
-{
- Q_D(const QTextControl);
- return d->doc->documentLayout()->blockBoundingRect(block);
-}
-
-
-
-QStringList QTextEditMimeData::formats() const
-{
- if (!fragment.isEmpty())
- return QStringList() << QString::fromLatin1("text/plain") << QString::fromLatin1("text/html")
-#ifndef QT_NO_TEXTODFWRITER
- << QString::fromLatin1("application/vnd.oasis.opendocument.text")
-#endif
- ;
- else
- return QMimeData::formats();
-}
-
-QVariant QTextEditMimeData::retrieveData(const QString &mimeType, QVariant::Type type) const
-{
- if (!fragment.isEmpty())
- setup();
- return QMimeData::retrieveData(mimeType, type);
-}
-
-void QTextEditMimeData::setup() const
-{
- QTextEditMimeData *that = const_cast<QTextEditMimeData *>(this);
-#ifndef QT_NO_TEXTHTMLPARSER
- that->setData(QLatin1String("text/html"), fragment.toHtml("utf-8").toUtf8());
-#endif
-#ifndef QT_NO_TEXTODFWRITER
- {
- QBuffer buffer;
- QTextDocumentWriter writer(&buffer, "ODF");
- writer.write(fragment);
- buffer.close();
- that->setData(QLatin1String("application/vnd.oasis.opendocument.text"), buffer.data());
- }
-#endif
- that->setText(fragment.toPlainText());
- fragment = QTextDocumentFragment();
-}
-
-
-QT_END_NAMESPACE
-
-#include "moc_qtextcontrol_p.cpp"
-
-#endif // QT_NO_TEXTCONTROL
diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h
deleted file mode 100644
index e00ffd4042..0000000000
--- a/src/gui/text/qtextcontrol_p.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 QTEXTCONTROL_P_H
-#define QTEXTCONTROL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtGui/qtextdocument.h>
-#include <QtGui/qtextoption.h>
-#include <QtGui/qtextcursor.h>
-#include <QtGui/qtextformat.h>
-#include <QtCore/qrect.h>
-#include <QtGui/qabstracttextdocumentlayout.h>
-#include <QtGui/qtextdocumentfragment.h>
-#include <QtGui/qclipboard.h>
-#include <QtCore/qmimedata.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class QStyleSheet;
-class QTextDocument;
-class QTextControlPrivate;
-class QAbstractScrollArea;
-class QEvent;
-class QTimerEvent;
-class QPagedPaintDevice;
-
-class Q_GUI_EXPORT QTextControl : public QObject
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QTextControl)
-#ifndef QT_NO_TEXTHTMLPARSER
- Q_PROPERTY(QString html READ toHtml WRITE setHtml NOTIFY textChanged USER true)
-#endif
- Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
- Q_PROPERTY(bool acceptRichText READ acceptRichText WRITE setAcceptRichText)
- Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth)
- Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
- Q_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
- Q_PROPERTY(bool ignoreUnusedNavigationEvents READ ignoreUnusedNavigationEvents WRITE setIgnoreUnusedNavigationEvents)
-public:
- explicit QTextControl(QObject *parent = 0);
- explicit QTextControl(const QString &text, QObject *parent = 0);
- explicit QTextControl(QTextDocument *doc, QObject *parent = 0);
- virtual ~QTextControl();
-
- void setView(QObject *view);
- QObject *view() const;
-
- void setDocument(QTextDocument *document);
- QTextDocument *document() const;
-
- void setTextCursor(const QTextCursor &cursor);
- QTextCursor textCursor() const;
-
- void setTextInteractionFlags(Qt::TextInteractionFlags flags);
- Qt::TextInteractionFlags textInteractionFlags() const;
-
- void mergeCurrentCharFormat(const QTextCharFormat &modifier);
-
- void setCurrentCharFormat(const QTextCharFormat &format);
- QTextCharFormat currentCharFormat() const;
-
- bool find(const QString &exp, QTextDocument::FindFlags options = 0);
-
- inline QString toPlainText() const
- { return document()->toPlainText(); }
-#ifndef QT_NO_TEXTHTMLPARSER
- inline QString toHtml() const
- { return document()->toHtml(); }
-#endif
-
- virtual void ensureCursorVisible();
-
- virtual QVariant loadResource(int type, const QUrl &name);
-
- QTextCursor cursorForPosition(const QPointF &pos) const;
- QRectF cursorRect(const QTextCursor &cursor) const;
- QRectF cursorRect() const;
- QRectF selectionRect(const QTextCursor &cursor) const;
- QRectF selectionRect() const;
-
- QString anchorAt(const QPointF &pos) const;
- QPointF anchorPosition(const QString &name) const;
-
- QString anchorAtCursor() const;
-
- bool overwriteMode() const;
- void setOverwriteMode(bool overwrite);
-
- int cursorWidth() const;
- void setCursorWidth(int width);
-
- bool acceptRichText() const;
- void setAcceptRichText(bool accept);
-
- void setExtraSelections(const QVector<QAbstractTextDocumentLayout::Selection> &selections);
- QVector<QAbstractTextDocumentLayout::Selection> extraSelections() const;
-
- void setTextWidth(qreal width);
- qreal textWidth() const;
- QSizeF size() const;
-
- void setOpenExternalLinks(bool open);
- bool openExternalLinks() const;
-
- void setIgnoreUnusedNavigationEvents(bool ignore);
- bool ignoreUnusedNavigationEvents() const;
-
- void moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
-
- bool canPaste() const;
-
- void setCursorIsFocusIndicator(bool b);
- bool cursorIsFocusIndicator() const;
-
- void setDragEnabled(bool enabled);
- bool isDragEnabled() const;
-
- bool isWordSelectionEnabled() const;
- void setWordSelectionEnabled(bool enabled);
-
- void print(QPagedPaintDevice *printer) const;
-
- virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const;
- virtual QRectF blockBoundingRect(const QTextBlock &block) const;
- QAbstractTextDocumentLayout::PaintContext getPaintContext() const;
-
-public Q_SLOTS:
- void setPlainText(const QString &text);
- void setHtml(const QString &text);
-
-#ifndef QT_NO_CLIPBOARD
- void cut();
- void copy();
- void paste(QClipboard::Mode mode = QClipboard::Clipboard);
-#endif
-
- void undo();
- void redo();
-
- void clear();
- void selectAll();
-
- void insertPlainText(const QString &text);
-#ifndef QT_NO_TEXTHTMLPARSER
- void insertHtml(const QString &text);
-#endif
-
- void append(const QString &text);
- void appendHtml(const QString &html);
- void appendPlainText(const QString &text);
-
- void adjustSize();
-
-Q_SIGNALS:
- void textChanged();
- void undoAvailable(bool b);
- void redoAvailable(bool b);
- void currentCharFormatChanged(const QTextCharFormat &format);
- void copyAvailable(bool b);
- void selectionChanged();
- void cursorPositionChanged();
-
- // control signals
- void updateCursorRequest(const QRectF &rect = QRectF());
- void updateRequest(const QRectF &rect = QRectF());
- void documentSizeChanged(const QSizeF &);
- void blockCountChanged(int newBlockCount);
- void visibilityRequest(const QRectF &rect);
- void microFocusChanged();
- void linkActivated(const QString &link);
- void linkHovered(const QString &);
- void modificationChanged(bool m);
-
-public:
- // control properties
- QPalette palette() const;
- void setPalette(const QPalette &pal);
-
- virtual void processEvent(QEvent *e, const QMatrix &matrix);
- void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF());
-
- // control methods
- void drawContents(QPainter *painter, const QRectF &rect = QRectF());
-
- void setFocus(bool focus, Qt::FocusReason = Qt::OtherFocusReason);
-
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
-
- virtual QMimeData *createMimeDataFromSelection() const;
- virtual bool canInsertFromMimeData(const QMimeData *source) const;
- virtual void insertFromMimeData(const QMimeData *source);
-
- bool setFocusToAnchor(const QTextCursor &newCursor);
- bool setFocusToNextOrPreviousAnchor(bool next);
- bool findNextPrevAnchor(const QTextCursor& from, bool next, QTextCursor& newAnchor);
-
- bool cursorOn() const;
-
-protected:
- virtual void timerEvent(QTimerEvent *e);
-
- virtual bool event(QEvent *e);
-
-private:
- Q_DISABLE_COPY(QTextControl)
- Q_PRIVATE_SLOT(d_func(), void _q_updateCurrentCharFormatAndSelection())
- Q_PRIVATE_SLOT(d_func(), void _q_emitCursorPosChanged(const QTextCursor &))
- Q_PRIVATE_SLOT(d_func(), void _q_deleteSelected())
- Q_PRIVATE_SLOT(d_func(), void _q_copyLink())
- Q_PRIVATE_SLOT(d_func(), void _q_updateBlock(const QTextBlock &))
- Q_PRIVATE_SLOT(d_func(), void _q_documentLayoutChanged())
-};
-
-
-// also used by QLabel
-class QTextEditMimeData : public QMimeData
-{
-public:
- inline QTextEditMimeData(const QTextDocumentFragment &aFragment) : fragment(aFragment) {}
-
- virtual QStringList formats() const;
-protected:
- virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const;
-private:
- void setup() const;
-
- mutable QTextDocumentFragment fragment;
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QTextControl_H
diff --git a/src/gui/text/qtextcontrol_p_p.h b/src/gui/text/qtextcontrol_p_p.h
deleted file mode 100644
index 12dfbafb69..0000000000
--- a/src/gui/text/qtextcontrol_p_p.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** 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 QTEXTCONTROL_P_P_H
-#define QTEXTCONTROL_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "QtGui/qtextdocumentfragment.h"
-#include "QtGui/qtextcursor.h"
-#include "QtGui/qtextformat.h"
-#include "QtGui/qabstracttextdocumentlayout.h"
-#include "QtCore/qbasictimer.h"
-#include "QtCore/qpointer.h"
-#include "private/qobject_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QMimeData;
-class QAbstractScrollArea;
-class QInputContext;
-
-class QTextControlPrivate : public QObjectPrivate
-{
- Q_DECLARE_PUBLIC(QTextControl)
-public:
- QTextControlPrivate();
-
- bool cursorMoveKeyEvent(QKeyEvent *e);
-
- void updateCurrentCharFormat();
-
- void indent();
- void outdent();
-
- void gotoNextTableCell();
- void gotoPreviousTableCell();
-
- void createAutoBulletList();
-
- void init(Qt::TextFormat format = Qt::RichText, const QString &text = QString(),
- QTextDocument *document = 0);
- void setContent(Qt::TextFormat format = Qt::RichText, const QString &text = QString(),
- QTextDocument *document = 0);
- void startDrag();
-
- void paste(const QMimeData *source);
-
- void setCursorPosition(const QPointF &pos);
- void setCursorPosition(int pos, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor);
-
- void repaintCursor();
- inline void repaintSelection()
- { repaintOldAndNewSelection(QTextCursor()); }
- void repaintOldAndNewSelection(const QTextCursor &oldSelection);
-
- void selectionChanged(bool forceEmitSelectionChanged = false);
-
- void _q_updateCurrentCharFormatAndSelection();
-
-#ifndef QT_NO_CLIPBOARD
- void setClipboardSelection();
-#endif
-
- void _q_emitCursorPosChanged(const QTextCursor &someCursor);
-
- void setBlinkingCursorEnabled(bool enable);
-
- void extendWordwiseSelection(int suggestedNewPosition, qreal mouseXPosition);
- void extendBlockwiseSelection(int suggestedNewPosition);
-
- void _q_deleteSelected();
-
- void _q_setCursorAfterUndoRedo(int undoPosition, int charsAdded, int charsRemoved);
-
- QRectF cursorRectPlusUnicodeDirectionMarkers(const QTextCursor &cursor) const;
- QRectF rectForPosition(int position) const;
- QRectF selectionRect(const QTextCursor &cursor) const;
- inline QRectF selectionRect() const
- { return selectionRect(this->cursor); }
-
- QString anchorForCursor(const QTextCursor &anchor) const;
-
- void keyPressEvent(QKeyEvent *e);
- void mousePressEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
- Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons,
- const QPoint &globalPos);
- void mouseMoveEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
- Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons,
- const QPoint &globalPos);
- void mouseReleaseEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
- Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons,
- const QPoint &globalPos);
- void mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos,
- Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons,
- const QPoint &globalPos);
- bool sendMouseEventToInputContext(QEvent *e, QEvent::Type eventType, Qt::MouseButton button,
- const QPointF &pos,
- Qt::KeyboardModifiers modifiers,
- Qt::MouseButtons buttons,
- const QPoint &globalPos);
- void contextMenuEvent(const QPoint &screenPos, const QPointF &docPos, QWidget *contextWidget);
- void focusEvent(QFocusEvent *e);
-#ifdef QT_KEYPAD_NAVIGATION
- void editFocusEvent(QEvent *e);
-#endif
- bool dragEnterEvent(QEvent *e, const QMimeData *mimeData);
- void dragLeaveEvent();
- bool dragMoveEvent(QEvent *e, const QMimeData *mimeData, const QPointF &pos);
- bool dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QObject *source);
-
- void inputMethodEvent(QInputMethodEvent *);
-
- void activateLinkUnderCursor(QString href = QString());
-
- void append(const QString &text, Qt::TextFormat format = Qt::AutoText);
-
- QInputContext *inputContext();
-
- QTextDocument *doc;
- bool cursorOn;
- QTextCursor cursor;
- bool cursorIsFocusIndicator;
- QTextCharFormat lastCharFormat;
-
- QTextCursor dndFeedbackCursor;
-
- Qt::TextInteractionFlags interactionFlags;
-
- QBasicTimer cursorBlinkTimer;
- QBasicTimer trippleClickTimer;
- QPointF trippleClickPoint;
-
- bool dragEnabled;
-
- bool mousePressed;
-
- bool mightStartDrag;
- QPoint dragStartPos;
- QPointer<QObject> contextObject;
-
- bool lastSelectionState;
-
- bool ignoreAutomaticScrollbarAdjustement;
-
- QTextCursor selectedWordOnDoubleClick;
- QTextCursor selectedBlockOnTrippleClick;
-
- bool overwriteMode;
- bool acceptRichText;
-
- int preeditCursor;
- bool hideCursor; // used to hide the cursor in the preedit area
-
- QVector<QAbstractTextDocumentLayout::Selection> extraSelections;
-
- QPalette palette;
- bool hasFocus;
-#ifdef QT_KEYPAD_NAVIGATION
- bool hasEditFocus;
-#endif
- bool isEnabled;
-
- QString highlightedAnchor; // Anchor below cursor
- QString anchorOnMousePress;
- bool hadSelectionOnMousePress;
-
- bool ignoreUnusedNavigationEvents;
- bool openExternalLinks;
-
- bool wordSelectionEnabled;
-
- QString linkToCopy;
- void _q_copyLink();
- void _q_updateBlock(const QTextBlock &);
- void _q_documentLayoutChanged();
-};
-
-QT_END_NAMESPACE
-
-#endif // QTextControl_P_H
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index 766d9792cd..25ec09d9db 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index 32ded45137..bf7c4a8787 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextDocument;
class QTextCursorPrivate;
diff --git a/src/gui/text/qtextcursor_p.h b/src/gui/text/qtextcursor_p.h
index d64498a7ac..d8a644c842 100644
--- a/src/gui/text/qtextcursor_p.h
+++ b/src/gui/text/qtextcursor_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 3038504591..1fad064b5c 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index b7c77c2c54..aeb431c2bc 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextFormatCollection;
class QTextListFormat;
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 9e410b40af..8ce3ae4ac3 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -531,16 +531,17 @@ int QTextDocumentPrivate::remove_block(int pos, int *blockFormat, int command, Q
Q_ASSERT(b);
if (blocks.size(b) == 1 && command == QTextUndoCommand::BlockAdded) {
- Q_ASSERT((int)blocks.position(b) == pos);
-// qDebug("removing empty block");
- // empty block remove the block itself
+ Q_ASSERT((int)blocks.position(b) == pos);
+ // qDebug("removing empty block");
+ // empty block remove the block itself
} else {
- // non empty block, merge with next one into this block
-// qDebug("merging block with next");
- int n = blocks.next(b);
- Q_ASSERT((int)blocks.position(n) == pos + 1);
- blocks.setSize(b, blocks.size(b) + blocks.size(n) - 1);
- b = n;
+ // non empty block, merge with next one into this block
+ // qDebug("merging block with next");
+ int n = blocks.next(b);
+ Q_ASSERT((int)blocks.position(n) == pos + 1);
+ blocks.setSize(b, blocks.size(b) + blocks.size(n) - 1);
+ blocks.fragment(b)->userState = blocks.fragment(n)->userState;
+ b = n;
}
*blockFormat = blocks.fragment(b)->format;
diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h
index 07a5230ec5..5f2f0f0096 100644
--- a/src/gui/text/qtextdocument_p.h
+++ b/src/gui/text/qtextdocument_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index a42a4ce39a..72113bc977 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentfragment.h b/src/gui/text/qtextdocumentfragment.h
index cc7dd293f2..2e1f14fd81 100644
--- a/src/gui/text/qtextdocumentfragment.h
+++ b/src/gui/text/qtextdocumentfragment.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -48,7 +48,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextStream;
class QTextDocument;
diff --git a/src/gui/text/qtextdocumentfragment_p.h b/src/gui/text/qtextdocumentfragment_p.h
index 44276d3629..154971ff3d 100644
--- a/src/gui/text/qtextdocumentfragment_p.h
+++ b/src/gui/text/qtextdocumentfragment_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 80975f928b..cc3372d6e8 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentlayout_p.h b/src/gui/text/qtextdocumentlayout_p.h
index e5f8cc19a8..92bcf47b64 100644
--- a/src/gui/text/qtextdocumentlayout_p.h
+++ b/src/gui/text/qtextdocumentlayout_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp
index a371471b76..d43a61866d 100644
--- a/src/gui/text/qtextdocumentwriter.cpp
+++ b/src/gui/text/qtextdocumentwriter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextdocumentwriter.h b/src/gui/text/qtextdocumentwriter.h
index 7dc903c412..c0dea06f8f 100644
--- a/src/gui/text/qtextdocumentwriter.h
+++ b/src/gui/text/qtextdocumentwriter.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -47,7 +47,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextDocumentWriterPrivate;
class QIODevice;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 0dd8d0bef3..5e5354a980 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -54,7 +54,7 @@
#include <private/qunicodetables_p.h>
#include "qtextdocument_p.h"
#include <qguiapplication.h>
-#include <qinputpanel.h>
+#include <qinputmethod.h>
#include <stdlib.h>
@@ -1409,7 +1409,7 @@ bool QTextEngine::isRightToLeft() const
itemize();
// this places the cursor in the right position depending on the keyboard layout
if (layoutData->string.isEmpty())
- return qApp ? qApp->inputPanel()->inputDirection() == Qt::RightToLeft : false;
+ return qApp ? qApp->inputMethod()->inputDirection() == Qt::RightToLeft : false;
return layoutData->string.isRightToLeft();
}
@@ -2526,7 +2526,7 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
// fall through
case QTextOption::RightTab:
tab = QFixed::fromReal(tabSpec.position) * dpiScale - length;
- if (tab < 0) // default to tab taking no space
+ if (tab < x) // default to tab taking no space
return QFixed();
break;
case QTextOption::LeftTab:
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 368ad3763d..641d946aa9 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 9ce45fdaf3..a7e68a41c2 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h
index 5c9d6fe20e..6843995124 100644
--- a/src/gui/text/qtextformat.h
+++ b/src/gui/text/qtextformat.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -55,7 +55,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QString;
class QVariant;
diff --git a/src/gui/text/qtextformat_p.h b/src/gui/text/qtextformat_p.h
index 61e3e1f253..b5ac3ff269 100644
--- a/src/gui/text/qtextformat_p.h
+++ b/src/gui/text/qtextformat_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 4ee282c46e..da08c4e468 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtexthtmlparser_p.h b/src/gui/text/qtexthtmlparser_p.h
index f1a90ee0a3..8216681381 100644
--- a/src/gui/text/qtexthtmlparser_p.h
+++ b/src/gui/text/qtexthtmlparser_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index c7cf2df903..abd283e459 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextimagehandler_p.h b/src/gui/text/qtextimagehandler_p.h
index ce1d481eba..b997e3a41d 100644
--- a/src/gui/text/qtextimagehandler_p.h
+++ b/src/gui/text/qtextimagehandler_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 1e8cb9e478..ac92c4dd51 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -2228,9 +2228,12 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
int glyphsEnd = (relativeTo == eng->length(&si))
? si.num_glyphs - 1
: logClusters[relativeTo];
+ // the glyph index right next to the requested range
+ int nextGlyphIndex = relativeTo < eng->length(&si) - 1 ? logClusters[relativeTo + 1] : si.num_glyphs;
+ if (nextGlyphIndex - 1 > glyphsEnd)
+ glyphsEnd = nextGlyphIndex - 1;
bool startsInsideLigature = relativeFrom > 0 && logClusters[relativeFrom - 1] == glyphsStart;
- bool endsInsideLigature = relativeTo < eng->length(&si) - 1
- && logClusters[relativeTo + 1] == glyphsEnd;
+ bool endsInsideLigature = nextGlyphIndex == glyphsEnd;
int itemGlyphsStart = logClusters[iterator.itemStart - si.position];
int itemGlyphsEnd = logClusters[iterator.itemEnd - 1 - si.position];
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index e698625d9b..a3bc79dc52 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -56,7 +56,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextEngine;
class QFont;
diff --git a/src/gui/text/qtextlist.cpp b/src/gui/text/qtextlist.cpp
index 97ad9dc82b..5a642e90ef 100644
--- a/src/gui/text/qtextlist.cpp
+++ b/src/gui/text/qtextlist.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextlist.h b/src/gui/text/qtextlist.h
index 5a470f4582..11ef3e084b 100644
--- a/src/gui/text/qtextlist.h
+++ b/src/gui/text/qtextlist.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -49,7 +49,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextListPrivate;
class QTextCursor;
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index e49b0d3ad8..bffc2c3a65 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index f56a38b366..65b2d5c52d 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextObjectPrivate;
class QTextDocument;
diff --git a/src/gui/text/qtextobject_p.h b/src/gui/text/qtextobject_p.h
index 0ca2f87f0d..960e4e81f2 100644
--- a/src/gui/text/qtextobject_p.h
+++ b/src/gui/text/qtextobject_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 0fe2efdd5f..80adeb602c 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextodfwriter_p.h b/src/gui/text/qtextodfwriter_p.h
index 5108175291..b6252c722e 100644
--- a/src/gui/text/qtextodfwriter_p.h
+++ b/src/gui/text/qtextodfwriter_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 2fe6284592..b3b4c90d79 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h
index 8b7b006921..a0a4c76282 100644
--- a/src/gui/text/qtextoption.h
+++ b/src/gui/text/qtextoption.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
template <typename T> class QList;
struct QTextOptionPrivate;
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 64b28811e5..35adfd16b2 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qtexttable.h b/src/gui/text/qtexttable.h
index e5ea7609dd..dbcb6705c2 100644
--- a/src/gui/text/qtexttable.h
+++ b/src/gui/text/qtexttable.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -50,7 +50,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
class QTextCursor;
class QTextTable;
diff --git a/src/gui/text/qtexttable_p.h b/src/gui/text/qtexttable_p.h
index 237a1a883c..273caa110f 100644
--- a/src/gui/text/qtexttable_p.h
+++ b/src/gui/text/qtexttable_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index b82e679d8b..337326d3d7 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h
index a569b584cf..4dbf1d0a36 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/gui/text/qzipreader_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/qzipwriter_p.h b/src/gui/text/qzipwriter_p.h
index 0860c004f9..5fcc48a10b 100644
--- a/src/gui/text/qzipwriter_p.h
+++ b/src/gui/text/qzipwriter_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index c6bdfbd9c2..63a731f116 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -9,7 +9,6 @@ HEADERS += \
text/qfontmetrics.h \
text/qfont_p.h \
text/qfontsubset_p.h \
- text/qlinecontrol_p.h \
text/qtextengine_p.h \
text/qtextlayout.h \
text/qtextformat.h \
@@ -23,8 +22,6 @@ HEADERS += \
text/qtexthtmlparser_p.h \
text/qabstracttextdocumentlayout.h \
text/qtextdocumentlayout_p.h \
- text/qtextcontrol_p.h \
- text/qtextcontrol_p_p.h \
text/qtextcursor.h \
text/qtextcursor_p.h \
text/qtextdocumentfragment.h \
@@ -53,8 +50,6 @@ SOURCES += \
text/qfontsubset.cpp \
text/qfontmetrics.cpp \
text/qfontdatabase.cpp \
- text/qlinecontrol.cpp \
- text/qtextcontrol.cpp \
text/qtextengine.cpp \
text/qtextlayout.cpp \
text/qtextformat.cpp \
@@ -107,25 +102,5 @@ SOURCES += \
HEADERS += \
text/qplatformfontdatabase_qpa.h
-symbian {
- SOURCES += \
- text/qfont_s60.cpp
- contains(QT_CONFIG, freetype) {
- SOURCES += \
- text/qfontengine_ft.cpp \
- text/qrawfont_ft.cpp
- HEADERS += \
- text/qfontengine_ft_p.h
- DEFINES += \
- QT_NO_FONTCONFIG
- } else {
- SOURCES += \
- text/qfontengine_s60.cpp
- HEADERS += \
- text/qfontengine_s60_p.h
- }
- LIBS += -lfntstr -lecom
-}
-
DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 0bb233c82f..0f1312e02d 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qdesktopservices.h b/src/gui/util/qdesktopservices.h
index af9aa7bec7..04a639437e 100644
--- a/src/gui/util/qdesktopservices.h
+++ b/src/gui/util/qdesktopservices.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -43,15 +43,12 @@
#define QDESKTOPSERVICES_H
#include <QtCore/qstring.h>
-#if QT_DEPRECATED_SINCE(5, 0)
#include <QtCore/qstandardpaths.h>
-#endif
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_DESKTOPSERVICES
@@ -67,7 +64,7 @@ public:
static void unsetUrlHandler(const QString &scheme);
#if QT_DEPRECATED_SINCE(5, 0)
- enum StandardLocation {
+ QT_DEPRECATED enum StandardLocation {
DesktopLocation,
DocumentsLocation,
FontsLocation,
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index d822455886..84c7156ef3 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qdesktopservices_qpa.cpp b/src/gui/util/qdesktopservices_qpa.cpp
index 9e517a0166..b94267e72e 100644
--- a/src/gui/util/qdesktopservices_qpa.cpp
+++ b/src/gui/util/qdesktopservices_qpa.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index fe6d65994a..88f245d6f6 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp
index e64833a20c..73cf47a1db 100644
--- a/src/gui/util/qdesktopservices_x11.cpp
+++ b/src/gui/util/qdesktopservices_x11.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qhexstring_p.h b/src/gui/util/qhexstring_p.h
index 7579e4ff78..87bcf2293c 100644
--- a/src/gui/util/qhexstring_p.h
+++ b/src/gui/util/qhexstring_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp
index 5b637e4383..02552f5a53 100644
--- a/src/gui/util/qvalidator.cpp
+++ b/src/gui/util/qvalidator.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -131,6 +131,12 @@ QT_BEGIN_NAMESPACE
\omitvalue Valid
*/
+/*!
+ \fn void QValidator::changed()
+
+ This signal is emitted when any property that may affect the validity of
+ a string has changed.
+*/
/*!
\fn void QIntValidator::topChanged(int top)
@@ -247,7 +253,10 @@ QLocale QValidator::locale() const
void QValidator::setLocale(const QLocale &locale)
{
Q_D(QValidator);
- d->locale = locale;
+ if (d->locale != locale) {
+ d->locale = locale;
+ emit changed();
+ }
}
/*!
@@ -312,9 +321,7 @@ void QValidator::fixup(QString &) const
or individually with setBottom() and setTop().
QIntValidator uses its locale() to interpret the number. For example,
- in Arabic locales, QIntValidator will accept Arabic digits. In addition,
- QIntValidator is always guaranteed to accept a number formatted according
- to the "C" locale.
+ in Arabic locales, QIntValidator will accept Arabic digits.
\sa QDoubleValidator, QRegExpValidator, {Line Edits Example}
*/
@@ -394,9 +401,7 @@ QValidator::State QIntValidator::validate(QString & input, int&) const
{
QByteArray buff;
if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
- QLocale cl(QLocale::C);
- if (!cl.d()->validateChars(input, QLocalePrivate::IntegerMode, &buff))
- return Invalid;
+ return Invalid;
}
if (buff.isEmpty())
@@ -417,7 +422,7 @@ QValidator::State QIntValidator::validate(QString & input, int&) const
return Invalid;
if (entered >= b && entered <= t) {
- locale().toInt(input, &ok, 10);
+ locale().toInt(input, &ok);
return ok ? Acceptable : Intermediate;
}
@@ -435,9 +440,7 @@ void QIntValidator::fixup(QString &input) const
{
QByteArray buff;
if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) {
- QLocale cl(QLocale::C);
- if (!cl.d()->validateChars(input, QLocalePrivate::IntegerMode, &buff))
- return;
+ return;
}
bool ok, overflow;
qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow);
@@ -452,15 +455,21 @@ void QIntValidator::fixup(QString &input) const
void QIntValidator::setRange(int bottom, int top)
{
+ bool rangeChanged = false;
if (b != bottom) {
b = bottom;
+ rangeChanged = true;
emit bottomChanged(b);
}
if (t != top) {
t = top;
+ rangeChanged = true;
emit topChanged(t);
}
+
+ if (rangeChanged)
+ emit changed();
}
@@ -546,10 +555,6 @@ public:
in the German locale, "1,234" will be accepted as the fractional number
1.234. In Arabic locales, QDoubleValidator will accept Arabic digits.
- In addition, QDoubleValidator is always guaranteed to accept a number
- formatted according to the "C" locale. QDoubleValidator will not accept
- numbers with thousand-separators.
-
\sa QIntValidator, QRegExpValidator, {Line Edits Example}
*/
@@ -643,11 +648,7 @@ QValidator::State QDoubleValidator::validate(QString & input, int &) const
break;
}
- State currentLocaleValidation = d->validateWithLocale(input, numMode, locale());
- if (currentLocaleValidation == Acceptable || locale().language() == QLocale::C)
- return currentLocaleValidation;
- State cLocaleValidation = d->validateWithLocale(input, numMode, QLocale(QLocale::C));
- return qMax(currentLocaleValidation, cLocaleValidation);
+ return d->validateWithLocale(input, numMode, locale());
}
QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QLocalePrivate::NumberMode numMode, const QLocale &locale) const
@@ -697,20 +698,26 @@ QValidator::State QDoubleValidatorPrivate::validateWithLocale(QString &input, QL
void QDoubleValidator::setRange(double minimum, double maximum, int decimals)
{
+ bool rangeChanged = false;
if (b != minimum) {
b = minimum;
+ rangeChanged = true;
emit bottomChanged(b);
}
if (t != maximum) {
t = maximum;
+ rangeChanged = true;
emit topChanged(t);
}
if (dec != decimals) {
dec = decimals;
+ rangeChanged = true;
emit decimalsChanged(dec);
}
+ if (rangeChanged)
+ emit changed();
}
/*!
@@ -772,6 +779,7 @@ void QDoubleValidator::setNotation(Notation newNotation)
if (d->notation != newNotation) {
d->notation = newNotation;
emit notationChanged(d->notation);
+ emit changed();
}
}
@@ -888,6 +896,7 @@ void QRegExpValidator::setRegExp(const QRegExp& rx)
if (r != rx) {
r = rx;
emit regExpChanged(r);
+ emit changed();
}
}
diff --git a/src/gui/util/qvalidator.h b/src/gui/util/qvalidator.h
index 3e15b48c1c..f3191d2b1b 100644
--- a/src/gui/util/qvalidator.h
+++ b/src/gui/util/qvalidator.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -51,7 +51,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-QT_MODULE(Gui)
#ifndef QT_NO_VALIDATOR
@@ -76,6 +75,9 @@ public:
virtual State validate(QString &, int &) const = 0;
virtual void fixup(QString &) const;
+Q_SIGNALS:
+ void changed();
+
protected:
QValidator(QObjectPrivate &d, QObject *parent);
QValidator(QValidatorPrivate &d, QObject *parent);