From c354bc1d567874dd58db6abecf9d5796dfd721be Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 18 May 2011 12:16:33 +0200 Subject: Fix broken drawing with large fonts using QStaticText and FreeType In FreeType, there's a fall back to QFontEngine::alphaMapForGlyph() when the fonts are very large. Since this uses a QPainterPath containing an unhinted glyph, the use of hinted metrics would sometimes lead to the glyphs being clipped because they would be positioned slightly outside the image they were painted into. When outline drawing is on, it makes sense to return unhinted metrics, since the glyphs we will actually use are unhinted. Task-number: QTBUG-19067 Reviewed-by: Jiang Jiang --- src/gui/text/qfontengine_ft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index c74ecc8a4f..c4e89d5536 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -909,7 +909,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, Glyph } } - if (default_hint_style == HintNone) + if (default_hint_style == HintNone || set->outline_drawing) load_flags |= FT_LOAD_NO_HINTING; else load_flags |= load_target; -- cgit v1.2.3 From 5933d4e4fb8b48ebed641e7f6b1d032df253df30 Mon Sep 17 00:00:00 2001 From: Tomi Vihria Date: Wed, 18 May 2011 17:43:14 +0300 Subject: Fixing Linux compatibility issues for Symbian Reviewed-by: Laszlo Agocs --- .../mobile/quickhit/plugins/LevelOne/levelone.pro | 6 ++-- .../plugins/LevelTemplate/leveltemplate.pro | 6 ++-- .../mobile/quickhit/plugins/LevelTwo/leveltwo.pro | 6 ++-- mkspecs/features/symbian/application_icon.prf | 4 +-- src/gui/dialogs/dialogs.pri | 2 +- src/gui/styles/styles.pri | 6 +--- src/plugins/bearer/symbian/symbian.pri | 9 ++--- src/plugins/phonon/mmf/mmf.pro | 4 +-- src/plugins/s60/5_0/5_0.pro | 8 ++--- src/s60installs/qt.iby | 42 +++++++++++----------- src/s60installs/s60installs.pro | 6 ++-- tests/auto/qcssparser/qcssparser.pro | 2 +- 12 files changed, 44 insertions(+), 57 deletions(-) diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro index fcbfc56a53..b9367219b7 100644 --- a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro @@ -57,11 +57,11 @@ BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/backgroun myQml.sources = level.qml -myQml.path = c:/System/quickhitdata/levelone +myQml.path = c:/system/quickhitdata/levelone myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/levelone/gfx +myGraphic.path = c:/system/quickhitdata/levelone/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/levelone/sound +mySound.path = c:/system/quickhitdata/levelone/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro index a4f590058b..1370956aa0 100644 --- a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro @@ -60,11 +60,11 @@ BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ myQml.sources = qml/* -myQml.path = c:/System/quickhitdata/leveltemplate +myQml.path = c:/system/quickhitdata/leveltemplate myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx +myGraphic.path = c:/system/quickhitdata/leveltemplate/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/leveltemplate/sound +mySound.path = c:/system/quickhitdata/leveltemplate/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro index 171ee6c2da..e5c144f381 100644 --- a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro @@ -64,11 +64,11 @@ BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/backgroun myQml.sources = qml/* -myQml.path = c:/System/quickhitdata/leveltwo +myQml.path = c:/system/quickhitdata/leveltwo myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/leveltwo/gfx +myGraphic.path = c:/system/quickhitdata/leveltwo/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/leveltwo/sound +mySound.path = c:/system/quickhitdata/leveltwo/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 06f5b3103a..56d1ea8ede 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -65,8 +65,8 @@ contains(CONFIG, no_icon) { mifconv.target = $$replace(mifconv.target, /, \\) } # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library - # svg-t icons should always use /c32 depth - mifconv.commands = mifconv $$mifconv.target /c32 $$ICON_backslashed + # svg-t icons should always use -c32 depth + mifconv.commands = mifconv $$mifconv.target -c32 $$ICON_backslashed mifconv.depends = $$ICON PRE_TARGETDEPS += $$mifconv.target diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index 12e3a711c8..c25b6d5c1d 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -109,7 +109,7 @@ SOURCES += \ dialogs/qprintpreviewdialog.cpp symbian:contains(QT_CONFIG, s60) { - LIBS += -lCommonDialogs + LIBS += -lcommondialogs SOURCES += dialogs/qfiledialog_symbian.cpp \ dialogs/qcolordialog_symbian.cpp } diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index b22a908fdf..c595ee86bd 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -172,11 +172,7 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) { symbian { SOURCES += styles/qs60style_s60.cpp LIBS += -legul -lbmpanim - contains(CONFIG, is_using_gnupoc) { - LIBS += -laknicon -laknskins -laknskinsrv -lfontutils - } else { - LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils - } + LIBS += -laknicon -laknskins -laknskinsrv -lfontutils } else { SOURCES += styles/qs60style_simulated.cpp RESOURCES += styles/qstyle_s60_simulated.qrc diff --git a/src/plugins/bearer/symbian/symbian.pri b/src/plugins/bearer/symbian/symbian.pri index 8d92f57b68..121cefb2c3 100644 --- a/src/plugins/bearer/symbian/symbian.pri +++ b/src/plugins/bearer/symbian/symbian.pri @@ -19,13 +19,8 @@ LIBS += -lcommdb \ -linsock \ -lecom \ -lefsrv \ - -lnetmeta - -is_using_gnupoc { - LIBS += -lconnmon -} else { - LIBS += -lConnMon -} + -lnetmeta \ + -lconnmon QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer target.path += $$[QT_INSTALL_PLUGINS]/bearer diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index a9e5746032..3b8184b6af 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -103,7 +103,7 @@ symbian { exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { HEADERS += $$PHONON_MMF_DIR/download.h SOURCES += $$PHONON_MMF_DIR/download.cpp - LIBS += -lDownloadMgr + LIBS += -ldownloadmgr DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD } } @@ -125,7 +125,7 @@ symbian { LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. - LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect + LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect # This is to allow IAP to be specified LIBS += -lcommdb diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro index 00aea1b148..1617a1e09f 100644 --- a/src/plugins/s60/5_0/5_0.pro +++ b/src/plugins/s60/5_0/5_0.pro @@ -10,12 +10,8 @@ contains(S60_VERSION, 3.1) { SOURCES += ../src/qlocale_3_2.cpp \ ../src/qdesktopservices_3_2.cpp \ ../src/qcoreapplication_3_2.cpp - contains(CONFIG, is_using_gnupoc) { - LIBS += -ldirectorylocalizer - } else { - LIBS += -lDirectoryLocalizer - } - LIBS += -lefsrv + LIBS += -lefsrv \ + -ldirectorylocalizer INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index d6b36e0fe3..9f2c979aa4 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -40,7 +40,7 @@ file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll // Phonon MMF backend file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll -data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // graphicssystems file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll @@ -54,41 +54,41 @@ file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll // imageformats stubs -data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin // codecs stubs -data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin // iconengines stubs -data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin // qml import plugins file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll -data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir -data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir -data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir // graphicssystems -data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin -data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin // bearer stub -data=\epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin // Stub sis file data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index d1bb48b814..17b229fa8e 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -10,10 +10,10 @@ symbian: { TARGET = "Qt$${QT_LIBINFIX}" isEmpty(QT_LIBINFIX) { - TARGET.UID3 = 0x2001E61C + TARGET.UID3 = 0x2001e61c } else { # Always use experimental UID for infixed configuration to avoid UID clash - TARGET.UID3 = 0xE001E61C + TARGET.UID3 = 0xe001e61c } VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} @@ -116,7 +116,7 @@ symbian: { # Support backup & restore for Qt libraries qtbackup.sources = backup_registration.xml - qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) + qtbackup.path = c:/private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,) DEPLOYMENT += qtlibraries \ qtbackup \ diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 674064fc83..4953490497 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -10,7 +10,7 @@ requires(contains(QT_CONFIG,private_tests)) wince*|symbian: { addFiles.sources = testdata addFiles.path = . - timesFont.sources = C:/Windows/Fonts/times.ttf + timesFont.sources = c:/windows/fonts/times.ttf timesFont.path = . DEPLOYMENT += addFiles timesFont } -- cgit v1.2.3 From 2e38c0b2339cdf7241ef913197bef4b992895d55 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Thu, 19 May 2011 15:02:03 +0200 Subject: directfb: Paint engine enhancements - Support negative scaling using DSBLIT_FLIP_HORIZONTAL/VERTICAL (DirectFB >= 1.4.3). - Implement drawing points. - Implement rectangular path filling. - Discard drawing when alpha is zero with SrcOver. - Also use DirectFB StretchBlit() if supported by hardware. - Unify/simplify pen/brush/composition support handling. - Enhance output when printing raster fallbacks. - Other minor cleanups. Merge-request: 991 Reviewed-by: Marcel Schuette --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 435 ++++++++++++++------- .../gfxdrivers/directfb/qdirectfbpaintengine.h | 1 + 2 files changed, 299 insertions(+), 137 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 18861cfac1..dfe5db4e76 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -63,27 +63,26 @@ class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { public: enum TransformationTypeFlags { - Matrix_NegativeScale = 0x100, + Matrix_NegativeScaleX = 0x100, + Matrix_NegativeScaleY = 0x200, Matrix_RectsUnsupported = (QTransform::TxRotate|QTransform::TxShear|QTransform::TxProject), - Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported) +#if (Q_DIRECTFB_VERSION >= 0x010403) + Matrix_BlitsUnsupported = (Matrix_RectsUnsupported) +#else + Matrix_BlitsUnsupported = (Matrix_RectsUnsupported|Matrix_NegativeScaleX|Matrix_NegativeScaleY) +#endif }; inline static uint getTransformationType(const QTransform &transform) { int ret = transform.type(); - if (qMin(transform.m11(), transform.m22()) < 0) { - ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale; - } + if (transform.m11() < 0) + ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScaleX; + if (transform.m22() < 0) + ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScaleY; return ret; } - enum CompositionModeStatus { - PorterDuff_None = 0x0, - PorterDuff_Supported = 0x1, - PorterDuff_PremultiplyColors = 0x2, - PorterDuff_AlwaysBlend = 0x4 - }; - enum ClipType { ClipUnset, NoClip, @@ -95,25 +94,24 @@ public: QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p); ~QDirectFBPaintEnginePrivate(); - inline void setTransform(const QTransform &transforma); - inline void setPen(const QPen &pen); - inline void setCompositionMode(QPainter::CompositionMode mode); - inline void setRenderHints(QPainter::RenderHints hints); + void setBrush(const QBrush &brush); + void setCompositionMode(QPainter::CompositionMode mode); + void setPen(const QPen &pen); + void setTransform(const QTransform &transforma); + void setRenderHints(QPainter::RenderHints hints); - inline void setDFBColor(const QColor &color); + bool prepareForDraw(const QColor &color); - inline void lock(); - inline void unlock(); + void lock(); + void unlock(); static inline void unlock(QDirectFBPaintDevice *device); - inline bool isSimpleBrush(const QBrush &brush) const; - void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos, const QTransform &pixmapTransform); void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src); - inline bool supportsStretchBlit() const; + bool supportsStretchBlit() const; - inline void updateClip(); + void updateClip(); virtual void systemStateChanged(); static IDirectFBSurface *getSurface(const QImage &img, bool *release); @@ -131,7 +129,8 @@ public: IDirectFBSurface *surface; bool antialiased; - bool simplePen; + bool supportedBrush; + bool supportedPen; uint transformationType; // this is QTransform::type() + Matrix_NegativeScale if qMin(transform.m11(), transform.m22()) < 0 @@ -141,13 +140,13 @@ public: ClipType clipType; QDirectFBPaintDevice *dfbDevice; - uint compositionModeStatus; + bool supportedComposition; bool isPremultiplied; bool inClip; QRect currentClip; - QDirectFBPaintEngine *q; + QDirectFBPaintEngine *engine; }; class SurfaceCache @@ -183,14 +182,27 @@ static QCache imageCache(4*1024*1024); // 4 MB #define VOID_ARG() static_cast(false) enum PaintOperation { - DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004, - DRAW_PIXMAP = 0x0008, DRAW_TILED_PIXMAP = 0x0010, STROKE_PATH = 0x0020, - DRAW_PATH = 0x0040, DRAW_POINTS = 0x0080, DRAW_ELLIPSE = 0x0100, - DRAW_POLYGON = 0x0200, DRAW_TEXT = 0x0400, FILL_PATH = 0x0800, - FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000, - DRAW_STATICTEXT = 0x8000, ALL = 0xffff + DRAW_RECTS = 0x0001, + DRAW_LINES = 0x0002, + DRAW_IMAGE = 0x0004, + DRAW_PIXMAP = 0x0008, + DRAW_TILED_PIXMAP = 0x0010, + STROKE_PATH = 0x0020, + DRAW_PATH = 0x0040, + DRAW_POINTS = 0x0080, + DRAW_ELLIPSE = 0x0100, + DRAW_POLYGON = 0x0200, + DRAW_TEXT = 0x0400, + FILL_PATH = 0x0800, + FILL_RECT = 0x1000, + DRAW_COLORSPANS = 0x2000, + DRAW_ROUNDED_RECT = 0x4000, + DRAW_STATICTEXT = 0x8000, + ALL = 0xffff }; +//#define QT_DIRECTFB_WARN_ON_RASTERFALLBACKS ALL + enum { RasterWarn = 1, RasterDisable = 2 }; static inline uint rasterFallbacksMask(PaintOperation op) { @@ -268,8 +280,7 @@ static inline uint rasterFallbacksMask(PaintOperation op) template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - uint transformationType, bool simplePen, - uint clipType, uint compositionModeStatus, + QDirectFBPaintEnginePrivate *priv, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three); @@ -283,26 +294,22 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * rasterFallbackWarn("Falling back to raster engine for", \ __FUNCTION__, \ state()->painter->device(), \ - d_func()->transformationType, \ - d_func()->simplePen, \ - d_func()->clipType, \ - d_func()->compositionModeStatus, \ + d_func(), \ #one, one, #two, two, #three, three); \ break; \ case RasterDisable|RasterWarn: \ rasterFallbackWarn("Disabled raster engine operation", \ __FUNCTION__, \ state()->painter->device(), \ - d_func()->transformationType, \ - d_func()->simplePen, \ - d_func()->clipType, \ - d_func()->compositionModeStatus, \ + d_func(), \ #one, one, #two, two, #three, three); \ case RasterDisable: \ return; \ } \ } +template +static inline void drawPoints(const T *points, int n, const QTransform &transform, IDirectFBSurface *surface); template static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface); template @@ -400,6 +407,14 @@ void QDirectFBPaintEngine::clipEnabledChanged() d->updateClip(); } +void QDirectFBPaintEngine::brushChanged() +{ + Q_D(QDirectFBPaintEngine); + d->setBrush(state()->brush); + + QRasterPaintEngine::brushChanged(); +} + void QDirectFBPaintEngine::penChanged() { Q_D(QDirectFBPaintEngine); @@ -494,23 +509,21 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) return; if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported) - || !d->simplePen + || !d->supportedPen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !d->isSimpleBrush(brush) - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedBrush + || !d->supportedComposition) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); return; } - if (brush.style() != Qt::NoBrush) { - d->setDFBColor(brush.color()); + if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) { CLIPPED_PAINT(QT_PREPEND_NAMESPACE(fillRects)(rects, rectCount, state()->matrix, d->surface)); } - if (pen.style() != Qt::NoPen) { - d->setDFBColor(pen.color()); + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects)(rects, rectCount, state()->matrix, d->surface)); } } @@ -524,23 +537,21 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) return; if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported) - || !d->simplePen + || !d->supportedPen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !d->isSimpleBrush(brush) - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedBrush + || !d->supportedComposition) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); return; } - if (brush.style() != Qt::NoBrush) { - d->setDFBColor(brush.color()); + if (brush.style() != Qt::NoBrush && d->prepareForDraw(brush.color())) { CLIPPED_PAINT(fillRects(rects, rectCount, state()->matrix, d->surface)); } - if (pen.style() != Qt::NoPen) { - d->setDFBColor(pen.color()); + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawRects)(rects, rectCount, state()->matrix, d->surface)); } } @@ -550,17 +561,16 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) Q_D(QDirectFBPaintEngine); const QPen &pen = state()->pen; - if (!d->simplePen + if (!d->supportedPen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedComposition) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); return; } - if (pen.style() != Qt::NoPen) { - d->setDFBColor(pen.color()); + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } } @@ -570,17 +580,16 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) Q_D(QDirectFBPaintEngine); const QPen &pen = state()->pen; - if (!d->simplePen + if (!d->supportedPen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedComposition) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); return; } - if (pen.style() != Qt::NoPen) { - d->setDFBColor(pen.color()); + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawLines)(lines, lineCount, state()->matrix, d->surface)); } } @@ -610,7 +619,7 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, */ #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) + if (!d->supportedComposition || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size()) @@ -664,7 +673,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) + if (!d->supportedComposition || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())) { @@ -701,7 +710,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r, RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset); d->lock(); QRasterPaintEngine::drawTiledPixmap(r, pixmap, offset); - } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) + } else if (!d->supportedComposition || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.isScaling())) { @@ -740,18 +749,40 @@ void QDirectFBPaintEngine::drawPath(const QPainterPath &path) void QDirectFBPaintEngine::drawPoints(const QPointF *points, int pointCount) { - RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG()); Q_D(QDirectFBPaintEngine); - d->lock(); - QRasterPaintEngine::drawPoints(points, pointCount); + + const QPen &pen = state()->pen; + if (!d->supportedPen + || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip + || !d->supportedComposition) { + RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG()); + d->lock(); + QRasterPaintEngine::drawPoints(points, pointCount); + return; + } + + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints)(points, pointCount, state()->matrix, d->surface)); + } } void QDirectFBPaintEngine::drawPoints(const QPoint *points, int pointCount) { - RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG()); Q_D(QDirectFBPaintEngine); - d->lock(); - QRasterPaintEngine::drawPoints(points, pointCount); + + const QPen &pen = state()->pen; + if (!d->supportedPen + || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip + || !d->supportedComposition) { + RASTERFALLBACK(DRAW_POINTS, pointCount, VOID_ARG(), VOID_ARG()); + d->lock(); + QRasterPaintEngine::drawPoints(points, pointCount); + return; + } + + if (pen.style() != Qt::NoPen && d->prepareForDraw(pen.color())) { + CLIPPED_PAINT(QT_PREPEND_NAMESPACE(drawPoints)(points, pointCount, state()->matrix, d->surface)); + } } void QDirectFBPaintEngine::drawEllipse(const QRectF &rect) @@ -793,6 +824,29 @@ void QDirectFBPaintEngine::fill(const QVectorPath &path, const QBrush &brush) { if (brush.style() == Qt::NoBrush) return; + + const QPainterPath::ElementType *elements = path.elements(); + const qreal *points = path.points(); + + if (path.elementCount() == 5) { + if (elements[0] == QPainterPath::MoveToElement + && elements[1] == QPainterPath::LineToElement + && elements[2] == QPainterPath::LineToElement + && elements[3] == QPainterPath::LineToElement + && elements[4] == QPainterPath::LineToElement) { + + if (points[1] == points[3] + && points[2] == points[4] + && points[5] == points[7] + && points[6] == points[0]) { + QRectF rect( points[0], points[1], points[4], points[5] ); + + fillRect( rect, brush ); + return; + } + } + } + RASTERFALLBACK(FILL_PATH, path, brush, VOID_ARG()); Q_D(QDirectFBPaintEngine); d->lock(); @@ -828,12 +882,13 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) return; if (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedComposition) { break; } - d->setDFBColor(color); - const QRect r = state()->matrix.mapRect(rect).toRect(); - CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); + if (d->prepareForDraw(color)) { + const QRect r = state()->matrix.mapRect(rect).toRect(); + CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); + } return; } case Qt::TexturePattern: { @@ -842,7 +897,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) QTransform transform(stateTransform); transform.translate(brushOrigin.x(), brushOrigin.y()); transform = brush.transform() * transform; - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) + if (!d->supportedComposition || (QDirectFBPaintEnginePrivate::getTransformationType(transform) & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (!d->supportsStretchBlit() && transform.isScaling())) { break; @@ -870,12 +925,11 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QDirectFBPaintEngine); if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) - || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { + || !d->supportedComposition) { RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG()); d->lock(); QRasterPaintEngine::fillRect(rect, color); - } else { - d->setDFBColor(color); + } else if (d->prepareForDraw(color)) { const QRect r = state()->matrix.mapRect(rect).toRect(); CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); } @@ -909,12 +963,11 @@ void QDirectFBPaintEngine::initImageCache(int size) // ---- QDirectFBPaintEnginePrivate ---- - QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p) - : surface(0), antialiased(false), simplePen(false), + : surface(0), antialiased(false), supportedBrush(false), supportedPen(false), transformationType(0), opacity(255), clipType(ClipUnset), dfbDevice(0), - compositionModeStatus(0), isPremultiplied(false), inClip(false), q(p) + supportedComposition(false), isPremultiplied(false), inClip(false), engine(p) { fb = QDirectFBScreen::instance()->dfb(); surfaceCache = new SurfaceCache; @@ -925,11 +978,6 @@ QDirectFBPaintEnginePrivate::~QDirectFBPaintEnginePrivate() delete surfaceCache; } -bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const -{ - return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased); -} - void QDirectFBPaintEnginePrivate::lock() { // We will potentially get a new pointer to the buffer after a @@ -961,25 +1009,9 @@ void QDirectFBPaintEnginePrivate::unlock(QDirectFBPaintDevice *device) #endif } -void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform) +void QDirectFBPaintEnginePrivate::setBrush(const QBrush &brush) { - transformationType = getTransformationType(transform); - setPen(q->state()->pen); -} - -void QDirectFBPaintEnginePrivate::setPen(const QPen &pen) -{ - if (pen.style() == Qt::NoPen) { - simplePen = true; - } else if (pen.style() == Qt::SolidLine - && !antialiased - && pen.brush().style() == Qt::SolidPattern - && pen.widthF() <= 1.0 - && (transformationType < QTransform::TxScale || pen.isCosmetic())) { - simplePen = true; - } else { - simplePen = false; - } + supportedBrush = (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased); } void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode) @@ -989,23 +1021,19 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m static const bool forceRasterFallBack = qgetenv("QT_DIRECTFB_FORCE_RASTER").toInt() > 0; if (forceRasterFallBack) { - compositionModeStatus = PorterDuff_None; + supportedComposition = false; return; } - compositionModeStatus = PorterDuff_Supported|PorterDuff_PremultiplyColors|PorterDuff_AlwaysBlend; + supportedComposition = true; switch (mode) { case QPainter::CompositionMode_Clear: surface->SetPorterDuff(surface, DSPD_CLEAR); break; case QPainter::CompositionMode_Source: surface->SetPorterDuff(surface, DSPD_SRC); - compositionModeStatus &= ~PorterDuff_AlwaysBlend; - if (!isPremultiplied) - compositionModeStatus &= ~PorterDuff_PremultiplyColors; break; case QPainter::CompositionMode_SourceOver: - compositionModeStatus &= ~PorterDuff_AlwaysBlend; surface->SetPorterDuff(surface, DSPD_SRC_OVER); break; case QPainter::CompositionMode_DestinationOver: @@ -1013,8 +1041,6 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; case QPainter::CompositionMode_SourceIn: surface->SetPorterDuff(surface, DSPD_SRC_IN); - if (!isPremultiplied) - compositionModeStatus &= ~PorterDuff_PremultiplyColors; break; case QPainter::CompositionMode_DestinationIn: surface->SetPorterDuff(surface, DSPD_DST_IN); @@ -1044,32 +1070,69 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; #endif default: - compositionModeStatus = PorterDuff_None; + supportedComposition = false; break; } } +void QDirectFBPaintEnginePrivate::setPen(const QPen &pen) +{ + if (pen.style() == Qt::NoPen) { + supportedPen = true; + } else if (pen.style() == Qt::SolidLine + && !antialiased + && pen.brush().style() == Qt::SolidPattern + && pen.widthF() <= 1.0 + && (transformationType < QTransform::TxScale || pen.isCosmetic())) { + supportedPen = true; + } else { + supportedPen = false; + } +} + +void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform) +{ + transformationType = getTransformationType(transform); + setPen(engine->state()->pen); +} + void QDirectFBPaintEnginePrivate::setRenderHints(QPainter::RenderHints hints) { const bool old = antialiased; antialiased = bool(hints & QPainter::Antialiasing); if (old != antialiased) { - setPen(q->state()->pen); + setPen(engine->state()->pen); } } void QDirectFBPaintEnginePrivate::prepareForBlit(uint flags) { DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX; - if (flags & Premultiplied) - blittingFlags |= DSBLIT_SRC_PREMULTIPLY; + +#if (Q_DIRECTFB_VERSION >= 0x010403) + if (transformationType & Matrix_NegativeScaleX) + blittingFlags |= DSBLIT_FLIP_HORIZONTAL; + + if (transformationType & Matrix_NegativeScaleY) + blittingFlags |= DSBLIT_FLIP_VERTICAL; +#endif + if (flags & HasAlpha) blittingFlags |= DSBLIT_BLEND_ALPHACHANNEL; + if (opacity != 255) { blittingFlags |= DSBLIT_BLEND_COLORALPHA; surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); } + if (flags & Premultiplied) { + if (blittingFlags & DSBLIT_BLEND_COLORALPHA) + blittingFlags |= DSBLIT_SRC_PREMULTCOLOR; + } else { + if (blittingFlags & (DSBLIT_BLEND_ALPHACHANNEL | DSBLIT_BLEND_COLORALPHA)) + blittingFlags |= DSBLIT_SRC_PREMULTIPLY; + } + surface->SetBlittingFlags(surface, blittingFlags); } @@ -1080,14 +1143,14 @@ static inline uint ALPHA_MUL(uint x, uint a) return t; } -void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color) +bool QDirectFBPaintEnginePrivate::prepareForDraw(const QColor &color) { Q_ASSERT(surface); - Q_ASSERT(compositionModeStatus & PorterDuff_Supported); + Q_ASSERT(supportedComposition); const quint8 alpha = (opacity == 255 ? color.alpha() : ALPHA_MUL(color.alpha(), opacity)); QColor col; - if (compositionModeStatus & PorterDuff_PremultiplyColors) { + if (isPremultiplied) { col = QColor(ALPHA_MUL(color.red(), alpha), ALPHA_MUL(color.green(), alpha), ALPHA_MUL(color.blue(), alpha), @@ -1096,7 +1159,28 @@ void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color) col = QColor(color.red(), color.green(), color.blue(), alpha); } surface->SetColor(surface, col.red(), col.green(), col.blue(), col.alpha()); - surface->SetDrawingFlags(surface, alpha == 255 && !(compositionModeStatus & PorterDuff_AlwaysBlend) ? DSDRAW_NOFX : DSDRAW_BLEND); + + bool blend = false; + + switch (engine->state()->composition_mode) { + case QPainter::CompositionMode_Clear: + case QPainter::CompositionMode_Source: + break; + case QPainter::CompositionMode_SourceOver: + if (alpha == 0) + return false; + + if (alpha != 255) + blend = true; + break; + default: + blend = true; + break; + } + + surface->SetDrawingFlags(surface, blend ? DSDRAW_BLEND : DSDRAW_NOFX); + + return true; } IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, bool *release) @@ -1137,7 +1221,7 @@ IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, boo void QDirectFBPaintEnginePrivate::blit(const QRectF &dest, IDirectFBSurface *s, const QRectF &src) { const QRect sr = src.toRect(); - const QRect dr = q->state()->matrix.mapRect(dest).toRect(); + const QRect dr = engine->state()->matrix.mapRect(dest).toRect(); if (dr.isEmpty()) return; const DFBRectangle sRect = { sr.x(), sr.y(), sr.width(), sr.height() }; @@ -1167,7 +1251,7 @@ static inline qreal fixCoord(qreal rect_pos, qreal pixmapSize, qreal offset) void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &off, const QTransform &pixmapTransform) { - const QTransform &transform = q->state()->matrix; + const QTransform &transform = engine->state()->matrix; Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) && !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported)); const QRect destinationRect = transform.mapRect(dest).toRect().normalized(); @@ -1293,7 +1377,12 @@ void QDirectFBPaintEnginePrivate::updateClip() bool QDirectFBPaintEnginePrivate::supportsStretchBlit() const { #ifdef QT_DIRECTFB_STRETCHBLIT - return !(q->state()->renderHints & QPainter::SmoothPixmapTransform); + DFBGraphicsDeviceDescription desc; + + fb->GetDeviceDescription(fb, &desc); + + return !(engine->state()->renderHints & QPainter::SmoothPixmapTransform) + || (desc.acceleration_mask & DFXL_STRETCHBLIT); #else return false; #endif @@ -1334,10 +1423,32 @@ void SurfaceCache::clear() } -static inline QRect mapRect(const QTransform &transform, const QRect &rect) { return transform.mapRect(rect); } -static inline QRect mapRect(const QTransform &transform, const QRectF &rect) { return transform.mapRect(rect).toRect(); } +static inline QRect map(const QTransform &transform, const QRect &rect) { return transform.mapRect(rect); } +static inline QRect map(const QTransform &transform, const QRectF &rect) { return transform.mapRect(rect).toRect(); } static inline QLine map(const QTransform &transform, const QLine &line) { return transform.map(line); } static inline QLine map(const QTransform &transform, const QLineF &line) { return transform.map(line).toLine(); } +static inline QPoint map(const QTransform &transform, const QPoint &point) { return transform.map(point); } +static inline QPoint map(const QTransform &transform, const QPointF &point) { return transform.map(point).toPoint(); } + +template +static inline void drawPoints(const T *points, int n, const QTransform &transform, IDirectFBSurface *surface) +{ + if (n == 1) { + const QPoint p = map(transform, points[0]); + surface->FillRectangle(surface, p.x(), p.y(), 1, 1); + } else { + QVarLengthArray rectArray(n); + for (int i=0; iFillRectangles(surface, rectArray.constData(), n); + } +} + template static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface) { @@ -1361,12 +1472,12 @@ template static inline void fillRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface) { if (n == 1) { - const QRect r = mapRect(transform, rects[0]); + const QRect r = map(transform, rects[0]); surface->FillRectangle(surface, r.x(), r.y(), r.width(), r.height()); } else { QVarLengthArray rectArray(n); for (int i=0; i static inline void drawRects(const T *rects, int n, const QTransform &transform, IDirectFBSurface *surface) { for (int i=0; iDrawRectangle(surface, r.x(), r.y(), r.width(), r.height()); } } @@ -1389,14 +1500,18 @@ template inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr(const bool &) { return 0; } template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - uint transformationType, bool simplePen, - uint clipType, uint compositionModeStatus, + QDirectFBPaintEnginePrivate *priv, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three) { QString out; QDebug dbg(&out); + + + dbg << "***"; + + dbg << msg << (QByteArray(func) + "()") << "painting on"; if (dev->devType() == QInternal::Widget) { dbg << static_cast(dev); @@ -1404,10 +1519,55 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * dbg << dev << "of type" << dev->devType(); } - dbg << QString::fromLatin1("transformationType 0x%1").arg(transformationType, 3, 16, QLatin1Char('0')) - << "simplePen" << simplePen - << "clipType" << clipType - << "compositionModeStatus" << compositionModeStatus; + dbg << "\n\t"; + + + dbg << ((priv->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) ? "*" : "") << QString::fromLatin1("transformationType 0x%1").arg(priv->transformationType, 3, 16, QLatin1Char('0')); + + dbg << priv->engine->state()->matrix; + + dbg << "\n\t"; + + + + dbg << (priv->supportedBrush ? "" : "*") << "supportedBrush" << priv->supportedBrush; + + dbg << priv->engine->state()->brush; + + dbg << "\n\t"; + + const QGradient *gradient = priv->engine->state()->brush.gradient(); + if (gradient) { + const QGradientStops &stops = gradient->stops(); + + dbg << "gradient: " << *gradient; + dbg << "stops: " << stops.count(); + dbg << "\n\t"; + + for (int i=0; isupportedPen ? "" : "*") << "supportedPen" << priv->supportedPen; + + dbg << priv->engine->state()->pen; + + dbg << "\n\t"; + + + + dbg << (priv->clipType == QDirectFBPaintEnginePrivate::ComplexClip ? "*" : "") << "clipType" << priv->clipType; + + dbg << "\n\t"; + + + dbg << (priv->supportedComposition ? "" : "*") << "supportedComposition" << priv->supportedComposition; + + dbg << "\n\t"; + const T1 *t1 = ptr(one); const T2 *t2 = ptr(two); @@ -1428,3 +1588,4 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * QT_END_NAMESPACE #endif // QT_NO_QWS_DIRECTFB + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h index a3217d0f32..b71671dd6b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.h @@ -97,6 +97,7 @@ public: virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode); virtual void clipEnabledChanged(); + virtual void brushChanged(); virtual void penChanged(); virtual void opacityChanged(); virtual void compositionModeChanged(); -- cgit v1.2.3 From 841cd1500d153f5141f4c8a1e039f235c39d01f3 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Thu, 19 May 2011 15:51:47 +0200 Subject: Fix brush transform in QtDirectFB backend, fixing QTBUG-18577 Merge-request: 1224 Reviewed-by: Marcel Schuette --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index dfe5db4e76..d90c8ca955 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -1254,7 +1254,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix const QTransform &transform = engine->state()->matrix; Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) && !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported)); - const QRect destinationRect = transform.mapRect(dest).toRect().normalized(); + const QRect destinationRect = dest.toRect(); QRect newClip = destinationRect; if (!currentClip.isEmpty()) newClip &= currentClip; @@ -1270,7 +1270,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix }; surface->SetClip(surface, &clip); - QPointF offset = pixmapTransform.inverted().map(off); + QPointF offset = off; Q_ASSERT(transform.type() <= QTransform::TxScale); QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); -- cgit v1.2.3 From a0b2fc44ff8752193cacde52276b1822741f5374 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 20 May 2011 14:22:39 +1000 Subject: Notify when the TextInput cursorRectangle property changes within pre-edit Anything that updates the horizontal scroll is also likely to change the position of the cursor rectangle and the micro focus. So group these actions together and ensure they're done before emitting cursorPositionChanged() so positionToRectangle() returns a valid value from that handler. Change-Id: I5fadc58efb148a8dabe88a94381c86cd64dba3bd Task-number: QTBUG-19089 Reviewed-by: Martin Jones --- .../graphicsitems/qdeclarativetextinput.cpp | 54 ++++++++-------------- .../graphicsitems/qdeclarativetextinput_p.h | 5 +- .../tst_qdeclarativetextinput.cpp | 10 ++++ 3 files changed, 33 insertions(+), 36 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 9a917690f1..226cce954d 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -236,11 +236,11 @@ void QDeclarativeTextInput::setFont(const QFont &font) if (oldFont != d->font) { d->control->setFont(d->font); + updateSize(); + updateCursorRectangle(); if(d->cursorItem){ d->cursorItem->setHeight(QFontMetrics(d->font).height()); - moveCursor(); } - updateSize(); } emit fontChanged(d->sourceFont); } @@ -359,8 +359,7 @@ void QDeclarativeTextInput::setHAlign(HAlignment align) bool forceAlign = d->hAlignImplicit && d->effectiveLayoutMirror; d->hAlignImplicit = false; if (d->setHAlign(align, forceAlign) && isComponentComplete()) { - updateRect(); - d->updateHorizontalScroll(); + updateCursorRectangle(); } } @@ -369,8 +368,7 @@ void QDeclarativeTextInput::resetHAlign() Q_D(QDeclarativeTextInput); d->hAlignImplicit = true; if (d->determineHorizontalAlignment() && isComponentComplete()) { - updateRect(); - d->updateHorizontalScroll(); + updateCursorRectangle(); } } @@ -423,8 +421,7 @@ void QDeclarativeTextInputPrivate::mirrorChange() Q_Q(QDeclarativeTextInput); if (q->isComponentComplete()) { if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) { - q->updateRect(); - updateHorizontalScroll(); + q->updateCursorRectangle(); emit q->effectiveHorizontalAlignmentChanged(); } } @@ -683,7 +680,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b) d->autoScroll = b; //We need to repaint so that the scrolling is taking into account. updateSize(true); - d->updateHorizontalScroll(); + updateCursorRectangle(); emit autoScrollChanged(d->autoScroll); } @@ -947,10 +944,6 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c) d->cursorComponent = c; if(!c){ //note that the components are owned by something else - disconnect(d->control, SIGNAL(cursorPositionChanged(int,int)), - this, SLOT(moveCursor())); - disconnect(d->control, SIGNAL(updateMicroFocus()), - this, SLOT(moveCursor())); delete d->cursorItem; }else{ d->startCreatingCursor(); @@ -962,10 +955,6 @@ void QDeclarativeTextInput::setCursorDelegate(QDeclarativeComponent* c) void QDeclarativeTextInputPrivate::startCreatingCursor() { Q_Q(QDeclarativeTextInput); - q->connect(control, SIGNAL(cursorPositionChanged(int,int)), - q, SLOT(moveCursor()), Qt::UniqueConnection); - q->connect(control, SIGNAL(updateMicroFocus()), - q, SLOT(moveCursor()), Qt::UniqueConnection); if(cursorComponent->isReady()){ q->createCursor(); }else if(cursorComponent->isLoading()){ @@ -1001,15 +990,6 @@ void QDeclarativeTextInput::createCursor() d->cursorItem->setHeight(d->control->height()-1); // -1 to counter QLineControl's +1 which is not consistent with Text. } -void QDeclarativeTextInput::moveCursor() -{ - Q_D(QDeclarativeTextInput); - if(!d->cursorItem) - return; - d->updateHorizontalScroll(); - d->cursorItem->setX(d->control->cursorToX() - d->hscroll); -} - /*! \qmlmethod rect TextInput::positionToRectangle(int pos) @@ -1118,8 +1098,6 @@ void QDeclarativeTextInput::inputMethodEvent(QInputMethodEvent *ev) ev->ignore(); } else { d->control->processInputMethodEvent(ev); - updateSize(); - d->updateHorizontalScroll(); } } if (!ev->isAccepted()) @@ -1297,7 +1275,7 @@ void QDeclarativeTextInput::geometryChanged(const QRectF &newGeometry, Q_D(QDeclarativeTextInput); if (newGeometry.width() != oldGeometry.width()) { updateSize(); - d->updateHorizontalScroll(); + updateCursorRectangle(); } QDeclarativePaintedItem::geometryChanged(newGeometry, oldGeometry); } @@ -1643,7 +1621,6 @@ void QDeclarativeTextInput::moveCursorSelection(int position) { Q_D(QDeclarativeTextInput); d->control->moveCursor(position, true); - d->updateHorizontalScroll(); } /*! @@ -1900,7 +1877,7 @@ void QDeclarativeTextInputPrivate::init() canPaste = !control->isReadOnly() && QApplication::clipboard()->text().length() != 0; #endif // QT_NO_CLIPBOARD q->connect(control, SIGNAL(updateMicroFocus()), - q, SLOT(updateMicroFocus())); + q, SLOT(updateCursorRectangle())); q->connect(control, SIGNAL(displayTextChanged(QString)), q, SLOT(updateRect())); q->updateSize(); @@ -1916,9 +1893,7 @@ void QDeclarativeTextInputPrivate::init() void QDeclarativeTextInput::cursorPosChanged() { Q_D(QDeclarativeTextInput); - d->updateHorizontalScroll(); - updateRect();//TODO: Only update rect between pos's - updateMicroFocus(); + updateCursorRectangle(); emit cursorPositionChanged(); d->control->resetCursorBlinkTimer(); @@ -1934,6 +1909,17 @@ void QDeclarativeTextInput::cursorPosChanged() } } +void QDeclarativeTextInput::updateCursorRectangle() +{ + Q_D(QDeclarativeTextInput); + d->updateHorizontalScroll(); + updateRect();//TODO: Only update rect between pos's + updateMicroFocus(); + emit cursorRectangleChanged(); + if (d->cursorItem) + d->cursorItem->setX(d->control->cursorToX() - d->hscroll); +} + void QDeclarativeTextInput::selectionChanged() { Q_D(QDeclarativeTextInput); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index ec70e43f68..171db92742 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -75,7 +75,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged) Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged) Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) - Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorPositionChanged) + Q_PROPERTY(QRect cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) Q_PROPERTY(QDeclarativeComponent *cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged) Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged) Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged) @@ -221,6 +221,7 @@ public: Q_SIGNALS: void textChanged(); void cursorPositionChanged(); + void cursorRectangleChanged(); void selectionStartChanged(); void selectionEndChanged(); void selectedTextChanged(); @@ -279,8 +280,8 @@ private Q_SLOTS: void q_textChanged(); void selectionChanged(); void createCursor(); - void moveCursor(); void cursorPosChanged(); + void updateCursorRectangle(); void updateRect(const QRect &r = QRect()); void q_canPasteChanged(); diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index a241241505..3349d34986 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -2431,15 +2431,20 @@ void tst_qdeclarativetextinput::preeditAutoScroll() QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), static_cast(&view)); + QSignalSpy cursorRectangleSpy(&input, SIGNAL(cursorRectangleChanged())); + int cursorRectangleChanges = 0; + // test the text is scrolled so the preedit is visible. ic.sendPreeditText(preeditText.mid(0, 3), 1); QVERIFY(input.positionAt(0) != 0); QVERIFY(input.cursorRectangle().left() < input.boundingRect().width()); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); // test the text is scrolled back when the preedit is removed. ic.sendEvent(QInputMethodEvent()); QCOMPARE(input.positionAt(0), 0); QCOMPARE(input.positionAt(input.width()), 5); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); // some tolerance for different fonts. #ifdef Q_OS_LINUX @@ -2455,26 +2460,31 @@ void tst_qdeclarativetextinput::preeditAutoScroll() ic.sendPreeditText(preeditText, i + 1); QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error); QVERIFY(input.positionToRectangle(0).x() < x); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); x = input.positionToRectangle(0).x(); } for (int i = 1; i >= 0; --i) { ic.sendPreeditText(preeditText, i + 1); QVERIFY(input.cursorRectangle().right() >= fm.width(preeditText.at(i)) - error); QVERIFY(input.positionToRectangle(0).x() > x); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); x = input.positionToRectangle(0).x(); } // Test incrementing the preedit cursor doesn't cause further // scrolling when right most text is visible. ic.sendPreeditText(preeditText, preeditText.length() - 3); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); x = input.positionToRectangle(0).x(); for (int i = 2; i >= 0; --i) { ic.sendPreeditText(preeditText, preeditText.length() - i); QCOMPARE(input.positionToRectangle(0).x(), x); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); } for (int i = 1; i < 3; ++i) { ic.sendPreeditText(preeditText, preeditText.length() - i); QCOMPARE(input.positionToRectangle(0).x(), x); + QCOMPARE(cursorRectangleSpy.count(), ++cursorRectangleChanges); } // Test disabling auto scroll. -- cgit v1.2.3 From 29a6523dd8d3fac9be198c73153691c6dcdb3b21 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 10 Aug 2010 15:58:25 +0200 Subject: Make selection work across ligatures For widgets like QPlainTextEdit, selection across ligatures (typically 'fi', 'ffi', 'fl', etc.) end up highlighting the entire ligature glyphs, this patch fixed that by dividing width inside the ligature so that selection will not expand past the actual selected characters. Since cursor position already considered this, we merely adopted the algorithm and made it a separated helper function for all necessary cases. Dividing width directly looks like a temporary workaround but works well enough so far for cursor positions. Task-number: QTBUG-11969 Reviewed-by: Eskil (cherry picked from commit 99fd5825dfb4d50cff93165995701a65b7a8e4ed) --- src/gui/text/qtextlayout.cpp | 64 +++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index c34a04ba97..7328ea9cda 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1011,6 +1011,35 @@ QScriptItem &QTextLineItemIterator::next() return *si; } +static QFixed offsetInLigature(const unsigned short *logClusters, + const QGlyphLayout &glyphs, + int pos, int max, int glyph_pos) +{ + int offsetInCluster = 0; + for (int i = pos - 1; i >= 0; i--) { + if (logClusters[i] == glyph_pos) + offsetInCluster++; + else + break; + } + + // in the case that the offset is inside a (multi-character) glyph, + // interpolate the position. + if (offsetInCluster > 0) { + int clusterLength = 0; + for (int i = pos - offsetInCluster; i < max; i++) { + if (logClusters[i] == glyph_pos) + clusterLength++; + else + break; + } + if (clusterLength) + return glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; + } + + return 0; +} + bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const { *selectionX = *selectionWidth = 0; @@ -1050,8 +1079,19 @@ bool QTextLineItemIterator::getSelectionBounds(QFixed *selectionX, QFixed *selec swidth += glyphs.effectiveAdvance(g); } - *selectionX = x + soff; - *selectionWidth = swidth; + // If the starting character is in the middle of a ligature, + // selection should only contain the right part of that ligature + // glyph, so we need to get the width of the left part here and + // add it to *selectionX + QFixed leftOffsetInLigature = offsetInLigature(logClusters, glyphs, from, + to, start_glyph); + *selectionX = x + soff + leftOffsetInLigature; + *selectionWidth = swidth - leftOffsetInLigature; + // If the ending character is also part of a ligature, swidth does + // not contain that part yet, we also need to find out the width of + // that left part + *selectionWidth += offsetInLigature(logClusters, glyphs, to, + eng->length(item), end_glyph); } return true; } @@ -2465,14 +2505,6 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const if(pos == l) x += si->width; } else { - int offsetInCluster = 0; - for (int i=pos-1; i >= 0; i--) { - if (logClusters[i] == glyph_pos) - offsetInCluster++; - else - break; - } - if (reverse) { int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; @@ -2484,17 +2516,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const for (int i = glyph_start; i < glyph_pos; i++) x += glyphs.effectiveAdvance(i); } - if (offsetInCluster > 0) { // in the case that the offset is inside a (multi-character) glyph, interpolate the position. - int clusterLength = 0; - for (int i=pos - offsetInCluster; i < line.length; i++) { - if (logClusters[i] == glyph_pos) - clusterLength++; - else - break; - } - if (clusterLength) - x+= glyphs.advances_x[glyph_pos] * offsetInCluster / clusterLength; - } + x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos); } *cursorPos = pos + si->position; -- cgit v1.2.3 From d80949eee06ff464d58bd97a6c89bae7e961f3c8 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 19 May 2011 12:40:03 +0200 Subject: Fix ligature offset in multi-line text Reviewed-by: Eskil --- src/gui/text/qtextlayout.cpp | 4 ++-- tests/auto/qtextlayout/tst_qtextlayout.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 7328ea9cda..de4ca4ff05 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2505,8 +2505,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const if(pos == l) x += si->width; } else { + int end = qMin(lineEnd, si->position + l) - si->position; if (reverse) { - int end = qMin(lineEnd, si->position + l) - si->position; int glyph_end = end == l ? si->num_glyphs : logClusters[end]; for (int i = glyph_end - 1; i >= glyph_pos; i--) x += glyphs.effectiveAdvance(i); @@ -2516,7 +2516,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const for (int i = glyph_start; i < glyph_pos; i++) x += glyphs.effectiveAdvance(i); } - x += offsetInLigature(logClusters, glyphs, pos, line.length, glyph_pos); + x += offsetInLigature(logClusters, glyphs, pos, end, glyph_pos); } *cursorPos = pos + si->position; diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index ad33b70b51..964679add2 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -126,6 +126,7 @@ private slots: void textWidthWithStackedTextEngine(); void textWidthWithLineSeparator(); void textWithSurrogates_qtbug15679(); + void cursorInLigatureWithMultipleLines(); private: QFont testFont; @@ -1436,5 +1437,21 @@ void tst_QTextLayout::textWithSurrogates_qtbug15679() QCOMPARE(x[2] - x[0], x[5] - x[3]); } +void tst_QTextLayout::cursorInLigatureWithMultipleLines() +{ +#if !defined(Q_WS_MAC) + QSKIP("This test can only be run on Mac", SkipAll); +#endif + QTextLayout layout("first line finish", QFont("Times", 20)); + layout.beginLayout(); + QTextLine line = layout.createLine(); + line.setLineWidth(70); + line = layout.createLine(); + layout.endLayout(); + + // The second line will be "finish", with "fi" as a ligature + QVERIFY(line.cursorToX(0) != line.cursorToX(1)); +} + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" -- cgit v1.2.3 From 3b6c77da8c8b2b7db4d75f122464462656ef8daf Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 20 May 2011 13:55:06 +0200 Subject: Absenting function in winscw def files. --- src/s60installs/bwins/QtCoreu.def | 92 ++++++------ src/s60installs/bwins/QtDeclarativeu.def | 18 +-- src/s60installs/bwins/QtGuiu.def | 240 +++++++++++++++---------------- src/s60installs/bwins/QtMultimediau.def | 10 +- src/s60installs/bwins/QtNetworku.def | 28 ++-- src/s60installs/bwins/QtScriptu.def | 4 +- src/s60installs/bwins/QtSqlu.def | 6 +- src/s60installs/bwins/QtTestu.def | 4 +- src/s60installs/bwins/QtXmlPatternsu.def | 6 +- src/s60installs/bwins/QtXmlu.def | 14 +- src/s60installs/bwins/phononu.def | 8 +- 11 files changed, 215 insertions(+), 215 deletions(-) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index d1e734de5e..aa1f348002 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4489,50 +4489,50 @@ EXPORTS ?symbianCommandLine@QCoreApplicationPrivate@@SAPAVCApaCommandLine@@XZ @ 4488 NONAME ; class CApaCommandLine * QCoreApplicationPrivate::symbianCommandLine(void) ?revision@QMetaProperty@@QBEHXZ @ 4489 NONAME ; int QMetaProperty::revision(void) const ?revision@QMetaMethod@@QBEHXZ @ 4490 NONAME ; int QMetaMethod::revision(void) const - ??_EQDateTime@@QAE@I@Z @ 4491 NONAME ; QDateTime::~QDateTime(unsigned int) - ??4QDate@@QAEAAV0@ABV0@@Z @ 4492 NONAME ; class QDate & QDate::operator=(class QDate const &) - ??4QSizeF@@QAEAAV0@ABV0@@Z @ 4493 NONAME ; class QSizeF & QSizeF::operator=(class QSizeF const &) - ??0QSize@@QAE@ABV0@@Z @ 4494 NONAME ; QSize::QSize(class QSize const &) - ??0QEvent@@QAE@ABV0@@Z @ 4495 NONAME ; QEvent::QEvent(class QEvent const &) - ??0QTextCodecFactoryInterface@@QAE@XZ @ 4496 NONAME ; QTextCodecFactoryInterface::QTextCodecFactoryInterface(void) - ??0QPointF@@QAE@ABV0@@Z @ 4497 NONAME ; QPointF::QPointF(class QPointF const &) - ??_EQUrl@@QAE@I@Z @ 4498 NONAME ; QUrl::~QUrl(unsigned int) - ??0QGenericArgument@@QAE@ABV0@@Z @ 4499 NONAME ; QGenericArgument::QGenericArgument(class QGenericArgument const &) - ??_EQVariant@@QAE@I@Z @ 4500 NONAME ; QVariant::~QVariant(unsigned int) - ??4QLineF@@QAEAAV0@ABV0@@Z @ 4501 NONAME ; class QLineF & QLineF::operator=(class QLineF const &) - ??0QXmlStreamAttributes@@QAE@ABV0@@Z @ 4502 NONAME ; QXmlStreamAttributes::QXmlStreamAttributes(class QXmlStreamAttributes const &) - ??0QMetaEnum@@QAE@ABV0@@Z @ 4503 NONAME ; QMetaEnum::QMetaEnum(class QMetaEnum const &) - ??4QUuid@@QAEAAU0@ABU0@@Z @ 4504 NONAME ; struct QUuid & QUuid::operator=(struct QUuid const &) - ??0CQtActiveScheduler@@QAE@XZ @ 4505 NONAME ; CQtActiveScheduler::CQtActiveScheduler(void) - ??0QSizeF@@QAE@ABV0@@Z @ 4506 NONAME ; QSizeF::QSizeF(class QSizeF const &) - ??4QMetaEnum@@QAEAAV0@ABV0@@Z @ 4507 NONAME ; class QMetaEnum & QMetaEnum::operator=(class QMetaEnum const &) - ??4QRect@@QAEAAV0@ABV0@@Z @ 4508 NONAME ; class QRect & QRect::operator=(class QRect const &) - ??_EQMutexPool@@QAE@I@Z @ 4509 NONAME ; QMutexPool::~QMutexPool(unsigned int) - ??0QMetaClassInfo@@QAE@ABV0@@Z @ 4510 NONAME ; QMetaClassInfo::QMetaClassInfo(class QMetaClassInfo const &) - ??0QDate@@QAE@ABV0@@Z @ 4511 NONAME ; QDate::QDate(class QDate const &) - ??_EQTextDecoder@@QAE@I@Z @ 4512 NONAME ; QTextDecoder::~QTextDecoder(unsigned int) - ??_EQMutex@@QAE@I@Z @ 4513 NONAME ; QMutex::~QMutex(unsigned int) - ??0QTimerEvent@@QAE@ABV0@@Z @ 4514 NONAME ; QTimerEvent::QTimerEvent(class QTimerEvent const &) - ??0QXmlStreamAttributes@@QAE@XZ @ 4515 NONAME ; QXmlStreamAttributes::QXmlStreamAttributes(void) - ??_EConverterState@QTextCodec@@QAE@I@Z @ 4516 NONAME ; QTextCodec::ConverterState::~ConverterState(unsigned int) - ??4QTime@@QAEAAV0@ABV0@@Z @ 4517 NONAME ; class QTime & QTime::operator=(class QTime const &) - ??0QMetaMethod@@QAE@ABV0@@Z @ 4518 NONAME ; QMetaMethod::QMetaMethod(class QMetaMethod const &) - ??_EQTextEncoder@@QAE@I@Z @ 4519 NONAME ; QTextEncoder::~QTextEncoder(unsigned int) - ??_EQFileInfo@@QAE@I@Z @ 4520 NONAME ; QFileInfo::~QFileInfo(unsigned int) - ??4QRectF@@QAEAAV0@ABV0@@Z @ 4521 NONAME ; class QRectF & QRectF::operator=(class QRectF const &) - ??4QXmlStreamStringRef@@QAEAAV0@ABV0@@Z @ 4522 NONAME ; class QXmlStreamStringRef & QXmlStreamStringRef::operator=(class QXmlStreamStringRef const &) - ??4QBasicAtomicInt@@QAEAAV0@ABV0@@Z @ 4523 NONAME ; class QBasicAtomicInt & QBasicAtomicInt::operator=(class QBasicAtomicInt const &) - ??_EQEasingCurve@@QAE@I@Z @ 4524 NONAME ; QEasingCurve::~QEasingCurve(unsigned int) - ??_EQReadWriteLock@@QAE@I@Z @ 4525 NONAME ; QReadWriteLock::~QReadWriteLock(unsigned int) - ??0QFactoryInterface@@QAE@XZ @ 4526 NONAME ; QFactoryInterface::QFactoryInterface(void) - ??4QLine@@QAEAAV0@ABV0@@Z @ 4527 NONAME ; class QLine & QLine::operator=(class QLine const &) - ??0QMetaProperty@@QAE@ABV0@@Z @ 4528 NONAME ; QMetaProperty::QMetaProperty(class QMetaProperty const &) - ??_EQBitArray@@QAE@I@Z @ 4529 NONAME ; QBitArray::~QBitArray(unsigned int) - ??0QTime@@QAE@ABV0@@Z @ 4530 NONAME ; QTime::QTime(class QTime const &) - ??4QPoint@@QAEAAV0@ABV0@@Z @ 4531 NONAME ; class QPoint & QPoint::operator=(class QPoint const &) - ??4QSize@@QAEAAV0@ABV0@@Z @ 4532 NONAME ; class QSize & QSize::operator=(class QSize const &) - ??0QPoint@@QAE@ABV0@@Z @ 4533 NONAME ; QPoint::QPoint(class QPoint const &) - ??4QPointF@@QAEAAV0@ABV0@@Z @ 4534 NONAME ; class QPointF & QPointF::operator=(class QPointF const &) - ??_EQRegExp@@QAE@I@Z @ 4535 NONAME ; QRegExp::~QRegExp(unsigned int) - ??4QLocalePrivate@@QAEAAU0@ABU0@@Z @ 4536 NONAME ; struct QLocalePrivate & QLocalePrivate::operator=(struct QLocalePrivate const &) + ??_EQDateTime@@QAE@I@Z @ 4491 NONAME ABSENT ; QDateTime::~QDateTime(unsigned int) + ??4QDate@@QAEAAV0@ABV0@@Z @ 4492 NONAME ABSENT ; class QDate & QDate::operator=(class QDate const &) + ??4QSizeF@@QAEAAV0@ABV0@@Z @ 4493 NONAME ABSENT ; class QSizeF & QSizeF::operator=(class QSizeF const &) + ??0QSize@@QAE@ABV0@@Z @ 4494 NONAME ABSENT ; QSize::QSize(class QSize const &) + ??0QEvent@@QAE@ABV0@@Z @ 4495 NONAME ABSENT ; QEvent::QEvent(class QEvent const &) + ??0QTextCodecFactoryInterface@@QAE@XZ @ 4496 NONAME ABSENT ; QTextCodecFactoryInterface::QTextCodecFactoryInterface(void) + ??0QPointF@@QAE@ABV0@@Z @ 4497 NONAME ABSENT ; QPointF::QPointF(class QPointF const &) + ??_EQUrl@@QAE@I@Z @ 4498 NONAME ABSENT ; QUrl::~QUrl(unsigned int) + ??0QGenericArgument@@QAE@ABV0@@Z @ 4499 NONAME ABSENT ; QGenericArgument::QGenericArgument(class QGenericArgument const &) + ??_EQVariant@@QAE@I@Z @ 4500 NONAME ABSENT ; QVariant::~QVariant(unsigned int) + ??4QLineF@@QAEAAV0@ABV0@@Z @ 4501 NONAME ABSENT ; class QLineF & QLineF::operator=(class QLineF const &) + ??0QXmlStreamAttributes@@QAE@ABV0@@Z @ 4502 NONAME ABSENT ; QXmlStreamAttributes::QXmlStreamAttributes(class QXmlStreamAttributes const &) + ??0QMetaEnum@@QAE@ABV0@@Z @ 4503 NONAME ABSENT ; QMetaEnum::QMetaEnum(class QMetaEnum const &) + ??4QUuid@@QAEAAU0@ABU0@@Z @ 4504 NONAME ABSENT ; struct QUuid & QUuid::operator=(struct QUuid const &) + ??0CQtActiveScheduler@@QAE@XZ @ 4505 NONAME ABSENT ; CQtActiveScheduler::CQtActiveScheduler(void) + ??0QSizeF@@QAE@ABV0@@Z @ 4506 NONAME ABSENT ; QSizeF::QSizeF(class QSizeF const &) + ??4QMetaEnum@@QAEAAV0@ABV0@@Z @ 4507 NONAME ABSENT ; class QMetaEnum & QMetaEnum::operator=(class QMetaEnum const &) + ??4QRect@@QAEAAV0@ABV0@@Z @ 4508 NONAME ABSENT ; class QRect & QRect::operator=(class QRect const &) + ??_EQMutexPool@@QAE@I@Z @ 4509 NONAME ABSENT ; QMutexPool::~QMutexPool(unsigned int) + ??0QMetaClassInfo@@QAE@ABV0@@Z @ 4510 NONAME ABSENT ; QMetaClassInfo::QMetaClassInfo(class QMetaClassInfo const &) + ??0QDate@@QAE@ABV0@@Z @ 4511 NONAME ABSENT ; QDate::QDate(class QDate const &) + ??_EQTextDecoder@@QAE@I@Z @ 4512 NONAME ABSENT ; QTextDecoder::~QTextDecoder(unsigned int) + ??_EQMutex@@QAE@I@Z @ 4513 NONAME ABSENT ; QMutex::~QMutex(unsigned int) + ??0QTimerEvent@@QAE@ABV0@@Z @ 4514 NONAME ABSENT ; QTimerEvent::QTimerEvent(class QTimerEvent const &) + ??0QXmlStreamAttributes@@QAE@XZ @ 4515 NONAME ABSENT ; QXmlStreamAttributes::QXmlStreamAttributes(void) + ??_EConverterState@QTextCodec@@QAE@I@Z @ 4516 NONAME ABSENT ; QTextCodec::ConverterState::~ConverterState(unsigned int) + ??4QTime@@QAEAAV0@ABV0@@Z @ 4517 NONAME ABSENT ; class QTime & QTime::operator=(class QTime const &) + ??0QMetaMethod@@QAE@ABV0@@Z @ 4518 NONAME ABSENT ; QMetaMethod::QMetaMethod(class QMetaMethod const &) + ??_EQTextEncoder@@QAE@I@Z @ 4519 NONAME ABSENT ; QTextEncoder::~QTextEncoder(unsigned int) + ??_EQFileInfo@@QAE@I@Z @ 4520 NONAME ABSENT ; QFileInfo::~QFileInfo(unsigned int) + ??4QRectF@@QAEAAV0@ABV0@@Z @ 4521 NONAME ABSENT ; class QRectF & QRectF::operator=(class QRectF const &) + ??4QXmlStreamStringRef@@QAEAAV0@ABV0@@Z @ 4522 NONAME ABSENT ; class QXmlStreamStringRef & QXmlStreamStringRef::operator=(class QXmlStreamStringRef const &) + ??4QBasicAtomicInt@@QAEAAV0@ABV0@@Z @ 4523 NONAME ABSENT ; class QBasicAtomicInt & QBasicAtomicInt::operator=(class QBasicAtomicInt const &) + ??_EQEasingCurve@@QAE@I@Z @ 4524 NONAME ABSENT ; QEasingCurve::~QEasingCurve(unsigned int) + ??_EQReadWriteLock@@QAE@I@Z @ 4525 NONAME ABSENT ; QReadWriteLock::~QReadWriteLock(unsigned int) + ??0QFactoryInterface@@QAE@XZ @ 4526 NONAME ABSENT ; QFactoryInterface::QFactoryInterface(void) + ??4QLine@@QAEAAV0@ABV0@@Z @ 4527 NONAME ABSENT ; class QLine & QLine::operator=(class QLine const &) + ??0QMetaProperty@@QAE@ABV0@@Z @ 4528 NONAME ABSENT ; QMetaProperty::QMetaProperty(class QMetaProperty const &) + ??_EQBitArray@@QAE@I@Z @ 4529 NONAME ABSENT ; QBitArray::~QBitArray(unsigned int) + ??0QTime@@QAE@ABV0@@Z @ 4530 NONAME ABSENT ; QTime::QTime(class QTime const &) + ??4QPoint@@QAEAAV0@ABV0@@Z @ 4531 NONAME ABSENT ; class QPoint & QPoint::operator=(class QPoint const &) + ??4QSize@@QAEAAV0@ABV0@@Z @ 4532 NONAME ABSENT ; class QSize & QSize::operator=(class QSize const &) + ??0QPoint@@QAE@ABV0@@Z @ 4533 NONAME ABSENT ; QPoint::QPoint(class QPoint const &) + ??4QPointF@@QAEAAV0@ABV0@@Z @ 4534 NONAME ABSENT ; class QPointF & QPointF::operator=(class QPointF const &) + ??_EQRegExp@@QAE@I@Z @ 4535 NONAME ABSENT ; QRegExp::~QRegExp(unsigned int) + ??4QLocalePrivate@@QAEAAU0@ABU0@@Z @ 4536 NONAME ABSENT ; struct QLocalePrivate & QLocalePrivate::operator=(struct QLocalePrivate const &) diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def index b3309adc29..bcc0ff6e94 100644 --- a/src/s60installs/bwins/QtDeclarativeu.def +++ b/src/s60installs/bwins/QtDeclarativeu.def @@ -1893,13 +1893,13 @@ EXPORTS ?setLayoutMirror@QDeclarativeItemPrivate@@QAEX_N@Z @ 1892 NONAME ; void QDeclarativeItemPrivate::setLayoutMirror(bool) ?setImplicitLayoutMirror@QDeclarativeItemPrivate@@QAEX_N0@Z @ 1893 NONAME ; void QDeclarativeItemPrivate::setImplicitLayoutMirror(bool, bool) ?isMirrored@QDeclarativeItemPrivate@@QBE_NXZ @ 1894 NONAME ; bool QDeclarativeItemPrivate::isMirrored(void) const - ??_EQDeclarativeListReference@@QAE@I@Z @ 1895 NONAME ; QDeclarativeListReference::~QDeclarativeListReference(unsigned int) - ??_EVariant@QDeclarativeParser@@QAE@I@Z @ 1896 NONAME ; QDeclarativeParser::Variant::~Variant(unsigned int) - ??_EQDeclarativeProperty@@QAE@I@Z @ 1897 NONAME ; QDeclarativeProperty::~QDeclarativeProperty(unsigned int) - ??_EQDeclarativeError@@QAE@I@Z @ 1898 NONAME ; QDeclarativeError::~QDeclarativeError(unsigned int) - ??_EQDeclarativeCustomParserProperty@@QAE@I@Z @ 1899 NONAME ; QDeclarativeCustomParserProperty::~QDeclarativeCustomParserProperty(unsigned int) - ??0QDeclarativeExtensionInterface@@QAE@XZ @ 1900 NONAME ; QDeclarativeExtensionInterface::QDeclarativeExtensionInterface(void) - ??_EQDeclarativeScriptString@@QAE@I@Z @ 1901 NONAME ; QDeclarativeScriptString::~QDeclarativeScriptString(unsigned int) - ??_EQDeclarativeCustomParserNode@@QAE@I@Z @ 1902 NONAME ; QDeclarativeCustomParserNode::~QDeclarativeCustomParserNode(unsigned int) - ??_EQDeclarativePixmap@@QAE@I@Z @ 1903 NONAME ; QDeclarativePixmap::~QDeclarativePixmap(unsigned int) + ??_EQDeclarativeListReference@@QAE@I@Z @ 1895 NONAME ABSENT ; QDeclarativeListReference::~QDeclarativeListReference(unsigned int) + ??_EVariant@QDeclarativeParser@@QAE@I@Z @ 1896 NONAME ABSENT ; QDeclarativeParser::Variant::~Variant(unsigned int) + ??_EQDeclarativeProperty@@QAE@I@Z @ 1897 NONAME ABSENT ; QDeclarativeProperty::~QDeclarativeProperty(unsigned int) + ??_EQDeclarativeError@@QAE@I@Z @ 1898 NONAME ABSENT ; QDeclarativeError::~QDeclarativeError(unsigned int) + ??_EQDeclarativeCustomParserProperty@@QAE@I@Z @ 1899 NONAME ABSENT ; QDeclarativeCustomParserProperty::~QDeclarativeCustomParserProperty(unsigned int) + ??0QDeclarativeExtensionInterface@@QAE@XZ @ 1900 NONAME ABSENT ; QDeclarativeExtensionInterface::QDeclarativeExtensionInterface(void) + ??_EQDeclarativeScriptString@@QAE@I@Z @ 1901 NONAME ABSENT ; QDeclarativeScriptString::~QDeclarativeScriptString(unsigned int) + ??_EQDeclarativeCustomParserNode@@QAE@I@Z @ 1902 NONAME ABSENT ; QDeclarativeCustomParserNode::~QDeclarativeCustomParserNode(unsigned int) + ??_EQDeclarativePixmap@@QAE@I@Z @ 1903 NONAME ABSENT ; QDeclarativePixmap::~QDeclarativePixmap(unsigned int) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index b68f59ff6e..3e848ec251 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12982,133 +12982,133 @@ EXPORTS ?releaseCachedResources@QGraphicsSystem@@UAEXXZ @ 12981 NONAME ABSENT ; void QGraphicsSystem::releaseCachedResources(void) ?qt_s60_setPartialScreenInputMode@@YAX_N@Z @ 12982 NONAME ; void qt_s60_setPartialScreenInputMode(bool) ?paintingActive@QVolatileImage@@QBE_NXZ @ 12983 NONAME ; bool QVolatileImage::paintingActive(void) const - ??_EQFontPrivate@@QAE@I@Z @ 12984 NONAME ; QFontPrivate::~QFontPrivate(unsigned int) - ??0QMimeSource@@QAE@XZ @ 12985 NONAME ; QMimeSource::QMimeSource(void) - ??0QStyleFactoryInterface@@QAE@XZ @ 12986 NONAME ; QStyleFactoryInterface::QStyleFactoryInterface(void) - ??0QFileOpenEvent@@QAE@ABV0@@Z @ 12987 NONAME ; QFileOpenEvent::QFileOpenEvent(class QFileOpenEvent const &) - ??4QStyleOptionViewItemV2@@QAEAAV0@ABV0@@Z @ 12988 NONAME ; class QStyleOptionViewItemV2 & QStyleOptionViewItemV2::operator=(class QStyleOptionViewItemV2 const &) - ??0QShowEvent@@QAE@ABV0@@Z @ 12989 NONAME ; QShowEvent::QShowEvent(class QShowEvent const &) - ??0QMouseEvent@@QAE@ABV0@@Z @ 12990 NONAME ; QMouseEvent::QMouseEvent(class QMouseEvent const &) - ??0QActionEvent@@QAE@ABV0@@Z @ 12991 NONAME ; QActionEvent::QActionEvent(class QActionEvent const &) - ??0QTouchEvent@@QAE@ABV0@@Z @ 12992 NONAME ; QTouchEvent::QTouchEvent(class QTouchEvent const &) - ??_EQImageData@@QAE@I@Z @ 12993 NONAME ; QImageData::~QImageData(unsigned int) - ??4QBezier@@QAEAAV0@ABV0@@Z @ 12994 NONAME ; class QBezier & QBezier::operator=(class QBezier const &) - ??0QIconEngineV2@@QAE@XZ @ 12995 NONAME ; QIconEngineV2::QIconEngineV2(void) - ??4iterator@QTextBlock@@QAEAAV01@ABV01@@Z @ 12996 NONAME ; class QTextBlock::iterator & QTextBlock::iterator::operator=(class QTextBlock::iterator const &) - ??0QIconEngineV2@@QAE@ABV0@@Z @ 12997 NONAME ; QIconEngineV2::QIconEngineV2(class QIconEngineV2 const &) - ??0QIconEngineFactoryInterfaceV2@@QAE@XZ @ 12998 NONAME ; QIconEngineFactoryInterfaceV2::QIconEngineFactoryInterfaceV2(void) - ??4QTextLine@@QAEAAV0@ABV0@@Z @ 12999 NONAME ; class QTextLine & QTextLine::operator=(class QTextLine const &) - ??0QToolBarChangeEvent@@QAE@ABV0@@Z @ 13000 NONAME ; QToolBarChangeEvent::QToolBarChangeEvent(class QToolBarChangeEvent const &) - ??0QResizeEvent@@QAE@ABV0@@Z @ 13001 NONAME ; QResizeEvent::QResizeEvent(class QResizeEvent const &) - ??0QIconEngineFactoryInterface@@QAE@XZ @ 13002 NONAME ; QIconEngineFactoryInterface::QIconEngineFactoryInterface(void) - ??0QPictureFormatInterface@@QAE@XZ @ 13003 NONAME ; QPictureFormatInterface::QPictureFormatInterface(void) - ??_EQPolygon@@QAE@I@Z @ 13004 NONAME ; QPolygon::~QPolygon(unsigned int) - ??_EQImageReader@@QAE@I@Z @ 13005 NONAME ; QImageReader::~QImageReader(unsigned int) - ??4QStyleOptionGraphicsItem@@QAEAAV0@ABV0@@Z @ 13006 NONAME ; class QStyleOptionGraphicsItem & QStyleOptionGraphicsItem::operator=(class QStyleOptionGraphicsItem const &) - ??4QStyleOptionProgressBarV2@@QAEAAV0@ABV0@@Z @ 13007 NONAME ; class QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2::operator=(class QStyleOptionProgressBarV2 const &) - ??0QDragEnterEvent@@QAE@ABV0@@Z @ 13008 NONAME ; QDragEnterEvent::QDragEnterEvent(class QDragEnterEvent const &) - ??_EKey@QPixmapCache@@QAE@I@Z @ 13009 NONAME ; QPixmapCache::Key::~Key(unsigned int) - ??_EQCursor@@QAE@I@Z @ 13010 NONAME ; QCursor::~QCursor(unsigned int) - ??0QShortcutEvent@@QAE@ABV0@@Z @ 13011 NONAME ; QShortcutEvent::QShortcutEvent(class QShortcutEvent const &) - ??_EQTextCursor@@QAE@I@Z @ 13012 NONAME ; QTextCursor::~QTextCursor(unsigned int) - ??0QGradient@@QAE@ABV0@@Z @ 13013 NONAME ; QGradient::QGradient(class QGradient const &) - ??4QInputMethodEvent@@QAEAAV0@ABV0@@Z @ 13014 NONAME ; class QInputMethodEvent & QInputMethodEvent::operator=(class QInputMethodEvent const &) - ??0QVector2D@@QAE@ABV0@@Z @ 13015 NONAME ; QVector2D::QVector2D(class QVector2D const &) - ??4QStyleOptionFocusRect@@QAEAAV0@ABV0@@Z @ 13016 NONAME ; class QStyleOptionFocusRect & QStyleOptionFocusRect::operator=(class QStyleOptionFocusRect const &) - ??_EQPen@@QAE@I@Z @ 13017 NONAME ; QPen::~QPen(unsigned int) - ??_EQKeySequence@@QAE@I@Z @ 13018 NONAME ; QKeySequence::~QKeySequence(unsigned int) - ??4QGradient@@QAEAAV0@ABV0@@Z @ 13019 NONAME ; class QGradient & QGradient::operator=(class QGradient const &) - ??0QTextTableFormat@@QAE@ABV0@@Z @ 13020 NONAME ; QTextTableFormat::QTextTableFormat(class QTextTableFormat const &) - ??_EQImagePixmapCleanupHooks@@QAE@I@Z @ 13021 NONAME ; QImagePixmapCleanupHooks::~QImagePixmapCleanupHooks(unsigned int) - ??0QStatusTipEvent@@QAE@ABV0@@Z @ 13022 NONAME ; QStatusTipEvent::QStatusTipEvent(class QStatusTipEvent const &) - ??0Value@QCss@@QAE@ABU01@@Z @ 13023 NONAME ; QCss::Value::Value(struct QCss::Value const &) - ??4QSizePolicy@@QAEAAV0@ABV0@@Z @ 13024 NONAME ; class QSizePolicy & QSizePolicy::operator=(class QSizePolicy const &) - ??_ETouchPoint@QTouchEvent@@QAE@I@Z @ 13025 NONAME ; QTouchEvent::TouchPoint::~TouchPoint(unsigned int) - ??4QItemSelection@@QAEAAV0@ABV0@@Z @ 13026 NONAME ; class QItemSelection & QItemSelection::operator=(class QItemSelection const &) - ??4QStyleOptionQ3ListView@@QAEAAV0@ABV0@@Z @ 13027 NONAME ; class QStyleOptionQ3ListView & QStyleOptionQ3ListView::operator=(class QStyleOptionQ3ListView const &) - ??0QSizePolicy@@QAE@ABV0@@Z @ 13028 NONAME ; QSizePolicy::QSizePolicy(class QSizePolicy const &) - ??4QStyleOptionFrameV2@@QAEAAV0@ABV0@@Z @ 13029 NONAME ; class QStyleOptionFrameV2 & QStyleOptionFrameV2::operator=(class QStyleOptionFrameV2 const &) - ??4QVector3D@@QAEAAV0@ABV0@@Z @ 13030 NONAME ; class QVector3D & QVector3D::operator=(class QVector3D const &) - ??4QStyleOptionQ3DockWindow@@QAEAAV0@ABV0@@Z @ 13031 NONAME ; class QStyleOptionQ3DockWindow & QStyleOptionQ3DockWindow::operator=(class QStyleOptionQ3DockWindow const &) - ??_EQFont@@QAE@I@Z @ 13032 NONAME ; QFont::~QFont(unsigned int) - ??4QStyleOptionDockWidget@@QAEAAV0@ABV0@@Z @ 13033 NONAME ; class QStyleOptionDockWidget & QStyleOptionDockWidget::operator=(class QStyleOptionDockWidget const &) - ??0QPainterState@@QAE@ABV0@@Z @ 13034 NONAME ; QPainterState::QPainterState(class QPainterState const &) - ??4QStyleOptionFrame@@QAEAAV0@ABV0@@Z @ 13035 NONAME ; class QStyleOptionFrame & QStyleOptionFrame::operator=(class QStyleOptionFrame const &) + ??_EQFontPrivate@@QAE@I@Z @ 12984 NONAME ABSENT ; QFontPrivate::~QFontPrivate(unsigned int) + ??0QMimeSource@@QAE@XZ @ 12985 NONAME ABSENT ; QMimeSource::QMimeSource(void) + ??0QStyleFactoryInterface@@QAE@XZ @ 12986 NONAME ABSENT ; QStyleFactoryInterface::QStyleFactoryInterface(void) + ??0QFileOpenEvent@@QAE@ABV0@@Z @ 12987 NONAME ABSENT ; QFileOpenEvent::QFileOpenEvent(class QFileOpenEvent const &) + ??4QStyleOptionViewItemV2@@QAEAAV0@ABV0@@Z @ 12988 NONAME ABSENT ; class QStyleOptionViewItemV2 & QStyleOptionViewItemV2::operator=(class QStyleOptionViewItemV2 const &) + ??0QShowEvent@@QAE@ABV0@@Z @ 12989 NONAME ABSENT ; QShowEvent::QShowEvent(class QShowEvent const &) + ??0QMouseEvent@@QAE@ABV0@@Z @ 12990 NONAME ABSENT ; QMouseEvent::QMouseEvent(class QMouseEvent const &) + ??0QActionEvent@@QAE@ABV0@@Z @ 12991 NONAME ABSENT ; QActionEvent::QActionEvent(class QActionEvent const &) + ??0QTouchEvent@@QAE@ABV0@@Z @ 12992 NONAME ABSENT ; QTouchEvent::QTouchEvent(class QTouchEvent const &) + ??_EQImageData@@QAE@I@Z @ 12993 NONAME ABSENT ; QImageData::~QImageData(unsigned int) + ??4QBezier@@QAEAAV0@ABV0@@Z @ 12994 NONAME ABSENT ; class QBezier & QBezier::operator=(class QBezier const &) + ??0QIconEngineV2@@QAE@XZ @ 12995 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(void) + ??4iterator@QTextBlock@@QAEAAV01@ABV01@@Z @ 12996 NONAME ABSENT ; class QTextBlock::iterator & QTextBlock::iterator::operator=(class QTextBlock::iterator const &) + ??0QIconEngineV2@@QAE@ABV0@@Z @ 12997 NONAME ABSENT ; QIconEngineV2::QIconEngineV2(class QIconEngineV2 const &) + ??0QIconEngineFactoryInterfaceV2@@QAE@XZ @ 12998 NONAME ABSENT ; QIconEngineFactoryInterfaceV2::QIconEngineFactoryInterfaceV2(void) + ??4QTextLine@@QAEAAV0@ABV0@@Z @ 12999 NONAME ABSENT ; class QTextLine & QTextLine::operator=(class QTextLine const &) + ??0QToolBarChangeEvent@@QAE@ABV0@@Z @ 13000 NONAME ABSENT ; QToolBarChangeEvent::QToolBarChangeEvent(class QToolBarChangeEvent const &) + ??0QResizeEvent@@QAE@ABV0@@Z @ 13001 NONAME ABSENT ; QResizeEvent::QResizeEvent(class QResizeEvent const &) + ??0QIconEngineFactoryInterface@@QAE@XZ @ 13002 NONAME ABSENT ; QIconEngineFactoryInterface::QIconEngineFactoryInterface(void) + ??0QPictureFormatInterface@@QAE@XZ @ 13003 NONAME ABSENT ; QPictureFormatInterface::QPictureFormatInterface(void) + ??_EQPolygon@@QAE@I@Z @ 13004 NONAME ABSENT ; QPolygon::~QPolygon(unsigned int) + ??_EQImageReader@@QAE@I@Z @ 13005 NONAME ABSENT ; QImageReader::~QImageReader(unsigned int) + ??4QStyleOptionGraphicsItem@@QAEAAV0@ABV0@@Z @ 13006 NONAME ABSENT ; class QStyleOptionGraphicsItem & QStyleOptionGraphicsItem::operator=(class QStyleOptionGraphicsItem const &) + ??4QStyleOptionProgressBarV2@@QAEAAV0@ABV0@@Z @ 13007 NONAME ABSENT ; class QStyleOptionProgressBarV2 & QStyleOptionProgressBarV2::operator=(class QStyleOptionProgressBarV2 const &) + ??0QDragEnterEvent@@QAE@ABV0@@Z @ 13008 NONAME ABSENT ; QDragEnterEvent::QDragEnterEvent(class QDragEnterEvent const &) + ??_EKey@QPixmapCache@@QAE@I@Z @ 13009 NONAME ABSENT ; QPixmapCache::Key::~Key(unsigned int) + ??_EQCursor@@QAE@I@Z @ 13010 NONAME ABSENT ; QCursor::~QCursor(unsigned int) + ??0QShortcutEvent@@QAE@ABV0@@Z @ 13011 NONAME ABSENT ; QShortcutEvent::QShortcutEvent(class QShortcutEvent const &) + ??_EQTextCursor@@QAE@I@Z @ 13012 NONAME ABSENT ; QTextCursor::~QTextCursor(unsigned int) + ??0QGradient@@QAE@ABV0@@Z @ 13013 NONAME ABSENT ; QGradient::QGradient(class QGradient const &) + ??4QInputMethodEvent@@QAEAAV0@ABV0@@Z @ 13014 NONAME ABSENT ; class QInputMethodEvent & QInputMethodEvent::operator=(class QInputMethodEvent const &) + ??0QVector2D@@QAE@ABV0@@Z @ 13015 NONAME ABSENT ; QVector2D::QVector2D(class QVector2D const &) + ??4QStyleOptionFocusRect@@QAEAAV0@ABV0@@Z @ 13016 NONAME ABSENT ; class QStyleOptionFocusRect & QStyleOptionFocusRect::operator=(class QStyleOptionFocusRect const &) + ??_EQPen@@QAE@I@Z @ 13017 NONAME ABSENT ; QPen::~QPen(unsigned int) + ??_EQKeySequence@@QAE@I@Z @ 13018 NONAME ABSENT ; QKeySequence::~QKeySequence(unsigned int) + ??4QGradient@@QAEAAV0@ABV0@@Z @ 13019 NONAME ABSENT ; class QGradient & QGradient::operator=(class QGradient const &) + ??0QTextTableFormat@@QAE@ABV0@@Z @ 13020 NONAME ABSENT ; QTextTableFormat::QTextTableFormat(class QTextTableFormat const &) + ??_EQImagePixmapCleanupHooks@@QAE@I@Z @ 13021 NONAME ABSENT ; QImagePixmapCleanupHooks::~QImagePixmapCleanupHooks(unsigned int) + ??0QStatusTipEvent@@QAE@ABV0@@Z @ 13022 NONAME ABSENT ; QStatusTipEvent::QStatusTipEvent(class QStatusTipEvent const &) + ??0Value@QCss@@QAE@ABU01@@Z @ 13023 NONAME ABSENT ; QCss::Value::Value(struct QCss::Value const &) + ??4QSizePolicy@@QAEAAV0@ABV0@@Z @ 13024 NONAME ABSENT ; class QSizePolicy & QSizePolicy::operator=(class QSizePolicy const &) + ??_ETouchPoint@QTouchEvent@@QAE@I@Z @ 13025 NONAME ABSENT ; QTouchEvent::TouchPoint::~TouchPoint(unsigned int) + ??4QItemSelection@@QAEAAV0@ABV0@@Z @ 13026 NONAME ABSENT ; class QItemSelection & QItemSelection::operator=(class QItemSelection const &) + ??4QStyleOptionQ3ListView@@QAEAAV0@ABV0@@Z @ 13027 NONAME ABSENT ; class QStyleOptionQ3ListView & QStyleOptionQ3ListView::operator=(class QStyleOptionQ3ListView const &) + ??0QSizePolicy@@QAE@ABV0@@Z @ 13028 NONAME ABSENT ; QSizePolicy::QSizePolicy(class QSizePolicy const &) + ??4QStyleOptionFrameV2@@QAEAAV0@ABV0@@Z @ 13029 NONAME ABSENT ; class QStyleOptionFrameV2 & QStyleOptionFrameV2::operator=(class QStyleOptionFrameV2 const &) + ??4QVector3D@@QAEAAV0@ABV0@@Z @ 13030 NONAME ABSENT ; class QVector3D & QVector3D::operator=(class QVector3D const &) + ??4QStyleOptionQ3DockWindow@@QAEAAV0@ABV0@@Z @ 13031 NONAME ABSENT ; class QStyleOptionQ3DockWindow & QStyleOptionQ3DockWindow::operator=(class QStyleOptionQ3DockWindow const &) + ??_EQFont@@QAE@I@Z @ 13032 NONAME ABSENT ; QFont::~QFont(unsigned int) + ??4QStyleOptionDockWidget@@QAEAAV0@ABV0@@Z @ 13033 NONAME ABSENT ; class QStyleOptionDockWidget & QStyleOptionDockWidget::operator=(class QStyleOptionDockWidget const &) + ??0QPainterState@@QAE@ABV0@@Z @ 13034 NONAME ABSENT ; QPainterState::QPainterState(class QPainterState const &) + ??4QStyleOptionFrame@@QAEAAV0@ABV0@@Z @ 13035 NONAME ABSENT ; class QStyleOptionFrame & QStyleOptionFrame::operator=(class QStyleOptionFrame const &) ?qt_draw_decoration_for_glyphs@@YAXPAVQPainter@@PBIPBUQFixedPoint@@HPAVQFontEngine@@ABVQFont@@ABVQTextCharFormat@@@Z @ 13036 NONAME ; void qt_draw_decoration_for_glyphs(class QPainter *, unsigned int const *, struct QFixedPoint const *, int, class QFontEngine *, class QFont const &, class QTextCharFormat const &) - ??4QTextLength@@QAEAAV0@ABV0@@Z @ 13037 NONAME ; class QTextLength & QTextLength::operator=(class QTextLength const &) - ??0QHelpEvent@@QAE@ABV0@@Z @ 13038 NONAME ; QHelpEvent::QHelpEvent(class QHelpEvent const &) - ??0QContextMenuEvent@@QAE@ABV0@@Z @ 13039 NONAME ; QContextMenuEvent::QContextMenuEvent(class QContextMenuEvent const &) - ??0QWhatsThisClickedEvent@@QAE@ABV0@@Z @ 13040 NONAME ; QWhatsThisClickedEvent::QWhatsThisClickedEvent(class QWhatsThisClickedEvent const &) - ??4QStyleOptionTab@@QAEAAV0@ABV0@@Z @ 13041 NONAME ; class QStyleOptionTab & QStyleOptionTab::operator=(class QStyleOptionTab const &) - ??0QTabletEvent@@QAE@ABV0@@Z @ 13042 NONAME ; QTabletEvent::QTabletEvent(class QTabletEvent const &) - ??4QItemSelectionRange@@QAEAAV0@ABV0@@Z @ 13043 NONAME ; class QItemSelectionRange & QItemSelectionRange::operator=(class QItemSelectionRange const &) - ??_EQStyleOptionViewItemV4@@QAE@I@Z @ 13044 NONAME ; QStyleOptionViewItemV4::~QStyleOptionViewItemV4(unsigned int) - ??0QSymbianGraphicsSystemEx@@QAE@XZ @ 13045 NONAME ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void) - ??4QEglProperties@@QAEAAV0@ABV0@@Z @ 13046 NONAME ; class QEglProperties & QEglProperties::operator=(class QEglProperties const &) - ??0QHoverEvent@@QAE@ABV0@@Z @ 13047 NONAME ; QHoverEvent::QHoverEvent(class QHoverEvent const &) - ??0QPaintEngineState@@QAE@XZ @ 13048 NONAME ; QPaintEngineState::QPaintEngineState(void) - ??0QKeyEvent@@QAE@ABV0@@Z @ 13049 NONAME ; QKeyEvent::QKeyEvent(class QKeyEvent const &) - ??0QIconEngine@@QAE@ABV0@@Z @ 13050 NONAME ; QIconEngine::QIconEngine(class QIconEngine const &) - ??4QStyleOptionToolBoxV2@@QAEAAV0@ABV0@@Z @ 13051 NONAME ; class QStyleOptionToolBoxV2 & QStyleOptionToolBoxV2::operator=(class QStyleOptionToolBoxV2 const &) - ??0QImageIOHandlerFactoryInterface@@QAE@XZ @ 13052 NONAME ; QImageIOHandlerFactoryInterface::QImageIOHandlerFactoryInterface(void) - ??_EQRegion@@QAE@I@Z @ 13053 NONAME ; QRegion::~QRegion(unsigned int) - ??4QStyleOptionComplex@@QAEAAV0@ABV0@@Z @ 13054 NONAME ; class QStyleOptionComplex & QStyleOptionComplex::operator=(class QStyleOptionComplex const &) - ??_EFileInfo@QZipReader@@QAE@I@Z @ 13055 NONAME ; QZipReader::FileInfo::~FileInfo(unsigned int) - ??0QBitmap@@QAE@ABV0@@Z @ 13056 NONAME ; QBitmap::QBitmap(class QBitmap const &) + ??4QTextLength@@QAEAAV0@ABV0@@Z @ 13037 NONAME ABSENT ; class QTextLength & QTextLength::operator=(class QTextLength const &) + ??0QHelpEvent@@QAE@ABV0@@Z @ 13038 NONAME ABSENT ; QHelpEvent::QHelpEvent(class QHelpEvent const &) + ??0QContextMenuEvent@@QAE@ABV0@@Z @ 13039 NONAME ABSENT ; QContextMenuEvent::QContextMenuEvent(class QContextMenuEvent const &) + ??0QWhatsThisClickedEvent@@QAE@ABV0@@Z @ 13040 NONAME ABSENT ; QWhatsThisClickedEvent::QWhatsThisClickedEvent(class QWhatsThisClickedEvent const &) + ??4QStyleOptionTab@@QAEAAV0@ABV0@@Z @ 13041 NONAME ABSENT ; class QStyleOptionTab & QStyleOptionTab::operator=(class QStyleOptionTab const &) + ??0QTabletEvent@@QAE@ABV0@@Z @ 13042 NONAME ABSENT ; QTabletEvent::QTabletEvent(class QTabletEvent const &) + ??4QItemSelectionRange@@QAEAAV0@ABV0@@Z @ 13043 NONAME ABSENT ; class QItemSelectionRange & QItemSelectionRange::operator=(class QItemSelectionRange const &) + ??_EQStyleOptionViewItemV4@@QAE@I@Z @ 13044 NONAME ABSENT ; QStyleOptionViewItemV4::~QStyleOptionViewItemV4(unsigned int) + ??0QSymbianGraphicsSystemEx@@QAE@XZ @ 13045 NONAME ABSENT ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void) + ??4QEglProperties@@QAEAAV0@ABV0@@Z @ 13046 NONAME ABSENT ; class QEglProperties & QEglProperties::operator=(class QEglProperties const &) + ??0QHoverEvent@@QAE@ABV0@@Z @ 13047 NONAME ABSENT ; QHoverEvent::QHoverEvent(class QHoverEvent const &) + ??0QPaintEngineState@@QAE@XZ @ 13048 NONAME ABSENT ; QPaintEngineState::QPaintEngineState(void) + ??0QKeyEvent@@QAE@ABV0@@Z @ 13049 NONAME ABSENT ; QKeyEvent::QKeyEvent(class QKeyEvent const &) + ??0QIconEngine@@QAE@ABV0@@Z @ 13050 NONAME ABSENT ; QIconEngine::QIconEngine(class QIconEngine const &) + ??4QStyleOptionToolBoxV2@@QAEAAV0@ABV0@@Z @ 13051 NONAME ABSENT ; class QStyleOptionToolBoxV2 & QStyleOptionToolBoxV2::operator=(class QStyleOptionToolBoxV2 const &) + ??0QImageIOHandlerFactoryInterface@@QAE@XZ @ 13052 NONAME ABSENT ; QImageIOHandlerFactoryInterface::QImageIOHandlerFactoryInterface(void) + ??_EQRegion@@QAE@I@Z @ 13053 NONAME ABSENT ; QRegion::~QRegion(unsigned int) + ??4QStyleOptionComplex@@QAEAAV0@ABV0@@Z @ 13054 NONAME ABSENT ; class QStyleOptionComplex & QStyleOptionComplex::operator=(class QStyleOptionComplex const &) + ??_EFileInfo@QZipReader@@QAE@I@Z @ 13055 NONAME ABSENT ; QZipReader::FileInfo::~FileInfo(unsigned int) + ??0QBitmap@@QAE@ABV0@@Z @ 13056 NONAME ABSENT ; QBitmap::QBitmap(class QBitmap const &) ?forceToRaster@QSymbianGraphicsSystemEx@@UAEXPAVQWidget@@@Z @ 13057 NONAME ; void QSymbianGraphicsSystemEx::forceToRaster(class QWidget *) ?leadingSpaceWidth@QTextEngine@@QAE?AUQFixed@@ABUQScriptLine@@@Z @ 13058 NONAME ; struct QFixed QTextEngine::leadingSpaceWidth(struct QScriptLine const &) ?releaseCachedGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 13059 NONAME ; void QSymbianGraphicsSystemEx::releaseCachedGpuResources(void) - ??_EQTextFormat@@QAE@I@Z @ 13060 NONAME ; QTextFormat::~QTextFormat(unsigned int) - ??4QStyleOptionTabWidgetFrame@@QAEAAV0@ABV0@@Z @ 13061 NONAME ; class QStyleOptionTabWidgetFrame & QStyleOptionTabWidgetFrame::operator=(class QStyleOptionTabWidgetFrame const &) - ??4QMouseEvent@@QAEAAV0@ABV0@@Z @ 13062 NONAME ; class QMouseEvent & QMouseEvent::operator=(class QMouseEvent const &) - ??_EQPainter@@QAE@I@Z @ 13063 NONAME ; QPainter::~QPainter(unsigned int) - ??4QStyleOptionTabBarBaseV2@@QAEAAV0@ABV0@@Z @ 13064 NONAME ; class QStyleOptionTabBarBaseV2 & QStyleOptionTabBarBaseV2::operator=(class QStyleOptionTabBarBaseV2 const &) - ??4QInputEvent@@QAEAAV0@ABV0@@Z @ 13065 NONAME ; class QInputEvent & QInputEvent::operator=(class QInputEvent const &) - ??_EQPainterPath@@QAE@I@Z @ 13066 NONAME ; QPainterPath::~QPainterPath(unsigned int) - ??4QQuaternion@@QAEAAV0@ABV0@@Z @ 13067 NONAME ; class QQuaternion & QQuaternion::operator=(class QQuaternion const &) - ??4Symbol@QCss@@QAEAAU01@ABU01@@Z @ 13068 NONAME ; struct QCss::Symbol & QCss::Symbol::operator=(struct QCss::Symbol const &) - ??0QIconDragEvent@@QAE@ABV0@@Z @ 13069 NONAME ; QIconDragEvent::QIconDragEvent(class QIconDragEvent const &) - ??0QTextImageFormat@@QAE@ABV0@@Z @ 13070 NONAME ; QTextImageFormat::QTextImageFormat(class QTextImageFormat const &) - ??0QMoveEvent@@QAE@ABV0@@Z @ 13071 NONAME ; QMoveEvent::QMoveEvent(class QMoveEvent const &) - ??0QInputContextFactoryInterface@@QAE@XZ @ 13072 NONAME ; QInputContextFactoryInterface::QInputContextFactoryInterface(void) - ??0QTextFrameFormat@@QAE@ABV0@@Z @ 13073 NONAME ; QTextFrameFormat::QTextFrameFormat(class QTextFrameFormat const &) - ??0Symbol@QCss@@QAE@ABU01@@Z @ 13074 NONAME ; QCss::Symbol::Symbol(struct QCss::Symbol const &) - ??4QStyleOptionFrameV3@@QAEAAV0@ABV0@@Z @ 13075 NONAME ; class QStyleOptionFrameV3 & QStyleOptionFrameV3::operator=(class QStyleOptionFrameV3 const &) - ??0QGraphicsSystem@@QAE@XZ @ 13076 NONAME ; QGraphicsSystem::QGraphicsSystem(void) - ??4QStyleOptionViewItem@@QAEAAV0@ABV0@@Z @ 13077 NONAME ; class QStyleOptionViewItem & QStyleOptionViewItem::operator=(class QStyleOptionViewItem const &) - ??4QStyleOptionProgressBar@@QAEAAV0@ABV0@@Z @ 13078 NONAME ; class QStyleOptionProgressBar & QStyleOptionProgressBar::operator=(class QStyleOptionProgressBar const &) - ??4QStyleOptionRubberBand@@QAEAAV0@ABV0@@Z @ 13079 NONAME ; class QStyleOptionRubberBand & QStyleOptionRubberBand::operator=(class QStyleOptionRubberBand const &) - ??0QDragResponseEvent@@QAE@ABV0@@Z @ 13080 NONAME ; QDragResponseEvent::QDragResponseEvent(class QDragResponseEvent const &) - ??0QIconEngine@@QAE@XZ @ 13081 NONAME ; QIconEngine::QIconEngine(void) - ??_EQBrush@@QAE@I@Z @ 13082 NONAME ; QBrush::~QBrush(unsigned int) - ??_EQTableWidgetSelectionRange@@QAE@I@Z @ 13083 NONAME ; QTableWidgetSelectionRange::~QTableWidgetSelectionRange(unsigned int) - ??4QStyleOptionTabBarBase@@QAEAAV0@ABV0@@Z @ 13084 NONAME ; class QStyleOptionTabBarBase & QStyleOptionTabBarBase::operator=(class QStyleOptionTabBarBase const &) - ??0QTextObjectInterface@@QAE@XZ @ 13085 NONAME ; QTextObjectInterface::QTextObjectInterface(void) - ??0QHideEvent@@QAE@ABV0@@Z @ 13086 NONAME ; QHideEvent::QHideEvent(class QHideEvent const &) - ??0QCloseEvent@@QAE@ABV0@@Z @ 13087 NONAME ; QCloseEvent::QCloseEvent(class QCloseEvent const &) - ??0QTextFrameLayoutData@@QAE@XZ @ 13088 NONAME ; QTextFrameLayoutData::QTextFrameLayoutData(void) - ??4QStyleOptionTabWidgetFrameV2@@QAEAAV0@ABV0@@Z @ 13089 NONAME ; class QStyleOptionTabWidgetFrameV2 & QStyleOptionTabWidgetFrameV2::operator=(class QStyleOptionTabWidgetFrameV2 const &) - ??4QStyleOptionTabV2@@QAEAAV0@ABV0@@Z @ 13090 NONAME ; class QStyleOptionTabV2 & QStyleOptionTabV2::operator=(class QStyleOptionTabV2 const &) + ??_EQTextFormat@@QAE@I@Z @ 13060 NONAME ABSENT ; QTextFormat::~QTextFormat(unsigned int) + ??4QStyleOptionTabWidgetFrame@@QAEAAV0@ABV0@@Z @ 13061 NONAME ABSENT ; class QStyleOptionTabWidgetFrame & QStyleOptionTabWidgetFrame::operator=(class QStyleOptionTabWidgetFrame const &) + ??4QMouseEvent@@QAEAAV0@ABV0@@Z @ 13062 NONAME ABSENT ; class QMouseEvent & QMouseEvent::operator=(class QMouseEvent const &) + ??_EQPainter@@QAE@I@Z @ 13063 NONAME ABSENT ; QPainter::~QPainter(unsigned int) + ??4QStyleOptionTabBarBaseV2@@QAEAAV0@ABV0@@Z @ 13064 NONAME ABSENT ; class QStyleOptionTabBarBaseV2 & QStyleOptionTabBarBaseV2::operator=(class QStyleOptionTabBarBaseV2 const &) + ??4QInputEvent@@QAEAAV0@ABV0@@Z @ 13065 NONAME ABSENT ; class QInputEvent & QInputEvent::operator=(class QInputEvent const &) + ??_EQPainterPath@@QAE@I@Z @ 13066 NONAME ABSENT ; QPainterPath::~QPainterPath(unsigned int) + ??4QQuaternion@@QAEAAV0@ABV0@@Z @ 13067 NONAME ABSENT ; class QQuaternion & QQuaternion::operator=(class QQuaternion const &) + ??4Symbol@QCss@@QAEAAU01@ABU01@@Z @ 13068 NONAME ABSENT ; struct QCss::Symbol & QCss::Symbol::operator=(struct QCss::Symbol const &) + ??0QIconDragEvent@@QAE@ABV0@@Z @ 13069 NONAME ABSENT ; QIconDragEvent::QIconDragEvent(class QIconDragEvent const &) + ??0QTextImageFormat@@QAE@ABV0@@Z @ 13070 NONAME ABSENT ; QTextImageFormat::QTextImageFormat(class QTextImageFormat const &) + ??0QMoveEvent@@QAE@ABV0@@Z @ 13071 NONAME ABSENT ; QMoveEvent::QMoveEvent(class QMoveEvent const &) + ??0QInputContextFactoryInterface@@QAE@XZ @ 13072 NONAME ABSENT ; QInputContextFactoryInterface::QInputContextFactoryInterface(void) + ??0QTextFrameFormat@@QAE@ABV0@@Z @ 13073 NONAME ABSENT ; QTextFrameFormat::QTextFrameFormat(class QTextFrameFormat const &) + ??0Symbol@QCss@@QAE@ABU01@@Z @ 13074 NONAME ABSENT ; QCss::Symbol::Symbol(struct QCss::Symbol const &) + ??4QStyleOptionFrameV3@@QAEAAV0@ABV0@@Z @ 13075 NONAME ABSENT ; class QStyleOptionFrameV3 & QStyleOptionFrameV3::operator=(class QStyleOptionFrameV3 const &) + ??0QGraphicsSystem@@QAE@XZ @ 13076 NONAME ABSENT ; QGraphicsSystem::QGraphicsSystem(void) + ??4QStyleOptionViewItem@@QAEAAV0@ABV0@@Z @ 13077 NONAME ABSENT ; class QStyleOptionViewItem & QStyleOptionViewItem::operator=(class QStyleOptionViewItem const &) + ??4QStyleOptionProgressBar@@QAEAAV0@ABV0@@Z @ 13078 NONAME ABSENT ; class QStyleOptionProgressBar & QStyleOptionProgressBar::operator=(class QStyleOptionProgressBar const &) + ??4QStyleOptionRubberBand@@QAEAAV0@ABV0@@Z @ 13079 NONAME ABSENT ; class QStyleOptionRubberBand & QStyleOptionRubberBand::operator=(class QStyleOptionRubberBand const &) + ??0QDragResponseEvent@@QAE@ABV0@@Z @ 13080 NONAME ABSENT ; QDragResponseEvent::QDragResponseEvent(class QDragResponseEvent const &) + ??0QIconEngine@@QAE@XZ @ 13081 NONAME ABSENT ; QIconEngine::QIconEngine(void) + ??_EQBrush@@QAE@I@Z @ 13082 NONAME ABSENT ; QBrush::~QBrush(unsigned int) + ??_EQTableWidgetSelectionRange@@QAE@I@Z @ 13083 NONAME ABSENT ; QTableWidgetSelectionRange::~QTableWidgetSelectionRange(unsigned int) + ??4QStyleOptionTabBarBase@@QAEAAV0@ABV0@@Z @ 13084 NONAME ABSENT ; class QStyleOptionTabBarBase & QStyleOptionTabBarBase::operator=(class QStyleOptionTabBarBase const &) + ??0QTextObjectInterface@@QAE@XZ @ 13085 NONAME ABSENT ; QTextObjectInterface::QTextObjectInterface(void) + ??0QHideEvent@@QAE@ABV0@@Z @ 13086 NONAME ABSENT ; QHideEvent::QHideEvent(class QHideEvent const &) + ??0QCloseEvent@@QAE@ABV0@@Z @ 13087 NONAME ABSENT ; QCloseEvent::QCloseEvent(class QCloseEvent const &) + ??0QTextFrameLayoutData@@QAE@XZ @ 13088 NONAME ABSENT ; QTextFrameLayoutData::QTextFrameLayoutData(void) + ??4QStyleOptionTabWidgetFrameV2@@QAEAAV0@ABV0@@Z @ 13089 NONAME ABSENT ; class QStyleOptionTabWidgetFrameV2 & QStyleOptionTabWidgetFrameV2::operator=(class QStyleOptionTabWidgetFrameV2 const &) + ??4QStyleOptionTabV2@@QAEAAV0@ABV0@@Z @ 13090 NONAME ABSENT ; class QStyleOptionTabV2 & QStyleOptionTabV2::operator=(class QStyleOptionTabV2 const &) ?platformExtension@QGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 13091 NONAME ; class QGraphicsSystemEx * QGraphicsSystem::platformExtension(void) - ??4QTextListFormat@@QAEAAV0@ABV0@@Z @ 13092 NONAME ; class QTextListFormat & QTextListFormat::operator=(class QTextListFormat const &) - ??_EQPalette@@QAE@I@Z @ 13093 NONAME ; QPalette::~QPalette(unsigned int) + ??4QTextListFormat@@QAEAAV0@ABV0@@Z @ 13092 NONAME ABSENT ; class QTextListFormat & QTextListFormat::operator=(class QTextListFormat const &) + ??_EQPalette@@QAE@I@Z @ 13093 NONAME ABSENT ; QPalette::~QPalette(unsigned int) ?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 13094 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void) - ??0QFocusEvent@@QAE@ABV0@@Z @ 13095 NONAME ; QFocusEvent::QFocusEvent(class QFocusEvent const &) - ??4QStyleOptionQ3ListViewItem@@QAEAAV0@ABV0@@Z @ 13096 NONAME ; class QStyleOptionQ3ListViewItem & QStyleOptionQ3ListViewItem::operator=(class QStyleOptionQ3ListViewItem const &) - ??_EQIcon@@QAE@I@Z @ 13097 NONAME ; QIcon::~QIcon(unsigned int) - ??0QTextListFormat@@QAE@ABV0@@Z @ 13098 NONAME ; QTextListFormat::QTextListFormat(class QTextListFormat const &) - ??0QGuiPlatformPluginInterface@@QAE@XZ @ 13099 NONAME ; QGuiPlatformPluginInterface::QGuiPlatformPluginInterface(void) - ??_EQTextLayout@@QAE@I@Z @ 13100 NONAME ; QTextLayout::~QTextLayout(unsigned int) - ??0QWheelEvent@@QAE@ABV0@@Z @ 13101 NONAME ; QWheelEvent::QWheelEvent(class QWheelEvent const &) - ??0QWindowStateChangeEvent@@QAE@ABV0@@Z @ 13102 NONAME ; QWindowStateChangeEvent::QWindowStateChangeEvent(class QWindowStateChangeEvent const &) - ??_EQTextEngine@@QAE@I@Z @ 13103 NONAME ; QTextEngine::~QTextEngine(unsigned int) - ??4QStyleOptionTitleBar@@QAEAAV0@ABV0@@Z @ 13104 NONAME ; class QStyleOptionTitleBar & QStyleOptionTitleBar::operator=(class QStyleOptionTitleBar const &) - ??4Value@QCss@@QAEAAU01@ABU01@@Z @ 13105 NONAME ; struct QCss::Value & QCss::Value::operator=(struct QCss::Value const &) + ??0QFocusEvent@@QAE@ABV0@@Z @ 13095 NONAME ABSENT ; QFocusEvent::QFocusEvent(class QFocusEvent const &) + ??4QStyleOptionQ3ListViewItem@@QAEAAV0@ABV0@@Z @ 13096 NONAME ABSENT ; class QStyleOptionQ3ListViewItem & QStyleOptionQ3ListViewItem::operator=(class QStyleOptionQ3ListViewItem const &) + ??_EQIcon@@QAE@I@Z @ 13097 NONAME ABSENT ; QIcon::~QIcon(unsigned int) + ??0QTextListFormat@@QAE@ABV0@@Z @ 13098 NONAME ABSENT ; QTextListFormat::QTextListFormat(class QTextListFormat const &) + ??0QGuiPlatformPluginInterface@@QAE@XZ @ 13099 NONAME ABSENT ; QGuiPlatformPluginInterface::QGuiPlatformPluginInterface(void) + ??_EQTextLayout@@QAE@I@Z @ 13100 NONAME ABSENT ; QTextLayout::~QTextLayout(unsigned int) + ??0QWheelEvent@@QAE@ABV0@@Z @ 13101 NONAME ABSENT ; QWheelEvent::QWheelEvent(class QWheelEvent const &) + ??0QWindowStateChangeEvent@@QAE@ABV0@@Z @ 13102 NONAME ABSENT ; QWindowStateChangeEvent::QWindowStateChangeEvent(class QWindowStateChangeEvent const &) + ??_EQTextEngine@@QAE@I@Z @ 13103 NONAME ABSENT ; QTextEngine::~QTextEngine(unsigned int) + ??4QStyleOptionTitleBar@@QAEAAV0@ABV0@@Z @ 13104 NONAME ABSENT ; class QStyleOptionTitleBar & QStyleOptionTitleBar::operator=(class QStyleOptionTitleBar const &) + ??4Value@QCss@@QAEAAU01@ABU01@@Z @ 13105 NONAME ABSENT ; struct QCss::Value & QCss::Value::operator=(struct QCss::Value const &) ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 13106 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) - ??0QDragLeaveEvent@@QAE@ABV0@@Z @ 13107 NONAME ; QDragLeaveEvent::QDragLeaveEvent(class QDragLeaveEvent const &) - ??4QBitmap@@QAEAAV0@ABV0@@Z @ 13108 NONAME ; class QBitmap & QBitmap::operator=(class QBitmap const &) - ??0QItemSelection@@QAE@ABV0@@Z @ 13109 NONAME ; QItemSelection::QItemSelection(class QItemSelection const &) - ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13110 NONAME ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &) + ??0QDragLeaveEvent@@QAE@ABV0@@Z @ 13107 NONAME ABSENT ; QDragLeaveEvent::QDragLeaveEvent(class QDragLeaveEvent const &) + ??4QBitmap@@QAEAAV0@ABV0@@Z @ 13108 NONAME ABSENT ; class QBitmap & QBitmap::operator=(class QBitmap const &) + ??0QItemSelection@@QAE@ABV0@@Z @ 13109 NONAME ABSENT ; QItemSelection::QItemSelection(class QItemSelection const &) + ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13110 NONAME ABSENT ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &) ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13111 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool) ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13112 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void) diff --git a/src/s60installs/bwins/QtMultimediau.def b/src/s60installs/bwins/QtMultimediau.def index 19e6bc77b9..763360bfa5 100644 --- a/src/s60installs/bwins/QtMultimediau.def +++ b/src/s60installs/bwins/QtMultimediau.def @@ -274,9 +274,9 @@ EXPORTS ?sampleRate@QAudioFormat@@QBEHXZ @ 273 NONAME ; int QAudioFormat::sampleRate(void) const ?supportedSampleRates@QAudioDeviceInfo@@QBE?AV?$QList@H@@XZ @ 274 NONAME ; class QList QAudioDeviceInfo::supportedSampleRates(void) const ?setChannelCount@QAudioFormat@@QAEXH@Z @ 275 NONAME ; void QAudioFormat::setChannelCount(int) - ??0QAbstractAudioInput@@QAE@XZ @ 276 NONAME ; QAbstractAudioInput::QAbstractAudioInput(void) - ??0QAudioEngineFactoryInterface@@QAE@XZ @ 277 NONAME ; QAudioEngineFactoryInterface::QAudioEngineFactoryInterface(void) - ??0QAbstractAudioDeviceInfo@@QAE@XZ @ 278 NONAME ; QAbstractAudioDeviceInfo::QAbstractAudioDeviceInfo(void) - ??0QAbstractAudioOutput@@QAE@XZ @ 279 NONAME ; QAbstractAudioOutput::QAbstractAudioOutput(void) - ??_EQAudioDeviceInfo@@QAE@I@Z @ 280 NONAME ; QAudioDeviceInfo::~QAudioDeviceInfo(unsigned int) + ??0QAbstractAudioInput@@QAE@XZ @ 276 NONAME ABSENT ; QAbstractAudioInput::QAbstractAudioInput(void) + ??0QAudioEngineFactoryInterface@@QAE@XZ @ 277 NONAME ABSENT ; QAudioEngineFactoryInterface::QAudioEngineFactoryInterface(void) + ??0QAbstractAudioDeviceInfo@@QAE@XZ @ 278 NONAME ABSENT ; QAbstractAudioDeviceInfo::QAbstractAudioDeviceInfo(void) + ??0QAbstractAudioOutput@@QAE@XZ @ 279 NONAME ABSENT ; QAbstractAudioOutput::QAbstractAudioOutput(void) + ??_EQAudioDeviceInfo@@QAE@I@Z @ 280 NONAME ABSENT ; QAudioDeviceInfo::~QAudioDeviceInfo(unsigned int) diff --git a/src/s60installs/bwins/QtNetworku.def b/src/s60installs/bwins/QtNetworku.def index c04469335b..b3137d8692 100644 --- a/src/s60installs/bwins/QtNetworku.def +++ b/src/s60installs/bwins/QtNetworku.def @@ -1145,18 +1145,18 @@ EXPORTS ?setNetworkAccessible@QNetworkAccessManager@@QAEXW4NetworkAccessibility@1@@Z @ 1144 NONAME ; void QNetworkAccessManager::setNetworkAccessible(enum QNetworkAccessManager::NetworkAccessibility) ??_EQBearerEngineFactoryInterface@@UAE@I@Z @ 1145 NONAME ; QBearerEngineFactoryInterface::~QBearerEngineFactoryInterface(unsigned int) ?enablePolling@QNetworkConfigurationManagerPrivate@@QAEXXZ @ 1146 NONAME ; void QNetworkConfigurationManagerPrivate::enablePolling(void) - ??_EQSslError@@QAE@I@Z @ 1147 NONAME ; QSslError::~QSslError(unsigned int) - ??0QBearerEngineFactoryInterface@@QAE@XZ @ 1148 NONAME ; QBearerEngineFactoryInterface::QBearerEngineFactoryInterface(void) - ??_EQSslCipher@@QAE@I@Z @ 1149 NONAME ; QSslCipher::~QSslCipher(unsigned int) - ??_EQSslConfiguration@@QAE@I@Z @ 1150 NONAME ; QSslConfiguration::~QSslConfiguration(unsigned int) - ??_EQSslCertificate@@QAE@I@Z @ 1151 NONAME ; QSslCertificate::~QSslCertificate(unsigned int) - ??_EQNetworkInterface@@QAE@I@Z @ 1152 NONAME ; QNetworkInterface::~QNetworkInterface(unsigned int) - ??_EQNetworkProxy@@QAE@I@Z @ 1153 NONAME ; QNetworkProxy::~QNetworkProxy(unsigned int) - ??_EQHostAddress@@QAE@I@Z @ 1154 NONAME ; QHostAddress::~QHostAddress(unsigned int) - ??_EQNetworkConfiguration@@QAE@I@Z @ 1155 NONAME ; QNetworkConfiguration::~QNetworkConfiguration(unsigned int) - ??_EQHostInfo@@QAE@I@Z @ 1156 NONAME ; QHostInfo::~QHostInfo(unsigned int) - ??_EQNetworkRequest@@QAE@I@Z @ 1157 NONAME ; QNetworkRequest::~QNetworkRequest(unsigned int) - ??4QIPv6Address@@QAEAAV0@ABV0@@Z @ 1158 NONAME ; class QIPv6Address & QIPv6Address::operator=(class QIPv6Address const &) - ??_EQNetworkAddressEntry@@QAE@I@Z @ 1159 NONAME ; QNetworkAddressEntry::~QNetworkAddressEntry(unsigned int) - ??_EQNetworkCookie@@QAE@I@Z @ 1160 NONAME ; QNetworkCookie::~QNetworkCookie(unsigned int) + ??_EQSslError@@QAE@I@Z @ 1147 NONAME ABSENT ; QSslError::~QSslError(unsigned int) + ??0QBearerEngineFactoryInterface@@QAE@XZ @ 1148 NONAME ABSENT ; QBearerEngineFactoryInterface::QBearerEngineFactoryInterface(void) + ??_EQSslCipher@@QAE@I@Z @ 1149 NONAME ABSENT ; QSslCipher::~QSslCipher(unsigned int) + ??_EQSslConfiguration@@QAE@I@Z @ 1150 NONAME ABSENT ; QSslConfiguration::~QSslConfiguration(unsigned int) + ??_EQSslCertificate@@QAE@I@Z @ 1151 NONAME ABSENT ; QSslCertificate::~QSslCertificate(unsigned int) + ??_EQNetworkInterface@@QAE@I@Z @ 1152 NONAME ABSENT ; QNetworkInterface::~QNetworkInterface(unsigned int) + ??_EQNetworkProxy@@QAE@I@Z @ 1153 NONAME ABSENT ; QNetworkProxy::~QNetworkProxy(unsigned int) + ??_EQHostAddress@@QAE@I@Z @ 1154 NONAME ABSENT ; QHostAddress::~QHostAddress(unsigned int) + ??_EQNetworkConfiguration@@QAE@I@Z @ 1155 NONAME ABSENT ; QNetworkConfiguration::~QNetworkConfiguration(unsigned int) + ??_EQHostInfo@@QAE@I@Z @ 1156 NONAME ABSENT ; QHostInfo::~QHostInfo(unsigned int) + ??_EQNetworkRequest@@QAE@I@Z @ 1157 NONAME ABSENT ; QNetworkRequest::~QNetworkRequest(unsigned int) + ??4QIPv6Address@@QAEAAV0@ABV0@@Z @ 1158 NONAME ABSENT ; class QIPv6Address & QIPv6Address::operator=(class QIPv6Address const &) + ??_EQNetworkAddressEntry@@QAE@I@Z @ 1159 NONAME ABSENT ; QNetworkAddressEntry::~QNetworkAddressEntry(unsigned int) + ??_EQNetworkCookie@@QAE@I@Z @ 1160 NONAME ABSENT ; QNetworkCookie::~QNetworkCookie(unsigned int) diff --git a/src/s60installs/bwins/QtScriptu.def b/src/s60installs/bwins/QtScriptu.def index 318581958e..2048e3627b 100644 --- a/src/s60installs/bwins/QtScriptu.def +++ b/src/s60installs/bwins/QtScriptu.def @@ -405,6 +405,6 @@ EXPORTS ?compare@QScriptDeclarativeClass@@UAE_NPAUObject@1@0@Z @ 404 NONAME ; bool QScriptDeclarativeClass::compare(struct QScriptDeclarativeClass::Object *, struct QScriptDeclarativeClass::Object *) ?toString@PersistentIdentifier@QScriptDeclarativeClass@@QBE?AVQString@@XZ @ 405 NONAME ; class QString QScriptDeclarativeClass::PersistentIdentifier::toString(void) const ?startsWithUpper@QScriptDeclarativeClass@@QAE_NABQAX@Z @ 406 NONAME ; bool QScriptDeclarativeClass::startsWithUpper(void * const const &) - ??0QScriptExtensionInterface@@QAE@XZ @ 407 NONAME ; QScriptExtensionInterface::QScriptExtensionInterface(void) - ??_EQScriptValue@@QAE@I@Z @ 408 NONAME ; QScriptValue::~QScriptValue(unsigned int) + ??0QScriptExtensionInterface@@QAE@XZ @ 407 NONAME ABSENT ; QScriptExtensionInterface::QScriptExtensionInterface(void) + ??_EQScriptValue@@QAE@I@Z @ 408 NONAME ABSENT ; QScriptValue::~QScriptValue(unsigned int) diff --git a/src/s60installs/bwins/QtSqlu.def b/src/s60installs/bwins/QtSqlu.def index 8b857c1ae3..777e86ec58 100644 --- a/src/s60installs/bwins/QtSqlu.def +++ b/src/s60installs/bwins/QtSqlu.def @@ -458,7 +458,7 @@ EXPORTS ?staticMetaObject@QSqlDriver@@2UQMetaObject@@B @ 457 NONAME ; struct QMetaObject const QSqlDriver::staticMetaObject ?staticMetaObject@QSqlQueryModel@@2UQMetaObject@@B @ 458 NONAME ; struct QMetaObject const QSqlQueryModel::staticMetaObject ?staticMetaObject@QSQLiteDriver@@2UQMetaObject@@B @ 459 NONAME ; struct QMetaObject const QSQLiteDriver::staticMetaObject - ??4QSqlRelation@@QAEAAV0@ABV0@@Z @ 460 NONAME ; class QSqlRelation & QSqlRelation::operator=(class QSqlRelation const &) - ??0QSqlDriverFactoryInterface@@QAE@XZ @ 461 NONAME ; QSqlDriverFactoryInterface::QSqlDriverFactoryInterface(void) - ??0QSqlRelation@@QAE@ABV0@@Z @ 462 NONAME ; QSqlRelation::QSqlRelation(class QSqlRelation const &) + ??4QSqlRelation@@QAEAAV0@ABV0@@Z @ 460 NONAME ABSENT ; class QSqlRelation & QSqlRelation::operator=(class QSqlRelation const &) + ??0QSqlDriverFactoryInterface@@QAE@XZ @ 461 NONAME ABSENT ; QSqlDriverFactoryInterface::QSqlDriverFactoryInterface(void) + ??0QSqlRelation@@QAE@ABV0@@Z @ 462 NONAME ABSENT ; QSqlRelation::QSqlRelation(class QSqlRelation const &) diff --git a/src/s60installs/bwins/QtTestu.def b/src/s60installs/bwins/QtTestu.def index 40ff5e28b7..ba3b167a77 100644 --- a/src/s60installs/bwins/QtTestu.def +++ b/src/s60installs/bwins/QtTestu.def @@ -107,7 +107,7 @@ EXPORTS ?addSkip@QTestResult@@SAXPBDW4SkipMode@QTest@@0H@Z @ 106 NONAME ; void QTestResult::addSkip(char const *, enum QTest::SkipMode, char const *, int) ?currentGlobalDataTag@QTestResult@@SAPBDXZ @ 107 NONAME ; char const * QTestResult::currentGlobalDataTag(void) ?stopLogging@QTestLog@@SAXXZ @ 108 NONAME ; void QTestLog::stopLogging(void) - ??_EQTestData@@QAE@I@Z @ 109 NONAME ; QTestData::~QTestData(unsigned int) + ??_EQTestData@@QAE@I@Z @ 109 NONAME ABSENT ; QTestData::~QTestData(unsigned int) ??1QTestLog@@AAE@XZ @ 110 NONAME ; QTestLog::~QTestLog(void) ?skipCount@QTestResult@@SAHXZ @ 111 NONAME ; int QTestResult::skipCount(void) ?setCurrentGlobalTestData@QTestResult@@SAXPAVQTestData@@@Z @ 112 NONAME ; void QTestResult::setCurrentGlobalTestData(class QTestData *) @@ -140,7 +140,7 @@ EXPORTS ?currentTestFailed@QTestResult@@SA_NXZ @ 139 NONAME ; bool QTestResult::currentTestFailed(void) ?compare@QTestResult@@SA_N_NPBDPAD2111H@Z @ 140 NONAME ; bool QTestResult::compare(bool, char const *, char *, char *, char const *, char const *, char const *, int) ?addXFail@QTestLog@@SAXPBD0H@Z @ 141 NONAME ; void QTestLog::addXFail(char const *, char const *, int) - ??_EQTestTable@@QAE@I@Z @ 142 NONAME ; QTestTable::~QTestTable(unsigned int) + ??_EQTestTable@@QAE@I@Z @ 142 NONAME ABSENT ; QTestTable::~QTestTable(unsigned int) ??0QBenchmarkGlobalData@@QAE@XZ @ 143 NONAME ; QBenchmarkGlobalData::QBenchmarkGlobalData(void) ?beginDataRun@QBenchmarkTestMethodData@@QAEXXZ @ 144 NONAME ; void QBenchmarkTestMethodData::beginDataRun(void) ?resultsAccepted@QBenchmarkTestMethodData@@QBE_NXZ @ 145 NONAME ; bool QBenchmarkTestMethodData::resultsAccepted(void) const diff --git a/src/s60installs/bwins/QtXmlPatternsu.def b/src/s60installs/bwins/QtXmlPatternsu.def index 5a458b3b5a..9d553e1c7f 100644 --- a/src/s60installs/bwins/QtXmlPatternsu.def +++ b/src/s60installs/bwins/QtXmlPatternsu.def @@ -277,7 +277,7 @@ EXPORTS ?writeEscapedAttribute@QXmlSerializer@@AAEXABVQString@@@Z @ 276 NONAME ; void QXmlSerializer::writeEscapedAttribute(class QString const &) ?staticMetaObject@QAbstractMessageHandler@@2UQMetaObject@@B @ 277 NONAME ; struct QMetaObject const QAbstractMessageHandler::staticMetaObject ?staticMetaObject@QAbstractUriResolver@@2UQMetaObject@@B @ 278 NONAME ; struct QMetaObject const QAbstractUriResolver::staticMetaObject - ??_EQXmlQuery@@QAE@I@Z @ 279 NONAME ; QXmlQuery::~QXmlQuery(unsigned int) - ??4QXmlNodeModelIndex@@QAEAAV0@ABV0@@Z @ 280 NONAME ; class QXmlNodeModelIndex & QXmlNodeModelIndex::operator=(class QXmlNodeModelIndex const &) - ??_EQXmlItem@@QAE@I@Z @ 281 NONAME ; QXmlItem::~QXmlItem(unsigned int) + ??_EQXmlQuery@@QAE@I@Z @ 279 NONAME ABSENT ; QXmlQuery::~QXmlQuery(unsigned int) + ??4QXmlNodeModelIndex@@QAEAAV0@ABV0@@Z @ 280 NONAME ABSENT ; class QXmlNodeModelIndex & QXmlNodeModelIndex::operator=(class QXmlNodeModelIndex const &) + ??_EQXmlItem@@QAE@I@Z @ 281 NONAME ABSENT ; QXmlItem::~QXmlItem(unsigned int) diff --git a/src/s60installs/bwins/QtXmlu.def b/src/s60installs/bwins/QtXmlu.def index f54e3173f1..c77f5ed4ba 100644 --- a/src/s60installs/bwins/QtXmlu.def +++ b/src/s60installs/bwins/QtXmlu.def @@ -400,11 +400,11 @@ EXPORTS ?warning@QXmlDefaultHandler@@UAE_NABVQXmlParseException@@@Z @ 399 NONAME ; bool QXmlDefaultHandler::warning(class QXmlParseException const &) ?EndOfDocument@QXmlInputSource@@2GB @ 400 NONAME ; unsigned short const QXmlInputSource::EndOfDocument ?EndOfData@QXmlInputSource@@2GB @ 401 NONAME ; unsigned short const QXmlInputSource::EndOfData - ??0QXmlContentHandler@@QAE@XZ @ 402 NONAME ; QXmlContentHandler::QXmlContentHandler(void) - ??0QXmlDTDHandler@@QAE@XZ @ 403 NONAME ; QXmlDTDHandler::QXmlDTDHandler(void) - ??0QXmlReader@@QAE@XZ @ 404 NONAME ; QXmlReader::QXmlReader(void) - ??0QXmlLexicalHandler@@QAE@XZ @ 405 NONAME ; QXmlLexicalHandler::QXmlLexicalHandler(void) - ??0QXmlDeclHandler@@QAE@XZ @ 406 NONAME ; QXmlDeclHandler::QXmlDeclHandler(void) - ??0QXmlEntityResolver@@QAE@XZ @ 407 NONAME ; QXmlEntityResolver::QXmlEntityResolver(void) - ??0QXmlErrorHandler@@QAE@XZ @ 408 NONAME ; QXmlErrorHandler::QXmlErrorHandler(void) + ??0QXmlContentHandler@@QAE@XZ @ 402 NONAME ABSENT ; QXmlContentHandler::QXmlContentHandler(void) + ??0QXmlDTDHandler@@QAE@XZ @ 403 NONAME ABSENT ; QXmlDTDHandler::QXmlDTDHandler(void) + ??0QXmlReader@@QAE@XZ @ 404 NONAME ABSENT ; QXmlReader::QXmlReader(void) + ??0QXmlLexicalHandler@@QAE@XZ @ 405 NONAME ABSENT ; QXmlLexicalHandler::QXmlLexicalHandler(void) + ??0QXmlDeclHandler@@QAE@XZ @ 406 NONAME ABSENT ; QXmlDeclHandler::QXmlDeclHandler(void) + ??0QXmlEntityResolver@@QAE@XZ @ 407 NONAME ABSENT ; QXmlEntityResolver::QXmlEntityResolver(void) + ??0QXmlErrorHandler@@QAE@XZ @ 408 NONAME ABSENT ; QXmlErrorHandler::QXmlErrorHandler(void) diff --git a/src/s60installs/bwins/phononu.def b/src/s60installs/bwins/phononu.def index 15f83b1730..71d1a80118 100644 --- a/src/s60installs/bwins/phononu.def +++ b/src/s60installs/bwins/phononu.def @@ -570,8 +570,8 @@ EXPORTS ?setOutputDevice@PulseSupport@Phonon@@QAE_NVQString@@H@Z @ 569 NONAME ; bool Phonon::PulseSupport::setOutputDevice(class QString, int) ?qt_metacast@AudioDataOutput@Phonon@@UAEPAXPBD@Z @ 570 NONAME ; void * Phonon::AudioDataOutput::qt_metacast(char const *) ?clearStreamCache@PulseSupport@Phonon@@QAEXVQString@@@Z @ 571 NONAME ; void Phonon::PulseSupport::clearStreamCache(class QString) - ??_EEffectParameter@Phonon@@QAE@I@Z @ 572 NONAME ; Phonon::EffectParameter::~EffectParameter(unsigned int) - ??_EPath@Phonon@@QAE@I@Z @ 573 NONAME ; Phonon::Path::~Path(unsigned int) - ??_EMediaSource@Phonon@@QAE@I@Z @ 574 NONAME ; Phonon::MediaSource::~MediaSource(unsigned int) - ??_EObjectDescriptionData@Phonon@@QAE@I@Z @ 575 NONAME ; Phonon::ObjectDescriptionData::~ObjectDescriptionData(unsigned int) + ??_EEffectParameter@Phonon@@QAE@I@Z @ 572 NONAME ABSENT ; Phonon::EffectParameter::~EffectParameter(unsigned int) + ??_EPath@Phonon@@QAE@I@Z @ 573 NONAME ABSENT ; Phonon::Path::~Path(unsigned int) + ??_EMediaSource@Phonon@@QAE@I@Z @ 574 NONAME ABSENT ; Phonon::MediaSource::~MediaSource(unsigned int) + ??_EObjectDescriptionData@Phonon@@QAE@I@Z @ 575 NONAME ABSENT ; Phonon::ObjectDescriptionData::~ObjectDescriptionData(unsigned int) -- cgit v1.2.3 From e5f38bb543696813a70995c90cd5450602c0356c Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 19 May 2011 10:29:49 +0200 Subject: Support placing cursor in ligature with mouse or touch We need to find out the closest element in the ligature to the point we clicked (or tapped), currently we do this by dividing the width of that ligature glyph evenly by the number of characters it covered. We only support Common and Greek script at this point, ligatures in other scripts are still handled as a whole. Task-number: QTBUG-19260 Reviewed-by: Eskil --- src/gui/text/qtextengine.cpp | 66 ++++++++++++++++++++++++++++++ src/gui/text/qtextengine_p.h | 3 ++ src/gui/text/qtextlayout.cpp | 12 +++--- tests/auto/qtextlayout/tst_qtextlayout.cpp | 25 +++++++++++ 4 files changed, 99 insertions(+), 7 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 806779a90d..62de1fee30 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2697,6 +2697,72 @@ QFixed QTextEngine::leadingSpaceWidth(const QScriptLine &line) return width(line.from + pos, line.length - pos); } +// Scan in logClusters[from..to-1] for glyph_pos +int QTextEngine::getClusterLength(unsigned short *logClusters, + const HB_CharAttributes *attributes, + int from, int to, int glyph_pos, int *start) +{ + int clusterLength = 0; + for (int i = from; i < to; i++) { + if (logClusters[i] == glyph_pos && attributes[i].charStop) { + if (*start < 0) + *start = i; + clusterLength++; + } + else if (clusterLength) + break; + } + return clusterLength; +} + +int QTextEngine::positionInLigature(const QScriptItem *si, int end, + QFixed x, QFixed edge, int glyph_pos) +{ + unsigned short *logClusters = this->logClusters(si); + int clusterStart = -1; + int clusterLength = 0; + + if (si->analysis.script != QUnicodeTables::Common && + si->analysis.script != QUnicodeTables::Greek) { + if (glyph_pos == -1) + return si->position + end; + else { + int i; + for (i = 0; i < end; i++) + if (logClusters[i] == glyph_pos) + break; + return si->position + i; + } + } + + if (glyph_pos == -1 && end > 0) + glyph_pos = logClusters[end - 1]; + else { + if (x < edge) + glyph_pos--; + } + + const HB_CharAttributes *attrs = attributes(); + clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart); + + if (clusterLength) { + const QGlyphLayout &glyphs = shapedGlyphs(si); + QFixed glyphWidth = glyphs.effectiveAdvance(glyph_pos); + // the approximate width of each individual element of the ligature + QFixed perItemWidth = glyphWidth / clusterLength; + QFixed left = x > edge ? edge : edge - glyphWidth; + int n = ((x - left) / perItemWidth).floor().toInt(); + QFixed dist = x - left - n * perItemWidth; + int closestItem = dist > (perItemWidth / 2) ? n + 1 : n; + int pos = si->position + clusterStart + closestItem; + // Jump to the next charStop + while (!attrs[pos].charStop && pos < end) + pos++; + return pos; + } + return si->position + end; +} + QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) : QTextEngine(string, f), _layoutData(string, _memory, MemSize) diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 5e33f21616..f8939e3e6d 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -594,6 +594,8 @@ public: void shapeLine(const QScriptLine &line); QFixed leadingSpaceWidth(const QScriptLine &line); + int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos); + private: void setBoundary(int strPos) const; void addRequiredBoundaries() const; @@ -608,6 +610,7 @@ private: void splitItem(int item, int pos) const; void resolveAdditionalFormats() const; + int getClusterLength(unsigned short *logClusters, const HB_CharAttributes *attributes, int from, int to, int glyph_pos, int *start); }; class QStackTextEngine : public QTextEngine { diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index de4ca4ff05..5857f33df4 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2622,6 +2622,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const } int glyph_pos = -1; + QFixed edge; // has to be inside run if (cpos == QTextLine::CursorOnCharacter) { if (si.analysis.bidiLevel % 2) { @@ -2632,6 +2633,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const if (pos < x) break; glyph_pos = gs; + edge = pos; break; } pos -= glyphs.effectiveAdvance(gs); @@ -2644,6 +2646,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const if (pos > x) break; glyph_pos = gs; + edge = pos; } pos += glyphs.effectiveAdvance(gs); ++gs; @@ -2672,15 +2675,10 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const } } if (qAbs(x-pos) < dist) - return si.position + end; + return eng->positionInLigature(&si, end, x, pos, -1); } Q_ASSERT(glyph_pos != -1); - int j; - for (j = 0; j < eng->length(item); ++j) - if (logClusters[j] == glyph_pos) - break; -// qDebug("at pos %d (in run: %d)", si.position + j, j); - return si.position + j; + return eng->positionInLigature(&si, end, x, edge, glyph_pos); } } // right of last item diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp index 964679add2..df84c8f412 100644 --- a/tests/auto/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp @@ -127,6 +127,7 @@ private slots: void textWidthWithLineSeparator(); void textWithSurrogates_qtbug15679(); void cursorInLigatureWithMultipleLines(); + void xToCursorForLigatures(); private: QFont testFont; @@ -1453,5 +1454,29 @@ void tst_QTextLayout::cursorInLigatureWithMultipleLines() QVERIFY(line.cursorToX(0) != line.cursorToX(1)); } +void tst_QTextLayout::xToCursorForLigatures() +{ +#if !defined(Q_WS_MAC) + QSKIP("This test can not be run on Mac", SkipAll); +#endif + QTextLayout layout("fi", QFont("Times", 20)); + layout.beginLayout(); + QTextLine line = layout.createLine(); + layout.endLayout(); + + QVERIFY(line.xToCursor(0) != line.xToCursor(line.naturalTextWidth() / 2)); + + // U+0061 U+0308 + QTextLayout layout2(QString::fromUtf8("\x61\xCC\x88"), QFont("Times", 20)); + + layout2.beginLayout(); + line = layout2.createLine(); + layout2.endLayout(); + + qreal width = line.naturalTextWidth(); + QVERIFY(line.xToCursor(0) == line.xToCursor(width / 2) || + line.xToCursor(width) == line.xToCursor(width / 2)); +} + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" -- cgit v1.2.3 From 5a4df38ac98aa013bcfaddc8470bc1a7bae4449e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 18 May 2011 12:16:33 +0200 Subject: Fix broken drawing with large fonts using QStaticText and FreeType In FreeType, there's a fall back to QFontEngine::alphaMapForGlyph() when the fonts are very large. Since this uses a QPainterPath containing an unhinted glyph, the use of hinted metrics would sometimes lead to the glyphs being clipped because they would be positioned slightly outside the image they were painted into. When outline drawing is on, it makes sense to return unhinted metrics, since the glyphs we will actually use are unhinted. Task-number: QTBUG-19067 Reviewed-by: Jiang Jiang (cherry picked from commit 5fcd60f2560e8caf495ce67028a8da8bef27acad) --- src/gui/text/qfontengine_ft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index f514942754..4c6083c858 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -795,7 +795,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags, if (set && set->outline_drawing) load_flags = FT_LOAD_NO_BITMAP; - if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics)) + if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics) || set->outline_drawing) load_flags |= FT_LOAD_NO_HINTING; else load_flags |= load_target; -- cgit v1.2.3 From b001e886b35d06ca2551709280f0541cdc75c34a Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Tue, 24 May 2011 13:43:45 +0300 Subject: Fix the state of default network configuration. PMO Bug 257336 - Default configuration remains in QNetworkConfiguration::Active state even when device moves out of WLAN coverage This fix sets the default network configuration (of type UserChoice) back to Discovered when the network session is disconnected. Reviewed-by: Cristiano di Flora --- src/plugins/bearer/icd/qnetworksession_impl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index f08d8bf363..a99c0a7891 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -183,6 +183,12 @@ void QNetworkSessionPrivateImpl::updateState(QNetworkSession::State newState) icdConfig->mutex.lock(); icdConfig->state = QNetworkConfiguration::Defined; icdConfig->mutex.unlock(); + + // Reset the state of the default configuration to Discovered + icdConfig = toIcdConfig(privateConfiguration(publicConfig)); + icdConfig->mutex.lock(); + icdConfig->state = QNetworkConfiguration::Discovered; + icdConfig->mutex.unlock(); } else { if (!activeConfig.isValid()) { // Active configuration (IAP) was removed from system -- cgit v1.2.3 From 7214d84f3296a05e6db09f0ed12702b21c3fcb30 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 24 May 2011 14:18:23 +0200 Subject: Fix xToCursor issue due to backporting from 4.8 Task-number: QTBUG-19260 Reviewed-by: TrustMe --- src/gui/text/qtextlayout.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 5857f33df4..a9179edcb1 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2659,6 +2659,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const while (gs <= ge) { if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { glyph_pos = gs; + edge = pos; dist = qAbs(x-pos); } pos -= glyphs.effectiveAdvance(gs); @@ -2668,6 +2669,7 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const while (gs <= ge) { if (glyphs.attributes[gs].clusterStart && qAbs(x-pos) < dist) { glyph_pos = gs; + edge = pos; dist = qAbs(x-pos); } pos += glyphs.effectiveAdvance(gs); -- cgit v1.2.3 From c4727a85eed57a4db698326a1bed4aa75b6e5284 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 24 May 2011 14:05:48 +0100 Subject: sockets: limit buffer size of the internal sockets in proxy engines The application can normally control the amount of buffering of a socket or QNetworkReply by using the setReadBufferSize API. This allows the application to flow control the TCP connection, and avoids out of memory errors when the data being downloaded is received faster than the application can process it. However when using a proxy, the proxy socket engine has an internal socket which is used to communicate with the proxy server. It is not visible to the user, and does not have awareness of the buffer size of the external socket. To solve this, we limit the internal sockets' buffer size to 64k bytes. Under normal operation, the data is swiftly copied to the external socket where the buffer can grow (or not) based on the application's set value for read buffer size. Task-number: QT-4966 Reviewed-by: Markus Goetz --- src/network/socket/qhttpsocketengine.cpp | 2 ++ src/network/socket/qsocks5socketengine.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 81a2c61c78..b002bec693 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -145,6 +145,8 @@ bool QHttpSocketEngine::connectInternal() // Handshake isn't done. If unconnected, start connecting. if (d->state == None && d->socket->state() == QAbstractSocket::UnconnectedState) { setState(QAbstractSocket::ConnectingState); + //limit buffer in internal socket, data is buffered in the external socket under application control + d->socket->setReadBufferSize(65536); d->socket->connectToHost(d->proxy.hostName(), d->proxy.port()); } diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 87e770015b..f7acc4e74a 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -1119,6 +1119,8 @@ bool QSocks5SocketEngine::connectInternal() if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized && d->socketState != QAbstractSocket::ConnectingState) { setState(QAbstractSocket::ConnectingState); + //limit buffer in internal socket, data is buffered in the external socket under application control + d->data->controlSocket->setReadBufferSize(65536); d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port()); return false; } -- cgit v1.2.3 From 67ed18497705fa938728c505d165173dc5d3de68 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 25 May 2011 13:01:33 +1000 Subject: Flickable could flick in wrong direction if given too few touch samples If we got <= QML_FLICK_DISCARDSAMPLES the previous velocity was not cleared, so the view would continue flicking with the previous velocity, and therefore the previous direction. Change-Id: I876610f4522f32c814449309b01ec3787c5f6cc6 Task-number: QT-4903 Reviewed-by: Andrew den Exter --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 82ed18c690..2bf863b58f 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -232,8 +232,8 @@ void QDeclarativeFlickablePrivate::AxisData::addVelocitySample(qreal v, qreal ma void QDeclarativeFlickablePrivate::AxisData::updateVelocity() { + velocity = 0; if (velocityBuffer.count() > QML_FLICK_DISCARDSAMPLES) { - velocity = 0; int count = velocityBuffer.count()-QML_FLICK_DISCARDSAMPLES; for (int i = 0; i < count; ++i) { qreal v = velocityBuffer.at(i); -- cgit v1.2.3 From 1013cf05d579dbcf61890b5529a6e970aa562a19 Mon Sep 17 00:00:00 2001 From: shiroki Date: Wed, 25 May 2011 11:26:23 +0200 Subject: fix the "Host" header for ipv6 URLs in QNAM Reviewed-by: Markus Goetz --- src/network/access/qhttpnetworkconnection.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 61230fc8ba..d76a5fd4a8 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -256,7 +256,17 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair) // set the host value = request.headerField("host"); if (value.isEmpty()) { - QByteArray host = QUrl::toAce(hostName); + QHostAddress add; + QByteArray host; + if(add.setAddress(hostName)) { + if(add.protocol() == QAbstractSocket::IPv6Protocol) { + host = "[" + hostName.toAscii() + "]";//format the ipv6 in the standard way + } else { + host = QUrl::toAce(hostName); + } + } else { + host = QUrl::toAce(hostName); + } int port = request.url().port(); if (port != -1) { -- cgit v1.2.3 From e38aaf9f7c91efb6197f7f579e3064e0e6dcce1e Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 25 May 2011 10:55:52 +0200 Subject: Fix cursor position test on CursorOnCharacter case Reviewed-by: TrustMe --- src/gui/text/qtextengine.cpp | 5 ++++- src/gui/text/qtextengine_p.h | 2 +- src/gui/text/qtextlayout.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 62de1fee30..69598cfef9 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2716,7 +2716,8 @@ int QTextEngine::getClusterLength(unsigned short *logClusters, } int QTextEngine::positionInLigature(const QScriptItem *si, int end, - QFixed x, QFixed edge, int glyph_pos) + QFixed x, QFixed edge, int glyph_pos, + bool cursorOnCharacter) { unsigned short *logClusters = this->logClusters(si); int clusterStart = -1; @@ -2754,6 +2755,8 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, int n = ((x - left) / perItemWidth).floor().toInt(); QFixed dist = x - left - n * perItemWidth; int closestItem = dist > (perItemWidth / 2) ? n + 1 : n; + if (cursorOnCharacter && closestItem > 0) + closestItem--; int pos = si->position + clusterStart + closestItem; // Jump to the next charStop while (!attrs[pos].charStop && pos < end) diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index f8939e3e6d..09610ff04a 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -594,7 +594,7 @@ public: void shapeLine(const QScriptLine &line); QFixed leadingSpaceWidth(const QScriptLine &line); - int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos); + int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter); private: void setBoundary(int strPos) const; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index a9179edcb1..4b3c9e7929 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2677,10 +2677,12 @@ int QTextLine::xToCursor(qreal _x, CursorPosition cpos) const } } if (qAbs(x-pos) < dist) - return eng->positionInLigature(&si, end, x, pos, -1); + return eng->positionInLigature(&si, end, x, pos, -1, + cpos == QTextLine::CursorOnCharacter); } Q_ASSERT(glyph_pos != -1); - return eng->positionInLigature(&si, end, x, edge, glyph_pos); + return eng->positionInLigature(&si, end, x, edge, glyph_pos, + cpos == QTextLine::CursorOnCharacter); } } // right of last item -- cgit v1.2.3 From 04cde562a0be446234e33725c999bdb61fab3ff2 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 25 May 2011 11:39:12 +0200 Subject: Revert "Fixing Linux compatibility issues for Symbian" Changing the library names to lowercase breaks 5.0-based Linux builds. It will be investigated if it is possible to change the SDKs instead. If not, the patch will have to be extended to use the original names for 5.0 and the lowercased ones otherwise. This reverts commit 5933d4e4fb8b48ebed641e7f6b1d032df253df30. --- .../mobile/quickhit/plugins/LevelOne/levelone.pro | 6 ++-- .../plugins/LevelTemplate/leveltemplate.pro | 6 ++-- .../mobile/quickhit/plugins/LevelTwo/leveltwo.pro | 6 ++-- mkspecs/features/symbian/application_icon.prf | 4 +-- src/gui/dialogs/dialogs.pri | 2 +- src/gui/styles/styles.pri | 6 +++- src/plugins/bearer/symbian/symbian.pri | 9 +++-- src/plugins/phonon/mmf/mmf.pro | 4 +-- src/plugins/s60/5_0/5_0.pro | 8 +++-- src/s60installs/qt.iby | 42 +++++++++++----------- src/s60installs/s60installs.pro | 6 ++-- tests/auto/qcssparser/qcssparser.pro | 2 +- 12 files changed, 57 insertions(+), 44 deletions(-) diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro index b9367219b7..fcbfc56a53 100644 --- a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro @@ -57,11 +57,11 @@ BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/backgroun myQml.sources = level.qml -myQml.path = c:/system/quickhitdata/levelone +myQml.path = c:/System/quickhitdata/levelone myGraphic.sources = gfx/* -myGraphic.path = c:/system/quickhitdata/levelone/gfx +myGraphic.path = c:/System/quickhitdata/levelone/gfx mySound.sources = sound/* -mySound.path = c:/system/quickhitdata/levelone/sound +mySound.path = c:/System/quickhitdata/levelone/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro index 1370956aa0..a4f590058b 100644 --- a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro @@ -60,11 +60,11 @@ BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ myQml.sources = qml/* -myQml.path = c:/system/quickhitdata/leveltemplate +myQml.path = c:/System/quickhitdata/leveltemplate myGraphic.sources = gfx/* -myGraphic.path = c:/system/quickhitdata/leveltemplate/gfx +myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx mySound.sources = sound/* -mySound.path = c:/system/quickhitdata/leveltemplate/sound +mySound.path = c:/System/quickhitdata/leveltemplate/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro index e5c144f381..171ee6c2da 100644 --- a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro @@ -64,11 +64,11 @@ BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/backgroun myQml.sources = qml/* -myQml.path = c:/system/quickhitdata/leveltwo +myQml.path = c:/System/quickhitdata/leveltwo myGraphic.sources = gfx/* -myGraphic.path = c:/system/quickhitdata/leveltwo/gfx +myGraphic.path = c:/System/quickhitdata/leveltwo/gfx mySound.sources = sound/* -mySound.path = c:/system/quickhitdata/leveltwo/sound +mySound.path = c:/System/quickhitdata/leveltwo/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 56d1ea8ede..06f5b3103a 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -65,8 +65,8 @@ contains(CONFIG, no_icon) { mifconv.target = $$replace(mifconv.target, /, \\) } # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library - # svg-t icons should always use -c32 depth - mifconv.commands = mifconv $$mifconv.target -c32 $$ICON_backslashed + # svg-t icons should always use /c32 depth + mifconv.commands = mifconv $$mifconv.target /c32 $$ICON_backslashed mifconv.depends = $$ICON PRE_TARGETDEPS += $$mifconv.target diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index c25b6d5c1d..12e3a711c8 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -109,7 +109,7 @@ SOURCES += \ dialogs/qprintpreviewdialog.cpp symbian:contains(QT_CONFIG, s60) { - LIBS += -lcommondialogs + LIBS += -lCommonDialogs SOURCES += dialogs/qfiledialog_symbian.cpp \ dialogs/qcolordialog_symbian.cpp } diff --git a/src/gui/styles/styles.pri b/src/gui/styles/styles.pri index c595ee86bd..b22a908fdf 100644 --- a/src/gui/styles/styles.pri +++ b/src/gui/styles/styles.pri @@ -172,7 +172,11 @@ contains( styles, s60 ):contains(QT_CONFIG, s60) { symbian { SOURCES += styles/qs60style_s60.cpp LIBS += -legul -lbmpanim - LIBS += -laknicon -laknskins -laknskinsrv -lfontutils + contains(CONFIG, is_using_gnupoc) { + LIBS += -laknicon -laknskins -laknskinsrv -lfontutils + } else { + LIBS += -lAknIcon -lAKNSKINS -lAKNSKINSRV -lFontUtils + } } else { SOURCES += styles/qs60style_simulated.cpp RESOURCES += styles/qstyle_s60_simulated.qrc diff --git a/src/plugins/bearer/symbian/symbian.pri b/src/plugins/bearer/symbian/symbian.pri index 121cefb2c3..8d92f57b68 100644 --- a/src/plugins/bearer/symbian/symbian.pri +++ b/src/plugins/bearer/symbian/symbian.pri @@ -19,8 +19,13 @@ LIBS += -lcommdb \ -linsock \ -lecom \ -lefsrv \ - -lnetmeta \ - -lconnmon + -lnetmeta + +is_using_gnupoc { + LIBS += -lconnmon +} else { + LIBS += -lConnMon +} QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/bearer target.path += $$[QT_INSTALL_PLUGINS]/bearer diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 3b8184b6af..a9e5746032 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -103,7 +103,7 @@ symbian { exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { HEADERS += $$PHONON_MMF_DIR/download.h SOURCES += $$PHONON_MMF_DIR/download.cpp - LIBS += -ldownloadmgr + LIBS += -lDownloadMgr DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD } } @@ -125,7 +125,7 @@ symbian { LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. - LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect + LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect # This is to allow IAP to be specified LIBS += -lcommdb diff --git a/src/plugins/s60/5_0/5_0.pro b/src/plugins/s60/5_0/5_0.pro index 1617a1e09f..00aea1b148 100644 --- a/src/plugins/s60/5_0/5_0.pro +++ b/src/plugins/s60/5_0/5_0.pro @@ -10,8 +10,12 @@ contains(S60_VERSION, 3.1) { SOURCES += ../src/qlocale_3_2.cpp \ ../src/qdesktopservices_3_2.cpp \ ../src/qcoreapplication_3_2.cpp - LIBS += -lefsrv \ - -ldirectorylocalizer + contains(CONFIG, is_using_gnupoc) { + LIBS += -ldirectorylocalizer + } else { + LIBS += -lDirectoryLocalizer + } + LIBS += -lefsrv INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index 9f2c979aa4..d6b36e0fe3 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -40,7 +40,7 @@ file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll // Phonon MMF backend file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // graphicssystems file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll @@ -54,41 +54,41 @@ file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll // imageformats stubs -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin // codecs stubs -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin // iconengines stubs -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin +data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin // qml import plugins file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin +data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin +data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin +data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir -data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir +data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir +data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir +data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir // graphicssystems -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin +data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin +data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin // bearer stub -data=EPOCROOT##epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin +data=\epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin // Stub sis file data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 17b229fa8e..d1bb48b814 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -10,10 +10,10 @@ symbian: { TARGET = "Qt$${QT_LIBINFIX}" isEmpty(QT_LIBINFIX) { - TARGET.UID3 = 0x2001e61c + TARGET.UID3 = 0x2001E61C } else { # Always use experimental UID for infixed configuration to avoid UID clash - TARGET.UID3 = 0xe001e61c + TARGET.UID3 = 0xE001E61C } VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} @@ -116,7 +116,7 @@ symbian: { # Support backup & restore for Qt libraries qtbackup.sources = backup_registration.xml - qtbackup.path = c:/private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,) + qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) DEPLOYMENT += qtlibraries \ qtbackup \ diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 4953490497..674064fc83 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -10,7 +10,7 @@ requires(contains(QT_CONFIG,private_tests)) wince*|symbian: { addFiles.sources = testdata addFiles.path = . - timesFont.sources = c:/windows/fonts/times.ttf + timesFont.sources = C:/Windows/Fonts/times.ttf timesFont.path = . DEPLOYMENT += addFiles timesFont } -- cgit v1.2.3 From db20b6c03b6a93ab3e483cd85d5d0a923c3d3430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Niemel=C3=A4?= Date: Wed, 25 May 2011 14:19:14 +0300 Subject: Backported QML ShaderEffectItem from QML2.0 into Qt Quick 1.1 This issue is about backporting Scenegraph's ShaderEffectItem and ShaderEffectSource elements into Qt Quick 1.1 as a Qt labs plugin. Purpose of these elements is to provide an interface for utilizing OpenGL shaders in QML applications. Task-number: QTBUG-18346 Reviewed-by: Kim Gronholm --- src/imports/imports.pro | 1 + src/imports/shaders/glfunctions.h | 75 ++ src/imports/shaders/qmldir | 2 + src/imports/shaders/qmlshadersplugin_plugin.cpp | 55 ++ src/imports/shaders/qmlshadersplugin_plugin.h | 56 ++ src/imports/shaders/scenegraph/qsggeometry.cpp | 310 +++++++ src/imports/shaders/scenegraph/qsggeometry.h | 234 ++++++ src/imports/shaders/shadereffect.cpp | 192 +++++ src/imports/shaders/shadereffect.h | 81 ++ src/imports/shaders/shadereffectbuffer.cpp | 52 ++ src/imports/shaders/shadereffectbuffer.h | 62 ++ src/imports/shaders/shadereffectitem.cpp | 915 +++++++++++++++++++++ src/imports/shaders/shadereffectitem.h | 152 ++++ src/imports/shaders/shadereffectsource.cpp | 472 +++++++++++ src/imports/shaders/shadereffectsource.h | 158 ++++ src/imports/shaders/shaders.pro | 38 + tests/auto/declarative/declarative.pro | 2 + tests/auto/declarative/qmlshadersplugin/main.qml | 80 ++ .../qmlshadersplugin/qmlshadersplugin.pro | 18 + .../qmlshadersplugin/tst_qmlshadersplugin.cpp | 205 +++++ tests/benchmarks/declarative/declarative.pro | 2 +- .../declarative/qmlshadersplugin/GaussianBlur.qml | 43 + .../qmlshadersplugin/GaussianDirectionalBlur.qml | 168 ++++ .../qmlshadersplugin/GaussianDropShadow.qml | 41 + .../qmlshadersplugin/TestGaussianDropShadow.qml | 66 ++ .../declarative/qmlshadersplugin/TestWater.qml | 20 + .../declarative/qmlshadersplugin/Water.qml | 85 ++ .../benchmarks/declarative/qmlshadersplugin/bg.jpg | Bin 0 -> 10189 bytes .../qmlshadersplugin/drop_shadow_small.png | Bin 0 -> 46081 bytes .../qmlshadersplugin/qmlshadersplugin.pro | 23 + .../declarative/qmlshadersplugin/sky.jpg | Bin 0 -> 36734 bytes .../qmlshadersplugin/tst_performance.cpp | 110 +++ tests/manual/declarative/declarative.pro | 3 + tests/manual/declarative/qmlshadersplugin/main.cpp | 67 ++ .../qml/qmlshadersplugintest/TestActive.qml | 83 ++ .../qml/qmlshadersplugintest/TestBasic.qml | 57 ++ .../qml/qmlshadersplugintest/TestBlending.qml | 82 ++ .../qml/qmlshadersplugintest/TestBlendingModes.qml | 267 ++++++ .../qmlshadersplugintest/TestEffectHierarchy.qml | 133 +++ .../TestEffectInsideAnotherEffect.qml | 119 +++ .../qml/qmlshadersplugintest/TestFormat.qml | 89 ++ .../qmlshadersplugintest/TestFragmentShader.qml | 91 ++ .../qml/qmlshadersplugintest/TestGrab.qml | 89 ++ .../qml/qmlshadersplugintest/TestHideOriginal.qml | 97 +++ .../qmlshadersplugintest/TestHorizontalWrap.qml | 93 +++ .../qmlshadersplugintest/TestImageFiltering.qml | 84 ++ .../qml/qmlshadersplugintest/TestImageMargins.qml | 98 +++ .../TestImageMarginsWithTextureSize.qml | 96 +++ .../qml/qmlshadersplugintest/TestImageMipmap.qml | 95 +++ .../qml/qmlshadersplugintest/TestItemMargins.qml | 102 +++ .../TestItemMarginsWithTextureSize.qml | 101 +++ .../qml/qmlshadersplugintest/TestLive.qml | 104 +++ .../qmlshadersplugintest/TestMeshResolution.qml | 108 +++ .../qml/qmlshadersplugintest/TestOneSource.qml | 74 ++ .../qml/qmlshadersplugintest/TestOpacity.qml | 98 +++ .../qml/qmlshadersplugintest/TestRotation.qml | 95 +++ .../qml/qmlshadersplugintest/TestScale.qml | 95 +++ .../qml/qmlshadersplugintest/TestTextureSize.qml | 85 ++ .../qmlshadersplugintest/TestTwiceOnSameSource.qml | 92 +++ .../qml/qmlshadersplugintest/TestTwoSources.qml | 95 +++ .../qml/qmlshadersplugintest/TestVertexShader.qml | 109 +++ .../qml/qmlshadersplugintest/TestVerticalWrap.qml | 92 +++ .../qml/qmlshadersplugintest/TestWrapRepeat.qml | 92 +++ .../qml/qmlshadersplugintest/back.svg | 11 + .../green_image_transparent.png | Bin 0 -> 1153 bytes .../qml/qmlshadersplugintest/image.png | Bin 0 -> 219220 bytes .../qml/qmlshadersplugintest/image_opaque.png | Bin 0 -> 293803 bytes .../qml/qmlshadersplugintest/image_small.png | Bin 0 -> 40220 bytes .../qml/qmlshadersplugintest/main.qml | 236 ++++++ .../qml/qmlshadersplugintest/wallpaper.jpg | Bin 0 -> 337569 bytes .../qmlapplicationviewer/qmlapplicationviewer.cpp | 127 +++ .../qmlapplicationviewer/qmlapplicationviewer.h | 28 + .../qmlapplicationviewer/qmlapplicationviewer.pri | 152 ++++ .../qmlshadersplugin/qmlshadersplugin.pro | 29 + 74 files changed, 7285 insertions(+), 1 deletion(-) create mode 100755 src/imports/shaders/glfunctions.h create mode 100644 src/imports/shaders/qmldir create mode 100644 src/imports/shaders/qmlshadersplugin_plugin.cpp create mode 100644 src/imports/shaders/qmlshadersplugin_plugin.h create mode 100644 src/imports/shaders/scenegraph/qsggeometry.cpp create mode 100644 src/imports/shaders/scenegraph/qsggeometry.h create mode 100644 src/imports/shaders/shadereffect.cpp create mode 100644 src/imports/shaders/shadereffect.h create mode 100644 src/imports/shaders/shadereffectbuffer.cpp create mode 100644 src/imports/shaders/shadereffectbuffer.h create mode 100644 src/imports/shaders/shadereffectitem.cpp create mode 100644 src/imports/shaders/shadereffectitem.h create mode 100644 src/imports/shaders/shadereffectsource.cpp create mode 100644 src/imports/shaders/shadereffectsource.h create mode 100644 src/imports/shaders/shaders.pro create mode 100644 tests/auto/declarative/qmlshadersplugin/main.qml create mode 100644 tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro create mode 100644 tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml create mode 100755 tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml create mode 100755 tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/Water.qml create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/bg.jpg create mode 100755 tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/sky.jpg create mode 100644 tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp create mode 100644 tests/manual/declarative/declarative.pro create mode 100644 tests/manual/declarative/qmlshadersplugin/main.cpp create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png create mode 100644 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml create mode 100755 tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg create mode 100644 tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp create mode 100644 tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h create mode 100644 tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri create mode 100644 tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro diff --git a/src/imports/imports.pro b/src/imports/imports.pro index 5e50b08da8..c1298e214a 100644 --- a/src/imports/imports.pro +++ b/src/imports/imports.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS += folderlistmodel particles gestures +contains(QT_CONFIG, opengl): SUBDIRS += shaders diff --git a/src/imports/shaders/glfunctions.h b/src/imports/shaders/glfunctions.h new file mode 100755 index 0000000000..03b88d1cbc --- /dev/null +++ b/src/imports/shaders/glfunctions.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef GLFUNCTIONS_H +#define GLFUNCTIONS_H + +#ifndef QT_OPENGL_ES + +#ifndef Q_WS_MAC +# ifndef QGLF_APIENTRYP +# ifdef QGLF_APIENTRY +# define QGLF_APIENTRYP QGLF_APIENTRY * +# else +# define QGLF_APIENTRY +# define QGLF_APIENTRYP * +# endif +# endif +#else +# define QGLF_APIENTRY +# define QGLF_APIENTRYP * +#endif + +#define GL_TEXTURE0 0x84C0 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_BGRA 0x80E1 + +typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture); +typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target); +typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); + +#define glActiveTexture ((type_glActiveTexture)QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture"))) +#define glGenerateMipmap ((type_glGenerateMipmap)QGLContext::currentContext()->getProcAddress(QLatin1String("glGenerateMipmap"))) +#define glVertexAttribPointer ((type_glVertexAttribPointer)QGLContext::currentContext()->getProcAddress(QLatin1String("glVertexAttribPointer"))) + +#endif + +#endif // GLFUNCTIONS_H diff --git a/src/imports/shaders/qmldir b/src/imports/shaders/qmldir new file mode 100644 index 0000000000..b2a9de2132 --- /dev/null +++ b/src/imports/shaders/qmldir @@ -0,0 +1,2 @@ +plugin qmlshadersplugin + diff --git a/src/imports/shaders/qmlshadersplugin_plugin.cpp b/src/imports/shaders/qmlshadersplugin_plugin.cpp new file mode 100644 index 0000000000..c03ef2c8c6 --- /dev/null +++ b/src/imports/shaders/qmlshadersplugin_plugin.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlshadersplugin_plugin.h" +#include "shadereffectitem.h" +#include "shadereffectsource.h" + +#include + +void qmlshaderspluginPlugin::registerTypes(const char *uri) +{ + qmlRegisterType(uri, 1, 0, "ShaderEffectItem"); + qmlRegisterType(uri, 1, 0, "ShaderEffectSource"); +} + +Q_EXPORT_PLUGIN2(qmlshadersplugin, qmlshaderspluginPlugin) + diff --git a/src/imports/shaders/qmlshadersplugin_plugin.h b/src/imports/shaders/qmlshadersplugin_plugin.h new file mode 100644 index 0000000000..2614a448c4 --- /dev/null +++ b/src/imports/shaders/qmlshadersplugin_plugin.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLSHADERSPLUGIN_PLUGIN_H +#define QMLSHADERSPLUGIN_PLUGIN_H + +#include + +class qmlshaderspluginPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT + +public: + void registerTypes(const char *uri); +}; + +#endif // QMLSHADERSPLUGIN_PLUGIN_H + diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp new file mode 100644 index 0000000000..14ee4db795 --- /dev/null +++ b/src/imports/shaders/scenegraph/qsggeometry.cpp @@ -0,0 +1,310 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt scene graph research project. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qsggeometry.h" + +QT_BEGIN_NAMESPACE + + +/*! + Convenience function which returns attributes to be used for 2D solid + color drawing. + */ + +const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D() +{ + static Attribute data[] = { + { 0, 2, GL_FLOAT } + }; + static AttributeSet attrs = { 1, sizeof(float) * 2, data }; + return attrs; +} + +/*! + Convenience function which returns attributes to be used for textured 2D drawing. + */ + +const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D() +{ + static Attribute data[] = { + { 0, 2, GL_FLOAT }, + { 1, 2, GL_FLOAT } + }; + static AttributeSet attrs = { 2, sizeof(float) * 4, data }; + return attrs; +} + +/*! + Convenience function which returns attributes to be used for per vertex colored 2D drawing. + */ + +const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D() +{ + static Attribute data[] = { + { 0, 2, GL_FLOAT }, + { 1, 4, GL_UNSIGNED_BYTE } + }; + static AttributeSet attrs = { 2, 2 * sizeof(float) + 4 * sizeof(char), data }; + return attrs; +} + + +/*! + \class QSGGeometry + \brief The QSGGeometry class provides low-level storage for graphics primitives + in the QML Scene Graph. + + The QSGGeometry class provides a few convenience attributes and attribute accessors + by default. The defaultAttributes_Point2D() function returns attributes to be used + in normal solid color rectangles, while the defaultAttributes_TexturedPoint2D function + returns attributes to be used for the common pixmap usecase. + */ + + +/*! + Constructs a geometry object based on \a attributes. + + The object allocate space for \a vertexCount vertices based on the accumulated + size in \a attributes and for \a indexCount. + + Geometry objects are constructed with GL_TRIANGLE_STRIP as default drawing mode. + + The attribute structure is assumed to be POD and the geometry object + assumes this will not go away. There is no memory management involved. + */ + +QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes, + int vertexCount, + int indexCount, + int indexType) + : m_drawing_mode(GL_TRIANGLE_STRIP) + , m_vertex_count(0) + , m_index_count(0) + , m_index_type(indexType) + , m_attributes(attributes) + , m_data(0) + , m_index_data_offset(-1) + , m_owns_data(false) +{ + Q_ASSERT(m_attributes.count > 0); + Q_ASSERT(m_attributes.stride > 0); + + // Because allocate reads m_vertex_count, m_index_count and m_owns_data, these + // need to be set before calling allocate... + allocate(vertexCount, indexCount); +} + +QSGGeometry::~QSGGeometry() +{ + if (m_owns_data) + qFree(m_data); +} + +/*! + \fn int QSGGeometry::vertexCount() const + + Returns the number of vertices in this geometry object. + */ + +/*! + \fn int QSGGeometry::indexCount() const + + Returns the number of indices in this geometry object. + */ + + + +/*! + \fn void *QSGGeometry::vertexData() + + Returns a pointer to the raw vertex data of this geometry object. + + \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D + */ + +/*! + \fn const void *QSGGeometry::vertexData() const + + Returns a pointer to the raw vertex data of this geometry object. + + \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D + */ + +/*! + Returns a pointer to the raw index data of this geometry object. + + \sa indexDataAsUShort(), indexDataAsUInt() + */ +void *QSGGeometry::indexData() +{ + return m_index_data_offset < 0 + ? 0 + : ((char *) m_data + m_index_data_offset); +} + +/*! + Returns a pointer to the raw index data of this geometry object. + + \sa indexDataAsUShort(), indexDataAsUInt() + */ +const void *QSGGeometry::indexData() const +{ + return m_index_data_offset < 0 + ? 0 + : ((char *) m_data + m_index_data_offset); +} + +/*! + Sets the drawing mode to be used for this geometry. + + The default value is GL_TRIANGLE_STRIP. + */ +void QSGGeometry::setDrawingMode(GLenum mode) +{ + m_drawing_mode = mode; +} + +/*! + \fn int QSGGeometry::drawingMode() const + + Returns the drawing mode of this geometry. + + The default value is GL_TRIANGLE_STRIP. + */ + +/*! + \fn int QSGGeometry::indexType() const + + Returns the primitive type used for indices in this + geometry object. + */ + + +/*! + Resizes the vertex and index data of this geometry object to fit \a vertexCount + vertices and \a indexCount indices. + + Vertex and index data will be invalidated after this call and the caller must + */ +void QSGGeometry::allocate(int vertexCount, int indexCount) +{ + if (vertexCount == m_vertex_count && indexCount == m_index_count) + return; + + m_vertex_count = vertexCount; + m_index_count = indexCount; + + bool canUsePrealloc = m_index_count <= 0; + int vertexByteSize = m_attributes.stride * m_vertex_count; + + if (m_owns_data) + qFree(m_data); + + if (canUsePrealloc && vertexByteSize <= (int) sizeof(m_prealloc)) { + m_data = (void *) &m_prealloc[0]; + m_index_data_offset = -1; + m_owns_data = false; + } else { + Q_ASSERT(m_index_type == GL_UNSIGNED_INT || m_index_type == GL_UNSIGNED_SHORT); + int indexByteSize = indexCount * (m_index_type == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32)); + m_data = (void *) qMalloc(vertexByteSize + indexByteSize); + m_index_data_offset = vertexByteSize; + m_owns_data = true; + } + +} + +/*! + Updates the geometry \a g with the coordinates in \a rect. + + The function assumes the geometry object contains a single triangle strip + of QSGGeometry::Point2D vertices + */ +void QSGGeometry::updateRectGeometry(QSGGeometry *g, const QRectF &rect) +{ + Point2D *v = g->vertexDataAsPoint2D(); + v[0].x = rect.left(); + v[0].y = rect.top(); + + v[1].x = rect.right(); + v[1].y = rect.top(); + + v[2].x = rect.left(); + v[2].y = rect.bottom(); + + v[3].x = rect.right(); + v[3].y = rect.bottom(); +} + +/*! + Updates the geometry \a g with the coordinates in \a rect and texture + coordinates from \a textureRect. + + \a textureRect should be in normalized coordinates. + + \a g is assumed to be a triangle strip of four vertices of type + QSGGeometry::TexturedPoint2D. + */ +void QSGGeometry::updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &textureRect) +{ + TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D(); + v[0].x = rect.left(); + v[0].y = rect.top(); + v[0].tx = textureRect.left(); + v[0].ty = textureRect.top(); + + v[1].x = rect.right(); + v[1].y = rect.top(); + v[1].tx = textureRect.right(); + v[1].ty = textureRect.top(); + + v[2].x = rect.left(); + v[2].y = rect.bottom(); + v[2].tx = textureRect.left(); + v[2].ty = textureRect.bottom(); + + v[3].x = rect.right(); + v[3].y = rect.bottom(); + v[3].tx = textureRect.right(); + v[3].ty = textureRect.bottom(); +} + +QT_END_NAMESPACE diff --git a/src/imports/shaders/scenegraph/qsggeometry.h b/src/imports/shaders/scenegraph/qsggeometry.h new file mode 100644 index 0000000000..0055392a49 --- /dev/null +++ b/src/imports/shaders/scenegraph/qsggeometry.h @@ -0,0 +1,234 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt scene graph research project. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSGGEOMETRY_H +#define QSGGEOMETRY_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QSGGeometry +{ +public: + struct Attribute + { + int position; + int tupleSize; + int type; + }; + + struct AttributeSet { + int count; + int stride; + const Attribute *attributes; + }; + + struct Point2D { float x, y; }; + struct TexturedPoint2D { float x, y; float tx, ty; }; + struct ColoredPoint2D { float x, y; unsigned char r, g, b, a; }; + + static const AttributeSet &defaultAttributes_Point2D(); + static const AttributeSet &defaultAttributes_TexturedPoint2D(); + static const AttributeSet &defaultAttributes_ColoredPoint2D(); + + QSGGeometry(const QSGGeometry::AttributeSet &attribs, + int vertexCount, + int indexCount = 0, + int indexType = GL_UNSIGNED_SHORT); + ~QSGGeometry(); + + void setDrawingMode(GLenum mode); + inline GLenum drawingMode() const { return m_drawing_mode; } + + void allocate(int vertexCount, int indexCount = 0); + + int vertexCount() const { return m_vertex_count; } + + void *vertexData() { return m_data; } + inline Point2D *vertexDataAsPoint2D(); + inline TexturedPoint2D *vertexDataAsTexturedPoint2D(); + inline ColoredPoint2D *vertexDataAsColoredPoint2D(); + + inline const void *vertexData() const { return m_data; } + inline const Point2D *vertexDataAsPoint2D() const; + inline const TexturedPoint2D *vertexDataAsTexturedPoint2D() const; + inline const ColoredPoint2D *vertexDataAsColoredPoint2D() const; + + inline int indexType() const { return m_index_type; } + + int indexCount() const { return m_index_count; } + + void *indexData(); + inline uint *indexDataAsUInt(); + inline quint16 *indexDataAsUShort(); + + const void *indexData() const; + inline const uint *indexDataAsUInt() const; + inline const quint16 *indexDataAsUShort() const; + + inline int attributeCount() const { return m_attributes.count; } + inline const Attribute *attributes() const { return m_attributes.attributes; } + inline int stride() const { return m_attributes.stride; } + + static void updateRectGeometry(QSGGeometry *g, const QRectF &rect); + static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect); + +private: + int m_drawing_mode; + int m_vertex_count; + int m_index_count; + int m_index_type; + const AttributeSet &m_attributes; + void *m_data; + int m_index_data_offset; + + void *m_reserved_pointer; + + uint m_owns_data : 1; + uint m_reserved_bits : 31; + + float m_prealloc[16]; +}; + +inline uint *QSGGeometry::indexDataAsUInt() +{ + Q_ASSERT(m_index_type == GL_UNSIGNED_INT); + return (uint *) indexData(); +} + +inline quint16 *QSGGeometry::indexDataAsUShort() +{ + Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT); + return (quint16 *) indexData(); +} + +inline const uint *QSGGeometry::indexDataAsUInt() const +{ + Q_ASSERT(m_index_type == GL_UNSIGNED_INT); + return (uint *) indexData(); +} + +inline const quint16 *QSGGeometry::indexDataAsUShort() const +{ + Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT); + return (quint16 *) indexData(); +} + +inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() +{ + Q_ASSERT(m_attributes.count == 1); + Q_ASSERT(m_attributes.stride == 2 * sizeof(float)); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[0].position == 0); + return (Point2D *) m_data; +} + +inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() +{ + Q_ASSERT(m_attributes.count == 2); + Q_ASSERT(m_attributes.stride == 4 * sizeof(float)); + Q_ASSERT(m_attributes.attributes[0].position == 0); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[1].position == 1); + Q_ASSERT(m_attributes.attributes[1].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT); + return (TexturedPoint2D *) m_data; +} + +inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() +{ + Q_ASSERT(m_attributes.count == 2); + Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char)); + Q_ASSERT(m_attributes.attributes[0].position == 0); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[1].position == 1); + Q_ASSERT(m_attributes.attributes[1].tupleSize == 4); + Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE); + return (ColoredPoint2D *) m_data; +} + +inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const +{ + Q_ASSERT(m_attributes.count == 1); + Q_ASSERT(m_attributes.stride == 2 * sizeof(float)); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[0].position == 0); + return (const Point2D *) m_data; +} + +inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() const +{ + Q_ASSERT(m_attributes.count == 2); + Q_ASSERT(m_attributes.stride == 4 * sizeof(float)); + Q_ASSERT(m_attributes.attributes[0].position == 0); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[1].position == 1); + Q_ASSERT(m_attributes.attributes[1].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT); + return (const TexturedPoint2D *) m_data; +} + +inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() const +{ + Q_ASSERT(m_attributes.count == 2); + Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char)); + Q_ASSERT(m_attributes.attributes[0].position == 0); + Q_ASSERT(m_attributes.attributes[0].tupleSize == 2); + Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT); + Q_ASSERT(m_attributes.attributes[1].position == 1); + Q_ASSERT(m_attributes.attributes[1].tupleSize == 4); + Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE); + return (const ColoredPoint2D *) m_data; +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QSGGEOMETRY_H diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp new file mode 100644 index 0000000000..bbea43c0c7 --- /dev/null +++ b/src/imports/shaders/shadereffect.cpp @@ -0,0 +1,192 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "shadereffect.h" +#include "shadereffectbuffer.h" +#include "shadereffectsource.h" + +#include +#include +#include + +static QTransform savedWorldTransform; + +ShaderEffect::ShaderEffect(QObject *parent) + : QGraphicsEffect(parent) + , m_changed(true) +{ +} + +ShaderEffect::~ShaderEffect() +{ +} + +void ShaderEffect::prepareBufferedDraw(QPainter *painter) +{ + // This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform + // instead of the active painters worldtransform. + const ShaderEffectBuffer *effectBuffer = dynamic_cast (painter->device()); + if (effectBuffer) { + savedWorldTransform = painter->worldTransform() * savedWorldTransform; + painter->setWorldTransform(savedWorldTransform); + } else { + savedWorldTransform = painter->worldTransform(); + } +} + +void ShaderEffect::draw (QPainter *painter) +{ + const QGLContext *context = QGLContext::currentContext(); + + prepareBufferedDraw(painter); + + if (context) { + updateRenderTargets(); + } + + if (!context || m_renderTargets.count() == 0 || !hideOriginal()) + drawSource(painter); +} + +void ShaderEffect::updateRenderTargets() +{ + if (!m_changed) + return; + + m_changed = false; + + int count = m_renderTargets.count(); + for (int i = 0; i < count; i++) { + if (m_renderTargets[i]->isLive() || m_renderTargets[i]->isDirtyTexture()) { + m_renderTargets[i]->updateBackbuffer(); + ShaderEffectBuffer* target = m_renderTargets[i]->fbo(); + if (target && target->isValid() && target->width() > 0 && target->height() > 0) { + QPainter p(target); + p.setCompositionMode(QPainter::CompositionMode_Clear); + p.fillRect(QRect(QPoint(0, 0), target->size()), Qt::transparent); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + + QRectF sourceRect = m_renderTargets[i]->sourceRect(); + QSize textureSize = m_renderTargets[i]->textureSize(); + + qreal yflip = m_renderTargets[i]->isMirrored() ? -1.0 : 1.0; // flip y to match scenegraph, it also flips texturecoordinates + qreal xscale = 1.0; + qreal yscale = 1.0 * yflip; + + qreal leftMargin = 0.0; + qreal rightMargin = 0.0; + qreal topMargin = 0.0; + qreal bottomMargin = 0.0; + + qreal width = m_renderTargets[i]->sourceItem()->width(); + qreal height = m_renderTargets[i]->sourceItem()->height(); + + if (!sourceRect.isEmpty()) { + leftMargin = -sourceRect.left(); + rightMargin = sourceRect.right() - width; + topMargin = -sourceRect.top(); + bottomMargin = sourceRect.bottom() - height; + } + + if ((width + leftMargin + rightMargin) > 0 && (height + topMargin + bottomMargin) > 0) { + if (!textureSize.isEmpty()) { + qreal textureWidth = textureSize.width(); + qreal textureHeight = textureSize.height(); + + xscale = width / (width + leftMargin + rightMargin); + yscale = height / (height + topMargin + bottomMargin); + + p.translate(textureWidth / 2, textureHeight / 2); + p.scale(xscale, yscale * yflip); + p.translate(-textureWidth / 2, -textureHeight / 2); + p.scale(textureWidth / width, textureHeight / height); + } else { + xscale = width / (width + leftMargin + rightMargin); + yscale = height / (height + topMargin + bottomMargin); + + p.translate(width / 2, height / 2); + p.scale(xscale, yscale * yflip); + p.translate(-width / 2, -height / 2); + } + } + + drawSource(&p); + p.end(); + m_renderTargets[i]->markSceneGraphDirty(); + } + } + } +} + +void ShaderEffect::sourceChanged (ChangeFlags flags) +{ + Q_UNUSED(flags); + m_changed = true; +} + +void ShaderEffect::addRenderTarget(ShaderEffectSource *target) +{ + if (!m_renderTargets.contains(target)) + m_renderTargets.append(target); +} + +void ShaderEffect::removeRenderTarget(ShaderEffectSource *target) +{ + int index = m_renderTargets.indexOf(target); + if (index >= 0) + m_renderTargets.remove(index); + else + qWarning() << "ShaderEffect::removeRenderTarget - did not find target."; +} + +bool ShaderEffect::hideOriginal() const +{ + if (m_renderTargets.count() == 0) + return false; + + // Just like scenegraph version, if there is even one source that says "hide original" we hide it. + int count = m_renderTargets.count(); + for (int i = 0; i < count; i++) { + if (m_renderTargets[i]->hideSource()) + return true; + } + return false; +} diff --git a/src/imports/shaders/shadereffect.h b/src/imports/shaders/shadereffect.h new file mode 100644 index 0000000000..35a697b136 --- /dev/null +++ b/src/imports/shaders/shadereffect.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SHADEREFFECT_H +#define SHADEREFFECT_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class ShaderEffectSource; + +class ShaderEffect : public QGraphicsEffect +{ + Q_OBJECT + +public: + ShaderEffect(QObject *parent = 0); + ~ShaderEffect(); + void addRenderTarget(ShaderEffectSource *target); + void removeRenderTarget(ShaderEffectSource *target); + +protected: + virtual void draw (QPainter *painter); + virtual void sourceChanged (ChangeFlags flags); + +private: + void prepareBufferedDraw(QPainter *painter); + void updateRenderTargets(); + bool hideOriginal() const; + +public: + QVector m_renderTargets; + bool m_changed : 1; +}; + +QT_END_HEADER + +QT_END_NAMESPACE + +#endif // SHADEREFFECT_H diff --git a/src/imports/shaders/shadereffectbuffer.cpp b/src/imports/shaders/shadereffectbuffer.cpp new file mode 100644 index 0000000000..4c76adaae3 --- /dev/null +++ b/src/imports/shaders/shadereffectbuffer.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "shadereffectbuffer.h" + +ShaderEffectBuffer::ShaderEffectBuffer(const QSize & size, const QGLFramebufferObjectFormat & format) + : QGLFramebufferObject(size, format) +{ +} + +ShaderEffectBuffer::~ShaderEffectBuffer() +{ +} + diff --git a/src/imports/shaders/shadereffectbuffer.h b/src/imports/shaders/shadereffectbuffer.h new file mode 100644 index 0000000000..dcab6ec683 --- /dev/null +++ b/src/imports/shaders/shadereffectbuffer.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SHADEREFFECTBUFFER_H +#define SHADEREFFECTBUFFER_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class ShaderEffectBuffer : public QGLFramebufferObject +{ +public: + ShaderEffectBuffer(const QSize &size, const QGLFramebufferObjectFormat &format); + ~ShaderEffectBuffer(); +}; + +QT_END_HEADER + +QT_END_NAMESPACE + +#endif // SHADEREFFECTBUFFER_H diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp new file mode 100644 index 0000000000..a32168e9cd --- /dev/null +++ b/src/imports/shaders/shadereffectitem.cpp @@ -0,0 +1,915 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "shadereffectitem.h" +#include "shadereffect.h" +#include "glfunctions.h" + +#include +#include + +static const char qt_default_vertex_code[] = + "uniform highp mat4 qt_ModelViewProjectionMatrix;\n" + "attribute highp vec4 qt_Vertex;\n" + "attribute highp vec2 qt_MultiTexCoord0;\n" + "varying highp vec2 qt_TexCoord0;\n" + "void main(void)\n" + "{\n" + "qt_TexCoord0 = qt_MultiTexCoord0;\n" + "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n" + "}\n"; + +static const char qt_default_fragment_code[] = + "varying highp vec2 qt_TexCoord0;\n" + "uniform lowp sampler2D source;\n" + "void main(void)\n" + "{\n" + "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n" + "}\n"; + +static const char qt_postion_attribute_name[] = "qt_Vertex"; +static const char qt_texcoord_attribute_name[] = "qt_MultiTexCoord0"; +static const char qt_emptyAttributeName[] = ""; + + +/*! + \qmlclass ShaderEffectItem ShaderEffectItem + \ingroup qmlshadersplugin + \brief The ShaderEffectItem object alters the output of given item with OpenGL shaders. + \inherits Item + + ShaderEffectItem is available in the \bold{Qt.labs.shaders 1.0} module. + \e {Elements in the Qt.labs module are not guaranteed to remain compatible + in future versions.} + + This element provides preliminary support for embedding OpenGL shader code into QML, + and may be heavily changed or removed in later versions. + + Requirement for the use of shaders is that the application is either using + Qt OpenGL graphicssystem or is forced to use OpenGL by setting QGLWidget as the viewport to QDeclarativeView (recommened way). + + ShaderEffectItem internal behaviour is such that during the paint event it first renders its + ShaderEffectSource items into a OpenGL framebuffer object which can be used as a texture. If the ShaderEffectSource is defined to be an image, + it is directly uploaded as a texture. The texture(s) containing the source pixelcontent are then bound to graphics + pipeline texture units. Finally a textured mesh is passed to the vertex- and fragmentshaders which + then produce the final output for the ShaderEffectItem. It is possible to alter the mesh structure by defining + the amount vertices it contains, but currently it is not possible to import complex 3D-models to be used as the mesh. + + It is possible to define one or more ShaderEffectItems to be a ShaderEffectSource for other ShaderEffectItems, but ShaderEffectItem + should never be declared as a child element of its source item(s) because it would cause circular loop in the painting. + + A standard set of vertex attributes are provided for the shaders: + + \list + \o qt_Vertex - The primary position of the vertex. + \o qt_MultiTexCoord0 - The texture co-ordinate at each vertex for texture unit 0. + \endlist + + Additionally following uniforms are available for shaders: + + \list + \o qt_Opacity - Effective opacity of the item. + \o qt_ModelViewProjectionMatrix - current 4x4 transformation matrix of the item. + \endlist + + Furthermore, it is possible to utilize automatic QML propertybinding into vertex- and fragment shader + uniforms. Conversions are done according to the table below: + + \table + \header + \o QML property + \o GLSL uniform + \row + \o property double foo: 1.0 + \o uniform highp float foo + \row + \o property real foo: 1.0 + \o uniform highp float foo + \row + \o property bool foo: true + \o uniform bool foo + \row + \o property int foo: 1 + \o uniform int foo + \row + \o property variant foo: Qt.point(1,1) + \o uniform highp vec2 foo + \row + \o property variant foo: Qt.size(1, 1) + \o uniform highp vec2 foo + \row + \o property variant foo: Qt.rect(1, 1, 2, 2) + \o uniform highp vec4 foo + \row + \o property color foo: "#00000000" + \o uniform lowp vec4 foo + \row + \o property variant foo: Qt.vector3d(1.0, 2.0, 0.0) + \o uniform highp vec3 foo + \row + \o property variant foo: ShaderEffectSource { SourceItem: bar } + \o uniform lowp sampler2D foo + \endtable + \note + The uniform precision definitions in the above table are not strict, it is possible to choose the uniform + precision based on what is the most suitable for the shader code for that particular uniform. + + + The below example uses fragment shader to create simple wiggly effect to a text label. + Automatic property binding takes care of binding the properties to the uniforms if their + names are identical. ShaderEffectSource referring to textLabel is bound to sampler2D uniform inside the fragment + shader code. + + \qml +import QtQuick 1.0 +import Qt.labs.shaders 1.0 + +Rectangle { + width: 300 + height: 300 + color: "black" + + Text { + id: textLabel + text: "Hello World" + anchors.centerIn: parent + font.pixelSize: 32 + color: "white" + + } + + ShaderEffectItem { + property variant source: ShaderEffectSource { sourceItem: textLabel; hideSource: true } + property real wiggleAmount: 0.005 + anchors.fill: textLabel + + fragmentShader: " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + uniform highp float wiggleAmount; + void main(void) + { + highp vec2 wiggledTexCoord = qt_TexCoord0; + wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount; + gl_FragColor = texture2D(source, wiggledTexCoord.st); + } + " + } +} + \endqml + \image Example1.png + +*/ + +ShaderEffectItem::ShaderEffectItem(QDeclarativeItem *parent) + : QDeclarativeItem(parent) + , m_meshResolution(1, 1) + , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) + , m_blending(true) + , m_program_dirty(true) + , m_active(true) + , m_respectsMatrix(false) + , m_respectsOpacity(false) + , m_checkedViewportUpdateMode(false) + , m_checkedOpenGL(false) + , m_checkedShaderPrograms(false) + , m_hasShaderPrograms(false) + , m_mirrored(false) + , m_defaultVertexShader(true) +{ + setFlag(QGraphicsItem::ItemHasNoContents, false); + connect(this, SIGNAL(visibleChanged()), this, SLOT(handleVisibilityChange())); + m_active = isVisible(); +} + +ShaderEffectItem::~ShaderEffectItem() +{ + reset(); +} + + +/*! + \qmlproperty string ShaderEffectItem::fragmentShader + This property holds the OpenGL fragment shader code. + + The default fragment shader is following: + + \code + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + void main(void) + { + gl_FragColor = texture2D(source, qt_TexCoord0.st); + } + \endcode + +*/ + +/*! + \property ShaderEffectItem::fragmentShader + \brief the OpenGL fragment shader code. +*/ + +void ShaderEffectItem::setFragmentShader(const QString &code) +{ + if (m_fragment_code.constData() == code.constData()) + return; + + m_fragment_code = code; + if (isComponentComplete()) { + reset(); + updateProperties(); + } + emit fragmentShaderChanged(); +} + +/*! + \qmlproperty string ShaderEffectItem::vertexShader + This property holds the OpenGL vertex shader code. + + The default vertex shader is following: + + \code + uniform highp mat4 qt_ModelViewProjectionMatrix; + attribute highp vec4 qt_Vertex; + attribute highp vec2 qt_MultiTexCoord0; + varying highp vec2 qt_TexCoord0; + void main(void) + { + qt_TexCoord0 = qt_MultiTexCoord0; + gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex; + } + \endcode + +*/ + +/*! + \property ShaderEffectItem::vertexShader + \brief the OpenGL vertex shader code. +*/ + +void ShaderEffectItem::setVertexShader(const QString &code) +{ + if (m_vertex_code.constData() == code.constData()) + return; + + m_vertex_code = code; + m_defaultVertexShader = false; + if (isComponentComplete()) { + reset(); + updateProperties(); + } + emit vertexShaderChanged(); +} + +/*! + \qmlproperty bool ShaderEffectItem::blending + This property defines wheter item is drawn using blending. + + If true, the RGBA pixel output from the fragment shader is blended with + the pixel RGBA-values already in the framebuffer. + + If false, fragment shader output is written to framebuffer as such. + + Usually drawing without blending is slightly faster, thus disabling blending + might be a good choice when item is used as a background element. + + \note + By default the pixel data in textures is stored in 32-bit premultiplied alpha format. + This should be taken into account when blending or reading the pixel values + in the fragment shader code. + + The default value is true. +*/ + +/*! + \property ShaderEffectItem::blending + \brief the drawing is done using blending. +*/ + +void ShaderEffectItem::setBlending(bool enable) +{ + if (m_blending == enable) + return; + + m_blending = enable; + m_changed = true; + emit blendingChanged(); +} + + +/*! + \qmlproperty QSize ShaderEffectItem::meshResolution + This property defines to how many triangles the item is divided into before its + vertices are passed to the vertex shader. + + Triangles are defined as triangle strips and the amount of triangles can be controlled + separately for x and y-axis. + + The default value is QSize(1,1). +*/ + +/*! + \property ShaderEffectItem::meshResolution + \brief the amount of triangles in the mesh for both x and y-axis. +*/ + +void ShaderEffectItem::setMeshResolution(const QSize &size) +{ + if (size == m_meshResolution) + return; + + m_meshResolution = size; + emit meshResolutionChanged(); + updateGeometry(); +} + +void ShaderEffectItem::componentComplete() +{ + updateProperties(); + QDeclarativeItem::componentComplete(); +} + +void ShaderEffectItem::checkViewportUpdateMode() +{ + if (!m_checkedViewportUpdateMode) { + QGraphicsScene *s = scene(); + if (s){ + QList views = s->views(); + for (int i = 0; i < views.count(); i++) { + if (views[i]->viewportUpdateMode() != QGraphicsView::FullViewportUpdate) { + qWarning() << "ShaderEffectItem::checkViewportUpdateMode - consider setting QGraphicsView::FullViewportUpdate mode with OpenGL!"; + } + } + } + m_checkedViewportUpdateMode = true; + } +} + +void ShaderEffectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) +{ + if (!m_active) return; + + const QGLContext *context = QGLContext::currentContext(); + + if (context) { + if (!m_checkedShaderPrograms) { + m_hasShaderPrograms = QGLShaderProgram::hasOpenGLShaderPrograms(context); + m_checkedShaderPrograms = true; + + if (!m_hasShaderPrograms) + qWarning() << "ShaderEffectItem::paint - Shader programs are not supported"; + } + + if ( !m_hasShaderPrograms ) + return; + + checkViewportUpdateMode(); + painter->save(); + painter->beginNativePainting(); + QMatrix4x4 combinedMatrix = QMatrix4x4(painter->transform()); + renderEffect(painter, combinedMatrix); + painter->endNativePainting(); + painter->restore(); + } else { + if (!m_checkedOpenGL) { + qWarning() << "ShaderEffectItem::paint - OpenGL not available"; + m_checkedOpenGL = true; + } + } +} + +void ShaderEffectItem::renderEffect(QPainter *painter, const QMatrix4x4 &matrix) +{ + if (!painter || !painter->device()) + return; + + if (!m_program.isLinked() || m_program_dirty) + updateShaderProgram(); + + m_program.bind(); + + QMatrix4x4 combinedMatrix; + combinedMatrix.scale(2.0 / painter->device()->width(), -2.0 / painter->device()->height(), 1.0); + combinedMatrix.translate(-painter->device()->width() / 2.0, -painter->device()->height() / 2.0 ); + combinedMatrix *= matrix; + updateEffectState(combinedMatrix); + + for (int i = 0; i < m_attributeNames.size(); ++i) { + m_program.enableAttributeArray(m_geometry.attributes()[i].position); + } + + bindGeometry(); + + // Optimization, disable depth test when we know we don't need it. + if (m_defaultVertexShader) { + glDepthMask(false); + glDisable(GL_DEPTH_TEST); + } else { + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_GREATER); + glDepthMask(true); +#if defined(QT_OPENGL_ES) + glClearDepthf(0); +#else + glClearDepth(0); +#endif + glClearColor(0, 0, 0, 0); + glClear(GL_DEPTH_BUFFER_BIT); + } + + if (m_blending){ + glEnable(GL_BLEND); + glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glDisable(GL_BLEND); + } + + if (m_geometry.indexCount()) + glDrawElements(m_geometry.drawingMode(), m_geometry.indexCount(), m_geometry.indexType(), m_geometry.indexData()); + else + glDrawArrays(m_geometry.drawingMode(), 0, m_geometry.vertexCount()); + + glDepthMask(false); + glDisable(GL_DEPTH_TEST); + + for (int i = 0; i < m_attributeNames.size(); ++i) + m_program.disableAttributeArray(m_geometry.attributes()[i].position); +} + +void ShaderEffectItem::updateEffectState(const QMatrix4x4 &matrix) +{ + for (int i = m_sources.size() - 1; i >= 0; --i) { + const ShaderEffectItem::SourceData &source = m_sources.at(i); + if (!source.source) + continue; + + glActiveTexture(GL_TEXTURE0 + i); + source.source->bind(); + } + + if (m_respectsOpacity) + m_program.setUniformValue("qt_Opacity", static_cast (effectiveOpacity())); + + if (m_respectsMatrix){ + m_program.setUniformValue("qt_ModelViewProjectionMatrix", matrix); + } + + QSet::const_iterator it; + for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) { + const QByteArray &name = *it; + QVariant v = property(name.constData()); + + switch (v.type()) { + case QVariant::Color: + m_program.setUniformValue(name.constData(), qvariant_cast(v)); + break; + case QVariant::Double: + m_program.setUniformValue(name.constData(), (float) qvariant_cast(v)); + break; + case QVariant::Transform: + m_program.setUniformValue(name.constData(), qvariant_cast(v)); + break; + case QVariant::Int: + m_program.setUniformValue(name.constData(), v.toInt()); + break; + case QVariant::Bool: + m_program.setUniformValue(name.constData(), GLint(v.toBool())); + break; + case QVariant::Size: + case QVariant::SizeF: + m_program.setUniformValue(name.constData(), v.toSizeF()); + break; + case QVariant::Point: + case QVariant::PointF: + m_program.setUniformValue(name.constData(), v.toPointF()); + break; + case QVariant::Rect: + case QVariant::RectF: + { + QRectF r = v.toRectF(); + m_program.setUniformValue(name.constData(), r.x(), r.y(), r.width(), r.height()); + } + break; + case QVariant::Vector3D: + m_program.setUniformValue(name.constData(), qvariant_cast(v)); + break; + default: + break; + } + } +} + +static inline int size_of_type(GLenum type) +{ + static int sizes[] = { + sizeof(char), + sizeof(unsigned char), + sizeof(short), + sizeof(unsigned short), + sizeof(int), + sizeof(unsigned int), + sizeof(float), + 2, + 3, + 4, + sizeof(double) + }; + return sizes[type - GL_BYTE]; +} + +void ShaderEffectItem::bindGeometry() +{ + char const *const *attrNames = m_attributeNames.constData(); + int offset = 0; + for (int j = 0; j < m_attributeNames.size(); ++j) { + if (!*attrNames[j]) + continue; + Q_ASSERT_X(j < m_geometry.attributeCount(), "ShaderEffectItem::bindGeometry()", "Geometry lacks attribute required by material"); + const QSGGeometry::Attribute &a = m_geometry.attributes()[j]; + Q_ASSERT_X(j == a.position, "ShaderEffectItem::bindGeometry()", "Geometry does not have continous attribute positions"); +#if defined(QT_OPENGL_ES_2) + GLboolean normalize = a.type != GL_FLOAT; +#else + GLboolean normalize = a.type != GL_FLOAT && a.type != GL_DOUBLE; +#endif + if (normalize) + qWarning() << "ShaderEffectItem::bindGeometry() - non supported attribute type!"; + + m_program.setAttributeArray(a.position, (GLfloat*) (((char*) m_geometry.vertexData()) + offset), a.tupleSize, m_geometry.stride()); + //glVertexAttribPointer(a.position, a.tupleSize, a.type, normalize, m_geometry.stride(), (char *) m_geometry.vertexData() + offset); + offset += a.tupleSize * size_of_type(a.type); + } +} + +void ShaderEffectItem::updateGeometry() +{ + QRectF srcRect(0, 1, 1, -1); + + if (m_mirrored) + srcRect = QRectF(0, 0, 1, 1); + + QRectF dstRect = QRectF(0,0, width(), height()); + + int vmesh = m_meshResolution.height(); + int hmesh = m_meshResolution.width(); + + QSGGeometry *g = &m_geometry; + if (vmesh == 1 && hmesh == 1) { + if (g->vertexCount() != 4) + g->allocate(4); + QSGGeometry::updateTexturedRectGeometry(g, dstRect, srcRect); + return; + } + + g->allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2)); + + QSGGeometry::TexturedPoint2D *vdata = g->vertexDataAsTexturedPoint2D(); + + for (int iy = 0; iy <= vmesh; ++iy) { + float fy = iy / float(vmesh); + float y = float(dstRect.top()) + fy * float(dstRect.height()); + float ty = float(srcRect.top()) + fy * float(srcRect.height()); + for (int ix = 0; ix <= hmesh; ++ix) { + float fx = ix / float(hmesh); + vdata->x = float(dstRect.left()) + fx * float(dstRect.width()); + vdata->y = y; + vdata->tx = float(srcRect.left()) + fx * float(srcRect.width()); + vdata->ty = ty; + ++vdata; + } + } + + quint16 *indices = (quint16 *)g->indexDataAsUShort(); + int i = 0; + for (int iy = 0; iy < vmesh; ++iy) { + *(indices++) = i + hmesh + 1; + for (int ix = 0; ix <= hmesh; ++ix, ++i) { + *(indices++) = i + hmesh + 1; + *(indices++) = i; + } + *(indices++) = i - 1; + } +} + +void ShaderEffectItem::setActive(bool enable) +{ + if (m_active == enable) + return; + + if (m_active) { + for (int i = 0; i < m_sources.size(); ++i) { + ShaderEffectSource *source = m_sources.at(i).source; + if (!source) + continue; + disconnect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty())); + source->derefFromEffectItem(); + } + } + + m_active = enable; + + if (m_active) { + for (int i = 0; i < m_sources.size(); ++i) { + ShaderEffectSource *source = m_sources.at(i).source; + if (!source) + continue; + source->refFromEffectItem(); + connect(source, SIGNAL(repaintRequired()), this, SLOT(markDirty())); + } + } + + emit activeChanged(); + markDirty(); +} + +void ShaderEffectItem::preprocess() +{ + for (int i = 0; i < m_sources.size(); ++i) { + ShaderEffectSource *source = m_sources.at(i).source; + if (source) + source->updateBackbuffer(); + } +} + +void ShaderEffectItem::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) +{ + if (newGeometry.size() != oldGeometry.size()) + updateGeometry(); + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); +} + +void ShaderEffectItem::changeSource(int index) +{ + Q_ASSERT(index >= 0 && index < m_sources.size()); + QVariant v = property(m_sources.at(index).name.constData()); + setSource(v, index); +} + +void ShaderEffectItem::markDirty() { + update(); +} + +void ShaderEffectItem::setSource(const QVariant &var, int index) +{ + Q_ASSERT(index >= 0 && index < m_sources.size()); + + SourceData &source = m_sources[index]; + + source.source = 0; + source.item = 0; + if (var.isNull()) { + return; + } else if (!qVariantCanConvert(var)) { + qWarning("Could not assign source of type '%s' to property '%s'.", var.typeName(), source.name.constData()); + return; + } + + QObject *obj = qVariantValue(var); + + source.source = qobject_cast(obj); + source.item = qobject_cast(obj); + + if (!source.item) + qWarning("Could not assign property '%s', did not implement QDeclarativeItem.", source.name.constData()); + + if (!source.source) + qWarning("Could not assign property '%s', did not implement ShaderEffectSource.", source.name.constData()); + + // TODO: Find better solution. + // 'source.item' needs a canvas to get a scenegraph node. + // The easiest way to make sure it gets a canvas is to + // make it a part of the same item tree as 'this'. + if (source.item && source.item->parentItem() == 0) { + source.item->setParentItem(this); + // Unlike in scenegraph, we cannot set item invisible here because qgraphicsview would optimize it away. + } + + // Unlike in scenegraph, ref counting is used to optimize memory consumption. Sources themself may free fbos when not referenced. + if (m_active && source.source) { + source.source->refFromEffectItem(); + connect(source.source, SIGNAL(repaintRequired()), this, SLOT(markDirty())); + } +} + +void ShaderEffectItem::disconnectPropertySignals() +{ + disconnect(this, 0, this, SLOT(markDirty())); + for (int i = 0; i < m_sources.size(); ++i) { + SourceData &source = m_sources[i]; + disconnect(this, 0, source.mapper, 0); + disconnect(source.mapper, 0, this, 0); + } +} + +void ShaderEffectItem::connectPropertySignals() +{ + QSet::const_iterator it; + for (it = m_uniformNames.begin(); it != m_uniformNames.end(); ++it) { + int pi = metaObject()->indexOfProperty(it->constData()); + if (pi >= 0) { + QMetaProperty mp = metaObject()->property(pi); + if (!mp.hasNotifySignal()) + qWarning("ShaderEffectItem: property '%s' does not have notification method!", it->constData()); + QByteArray signalName("2"); + signalName.append(mp.notifySignal().signature()); + connect(this, signalName, this, SLOT(markDirty())); + } else { + qWarning("ShaderEffectItem: '%s' does not have a matching property!", it->constData()); + } + } + for (int i = 0; i < m_sources.size(); ++i) { + SourceData &source = m_sources[i]; + int pi = metaObject()->indexOfProperty(source.name.constData()); + if (pi >= 0) { + QMetaProperty mp = metaObject()->property(pi); + QByteArray signalName("2"); + signalName.append(mp.notifySignal().signature()); + connect(this, signalName, source.mapper, SLOT(map())); + source.mapper->setMapping(this, i); + connect(source.mapper, SIGNAL(mapped(int)), this, SLOT(changeSource(int))); + } else { + qWarning("ShaderEffectItem: '%s' does not have a matching source!", source.name.constData()); + } + } +} + +void ShaderEffectItem::reset() +{ + disconnectPropertySignals(); + + m_program.removeAllShaders(); + m_attributeNames.clear(); + m_uniformNames.clear(); + for (int i = 0; i < m_sources.size(); ++i) { + const SourceData &source = m_sources.at(i); + if (m_active && source.source) + source.source->derefFromEffectItem(); + delete source.mapper; + } + + m_sources.clear(); + m_program_dirty = true; +} + +void ShaderEffectItem::updateProperties() +{ + QString vertexCode = m_vertex_code; + QString fragmentCode = m_fragment_code; + + if (vertexCode.isEmpty()) + vertexCode = qt_default_vertex_code; + + if (fragmentCode.isEmpty()) + fragmentCode = qt_default_fragment_code; + + lookThroughShaderCode(vertexCode); + lookThroughShaderCode(fragmentCode); + + if (!m_attributeNames.contains(qt_postion_attribute_name)) + qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_postion_attribute_name); + if (!m_attributeNames.contains(qt_texcoord_attribute_name)) + qWarning("ShaderEffectItem: Missing reference to \'%s\'.", qt_texcoord_attribute_name); + if (!m_respectsMatrix) + qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'."); + + for (int i = 0; i < m_sources.size(); ++i) { + QVariant v = property(m_sources.at(i).name); + setSource(v, i); // Property exists. + } + + connectPropertySignals(); +} + +void ShaderEffectItem::updateShaderProgram() +{ + QString vertexCode = m_vertex_code; + QString fragmentCode = m_fragment_code; + + if (vertexCode.isEmpty()) + vertexCode = QString::fromLatin1(qt_default_vertex_code); + + if (fragmentCode.isEmpty()) + fragmentCode = QString::fromLatin1(qt_default_fragment_code); + + m_program.addShaderFromSourceCode(QGLShader::Vertex, vertexCode); + m_program.addShaderFromSourceCode(QGLShader::Fragment, fragmentCode); + + for (int i = 0; i < m_attributeNames.size(); ++i) { + m_program.bindAttributeLocation(m_attributeNames.at(i), m_geometry.attributes()[i].position); + } + + if (!m_program.link()) { + qWarning("ShaderEffectItem: Shader compilation failed:"); + qWarning() << m_program.log(); + } + + if (!m_attributeNames.contains(qt_postion_attribute_name)) + qWarning("ShaderEffectItem: Missing reference to \'qt_Vertex\'."); + if (!m_attributeNames.contains(qt_texcoord_attribute_name)) + qWarning("ShaderEffectItem: Missing reference to \'qt_MultiTexCoord0\'."); + if (!m_respectsMatrix) + qWarning("ShaderEffectItem: Missing reference to \'qt_ModelViewProjectionMatrix\'."); + + if (m_program.isLinked()) { + m_program.bind(); + for (int i = 0; i < m_sources.size(); ++i) + m_program.setUniformValue(m_sources.at(i).name.constData(), i); + } + + m_program_dirty = false; +} + +void ShaderEffectItem::lookThroughShaderCode(const QString &code) +{ + // Regexp for matching attributes and uniforms. + // In human readable form: attribute|uniform [lowp|mediump|highp] + static QRegExp re(QLatin1String("\\b(attribute|uniform)\\b\\s*\\b(?:lowp|mediump|highp)?\\b\\s*\\b(\\w+)\\b\\s*\\b(\\w+)")); + Q_ASSERT(re.isValid()); + + int pos = -1; + + //QString wideCode = QString::fromLatin1(code.constData(), code.size()); + QString wideCode = code; + + while ((pos = re.indexIn(wideCode, pos + 1)) != -1) { + QByteArray decl = re.cap(1).toLatin1(); // uniform or attribute + QByteArray type = re.cap(2).toLatin1(); // type + QByteArray name = re.cap(3).toLatin1(); // variable name + + if (decl == "attribute") { + if (name == qt_postion_attribute_name) { + m_attributeNames.insert(0, qt_postion_attribute_name); + } else if (name == "qt_MultiTexCoord0") { + if (m_attributeNames.at(0) == 0) { + m_attributeNames.insert(0, qt_emptyAttributeName); + } + m_attributeNames.insert(1, qt_texcoord_attribute_name); + } else { + // TODO: Support user defined attributes. + qWarning("ShaderEffectItem: Attribute \'%s\' not recognized.", name.constData()); + } + } else { + Q_ASSERT(decl == "uniform"); + + if (name == "qt_ModelViewProjectionMatrix") { + m_respectsMatrix = true; + } else if (name == "qt_Opacity") { + m_respectsOpacity = true; + } else { + m_uniformNames.insert(name); + if (type == "sampler2D") { + SourceData d; + d.mapper = new QSignalMapper; + d.source = 0; + d.name = name; + d.item = 0; + m_sources.append(d); + } + } + } + } +} + +void ShaderEffectItem::handleVisibilityChange() +{ + setActive(isVisible()); +} diff --git a/src/imports/shaders/shadereffectitem.h b/src/imports/shaders/shadereffectitem.h new file mode 100644 index 0000000000..1d275439f2 --- /dev/null +++ b/src/imports/shaders/shadereffectitem.h @@ -0,0 +1,152 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SHADEREFFECTITEM_H +#define SHADEREFFECTITEM_H + +#include +#include +#include "shadereffectsource.h" +#include "scenegraph/qsggeometry.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class ShaderEffectItem : public QDeclarativeItem +{ + Q_OBJECT + Q_INTERFACES(QDeclarativeParserStatus) + Q_PROPERTY(QString fragmentShader READ fragmentShader WRITE setFragmentShader NOTIFY fragmentShaderChanged) + Q_PROPERTY(QString vertexShader READ vertexShader WRITE setVertexShader NOTIFY vertexShaderChanged) + Q_PROPERTY(bool blending READ blending WRITE setBlending NOTIFY blendingChanged) + Q_PROPERTY(QSize meshResolution READ meshResolution WRITE setMeshResolution NOTIFY meshResolutionChanged) + +public: + ShaderEffectItem(QDeclarativeItem* parent = 0); + ~ShaderEffectItem(); + + virtual void componentComplete(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + + QString fragmentShader() const { return m_fragment_code; } + void setFragmentShader(const QString &code); + + QString vertexShader() const { return m_vertex_code; } + void setVertexShader(const QString &code); + + bool blending() const { return m_blending; } + void setBlending(bool enable); + + QSize meshResolution() const { return m_meshResolution; } + void setMeshResolution(const QSize &size); + + void preprocess(); + +Q_SIGNALS: + void fragmentShaderChanged(); + void vertexShaderChanged(); + void blendingChanged(); + void activeChanged(); + void meshResolutionChanged(); + +protected: + virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); + +private Q_SLOTS: + void changeSource(int index); + void handleVisibilityChange(); + void markDirty(); + +private: + void checkViewportUpdateMode(); + void renderEffect(QPainter *painter, const QMatrix4x4 &matrix); + void updateEffectState(const QMatrix4x4 &matrix); + void updateGeometry(); + void bindGeometry(); + void setSource(const QVariant &var, int index); + void disconnectPropertySignals(); + void connectPropertySignals(); + void reset(); + void updateProperties(); + void updateShaderProgram(); + void lookThroughShaderCode(const QString &code); + bool active() const { return m_active; } + void setActive(bool enable); + +private: + QString m_fragment_code; + QString m_vertex_code; + QGLShaderProgram m_program; + QVector m_attributeNames; + QSet m_uniformNames; + QSize m_meshResolution; + QSGGeometry m_geometry; + + struct SourceData + { + QSignalMapper *mapper; + QPointer source; + QPointer item; + QByteArray name; + }; + + QVector m_sources; + + bool m_changed : 1; + bool m_blending : 1; + bool m_program_dirty : 1; + bool m_active : 1; + bool m_respectsMatrix : 1; + bool m_respectsOpacity : 1; + bool m_checkedViewportUpdateMode : 1; + bool m_checkedOpenGL : 1; + bool m_checkedShaderPrograms : 1; + bool m_hasShaderPrograms : 1; + bool m_mirrored : 1; + bool m_defaultVertexShader : 1; +}; + +QT_END_HEADER + +QT_END_NAMESPACE + +#endif // SHADEREFFECTITEM_H diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp new file mode 100644 index 0000000000..0a133bd6c9 --- /dev/null +++ b/src/imports/shaders/shadereffectsource.cpp @@ -0,0 +1,472 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "shadereffectsource.h" +#include "shadereffectbuffer.h" +#include "shadereffect.h" +#include "glfunctions.h" + +#include + +/*! + \qmlclass ShaderEffectSource ShaderEffectSource + \ingroup qmlshadersplugin + \brief The ShaderEffectSource object encapsulates the source content for the ShaderEffectItem. + + ShaderEffectSource is available in the \bold{Qt.labs.shaders 1.0} module. + \e {Elements in the Qt.labs module are not guaranteed to remain compatible + in future versions.} + + This element provides preliminary support for OpenGL shaders in QML, + and may be heavily changed or removed in later versions. + + Requirement for the ability to use of shaders is that the application is either using + opengl graphicssystem or has set QGLWidget as the viewport to QDeclarativeView (recommended way). + + ShaderEffectSource object encapsulates the source content so that it can be utilized in ShaderEffectItem. + Source content can be a live QML object tree, or a snapshot of QML object tree. + +*/ + +ShaderEffectSource::ShaderEffectSource(QDeclarativeItem *parent) + : QDeclarativeItem(parent) + , m_sourceItem(0) + , m_wrapMode(ClampToEdge) + , m_sourceRect(0, 0, 0, 0) + , m_textureSize(0, 0) + , m_format(RGBA) + , m_size(0, 0) + , m_fbo(0) + , m_multisampledFbo(0) + , m_refs(0) + , m_dirtyTexture(true) + , m_dirtySceneGraph(true) + , m_multisamplingSupported(false) + , m_checkedForMultisamplingSupport(false) + , m_live(true) + , m_hideSource(false) + , m_mirrored(false) +{ +} + +ShaderEffectSource::~ShaderEffectSource() +{ + if (m_refs && m_sourceItem) + detachSourceItem(); + + delete m_fbo; + delete m_multisampledFbo; +} + +/*! + \qmlproperty Item ShaderEffectSource::sourceItem + This property holds the Item which is used as the source for the shader effect. + If the item has children, those are included as well. + + \note When source item content is passed to the ShaderEffectItem(s), it is always clipped to the boundingrect of the + sourceItem regardless of its clipping property. +*/ + +/*! + \property ShaderEffectSource::sourceItem + \brief the Item which is the source for the effect. +*/ + +void ShaderEffectSource::setSourceItem(QDeclarativeItem *item) +{ + if (item == m_sourceItem) + return; + + if (m_sourceItem) { + disconnect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty())); + disconnect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty())); + + if (m_refs) + detachSourceItem(); + } + + m_sourceItem = item; + + if (m_sourceItem) { + + // Must have some item as parent + if (m_sourceItem->parentItem() == 0) + m_sourceItem->setParentItem(this); + + if (m_refs) + attachSourceItem(); + + connect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty())); + connect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty())); + } + + updateSizeAndTexture(); + emit sourceItemChanged(); + emit repaintRequired(); +} + +/*! + \qmlproperty QRectF ShaderEffectSource::sourceRect + This property can be used to specify margins for the source content. + + If other value than Qt.rect(0,0,0,0) is assigned to this property, it is interpreted as + specifying a relative source rectangle for the source content. + + For example, setting Qt.rect(-10.0, -10.0, 120.0, 120.0) for a source that has width and height + of 100 pixels would produce 10 pixels margins to each side of the source. + + Margins are useful when the original content is wanted to be spread outside the original source area, + like when creating a dropshadow with the shader or in other similar effects. + + The default value is Qt.rect(0,0,0,0). +*/ + +/*! + \property ShaderEffectSource::sourceRect + \brief the relative sourceRect for the source. +*/ + +void ShaderEffectSource::setSourceRect(const QRectF &rect) +{ + if (rect == m_sourceRect) + return; + m_sourceRect = rect; + updateSizeAndTexture(); + updateBackbuffer(); + emit sourceRectChanged(); + emit repaintRequired(); + + if (m_sourceItem) { + ShaderEffect* effect = qobject_cast (m_sourceItem->graphicsEffect()); + if (effect) + effect->m_changed = true; + } +} + +/*! + \qmlproperty QSize ShaderEffectSource::textureSize + This property holds the size for the texture containing the source content. + + If value QSize(0,0) is assigned to this property, texture is resized + according to the source size. Otherwise source content is scaled to + the given size. + + The default value is QSize(0,0). +*/ + +/*! + \property ShaderEffectSource::textureSize + \brief the texture size for the source. +*/ + +void ShaderEffectSource::setTextureSize(const QSize &size) +{ + if (size == m_textureSize) + return; + + m_textureSize = size; + updateSizeAndTexture(); + emit textureSizeChanged(); + emit repaintRequired(); + + if (m_sourceItem) { + ShaderEffect* effect = qobject_cast (m_sourceItem->graphicsEffect()); + if (effect) + effect->m_changed = true; + } +} + +/*! + \qmlproperty bool ShaderEffectSource::live + This property holds the optimization flag to define wheter the source item content is changing or + static. + + If value true is assigned to this property, source item content is re-rendered into a + texture for every frame. Setting the value to false improves the performance as it skips + rendering the source item (and its chidleren) and instead immediately passes the previously + rendered and cached texture to the shaders. + + The default value is true. +*/ + +/*! + \property ShaderEffectSource::live + \brief the flag tells wheter source item content is changing between frames. +*/ + +void ShaderEffectSource::setLive(bool s) +{ + if (s == m_live) + return; + + m_live = s; + + emit liveChanged(); + emit repaintRequired(); +} + +/*! + \qmlproperty bool ShaderEffectSource::hideSource + This property holds the flag to define wheter the original source item is + hidden when the effect item is drawn. + + The default value is false. +*/ + +/*! + \property ShaderEffectSource::hideSource + \brief the flag tells wheter original source item content should be hidden. +*/ + +void ShaderEffectSource::setHideSource(bool hide) +{ + if (hide == m_hideSource) + return; + + m_hideSource = hide; + + emit hideSourceChanged(); + emit repaintRequired(); +} + +/*! + \qmlproperty enumeration ShaderEffectSource::wrapMode + + This property defines the wrap parameter for the source after it has been mapped as a texture. + + \list + \o WrapMode.ClampToEdge - Causes texturecoordinates to be clamped to the range [ 1/2*N , 1 - 1/2*N ], where N is the texture width. + \o WrapMode.RepeatHorizontally - Causes the integer part of the horizontal texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a horizontal repeating pattern. + \o WrapMode.RepeatVertically - Causes the integer part of the vertical texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a vertical repeating pattern. + \o WrapMode.Repeat - Causes the integer part of both the horizontal and vertical texturecoordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. + \endlist + + The default value is ClampToEdge. + +*/ + +/*! + \property ShaderEffectSource::wrapMode + \brief the wrap parameter for the source after it has been mapped as a texture. +*/ + +void ShaderEffectSource::setWrapMode(WrapMode mode) +{ + if (mode == m_wrapMode) + return; + + m_wrapMode = mode; + updateBackbuffer(); + emit wrapModeChanged(); +} + +/*! + \qmlmethod ShaderEffectSource::grab() + + Repaints the source item content into the texture. + + This method is useful when ShaderEffectSource::live has been set to false and + the changes in the source item content is desired to be made visible for the shaders. + +*/ + +void ShaderEffectSource::grab() +{ + m_dirtyTexture = true; + emit repaintRequired(); +} + +void ShaderEffectSource::bind() const +{ + GLint filtering = smooth() ? GL_LINEAR : GL_NEAREST; + GLuint hwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatHorizontally) ? GL_REPEAT : GL_CLAMP_TO_EDGE; + GLuint vwrap = (m_wrapMode == Repeat || m_wrapMode == RepeatVertically) ? GL_REPEAT : GL_CLAMP_TO_EDGE; + +#if !defined(QT_OPENGL_ES_2) + glEnable(GL_TEXTURE_2D); +#endif + if (m_fbo) { + glBindTexture(GL_TEXTURE_2D, m_fbo->texture()); + } else { + glBindTexture(GL_TEXTURE_2D, 0); + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, smooth() ? GL_LINEAR : GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, hwrap); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, vwrap); +} + +void ShaderEffectSource::refFromEffectItem() +{ + if (m_refs++ == 0) { + attachSourceItem(); + emit activeChanged(); + } +} + +void ShaderEffectSource::derefFromEffectItem() +{ + if (--m_refs == 0) { + detachSourceItem(); + emit activeChanged(); + } + Q_ASSERT(m_refs >= 0); +} + +void ShaderEffectSource::updateBackbuffer() +{ + if (!m_sourceItem) + return; + + // Multisampling is not (for now) supported. + QSize size = QSize(m_sourceItem->width(), m_sourceItem->height()); + if (!m_textureSize.isEmpty()) + size = m_textureSize; + + if (size.height() > 0 && size.width() > 0) { + QGLFramebufferObjectFormat format; + format.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + format.setInternalTextureFormat(m_format); + + if (!m_fbo) { + m_fbo = new ShaderEffectBuffer(size, format); + } else { + if (m_fbo->size() != size || m_fbo->format().internalTextureFormat() != GLenum(m_format)) { + delete m_fbo; + m_fbo = 0; + m_fbo = new ShaderEffectBuffer(size, format); + } + } + } + + // Note that real update for the source content happens in shadereffect.cpp + m_dirtyTexture = false; +} + +void ShaderEffectSource::markSceneGraphDirty() +{ + m_dirtySceneGraph = true; + emit repaintRequired(); +} + +void ShaderEffectSource::markSourceSizeDirty() +{ + Q_ASSERT(m_sourceItem); + if (m_textureSize.isEmpty()) + updateSizeAndTexture(); + if (m_refs) + emit repaintRequired(); +} + +void ShaderEffectSource::updateSizeAndTexture() +{ + if (m_sourceItem) { + QSize size = m_textureSize; + if (size.isEmpty()) + size = QSize(m_sourceItem->width(), m_sourceItem->height()); + if (size.width() < 1) + size.setWidth(1); + if (size.height() < 1) + size.setHeight(1); + if (m_fbo && m_fbo->size() != size) { + delete m_fbo; + m_fbo = 0; + delete m_multisampledFbo; + m_fbo = m_multisampledFbo = 0; + } + if (m_size.width() != size.width()) { + m_size.setWidth(size.width()); + emit widthChanged(); + } + if (m_size.height() != size.height()) { + m_size.setHeight(size.height()); + emit heightChanged(); + } + m_dirtyTexture = true; + } else { + if (m_size.width() != 0) { + m_size.setWidth(0); + emit widthChanged(); + } + if (m_size.height() != 0) { + m_size.setHeight(0); + emit heightChanged(); + } + } +} + +void ShaderEffectSource::attachSourceItem() +{ + if (!m_sourceItem) + return; + + ShaderEffect *effect = qobject_cast (m_sourceItem->graphicsEffect()); + + if (!effect) { + effect = new ShaderEffect(); + m_sourceItem->setGraphicsEffect(effect); + } + + if (effect) + effect->addRenderTarget(this); + + m_sourceItem->update(); +} + +void ShaderEffectSource::detachSourceItem() +{ + if (!m_sourceItem) + return; + + ShaderEffect* effect = qobject_cast (m_sourceItem->graphicsEffect()); + + if (effect) + effect->removeRenderTarget(this); + + delete m_fbo; + m_fbo = 0; + + delete m_multisampledFbo; + m_multisampledFbo = 0; + + m_dirtyTexture = true; +} diff --git a/src/imports/shaders/shadereffectsource.h b/src/imports/shaders/shadereffectsource.h new file mode 100644 index 0000000000..275e5b2030 --- /dev/null +++ b/src/imports/shaders/shadereffectsource.h @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef SHADEREFFECTSOURCE_H +#define SHADEREFFECTSOURCE_H + +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class ShaderEffectBuffer; + +class ShaderEffectSource : public QDeclarativeItem +{ + Q_OBJECT + Q_PROPERTY(QDeclarativeItem *sourceItem READ sourceItem WRITE setSourceItem NOTIFY sourceItemChanged) + Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged) + Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged) + Q_PROPERTY(bool live READ isLive WRITE setLive NOTIFY liveChanged) + Q_PROPERTY(bool hideSource READ hideSource WRITE setHideSource NOTIFY hideSourceChanged) + Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) + Q_ENUMS(WrapMode) + Q_ENUMS(Format) + +public: + enum WrapMode { + ClampToEdge, + RepeatHorizontally, + RepeatVertically, + Repeat + }; + + enum Format { + Alpha = GL_ALPHA, + RGB = GL_RGB, + RGBA = GL_RGBA + }; + + ShaderEffectSource(QDeclarativeItem *parent = 0); + virtual ~ShaderEffectSource(); + + QDeclarativeItem *sourceItem() const { return m_sourceItem.data(); } + void setSourceItem(QDeclarativeItem *item); + + QRectF sourceRect() const { return m_sourceRect; }; + void setSourceRect(const QRectF &rect); + + QSize textureSize() const { return m_textureSize; } + void setTextureSize(const QSize &size); + + bool isLive() const { return m_live; } + void setLive(bool s); + + bool hideSource() const { return m_hideSource; } + void setHideSource(bool hide); + + WrapMode wrapMode() const { return m_wrapMode; }; + void setWrapMode(WrapMode mode); + + bool isActive() const { return m_refs; } + void bind() const; + void refFromEffectItem(); + void derefFromEffectItem(); + void updateBackbuffer(); + + ShaderEffectBuffer* fbo() { return m_fbo; } + bool isDirtyTexture() { return m_dirtyTexture; } + bool isMirrored() { return m_mirrored; } + + Q_INVOKABLE void grab(); + +Q_SIGNALS: + void sourceItemChanged(); + void sourceRectChanged(); + void textureSizeChanged(); + void formatChanged(); + void liveChanged(); + void hideSourceChanged(); + void activeChanged(); + void repaintRequired(); + void wrapModeChanged(); + +public Q_SLOTS: + void markSceneGraphDirty(); + void markSourceSizeDirty(); + +private: + void updateSizeAndTexture(); + void attachSourceItem(); + void detachSourceItem(); + +private: + QPointer m_sourceItem; + WrapMode m_wrapMode; + QRectF m_sourceRect; + QSize m_textureSize; + Format m_format; + QSize m_size; + + ShaderEffectBuffer *m_fbo; + ShaderEffectBuffer *m_multisampledFbo; + int m_refs; + bool m_dirtyTexture : 1; + bool m_dirtySceneGraph : 1; + bool m_multisamplingSupported : 1; + bool m_checkedForMultisamplingSupport : 1; + bool m_live : 1; + bool m_hideSource : 1; + bool m_mirrored : 1; +}; + +QT_END_HEADER + +QT_END_NAMESPACE + + +#endif // SHADEREFFECTSOURCE_H diff --git a/src/imports/shaders/shaders.pro b/src/imports/shaders/shaders.pro new file mode 100644 index 0000000000..d7a6275af5 --- /dev/null +++ b/src/imports/shaders/shaders.pro @@ -0,0 +1,38 @@ +TARGET = qmlshadersplugin +TARGETPATH = Qt/labs/shaders +include(../qimportbase.pri) + +QT += declarative opengl + +SOURCES += \ + qmlshadersplugin_plugin.cpp \ + shadereffect.cpp \ + shadereffectitem.cpp \ + shadereffectsource.cpp \ + scenegraph/qsggeometry.cpp \ + shadereffectbuffer.cpp + +HEADERS += \ + qmlshadersplugin_plugin.h \ + glfunctions.h \ + shadereffect.h \ + shadereffectitem.h \ + shadereffectsource.h \ + scenegraph/qsggeometry.h \ + shadereffectbuffer.h + +QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH +target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +qmldir.files += $$PWD/qmldir +qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +symbian:{ + TARGET.UID3 = 0x20034907 + isEmpty(DESTDIR):importFiles.sources = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir + else:importFiles.sources = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir + importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH + DEPLOYMENT = importFiles +} + +INSTALLS += target qmldir diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 1f0d32a3d0..1bcc26f8b4 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -79,5 +79,7 @@ contains(QT_CONFIG, webkit) { qdeclarativewebview } +contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin + # Tests which should run in Pulse PULSE_TESTS = $$SUBDIRS diff --git a/tests/auto/declarative/qmlshadersplugin/main.qml b/tests/auto/declarative/qmlshadersplugin/main.qml new file mode 100644 index 0000000000..fc80b39803 --- /dev/null +++ b/tests/auto/declarative/qmlshadersplugin/main.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.shaders 1.0 + + Rectangle { + width: 300 + height: 300 + + Text { + id: textLabel + text: "Hello World" + anchors.centerIn: parent + font.pixelSize: 48 + } + + ShaderEffectItem { + objectName: "effectItem" + property variant source: ShaderEffectSource { objectName: "effectSource"; sourceItem: textLabel; hideSource: true } + property real wiggleAmount: 0.01 + anchors.fill: textLabel + + SequentialAnimation on wiggleAmount { + loops: Animation.Infinite + NumberAnimation { to: -0.01; duration: 500 } + NumberAnimation { to: 0.01; duration: 500 } + } + + fragmentShader: " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + uniform highp float wiggleAmount; + void main(void) + { + highp vec2 wiggledTexCoord = qt_TexCoord0; + wiggledTexCoord.s += sin(4.0 * 3.141592653589 * wiggledTexCoord.t) * wiggleAmount; + gl_FragColor = texture2D(source, wiggledTexCoord.st); + } + " + } + } diff --git a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro new file mode 100644 index 0000000000..6225a8f661 --- /dev/null +++ b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -0,0 +1,18 @@ +load(qttest_p4) + +QT += opengl declarative +SOURCES += tst_qmlshadersplugin.cpp + +SOURCES += \ + ../../../../src/imports/shaders/src/shadereffectitem.cpp \ + ../../../../src/imports/shaders/src/shadereffectsource.cpp \ + ../../../../src/imports/shaders/src/shadereffect.cpp \ + ../../../../src/imports/shaders/src/shadereffectbuffer.cpp \ + ../../../../src/imports/shaders/src/scenegraph/qsggeometry.cpp + +HEADERS += \ + ../../../../src/imports/shaders/src/shadereffectitem.h \ + ../../../../src/imports/shaders/src/shadereffectsource.h \ + ../../../../src/imports/shaders/src/shadereffect.h \ + ../../../../src/imports/shaders/src/shadereffectbuffer.h \ + ../../../../src/imports/shaders/src/scenegraph/qsggeometry.h diff --git a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp new file mode 100644 index 0000000000..61fe2ee19f --- /dev/null +++ b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp @@ -0,0 +1,205 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "../../../../src/imports/shaders/src/shadereffectitem.h" +#include "../../../../src/imports/shaders/src/shadereffectsource.h" +#include "../../../../src/imports/shaders/src/shadereffect.h" + +static const char qt_default_vertex_code[] = + "uniform highp mat4 qt_ModelViewProjectionMatrix;\n" + "attribute highp vec4 qt_Vertex;\n" + "attribute highp vec2 qt_MultiTexCoord0;\n" + "varying highp vec2 qt_TexCoord0;\n" + "void main(void)\n" + "{\n" + "qt_TexCoord0 = qt_MultiTexCoord0;\n" + "gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n" + "}\n"; + +static const char qt_default_fragment_code[] = + "varying highp vec2 qt_TexCoord0;\n" + "uniform lowp sampler2D source;\n" + "void main(void)\n" + "{\n" + "gl_FragColor = texture2D(source, qt_TexCoord0.st);\n" + "}\n"; + +class tst_qmlshadersplugin : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void shaderEffectItemAPI(); + void shaderEffectSourceAPI(); + void combined(); + +private: + QDeclarativeEngine engine; +}; + +void tst_qmlshadersplugin::initTestCase() +{ + const char *uri ="Qt.labs.shaders"; + qmlRegisterType(uri, 1, 0, "ShaderEffectItem"); + qmlRegisterType(uri, 1, 0, "ShaderEffectSource"); +} + + +void tst_qmlshadersplugin::shaderEffectItemAPI() +{ + // Creation + QString componentStr = "import QtQuick 1.0\n" + "import Qt.labs.shaders 1.0\n" + "ShaderEffectItem {\n" + "property variant source\n" + "width: 200; height: 300\n" + "}"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + + QObject *obj = component.create(); + QTest::qWait(100); + QVERIFY(obj != 0); + + // Default values + QCOMPARE(obj->property("width").toDouble(), 200.); + QCOMPARE(obj->property("height").toDouble(), 300.); + QCOMPARE(obj->property("fragmentShader").toString(), QString("")); + QCOMPARE(obj->property("vertexShader").toString(), QString("")); + QCOMPARE(obj->property("blending").toBool(), true); + QCOMPARE(obj->property("meshResolution").toSize(), QSize(1, 1)); + QCOMPARE(obj->property("visible").toBool(), true); + + // Seting the values + QVERIFY(obj->setProperty("fragmentShader", QString(qt_default_fragment_code))); + QVERIFY(obj->setProperty("vertexShader", QString(qt_default_vertex_code))); + QVERIFY(obj->setProperty("blending", false)); + QVERIFY(obj->setProperty("meshResolution", QSize(20, 10))); + QVERIFY(obj->setProperty("visible", false)); + + QCOMPARE(obj->property("fragmentShader").toString(), QString(qt_default_fragment_code)); + QCOMPARE(obj->property("vertexShader").toString(), QString(qt_default_vertex_code)); + QCOMPARE(obj->property("blending").toBool(), false); + QCOMPARE(obj->property("meshResolution").toSize(), QSize(20, 10)); + QCOMPARE(obj->property("visible").toBool(), false); + + delete obj; +} + +void tst_qmlshadersplugin::shaderEffectSourceAPI() +{ + // Creation + QString componentStr = "import QtQuick 1.0\n" + "import Qt.labs.shaders 1.0\n" + "ShaderEffectSource {}"; + QDeclarativeComponent shaderEffectSourceComponent(&engine); + shaderEffectSourceComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + + QObject *obj = shaderEffectSourceComponent.create(); + QTest::qWait(100); + QVERIFY(obj != 0); + + // Default values + QCOMPARE(obj->property("sourceRect").toRect(), QRect(0, 0, 0, 0)); + QCOMPARE(obj->property("textureSize").toSize(), QSize(0, 0)); + QCOMPARE(obj->property("live").toBool(), true); + QCOMPARE(obj->property("hideSource").toBool(), false); + QCOMPARE(obj->property("wrapMode").toUInt(), static_cast(ShaderEffectSource::ClampToEdge)); + + // Seting the values + componentStr = "import QtQuick 1.0\n" + "Item {}"; + QDeclarativeComponent itemComponent(&engine); + itemComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeItem *item = qobject_cast (itemComponent.create()); + QVERIFY(item != 0); + + QVERIFY(obj->setProperty("sourceItem", QVariant::fromValue(item))); + QVERIFY(obj->setProperty("sourceRect", QRect(10, 20, 30, 40))); + QVERIFY(obj->setProperty("textureSize", QSize(50, 100))); + QVERIFY(obj->setProperty("live", false)); + QVERIFY(obj->setProperty("hideSource", true)); + QVERIFY(obj->setProperty("wrapMode", static_cast(ShaderEffectSource::Repeat))); + + QCOMPARE(obj->property("sourceItem"), QVariant::fromValue(item)); + QCOMPARE(obj->property("sourceRect").toRect(), QRect(10, 20, 30, 40)); + QCOMPARE(obj->property("textureSize").toSize(), QSize(50, 100)); + QCOMPARE(obj->property("live").toBool(), false); + QCOMPARE(obj->property("hideSource").toBool(), true); + QCOMPARE(obj->property("wrapMode").toUInt(), static_cast(ShaderEffectSource::Repeat)); + + delete item; + delete obj; +} + +void tst_qmlshadersplugin::combined() +{ + QGLFormat format = QGLFormat::defaultFormat(); + format.setSampleBuffers(false); + format.setSwapInterval(1); + + QGLWidget* glWidget = new QGLWidget(format); + glWidget->setAutoFillBackground(false); + + QDeclarativeView view; + view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + view.setAttribute(Qt::WA_OpaquePaintEvent); + view.setAttribute(Qt::WA_NoSystemBackground); + view.setViewport(glWidget); + view.setSource(QUrl::fromLocalFile("main.qml")); + view.show(); + QTest::qWait(1000); + + QObject *item = view.rootObject()->findChild("effectItem"); + QVERIFY(item != 0); + + QObject *src = view.rootObject()->findChild("effectSource"); + QVERIFY(src != 0); + + QCOMPARE(item->property("source"), QVariant::fromValue(src)); +} + +QTEST_MAIN(tst_qmlshadersplugin) + +#include "tst_qmlshadersplugin.moc" diff --git a/tests/benchmarks/declarative/declarative.pro b/tests/benchmarks/declarative/declarative.pro index 5dd31f3d13..51bbfaefa1 100644 --- a/tests/benchmarks/declarative/declarative.pro +++ b/tests/benchmarks/declarative/declarative.pro @@ -10,6 +10,6 @@ SUBDIRS += \ script \ qmltime -contains(QT_CONFIG, opengl): SUBDIRS += painting +contains(QT_CONFIG, opengl): SUBDIRS += painting qmlshadersplugin diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml new file mode 100644 index 0000000000..4424b0b03d --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml @@ -0,0 +1,43 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + id: gaussianBlur + property variant source: 0 + property real radius: 8; + property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0))) + property bool live: true + + ShaderEffectItem { + id: cache + anchors.fill: parent + visible: !gaussianBlur.live + property variant source: ShaderEffectSource { sourceItem: verticalBlur; live: false; hideSource: true } + } + + GaussianDirectionalBlur { + id: verticalBlur + anchors.fill: parent + + deltaX: 0.0 + deltaY: 1.0/parent.height + + source: ShaderEffectSource { sourceItem: horizontalBlur; hideSource: true } + deviation: gaussianBlur.deviation + radius: gaussianBlur.radius + } + + GaussianDirectionalBlur { + id: horizontalBlur + anchors.fill: parent + blending: false + + deltaX: 1.0/parent.width + deltaY: 0.0 + + source: gaussianBlur.source + deviation: gaussianBlur.deviation + radius: gaussianBlur.radius + } + +} diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml new file mode 100644 index 0000000000..33f576b439 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml @@ -0,0 +1,168 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +// Note 1. This shader implements gaussian blur without dynamic array access from inside shader loops (Optional feature in OpenGLES 2.0). +// Note 2. Shader code is generated to avoid ecessive if-else structure in fragment shader. Code re-generation (very slow!) happens if blur radius is changed. + +ShaderEffectItem { + id: effect + property variant source: 0 + property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0))); + property real radius: 8; + property real deltaX: 0.0 + property real deltaY: 0.0 + + property real gaussianSum: 0.0 + property real startIndex: 0.0 + property real samples: radius * 2 + + property variant gwts: [] + property variant delta: Qt.vector3d(effect.deltaX, effect.deltaY, effect.startIndex); + property variant factor_0_2: Qt.vector3d(effect.gwts[0], effect.gwts[1], effect.gwts[2]); + property variant factor_3_5: Qt.vector3d(effect.gwts[3],effect.gwts[4],effect.gwts[5]); + property variant factor_6_8: Qt.vector3d(effect.gwts[6],effect.gwts[7],effect.gwts[8]); + property variant factor_9_11: Qt.vector3d(effect.gwts[9],effect.gwts[10],effect.gwts[11]); + property variant factor_12_14: Qt.vector3d(effect.gwts[12],effect.gwts[13],effect.gwts[14]); + property variant factor_15_17: Qt.vector3d(effect.gwts[15],effect.gwts[16],effect.gwts[17]); + property variant factor_18_20: Qt.vector3d(effect.gwts[18],effect.gwts[19],effect.gwts[20]); + property variant factor_21_23: Qt.vector3d(effect.gwts[21],effect.gwts[22],effect.gwts[23]); + property variant factor_24_26: Qt.vector3d(effect.gwts[24],effect.gwts[25],effect.gwts[26]); + property variant factor_27_29: Qt.vector3d(effect.gwts[27],effect.gwts[28],effect.gwts[29]); + property variant factor_30_32: Qt.vector3d(effect.gwts[30],effect.gwts[31],effect.gwts[32]); + + //Gaussian function = h(x):=(1/sqrt(2*3.14159*(D^2))) * %e^(-(x^2)/(2*(D^2))); + function gausFunc(x){ + return (1/Math.sqrt(2*3.1415926*(Math.pow(effect.deviation,2)))) * Math.pow(2.7182818,-((Math.pow(x,2))/(2*(Math.pow(effect.deviation,2))))); + } + + function calcGWTS() { + var n = new Array(Math.floor(effect.samples)); + var step + for (var i = 0; i < effect.samples; i++) { + step = -effect.samples/2 + i + 0.5 + n[i] = gausFunc(step); + } + return n; + } + + function buildFragmentShader() { + + var shaderSteps = [ + "gl_FragColor += texture2D(source, texCoord) * factor_0_2.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_0_2.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_0_2.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_3_5.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_3_5.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_3_5.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_6_8.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_6_8.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_6_8.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_9_11.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_9_11.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_9_11.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_12_14.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_12_14.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_12_14.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_15_17.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_15_17.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_15_17.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_18_20.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_18_20.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_18_20.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_21_23.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_21_23.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_21_23.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_24_26.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_24_26.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_24_26.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_27_29.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_27_29.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_27_29.z; texCoord += shift;", + + "gl_FragColor += texture2D(source, texCoord) * factor_30_32.x; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_30_32.y; texCoord += shift;", + "gl_FragColor += texture2D(source, texCoord) * factor_30_32.z; texCoord += shift;" + ] + + var shader = fragmentShader_begin + var samples = effect.samples + if (samples > 32) { + console.log("GaussianBlur: Maximum of 32 blur samples exceeded!") + samples = 32 + } + + for (var i = 0; i < samples; i++) { + shader += shaderSteps[i] + } + + shader += fragmentShader_end + effect.fragmentShader = shader + + } + + onDeviationChanged:{ + effect.startIndex = -effect.samples/2 + 0.5 + effect.gwts = calcGWTS(); + var sum = 0.0; + for (var j = 0; j < effect.samples; j++) { + sum += effect.gwts[j]; + } + effect.gaussianSum = sum + } + + Component.onCompleted:{ + effect.startIndex = -effect.samples/2 + 0.5 + effect.gwts = calcGWTS(); + var sum = 0.0; + for (var j = 0; j < effect.samples; j++) { + sum += effect.gwts[j]; + } + effect.gaussianSum = sum + buildFragmentShader() + } + + onSamplesChanged: { + buildFragmentShader() + } + + property string fragmentShader_begin: + " + varying mediump vec2 qt_TexCoord0; + uniform sampler2D source; + uniform highp vec3 delta; + uniform highp vec3 factor_0_2; + uniform highp vec3 factor_3_5; + uniform highp vec3 factor_6_8; + uniform highp vec3 factor_9_11; + uniform highp vec3 factor_12_14; + uniform highp vec3 factor_15_17; + uniform highp vec3 factor_18_20; + uniform highp vec3 factor_21_23; + uniform highp vec3 factor_24_26; + uniform highp vec3 factor_27_29; + uniform highp vec3 factor_30_32; + uniform highp float gaussianSum; + + void main() { + highp vec2 shift = vec2(delta.x, delta.y); + highp float index = delta.z; + mediump vec2 texCoord = qt_TexCoord0 + (shift * index); + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + " + + property string fragmentShader_end: + " + if (gaussianSum > 0.0) + gl_FragColor /= gaussianSum; + } + " +} diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml new file mode 100644 index 0000000000..be78c86c24 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml @@ -0,0 +1,41 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + id: gaussianDropShadow + + property color shadowColor: Qt.rgba(0.5, 0.5, 0.5, 1.0) + property variant source: 0 + property real radius: 8 + property real deviation: Math.sqrt(-((radius+1) * (radius+1)) / (2 * Math.log(1.0 / 255.0))) + property bool live: true + + GaussianBlur { + id: blur + anchors.fill: parent + radius: gaussianDropShadow.radius + deviation: gaussianDropShadow.deviation + source: gaussianDropShadow.source + live: gaussianDropShadow.live + } + + ShaderEffectItem { + id: shadow + property color shadowColor: gaussianDropShadow.shadowColor + property variant source: ShaderEffectSource { sourceItem: blur; hideSource: true } + anchors.fill: parent + + fragmentShader: + " + varying mediump vec2 qt_TexCoord0; + uniform sampler2D source; + uniform lowp vec4 shadowColor; + + void main() { + lowp vec4 sourceColor = texture2D(source, qt_TexCoord0); + gl_FragColor = mix(vec4(0), shadowColor, sourceColor.a); + } + " + } +} + diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml new file mode 100755 index 0000000000..5843d55358 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml @@ -0,0 +1,66 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + id: main + width: 360 + height: 640 + + property bool liveShadows: true + property real r: 0 + + NumberAnimation on r { + loops: Animation.Infinite + from: 0 + to: 360 + duration: 3000 + } + + Image { + id: background + width: main.width + height: main.height + fillMode: Image.Tile + source: "bg.jpg" + } + + GaussianDropShadow { + x: image1.x + 50 + y: image1.y + 50 + width: image1.width + height: image1.height + shadowColor: "#88000000" + source: ShaderEffectSource { sourceItem: image1; hideSource: false; sourceRect: Qt.rect(-10, -10, image1.width + 20, image1.height + 20) } + radius: 12.0 + deviation: 12 + rotation: r + } + + Image { + id: image1 + anchors.fill: parent + source: "drop_shadow_small.png" + smooth: true + rotation: r + } + + GaussianDropShadow { + x: image2.x + 50 + y: image2.y + 50 + width: image2.width + height: image2.height + shadowColor: "#88000000" + source: ShaderEffectSource { sourceItem: image2; hideSource: false; sourceRect: Qt.rect(-10, -10, image2.width + 20, image2.height + 20) } + radius: 12.0 + deviation: 12 + rotation: -r + } + + Image { + id: image2 + anchors.fill: parent + source: "drop_shadow_small.png" + smooth: true + rotation: -r + } +} diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml new file mode 100755 index 0000000000..4d90950102 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml @@ -0,0 +1,20 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + width: 360 + height: 640 + + Image { + id: image + width: parent.width + height: parent.height * 0.65 + source: "sky.jpg" + smooth: true + } + Water { + sourceItem: image + intensity: 5 + height: parent.height - image.height + } +} diff --git a/tests/benchmarks/declarative/qmlshadersplugin/Water.qml b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml new file mode 100644 index 0000000000..02486dd0f7 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml @@ -0,0 +1,85 @@ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + id: root + property alias sourceItem: effectsource.sourceItem + property real intensity: 1 + property bool waving: true + anchors.top: sourceItem.bottom + width: sourceItem.width + height: sourceItem.height + + ShaderEffectItem { + anchors.fill: parent + property variant source: effectsource + property real f: 0 + property real f2: 0 + property alias intensity: root.intensity + smooth: true + + ShaderEffectSource { + id: effectsource + hideSource: false + smooth: true + } + + fragmentShader: + " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + uniform lowp float qt_Opacity; + uniform highp float f; + uniform highp float f2; + uniform highp float intensity; + + void main() { + const highp float twopi = 3.141592653589 * 2.0; + + highp float distanceFactorToPhase = pow(qt_TexCoord0.y + 0.5, 8.0) * 5.0; + highp float ofx = sin(f * twopi + distanceFactorToPhase) / 100.0; + highp float ofy = sin(f2 * twopi + distanceFactorToPhase * qt_TexCoord0.x) / 60.0; + + highp float intensityDampingFactor = (qt_TexCoord0.x + 0.1) * (qt_TexCoord0.y + 0.2); + highp float distanceFactor = (1.0 - qt_TexCoord0.y) * 4.0 * intensity * intensityDampingFactor; + + ofx *= distanceFactor; + ofy *= distanceFactor; + + highp float x = qt_TexCoord0.x + ofx; + highp float y = 1.0 - qt_TexCoord0.y + ofy; + + highp float fake = (sin((ofy + ofx) * twopi) + 0.5) * 0.05 * (1.2 - qt_TexCoord0.y) * intensity * intensityDampingFactor; + + highp vec4 pix = + texture2D(source, vec2(x, y)) * 0.6 + + texture2D(source, vec2(x-fake, y)) * 0.15 + + texture2D(source, vec2(x, y-fake)) * 0.15 + + texture2D(source, vec2(x+fake, y)) * 0.15 + + texture2D(source, vec2(x, y+fake)) * 0.15; + + highp float darken = 0.6 - (ofx - ofy) / 2.0; + pix.b *= 1.2 * darken; + pix.r *= 0.9 * darken; + pix.g *= darken; + + gl_FragColor = qt_Opacity * vec4(pix.r, pix.g, pix.b, 1.0); + } + " + + NumberAnimation on f { + running: root.waving + loops: Animation.Infinite + from: 0 + to: 1 + duration: 2410 + } + NumberAnimation on f2 { + running: root.waving + loops: Animation.Infinite + from: 0 + to: 1 + duration: 1754 + } + } +} diff --git a/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg b/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg new file mode 100644 index 0000000000..4d22143810 Binary files /dev/null and b/tests/benchmarks/declarative/qmlshadersplugin/bg.jpg differ diff --git a/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png new file mode 100755 index 0000000000..4a9b2831aa Binary files /dev/null and b/tests/benchmarks/declarative/qmlshadersplugin/drop_shadow_small.png differ diff --git a/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro new file mode 100644 index 0000000000..9fb8852c68 --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -0,0 +1,23 @@ +QT += opengl declarative testlib + +TARGET = tst_performance + +SOURCES += \ + tst_performance.cpp \ + ../../../../src/imports/shaders/src/shadereffectitem.cpp \ + ../../../../src/imports/shaders/src/shadereffectsource.cpp \ + ../../../../src/imports/shaders/src/shadereffect.cpp \ + ../../../../src/imports/shaders/src/shadereffectbuffer.cpp \ + ../../../../src/imports/shaders/src/scenegraph/qsggeometry.cpp + +HEADERS += \ + ../../../../src/imports/shaders/src/shadereffectitem.h \ + ../../../../src/imports/shaders/src/shadereffectsource.h \ + ../../../../src/imports/shaders/src/shadereffect.h \ + ../../../../src/imports/shaders/src/shadereffectbuffer.h \ + ../../../../src/imports/shaders/src/scenegraph/qsggeometry.h + +OTHER_FILES += \ + *.qml \ + *.png \ + *.jpg diff --git a/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg b/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg new file mode 100644 index 0000000000..8fc19ed1be Binary files /dev/null and b/tests/benchmarks/declarative/qmlshadersplugin/sky.jpg differ diff --git a/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp new file mode 100644 index 0000000000..6ee6979aef --- /dev/null +++ b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "../../../../src/imports/shaders/src/shadereffectitem.h" +#include "../../../../src/imports/shaders/src/shadereffectsource.h" +//#include "../../../src/shadereffect.h" + +class BenchmarkItem : public QDeclarativeItem +{ + Q_OBJECT + +public: + BenchmarkItem( QDeclarativeItem * parent = 0 ) : QDeclarativeItem(parent) + , m_frameCount(0) + { + setFlag(QGraphicsItem::ItemHasNoContents, false); + } + + void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + QDeclarativeItem::paint(painter, option, widget); + if (timer.restart() > 7) m_frameCount++; + } + + int frameCount() { return m_frameCount; } + +private: + int m_frameCount; + QTime timer; +}; + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QDeclarativeView view; + view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + view.setAttribute(Qt::WA_OpaquePaintEvent); + view.setAttribute(Qt::WA_NoSystemBackground); + view.setResizeMode(QDeclarativeView::SizeViewToRootObject); + + qmlRegisterType("Qt.labs.shaders", 1, 0, "ShaderEffectItem"); + qmlRegisterType("Qt.labs.shaders", 1, 0, "ShaderEffectSource"); + + QGLFormat format = QGLFormat::defaultFormat(); + format.setSampleBuffers(false); + format.setSwapInterval(1); + + QGLWidget* glWidget = new QGLWidget(format); + glWidget->setAutoFillBackground(false); + view.setViewport(glWidget); + view.show(); + + view.setSource(QUrl::fromLocalFile("TestWater.qml")); + BenchmarkItem *benchmarkItem; + + qDebug() << "Sea Water benchmark:"; + benchmarkItem = new BenchmarkItem(dynamic_cast(view.rootObject())); + QTest::qWait(5000); + qDebug() << "Rendered " << benchmarkItem->frameCount() << " frames in 5 seconds"; + qDebug() << "Average " << benchmarkItem->frameCount() / 5.0 << " frames per second"; + + qDebug() << "Gaussian drop shadow benchmark:"; + view.setSource(QUrl::fromLocalFile("TestGaussianDropShadow.qml")); + benchmarkItem = new BenchmarkItem(dynamic_cast(view.rootObject())); + QTest::qWait(5000); + qDebug() << "Rendered " << benchmarkItem->frameCount() << " frames in 5 seconds"; + qDebug() << "Average " << benchmarkItem->frameCount() / 5.0 << " frames per second"; +} + +#include "tst_performance.moc" diff --git a/tests/manual/declarative/declarative.pro b/tests/manual/declarative/declarative.pro new file mode 100644 index 0000000000..337db2f9c0 --- /dev/null +++ b/tests/manual/declarative/declarative.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +contains(QT_CONFIG, opengl): SUBDIRS += qmlshadersplugin + diff --git a/tests/manual/declarative/qmlshadersplugin/main.cpp b/tests/manual/declarative/qmlshadersplugin/main.cpp new file mode 100644 index 0000000000..3f40e92e23 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/main.cpp @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "qmlapplicationviewer.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QGLFormat format = QGLFormat::defaultFormat(); + format.setSampleBuffers(false); + format.setSwapInterval(1); + + QGLWidget* glWidget = new QGLWidget(format); + glWidget->setAutoFillBackground(false); + + QmlApplicationViewer viewer; + viewer.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + viewer.setViewport(glWidget); + viewer.setAttribute(Qt::WA_OpaquePaintEvent); + viewer.setAttribute(Qt::WA_NoSystemBackground); + viewer.setOrientation(QmlApplicationViewer::Auto); + viewer.setMainQmlFile(QLatin1String("qml/qmlshadersplugintest/main.qml")); + viewer.show(); + + return app.exec(); +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml new file mode 100644 index 0000000000..8aaee0dfcb --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "red" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + //effect.active = !effect.active + effect.visible = !effect.visible + } + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: effect.visible ? "Effect active (display should be green)" : "Effect not active (display should be red)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml new file mode 100644 index 0000000000..c7ec9084a4 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + anchors.fill: parent; + + ShaderEffectItem { + anchors.fill: parent; + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1); + } + " + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml new file mode 100644 index 0000000000..d7ce837bf0 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "green" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + effect.blending = !effect.blending + } + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(1.0, 0.0, 0.0, 0.0); + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: effect.blending ? "Effect blending (display should be orange)" : "Effect not blending (display should be red)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml new file mode 100644 index 0000000000..bd60c68172 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml @@ -0,0 +1,267 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Item { + id: blendModeTest + property real blendItemHeight: 60 + + anchors.fill: parent; + + Rectangle { + width: parent.width / 6 + height: parent.height + color: "black" + } + Rectangle { + x: parent.width/6 * 1 + width: parent.width / 6 + height: parent.height + color: "white" + } + Rectangle { + x: parent.width/6 * 2 + width: parent.width / 6 + height: parent.height + color: "gray" + } + Rectangle { + x: parent.width/6 * 3 + width: parent.width / 6 + height: parent.height + color: "red" + } + Rectangle { + x: parent.width/6 * 4 + width: parent.width / 6 + height: parent.height + color: "green" + } + Rectangle { + x: parent.width/6 * 5 + width: parent.width / 6 + height: parent.height + color: "blue" + } + + + Image { + anchors.fill: parent; + source: "image.png" + + } + + Rectangle { + id: first + anchors.top: parent.top + anchors.topMargin: 60 + width: parent.width + height: blendModeTest.blendItemHeight + color: "#8000ff00" + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " Rectangle color #8000ff00" + color: "white" + } + } + Rectangle { + id: second + anchors.top: first.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + color: "#ff00ff00" + opacity: 0.5 + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " Rectangle color #ff00ff00, opacity 0.5" + color: "white" + } + } + + ShaderEffectItem { + id: effect + anchors.top: second.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0.0, 1.0, 0.0, 0.5); + } + " + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " ShaderEffectItem gl_FragColor=vec4(0.0, 1.0, 0.0, 0.5)" + color: "white" + } + } + + ShaderEffectItem { + id: effect2 + anchors.top: effect.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0.0, 0.5, 0.0, 0.5); + } + " + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " ShaderEffectItem gl_FragColor=vec4(0.0, 0.5, 0.0, 0.5)" + color: "white" + } + } + + + Image { + id: image1 + source: "green_image_transparent.png" + anchors.top: effect2.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + } + Text { + anchors.bottom: image1.bottom + anchors.bottomMargin: 5 + text: " Image, green and 50% alpha" + color: "white" + } + + + ShaderEffectItem { + id: effect3 + property variant source: ShaderEffectSource { + sourceItem: image1 + hideSource: false + } + anchors.top: image1.bottom + anchors.topMargin: 5 + + width: parent.width + height: blendModeTest.blendItemHeight + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " ShaderEffectItem, source item green 50% alpha." + color: "white" + } + } + + ShaderEffectItem { + id: effect4 + property variant source: ShaderEffectSource { + sourceItem: Image { source: "green_image_transparent.png" } + hideSource: true + } + anchors.top: effect3.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " ShaderEffectItem, source image green 50% alpha." + color: "white" + } + } + + + Rectangle { + id: greenRect2 + anchors.top: effect4.bottom + anchors.topMargin: 5 + width: parent.width + height: blendModeTest.blendItemHeight + opacity: 0.5 + color: "green" + } + + + ShaderEffectItem { + id: effect5 + property variant source: ShaderEffectSource { sourceItem: greenRect2; hideSource: true } + anchors.top: effect4.bottom + anchors.topMargin: 5 + + width: parent.width + height: blendModeTest.blendItemHeight + Text { + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + text: " ShaderEffectItem, source item green rect with 0.5 opacity." + color: "white" + } + } + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + } + } + + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: "Blending test" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml new file mode 100644 index 0000000000..e3a4c80d11 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + id :root + anchors.fill: parent; + color: "green" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + effect1.visible = !effect1.visible + effect2.visible = !effect2.visible + //effect3.visible = !effect3.visible + } + } + + Rectangle { + id: a + x: 90 + y: 90 + color: "red" + width: 220 + height: 220 + Rectangle { + id: b + x: 10 + y: 10 + color: "blue" + width: 100 + height: 100 + rotation: 5 + Rectangle { + id: c + x: 10 + y: 10 + color: "black" + width: 80 + height: 80 + } + } + Rectangle { + id: d + x: 10 + y: 110 + color: "yellow" + width: 100 + height: 100 + } + } + + ShaderEffectItem { + id: effect1 + anchors.fill: a + property variant source: ShaderEffectSource{ sourceItem: a; hideSource: true } + } + + ShaderEffectItem { + id: effect2 + x: 100 + y: 100 + width: 100 + height: 100 + rotation: 5 + property variant source: ShaderEffectSource{ sourceItem: b; hideSource: true } + } + +// ShaderEffectItem { +// id: effect3 +// x: 110 +// y: 210 +// width: 80 +// height: 80 +// property variant source: ShaderEffectSource{ sourceItem: c; hideSource: true } +// } + + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: effect1.visible ? "Effects active" : "Effects NOT active" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml new file mode 100644 index 0000000000..ab845570e5 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml @@ -0,0 +1,119 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "green" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + + } + } + + Rectangle { + id: theSource + color: "red" + anchors.centerIn: parent; + width: parent.width/2 + height: parent.height/2 + } + + ShaderEffectItem { + id: effect1 + anchors.fill: theSource; + property variant source: ShaderEffectSource{ sourceItem: theSource; hideSource: true } + } + + ShaderEffectItem { + id: effect2 + anchors.fill: effect1; + property variant source: effect1 + + fragmentShader: " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + void main(void) + { + gl_FragColor = vec4(texture2D(source, qt_TexCoord0.st).rgb, 1.0); + } + " + } + + ShaderEffectItem { + id: effect3 + x: effect2.x + y: effect2.y + width: effect2.width + height: effect2.height + + property variant source: ShaderEffectSource { sourceItem: effect2 ; hideSource: false } + + fragmentShader: + " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + void main(void) + { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: "Red rect inside green fullscreen rect." + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml new file mode 100644 index 0000000000..9b1c697a03 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "gray" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (theSource.format == ShaderEffectSource.Alpha) + theSource.format = ShaderEffectSource.RGB + else if (theSource.format == ShaderEffectSource.RGB) + theSource.format = ShaderEffectSource.RGBA + else if (theSource.format == ShaderEffectSource.RGBA) + theSource.format = ShaderEffectSource.Alpha + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent + width: parent.width + height: parent.height + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: "Source format test: " + theSource.format + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml new file mode 100644 index 0000000000..0a7f261af6 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + effect.fragmentShader == effect.redFragmentShader ? effect.fragmentShader = effect.greenFragmentShader : effect.fragmentShader = effect.redFragmentShader + } + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + + property string redFragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); + } + " + + property string greenFragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); + } + " + + fragmentShader: redFragmentShader + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: effect.fragmentShader == effect.redFragmentShader ? "Effect (display should be red)" : "Effect (display should be green)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml new file mode 100644 index 0000000000..6a2083529a --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + console.log("Grabbed!") + theSource.grab(); + } + } + + Image { + id: theSourcImage + source: "image_opaque.png" + opacity: 0.5 + } + + ShaderEffectSource { + id: theSource + sourceItem: theSourcImage + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent + width: parent.width + height: parent.height + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: "Effect with grab (opacity 0.5)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml new file mode 100644 index 0000000000..40277459ae --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "green" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + //theSource.hideOriginal = !theSource.hideOriginal + theSource.hideSource = !theSource.hideSource + } + } + + Rectangle { + id: redRect + anchors.fill: parent; + color: "red" + } + + ShaderEffectSource { + id: theSource + sourceItem: redRect + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + + fragmentShader: " + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + void main() { + // Empty fragmentshader, we do not write any pixels via this effect item. We only observe hideoriginal functionality. + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + //text: theSource.hideOriginal ? "Hideoriginal true (display should be green)" : "Hideoriginal false (display should be red)" + text: theSource.hideSource ? "HideSource true (display should be green)" : "HideSource false (display should be red)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml new file mode 100644 index 0000000000..92436a8aa6 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatHorizontally + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_small.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + vec2 tex = qt_TexCoord0 * 4.0; + gl_FragColor = texture2D(source, tex); + } + " + + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.wrapMode == ShaderEffectSource.RepeatHorizontally ? "HorizontalWrap RepeatHorizontally" : "HorizontalWrap ClampToEdge" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml new file mode 100644 index 0000000000..07da7b8f98 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.smooth = !theSource.smooth + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + width: parent.width * 2.0 + height: parent.height * 2.0 + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: !theSource.smooth ? "Filtering nearest (faster)" : "Filtering linear (better quality)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml new file mode 100644 index 0000000000..8bfafa9624 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + id: imageMarginTester + anchors.fill: parent; + color: "green" + property real testMarginX: 10 + property real testMarginY: 10 + + Timer { + running: true + interval: 2000 + repeat: true + + onTriggered: { + if (imageMarginTester.testMarginX < 20) { + imageMarginTester.testMarginX = 50 + imageMarginTester.testMarginY = 120 + } + else { + imageMarginTester.testMarginX = 10 + imageMarginTester.testMarginY = 10 + } + + console.log("onTriggered...") + theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2) + console.log("onTriggered done") + } + } + + ShaderEffectSource { + id: theSource + sourceImage: "image_opaque.png" + sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10) + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + imageMarginTester.testMarginX + "x" + imageMarginTester.testMarginY + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml new file mode 100644 index 0000000000..61f947a7ee --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + id: marginTester + anchors.fill: parent; + color: "green" + property real testMarginX: 10 + property real testMarginY: 10 + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (marginTester.testMarginX < 20) { + marginTester.testMarginX = 50 + marginTester.testMarginY = 120 + } + else { + marginTester.testMarginX = 10 + marginTester.testMarginY = 10 + } + + theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2) + } + } + + ShaderEffectSource { + id: theSource + sourceImage: "image_opaque.png" + textureSize: Qt.size(160,160) + sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10) + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml new file mode 100644 index 0000000000..56b81686e2 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (theSource.mipmap && theSource.smooth){ + theSource.smooth = false + } else if (theSource.mipmap && !theSource.smooth){ + theSource.smooth = true + theSource.mipmap = false + } else if (!theSource.mipmap && theSource.smooth){ + theSource.smooth = false + } else if (!theSource.mipmap && !theSource.smooth){ + theSource.smooth = true + theSource.mipmap = true + } + } + } + + ShaderEffectSource { + id: theSource + sourceImage: "wallpaper.jpg" + mipmap: false + smooth: false + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent; + width: parent.width * 0.8 + height: parent.height * 0.8 + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: "Mipmap: " + theSource.mipmap + ", Smooth: " + theSource.smooth + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml new file mode 100644 index 0000000000..26c6f57dde --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml @@ -0,0 +1,102 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + id: marginTester + anchors.fill: parent; + color: "green" + property real testMarginX: 10 + property real testMarginY: 10 + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (marginTester.testMarginX < 20) { + marginTester.testMarginX = 50 + marginTester.testMarginY = 120 + } + else { + marginTester.testMarginX = 10 + marginTester.testMarginY = 10 + } + + theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2) + console.log("onTriggered") + } + } + + Image { + id: redrect + source: "image_opaque.png" + } + + + ShaderEffectSource { + id: theSource + sourceItem: redrect + sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10) + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml new file mode 100644 index 0000000000..abbf8f4833 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + id: marginTester + anchors.fill: parent; + color: "green" + property real testMarginX: 10 + property real testMarginY: 10 + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (marginTester.testMarginX < 20) { + marginTester.testMarginX = 50 + marginTester.testMarginY = 120 + } + else { + marginTester.testMarginX = 10 + marginTester.testMarginY = 10 + } + + theSource.sourceRect = Qt.rect(-testMarginX, -testMarginY, parent.width + testMarginX*2, parent.height + testMarginY*2) + } + } + + Image { + id: redrect + source: "image_opaque.png" + } + + ShaderEffectSource { + id: theSource + sourceItem: redrect + textureSize: Qt.size(160,160) + sourceRect: Qt.rect(-10,-10, parent.width + 2*10, parent.height + 2*10) + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.sourceRect.width == 0 ? "No margins" : "Green margins " + marginTester.testMarginX + "x" + marginTester.testMarginY + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml new file mode 100644 index 0000000000..0d3553b561 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.live = !theSource.live + theSource.grab() // This tests grabbing screenshot from static source + } + } + + Rectangle { + id: greenRect + anchors.fill: parent; + color: theSource.live ? "green" : "red" // This works if we use grab() + property int counter: 0 + Text { + id: counterText + anchors.centerIn: parent + text: greenRect.counter + font.pixelSize: 48 + } + Timer { + running: true + interval: 100 + repeat: true + onTriggered: { + greenRect.counter++ + } + } + } + + ShaderEffectSource { + id: theSource + sourceItem: greenRect + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.live ? "live true (color green, number changes)" : "live false (color red, same number)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml new file mode 100644 index 0000000000..e8ddc61d85 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "red" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + effect.meshResolution.width == 1 ? effect.meshResolution = Qt.size(40,40) : effect.meshResolution = Qt.size(1,1) + } + } + + Rectangle { + id: thesource + anchors.centerIn: parent; + color: "green" + width: parent.width + height: parent.height + Image { + anchors.centerIn: parent; + source: "image_opaque.png" + } + } + + + ShaderEffectItem { + id: effect + anchors.fill: thesource; + property variant source: ShaderEffectSource { sourceItem: thesource } + + vertexShader: " + attribute highp vec4 qt_Vertex; + attribute highp vec2 qt_MultiTexCoord0; + uniform highp mat4 qt_ModelViewProjectionMatrix; + varying highp vec2 qt_TexCoord0; + void main() { + qt_TexCoord0 = qt_MultiTexCoord0; + + highp vec4 shift = vec4(cos(1071. * qt_MultiTexCoord0.x + 1.0) + sin(2051. * qt_MultiTexCoord0.y + 1.0), + cos(1131. * qt_MultiTexCoord0.x + 1.0) + sin(3039. * qt_MultiTexCoord0.x + 1.0), 0, 0) * 3.0; + + if (qt_MultiTexCoord0.x < 0.01 || qt_MultiTexCoord0.x > 0.99) + shift.x = 0.; + if (qt_MultiTexCoord0.y < 0.01 || qt_MultiTexCoord0.y > 0.99) + shift.y = 0.; + + gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex + shift); + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: effect.meshResolution.width == 1 ? "Resolution (1,1) (image looks normal)" : "Resolution (40,40) (image looks distorted)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml new file mode 100644 index 0000000000..8b92247a49 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "black" + + Text { + id: text + anchors.centerIn: parent + font.pixelSize: 80 + text: "Shaderz!" + } + + ShaderEffectSource { + id: source + sourceItem: text + hideSource: true + } + + ShaderEffectItem { + anchors.fill: text; + + property variant source: source + + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(qt_TexCoord0.x, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a; + } + " + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml new file mode 100644 index 0000000000..af5ecf75b8 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (effect.opacity > 0.9) + effect.opacity = 0.0 + else if (effect.opacity < 0.5) + effect.opacity = 0.5 + else if (effect.opacity < 0.9) + effect.opacity = 1.0 + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_opaque.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent + width: parent.width + height: parent.height + property variant source: theSource + + fragmentShader: " + uniform highp float qt_Opacity; + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(texture2D(source, qt_TexCoord0).rgb, qt_Opacity); + } + " + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: "Effect with opacity: " + effect.opacity + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml new file mode 100644 index 0000000000..4262ebc7cb --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (effectWrapper.rotation < 45) + effectWrapper.rotation = 45 + else if (effectWrapper.rotation < 90) + effectWrapper.rotation = 90 + else if (effectWrapper.rotation < 180) + effectWrapper.rotation = 0 + + } + } + + Item { + id: effectWrapper + anchors.fill: parent; + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_opaque.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent + width: parent.width - 50 + height: parent.height - 50 + property variant source: theSource + } + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: "Effect is rotated " + effectWrapper.rotation + " degrees" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml new file mode 100644 index 0000000000..b60747c80c --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + if (effectWrapper.scale < 0.3) + effectWrapper.scale = 0.3 + else if (effectWrapper.scale < 1.7) + effectWrapper.scale = 1.7 + else if (effectWrapper.scale < 2.0) + effectWrapper.scale = 0.1 + } + } + + Item { + id: effectWrapper + anchors.fill: parent; + scale: 0.1 + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_opaque.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.centerIn: parent + width: parent.width - 50 + height: parent.height - 50 + property variant source: theSource + } + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + Text { + id: label + anchors.centerIn: parent + text: "Effect is scaled " + effectWrapper.scale + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml new file mode 100644 index 0000000000..5ca08cbd4f --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.textureSize.width == 64 ? theSource.textureSize = Qt.size(360,640) : theSource.textureSize = Qt.size(64,64) + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image.png" } + live: false + textureSize: Qt.size(64,64) + smooth: true + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: "textureSize:" + theSource.textureSize.width + "x" + theSource.textureSize.height + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml new file mode 100644 index 0000000000..e84b84ba66 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "black" + + Text { + id: text + anchors.centerIn: parent + font.pixelSize: 80 + text: "Shaderz!" + } + + ShaderEffectSource { + id: source + sourceItem: text + hideSource: true + } + + ShaderEffectItem { + width: parent.width + height: parent.height / 2 + blending: false + + property variant source: source + + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0, qt_TexCoord0.y, 1, 1) * texture2D(source, qt_TexCoord0).a; + } + " + } + + ShaderEffectItem { + width: parent.width + y: parent.height / 2 + height: parent.height / 2 + + property variant source: source + + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(qt_TexCoord0.x, 1, 0, 1) * texture2D(source, qt_TexCoord0).a; + } + " + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml new file mode 100644 index 0000000000..c8f12af96f --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "black" + + Rectangle { + id: rect; + anchors.centerIn: parent + width: 1 + height: 10 + + gradient: Gradient { + GradientStop { position: 0; color: "#ff0000" } + GradientStop { position: 0.5; color: "#00ff00" } + GradientStop { position: 1; color: "#0000ff" } + } + } + + Text { + id: text + anchors.centerIn: parent + font.pixelSize: 80 + text: "Shaderz!" + } + + ShaderEffectSource { + id: maskSource + sourceItem: text + hideSource: true + } + + ShaderEffectSource { + id: colorSource + sourceItem: rect; + hideSource: true + } + + ShaderEffectItem { + anchors.fill: text; + + property variant colorSource: colorSource + property variant maskSource: maskSource; + + fragmentShader: " + uniform lowp sampler2D maskSource; + uniform lowp sampler2D colorSource; + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = texture2D(maskSource, qt_TexCoord0).a * texture2D(colorSource, qt_TexCoord0.yx); + } + " + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml new file mode 100644 index 0000000000..0e122574af --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "red" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + effect.vertexShader == effect.defaultVertexShader ? effect.vertexShader = effect.dummyVertexShader : effect.vertexShader = effect.defaultVertexShader + } + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + + property string defaultVertexShader: " + uniform highp mat4 qt_ModelViewProjectionMatrix; + attribute highp vec4 qt_Vertex; + attribute highp vec2 qt_MultiTexCoord0; + varying highp vec2 qt_TexCoord0; + void main(void) + { + qt_TexCoord0 = qt_MultiTexCoord0; + gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex; + }; + " + + property string dummyVertexShader: " + uniform highp mat4 qt_ModelViewProjectionMatrix; + attribute highp vec4 qt_Vertex; + attribute highp vec2 qt_MultiTexCoord0; + varying highp vec2 qt_TexCoord0; + void main(void) + { + qt_TexCoord0 = qt_MultiTexCoord0; + gl_Position = qt_Vertex * vec4(0.0, 0.0, 0.0, 0.0001); + }; + " + + vertexShader: defaultVertexShader + + fragmentShader: " + varying highp vec2 qt_TexCoord0; + void main() { + gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); + } + " + + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: effect.vertexShader == effect.defaultVertexShader ? "Effect (display shoud be green)" : "Effect (display shoud be red)" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml new file mode 100644 index 0000000000..96171efa06 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.wrapMode == ShaderEffectSource.RepeatVertically ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.RepeatVertically + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_small.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + vec2 tex = qt_TexCoord0 * 4.0; + gl_FragColor = texture2D(source, tex); + } + " + + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.wrapMode == ShaderEffectSource.RepeatVertically ? "Wrap RepeatVertically" : "VerticalWrap ClampToEdge" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml new file mode 100644 index 0000000000..35f6b92a06 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import Qt 4.7 +import Qt.labs.shaders 1.0 + +Rectangle { + anchors.fill: parent; + color: "white" + + Timer { + running: true + interval: 2000 + repeat: true + onTriggered: { + theSource.wrapMode == ShaderEffectSource.Repeat ? theSource.wrapMode = ShaderEffectSource.ClampToEdge : theSource.wrapMode = ShaderEffectSource.Repeat + } + } + + ShaderEffectSource { + id: theSource + sourceItem: Image { source: "image_small.png" } + live: false + hideSource: true + } + + ShaderEffectItem { + id: effect + anchors.fill: parent; + property variant source: theSource + fragmentShader: " + uniform lowp sampler2D source; + varying highp vec2 qt_TexCoord0; + void main() { + vec2 tex = qt_TexCoord0 * 4.0; + gl_FragColor = texture2D(source, tex); + } + " + + } + + Rectangle { + width: parent.width + height: 40 + color: "#cc000000" + + Text { + id: label + anchors.centerIn: parent + text: theSource.wrapMode == ShaderEffectSource.Repeat ? "Wrap Repeat" : "Wrap ClampToEdge" + color: "white" + font.bold: true + } + } +} diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg new file mode 100755 index 0000000000..3005133b8e --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/back.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png new file mode 100755 index 0000000000..f3024f7eeb Binary files /dev/null and b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/green_image_transparent.png differ diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png new file mode 100755 index 0000000000..144c02d548 Binary files /dev/null and b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image.png differ diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png new file mode 100755 index 0000000000..c73d38927e Binary files /dev/null and b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_opaque.png differ diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png new file mode 100755 index 0000000000..b2267737fd Binary files /dev/null and b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/image_small.png differ diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml new file mode 100644 index 0000000000..2a857a9f56 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml @@ -0,0 +1,236 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import Qt 4.7 + +Item { + id: main + width: 360 + height: 640 + + Rectangle { + id: background + visible: testCaseList.visible + anchors.fill: parent + gradient: Gradient { + GradientStop { position: 0.0; color: "#EEEEEE" } + GradientStop { position: 1.0; color: "#AAAAAA" } + } + } + + Loader { + id: testLoader + width: parent.width + height: parent.height + visible: !testCaseList.visible + } + + ListModel { + id: testcaseModel + ListElement { name: "TestEffectHierarchy.qml"; group: "Effect source property tests" } + ListElement { name: "TestGrab.qml"; group: "Effect source property tests" } + ListElement { name: "TestLive.qml"; group: "Effect source property tests" } + ListElement { name: "TestImageFiltering.qml"; group: "Effect source property tests" } + ListElement { name: "TestWrapRepeat.qml"; group: "Effect source property tests" } + ListElement { name: "TestHorizontalWrap.qml"; group: "Effect source property tests" } + ListElement { name: "TestVerticalWrap.qml"; group: "Effect source property tests" } + ListElement { name: "TestTextureSize.qml"; group: "Effect source property tests" } + ListElement { name: "TestItemMargins.qml"; group: "Effect source property tests" } + ListElement { name: "TestEffectInsideAnotherEffect.qml"; group: "Effect source property tests" } + ListElement { name: "TestItemMarginsWithTextureSize.qml"; group: "Effect source property tests" } + ListElement { name: "TestHideOriginal.qml"; group: "Effect source property tests" } + ListElement { name: "TestActive.qml"; group: "Effect item property tests" } + ListElement { name: "TestBlending.qml"; group: "Effect item property tests" } + ListElement { name: "TestBlendingModes.qml"; group: "Effect item property tests" } + ListElement { name: "TestOpacity.qml"; group: "Effect item property tests" } + ListElement { name: "TestFragmentShader.qml"; group: "Effect item property tests" } + ListElement { name: "TestVertexShader.qml"; group: "Effect item property tests" } + ListElement { name: "TestMeshResolution.qml"; group: "Effect item property tests" } + ListElement { name: "TestRotation.qml"; group: "Shader effect transformation tests" } + ListElement { name: "TestScale.qml"; group: "Shader effect transformation tests" } + ListElement { name: "TestBasic.qml"; group: "Scenegraph effect tests" } + ListElement { name: "TestOneSource.qml"; group: "Scenegraph effect tests" } + ListElement { name: "TestTwiceOnSameSource.qml"; group: "Scenegraph effect tests" } + ListElement { name: "TestTwoSources.qml"; group: "Scenegraph effect tests" } + } + + Component { + id: sectionHeading + Rectangle { + width: testCaseList.width + height: 35 + color: "#00000000" + + Text { + text: section + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + anchors.fill: parent + anchors.leftMargin: 5 + font.bold: true + style: Text.Raised + styleColor: "white" + } + } + } + + ListView { + id: testCaseList + + property int hideTranslation: 0 + transform: Translate { + x: testCaseList.hideTranslation + } + + anchors.fill: parent + anchors.topMargin: 10 + anchors.leftMargin: 5 + anchors.rightMargin: 5 + anchors.bottomMargin: 10 + + model: testcaseModel + spacing: 3 + + state: "testStopped" + + section.property: "group" + section.criteria: ViewSection.FullString + section.delegate: sectionHeading + + delegate: Rectangle { + width: parent.width + height: 50 + radius: 5 + border.width: 1 + border.color: "#888888" + color: delegateMouseArea.pressed ? "#AAAAFF" : "#FFFFFF" + Text { + id: delegateText; + text: " " + name + width: parent.width + height: parent.height + font.pixelSize: 16 + verticalAlignment: Text.AlignVCenter + } + Text { + id: delegateText2; + text: "> " + width: parent.width + height: parent.height + font.pixelSize: 20 + smooth: true + color: "gray" + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignRight + } + + MouseArea { + id: delegateMouseArea + anchors.fill: parent; + onClicked: { + testCaseList.state = "testRunning" + testLoader.source = name + console.log(name) + } + } + } + + states: [ + State { + name: "testRunning" + PropertyChanges { target: testCaseList; visible: false; hideTranslation: -main.width } + }, + State { + name: "testStopped" + PropertyChanges { target: testCaseList; visible: true; hideTranslation: 0 } + } + ] + + transitions: [ + Transition { + to: "testRunning" + SequentialAnimation { + NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 } + PropertyAction { target: testCaseList; property: "visible"; value: false } + } + }, + Transition { + to: "testStopped" + SequentialAnimation { + PropertyAction { target: testCaseList; property: "visible"; value: true } + NumberAnimation { properties: "hideTranslation"; easing.type: Easing.InQuad; duration: 300 } + } + } + + ] + } + + Rectangle { + visible: true + anchors.bottom: main.bottom + anchors.left: main.left + anchors.right: main.right + height: 40 + color: "#cc000000" + Item { + anchors.top: parent.top + anchors.topMargin: 5 + anchors.left: parent.left + anchors.leftMargin: 20 + Image { + source: "back.svg" + } + } + + MouseArea { + anchors.fill: parent; + onClicked: { + if (testCaseList.visible){ + Qt.quit() + } else if (!testCaseList.state != "testStopped") { + testCaseList.state = "testStopped" + testLoader.source = "" + } + } + } + } +} + diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg new file mode 100755 index 0000000000..5bc7b58550 Binary files /dev/null and b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/wallpaper.jpg differ diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp new file mode 100644 index 0000000000..51b5fcc835 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -0,0 +1,127 @@ +// checksum 0xdf1f version 0x10008 +#include "qmlapplicationviewer.h" + +#include +#include +#include +#include +#include +#include + +#if defined(QMLJSDEBUGGER) +#include +#endif +#if defined(QMLOBSERVER) +#include +#endif + +#if defined(Q_OS_SYMBIAN) && defined(ORIENTATIONLOCK) +#include +#include +#include +#include +#endif // Q_OS_SYMBIAN && ORIENTATIONLOCK + +class QmlApplicationViewerPrivate +{ + QString mainQmlFile; + friend class QmlApplicationViewer; + static QString adjustPath(const QString &path); +}; + +QString QmlApplicationViewerPrivate::adjustPath(const QString &path) +{ +#ifdef Q_OS_UNIX +#ifdef Q_OS_MAC + if (!QDir::isAbsolutePath(path)) + return QCoreApplication::applicationDirPath() + + QLatin1String("/../Resources/") + path; +#else + const QString pathInShareDir = QCoreApplication::applicationDirPath() + + QLatin1String("/../share/") + + QFileInfo(QCoreApplication::applicationFilePath()).fileName() + + QLatin1Char('/') + path; + if (QFileInfo(pathInShareDir).exists()) + return pathInShareDir; +#endif +#endif + return path; +} + +QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : + QDeclarativeView(parent), + m_d(new QmlApplicationViewerPrivate) +{ + connect(engine(), SIGNAL(quit()), SLOT(close())); + setResizeMode(QDeclarativeView::SizeRootObjectToView); +#ifdef QMLJSDEBUGGER + new QmlJSDebugger::JSDebuggerAgent(engine()); +#endif +#ifdef QMLOBSERVER + new QmlJSDebugger::QDeclarativeViewObserver(this, parent); +#endif +} + +QmlApplicationViewer::~QmlApplicationViewer() +{ + delete m_d; +} + +void QmlApplicationViewer::setMainQmlFile(const QString &file) +{ + m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file); + setSource(QUrl::fromLocalFile(m_d->mainQmlFile)); +} + +void QmlApplicationViewer::addImportPath(const QString &path) +{ + engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path)); +} + +void QmlApplicationViewer::setOrientation(Orientation orientation) +{ +#ifdef Q_OS_SYMBIAN + if (orientation != Auto) { +#if defined(ORIENTATIONLOCK) + const CAknAppUiBase::TAppUiOrientation uiOrientation = + (orientation == LockPortrait) ? CAknAppUi::EAppUiOrientationPortrait + : CAknAppUi::EAppUiOrientationLandscape; + CAknAppUi* appUi = dynamic_cast (CEikonEnv::Static()->AppUi()); + TRAPD(error, + if (appUi) + appUi->SetOrientationL(uiOrientation); + ); +#else // ORIENTATIONLOCK + qWarning("'ORIENTATIONLOCK' needs to be defined on Symbian when locking the orientation."); +#endif // ORIENTATIONLOCK + } +#elif defined(Q_WS_MAEMO_5) + Qt::WidgetAttribute attribute; + switch (orientation) { + case LockPortrait: + attribute = Qt::WA_Maemo5PortraitOrientation; + break; + case LockLandscape: + attribute = Qt::WA_Maemo5LandscapeOrientation; + break; + case Auto: + default: + attribute = Qt::WA_Maemo5AutoOrientation; + break; + } + setAttribute(attribute, true); +#else // Q_OS_SYMBIAN + Q_UNUSED(orientation); +#endif // Q_OS_SYMBIAN +} + +void QmlApplicationViewer::show() +{ +#ifdef Q_OS_SYMBIAN + showFullScreen(); +#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + showMaximized(); +#else + QDeclarativeView::show(); +#endif +} diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h new file mode 100644 index 0000000000..ea784310cf --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h @@ -0,0 +1,28 @@ +// checksum 0x39ee version 0x10008 +#ifndef QMLAPPLICATIONVIEWER_H +#define QMLAPPLICATIONVIEWER_H + +#include + +class QmlApplicationViewer : public QDeclarativeView +{ +public: + enum Orientation { + LockPortrait, + LockLandscape, + Auto + }; + + QmlApplicationViewer(QWidget *parent = 0); + virtual ~QmlApplicationViewer(); + + void setMainQmlFile(const QString &file); + void addImportPath(const QString &path); + void setOrientation(Orientation orientation); + void show(); + +private: + class QmlApplicationViewerPrivate *m_d; +}; + +#endif // QMLAPPLICATIONVIEWER_H diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri new file mode 100644 index 0000000000..79e6a9f820 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.pri @@ -0,0 +1,152 @@ +# checksum 0xc123 version 0x10008 +# This file should not be edited. +# Future versions of Qt Creator might offer updated versions of this file. + +QT += declarative + +SOURCES += $$PWD/qmlapplicationviewer.cpp +HEADERS += $$PWD/qmlapplicationviewer.h +INCLUDEPATH += $$PWD + +contains(DEFINES, QMLOBSERVER) { + DEFINES *= QMLJSDEBUGGER +} + +defineTest(minQtVersion) { + maj = $$1 + min = $$2 + patch = $$3 + isEqual(QT_MAJOR_VERSION, $$maj) { + isEqual(QT_MINOR_VERSION, $$min) { + isEqual(QT_PATCH_VERSION, $$patch) { + return(true) + } + greaterThan(QT_PATCH_VERSION, $$patch) { + return(true) + } + } + greaterThan(QT_MINOR_VERSION, $$min) { + return(true) + } + } + return(false) +} + +contains(DEFINES, QMLJSDEBUGGER) { + CONFIG(debug, debug|release) { + !minQtVersion(4, 7, 1) { + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("This library requires Qt 4.7.1 or newer.") + warning() + + error("Qt version $$QT_VERSION too old for QmlJS Debugging. Aborting.") + } + isEmpty(QMLJSDEBUGGER_PATH) { + warning() + warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.") + warning("Please specify its location on the qmake command line, eg") + warning(" qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger") + warning() + + error("QMLJSDEBUGGER defined, but no QMLJSDEBUGGER_PATH set on command line. Aborting.") + DEFINES -= QMLJSDEBUGGER + } else { + include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri) + } + } else { + DEFINES -= QMLJSDEBUGGER + } +} +# This file should not be edited. +# Future versions of Qt Creator might offer updated versions of this file. + +defineTest(qtcAddDeployment) { +for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemsources = $${item}.sources + $$itemsources = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath= $$eval($${deploymentfolder}.target) + export($$itemsources) + export($$itempath) + DEPLOYMENT += $$item +} + +MAINPROFILEPWD = $$PWD + +symbian { + ICON = $${TARGET}.svg + TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 + contains(DEFINES, ORIENTATIONLOCK):LIBS += -lavkon -leikcore -leiksrv -lcone + contains(DEFINES, NETWORKACCESS):TARGET.CAPABILITY += NetworkServices +} else:win32 { + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + source = $$eval($${deploymentfolder}.source) + pathSegments = $$split(source, /) + sourceAndTarget = $$MAINPROFILEPWD/$$source $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(pathSegments) + copyCommand += && $(COPY_DIR) $$replace(sourceAndTarget, /, \\) + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } +} else:unix { + maemo5 { + installPrefix = /opt/usr + desktopfile.path = /usr/share/applications/hildon + } else { + installPrefix = /usr/local + desktopfile.path = /usr/share/applications + !isEqual(PWD,$$OUT_PWD) { + copyCommand = @echo Copying application data... + for(deploymentfolder, DEPLOYMENTFOLDERS) { + macx { + target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target) + } else { + target = $$OUT_PWD/$$eval($${deploymentfolder}.target) + } + copyCommand += && $(MKDIR) $$target + copyCommand += && $(COPY_DIR) $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source) $$target + } + copydeploymentfolders.commands = $$copyCommand + first.depends = $(first) copydeploymentfolders + export(first.depends) + export(copydeploymentfolders.commands) + QMAKE_EXTRA_TARGETS += first copydeploymentfolders + } + } + for(deploymentfolder, DEPLOYMENTFOLDERS) { + item = item$${deploymentfolder} + itemfiles = $${item}.files + $$itemfiles = $$eval($${deploymentfolder}.source) + itempath = $${item}.path + $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target) + export($$itemfiles) + export($$itempath) + INSTALLS += $$item + } + icon.files = $${TARGET}.png + icon.path = /usr/share/icons/hicolor/64x64/apps + desktopfile.files = $${TARGET}.desktop + target.path = $${installPrefix}/bin + export(icon.files) + export(icon.path) + export(desktopfile.files) + export(desktopfile.path) + export(target.path) + INSTALLS += desktopfile icon target +} + +export (ICON) +export (INSTALLS) +export (DEPLOYMENT) +export (TARGET.EPOCHEAPSIZE) +export (TARGET.CAPABILITY) +export (LIBS) +export (QMAKE_EXTRA_TARGETS) +} diff --git a/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro new file mode 100644 index 0000000000..98101fb641 --- /dev/null +++ b/tests/manual/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -0,0 +1,29 @@ +QT += declarative opengl + +# Add more folders to ship with the application, here +folder_01.source = qml/qmlshadersplugintest +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve Qml modules in Creator's code model +QML_IMPORT_PATH = + +# Avoid auto screen rotation +#DEFINES += ORIENTATIONLOCK + +# Needs to be defined for Symbian +#DEFINES += NETWORKACCESS + +symbian:TARGET.UID3 = 0xE40472A7 + +# Define QMLJSDEBUGGER to enable basic debugging (setting breakpoints etc) +# Define QMLOBSERVER for advanced features (requires experimental QmlInspector plugin!) +#DEFINES += QMLJSDEBUGGER +#DEFINES += QMLOBSERVER + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +include(qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() -- cgit v1.2.3 From 9663956626fe95ace6baa4cf0ba30898a88147a7 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 25 May 2011 15:09:33 +0200 Subject: Update the detection of is_using_gnupoc for S3. The akndoc.h was moved to epoc32/include/mw. Reviewed-By: axis --- mkspecs/features/symbian/qt_config.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/symbian/qt_config.prf b/mkspecs/features/symbian/qt_config.prf index 82c18621b7..1afd22c187 100644 --- a/mkspecs/features/symbian/qt_config.prf +++ b/mkspecs/features/symbian/qt_config.prf @@ -3,7 +3,7 @@ load(qt_config) !contains(QMAKE_HOST.os, "Windows") { # Test for the existence of lower cased headers, a sign of using Gnupoc. # Note that the qmake "exists" test won't do because it is case insensitive. - system("test -f $${EPOCROOT}epoc32/include/akndoc.h") { + system("test -f $${EPOCROOT}epoc32/include/akndoc.h") | system("test -f $${EPOCROOT}epoc32/include/mw/akndoc.h") { CONFIG += is_using_gnupoc } } -- cgit v1.2.3 From 3f82ecbd0e2cdf477e57c7fe41b63c09d7e84787 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Wed, 25 May 2011 18:24:30 +0200 Subject: Fix boundry conditions for cursor hit test Clicking at the edge of a glyph means lookup for the left glyph. Reviewed-by: TrustMe (cherry picked from commit 31110bf84bb06d57983501fa65fe0db3f7c61927) --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 69598cfef9..9271f3412e 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2739,7 +2739,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, if (glyph_pos == -1 && end > 0) glyph_pos = logClusters[end - 1]; else { - if (x < edge) + if (x <= edge) glyph_pos--; } -- cgit v1.2.3 From c9eb2ffd1ed940133392831747605bf735d92086 Mon Sep 17 00:00:00 2001 From: Tomi Vihria Date: Wed, 18 May 2011 17:43:14 +0300 Subject: Fixing Linux compatibility issues for Symbian The patch applies everything from the original, except for the filename case changes in LIBS which are handled differently based on the auto-detected is_using_gnupoc CONFIG value. Reviewed-by: Laszlo Agocs --- .../mobile/quickhit/plugins/LevelOne/levelone.pro | 6 ++-- .../plugins/LevelTemplate/leveltemplate.pro | 6 ++-- .../mobile/quickhit/plugins/LevelTwo/leveltwo.pro | 6 ++-- mkspecs/features/symbian/application_icon.prf | 4 +-- src/gui/dialogs/dialogs.pri | 6 +++- src/plugins/phonon/mmf/mmf.pro | 12 +++++-- src/s60installs/qt.iby | 42 +++++++++++----------- src/s60installs/s60installs.pro | 6 ++-- tests/auto/qcssparser/qcssparser.pro | 2 +- 9 files changed, 51 insertions(+), 39 deletions(-) diff --git a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro index fcbfc56a53..b9367219b7 100644 --- a/demos/mobile/quickhit/plugins/LevelOne/levelone.pro +++ b/demos/mobile/quickhit/plugins/LevelOne/levelone.pro @@ -57,11 +57,11 @@ BLD_INF_RULES.prj_exports += "gfx/background3.png ../winscw/c/Data/gfx/backgroun myQml.sources = level.qml -myQml.path = c:/System/quickhitdata/levelone +myQml.path = c:/system/quickhitdata/levelone myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/levelone/gfx +myGraphic.path = c:/system/quickhitdata/levelone/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/levelone/sound +mySound.path = c:/system/quickhitdata/levelone/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro index a4f590058b..1370956aa0 100644 --- a/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro +++ b/demos/mobile/quickhit/plugins/LevelTemplate/leveltemplate.pro @@ -60,11 +60,11 @@ BLD_INF_RULES.prj_exports += "gfx/enemy1.png ../winscw/c/Data/gfx/enemy1.png" \ myQml.sources = qml/* -myQml.path = c:/System/quickhitdata/leveltemplate +myQml.path = c:/system/quickhitdata/leveltemplate myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/leveltemplate/gfx +myGraphic.path = c:/system/quickhitdata/leveltemplate/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/leveltemplate/sound +mySound.path = c:/system/quickhitdata/leveltemplate/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro index 171ee6c2da..e5c144f381 100644 --- a/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro +++ b/demos/mobile/quickhit/plugins/LevelTwo/leveltwo.pro @@ -64,11 +64,11 @@ BLD_INF_RULES.prj_exports += "gfx/background2.png ../winscw/c/Data/gfx/backgroun myQml.sources = qml/* -myQml.path = c:/System/quickhitdata/leveltwo +myQml.path = c:/system/quickhitdata/leveltwo myGraphic.sources = gfx/* -myGraphic.path = c:/System/quickhitdata/leveltwo/gfx +myGraphic.path = c:/system/quickhitdata/leveltwo/gfx mySound.sources = sound/* -mySound.path = c:/System/quickhitdata/leveltwo/sound +mySound.path = c:/system/quickhitdata/leveltwo/sound # Takes qml, graphics and sounds into Symbian SIS package file (.pkg) DEPLOYMENT += myQml myGraphic mySound diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 06f5b3103a..56d1ea8ede 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -65,8 +65,8 @@ contains(CONFIG, no_icon) { mifconv.target = $$replace(mifconv.target, /, \\) } # Based on: http://www.forum.nokia.com/document/Cpp_Developers_Library - # svg-t icons should always use /c32 depth - mifconv.commands = mifconv $$mifconv.target /c32 $$ICON_backslashed + # svg-t icons should always use -c32 depth + mifconv.commands = mifconv $$mifconv.target -c32 $$ICON_backslashed mifconv.depends = $$ICON PRE_TARGETDEPS += $$mifconv.target diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index 12e3a711c8..365f589e22 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -109,7 +109,11 @@ SOURCES += \ dialogs/qprintpreviewdialog.cpp symbian:contains(QT_CONFIG, s60) { - LIBS += -lCommonDialogs + contains(CONFIG, is_using_gnupoc) { + LIBS += -lcommondialogs + } else { + LIBS += -lCommonDialogs + } SOURCES += dialogs/qfiledialog_symbian.cpp \ dialogs/qcolordialog_symbian.cpp } diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index a9e5746032..75e42af99b 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -103,7 +103,11 @@ symbian { exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { HEADERS += $$PHONON_MMF_DIR/download.h SOURCES += $$PHONON_MMF_DIR/download.cpp - LIBS += -lDownloadMgr + contains(CONFIG, is_using_gnupoc) { + LIBS += -ldownloadmgr + } else { + LIBS += -lDownloadMgr + } DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD } } @@ -125,7 +129,11 @@ symbian { LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. - LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect + CONTAINS(config, is_using_gnupoc) { + LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect + } else { + LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect + } # This is to allow IAP to be specified LIBS += -lcommdb diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index d6b36e0fe3..9f2c979aa4 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -40,7 +40,7 @@ file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll // Phonon MMF backend file=ABI_DIR\BUILD_DIR\phonon_mmf.dll SHARED_LIB_DIR\phonon_mmf.dll -data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // graphicssystems file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll @@ -54,41 +54,41 @@ file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll // imageformats stubs -data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin -data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin // codecs stubs -data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin -data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin // iconengines stubs -data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin // qml import plugins file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll -data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin -data=\epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir -data=\epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir -data=\epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir +data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir // graphicssystems -data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin -data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin // bearer stub -data=\epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin +data=EPOCROOT##epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin // Stub sis file data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index d1bb48b814..17b229fa8e 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -10,10 +10,10 @@ symbian: { TARGET = "Qt$${QT_LIBINFIX}" isEmpty(QT_LIBINFIX) { - TARGET.UID3 = 0x2001E61C + TARGET.UID3 = 0x2001e61c } else { # Always use experimental UID for infixed configuration to avoid UID clash - TARGET.UID3 = 0xE001E61C + TARGET.UID3 = 0xe001e61c } VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} @@ -116,7 +116,7 @@ symbian: { # Support backup & restore for Qt libraries qtbackup.sources = backup_registration.xml - qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) + qtbackup.path = c:/private/10202d56/import/packages/$$replace(TARGET.UID3, 0x,) DEPLOYMENT += qtlibraries \ qtbackup \ diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 674064fc83..4953490497 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -10,7 +10,7 @@ requires(contains(QT_CONFIG,private_tests)) wince*|symbian: { addFiles.sources = testdata addFiles.path = . - timesFont.sources = C:/Windows/Fonts/times.ttf + timesFont.sources = c:/windows/fonts/times.ttf timesFont.path = . DEPLOYMENT += addFiles timesFont } -- cgit v1.2.3 From e35d0af6ef3016b27bfd6dca1cf5c8f8a153fc04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Niemel=C3=A4?= Date: Thu, 26 May 2011 10:11:17 +0300 Subject: Fixed CI-errors caused by qmlshadersplugin addition. These are fixes for CI-issues caused by db20b6c03b6a93ab3e483cd85d5d0a923c3d3430 Reviewed-by: Kim Gronholm --- src/imports/shaders/scenegraph/qsggeometry.cpp | 4 +- src/imports/shaders/scenegraph/qsggeometry.h | 4 +- src/imports/shaders/shadereffectitem.cpp | 4 +- src/imports/shaders/shadereffectsource.cpp | 6 +-- .../qmlshadersplugin/qmlshadersplugin.pro | 20 +++++----- .../qmlshadersplugin/tst_qmlshadersplugin.cpp | 6 +-- .../declarative/qmlshadersplugin/GaussianBlur.qml | 43 +++++++++++++++++++++- .../qmlshadersplugin/GaussianDirectionalBlur.qml | 43 +++++++++++++++++++++- .../qmlshadersplugin/GaussianDropShadow.qml | 43 +++++++++++++++++++++- .../qmlshadersplugin/TestGaussianDropShadow.qml | 43 +++++++++++++++++++++- .../declarative/qmlshadersplugin/TestWater.qml | 42 ++++++++++++++++++++- .../declarative/qmlshadersplugin/Water.qml | 43 +++++++++++++++++++++- .../qmlshadersplugin/qmlshadersplugin.pro | 20 +++++----- .../qmlshadersplugin/tst_performance.cpp | 4 +- .../qml/qmlshadersplugintest/TestActive.qml | 2 +- .../qml/qmlshadersplugintest/TestBasic.qml | 2 +- .../qml/qmlshadersplugintest/TestBlending.qml | 2 +- .../qml/qmlshadersplugintest/TestBlendingModes.qml | 2 +- .../qmlshadersplugintest/TestEffectHierarchy.qml | 2 +- .../TestEffectInsideAnotherEffect.qml | 2 +- .../qml/qmlshadersplugintest/TestFormat.qml | 2 +- .../qmlshadersplugintest/TestFragmentShader.qml | 2 +- .../qml/qmlshadersplugintest/TestGrab.qml | 2 +- .../qml/qmlshadersplugintest/TestHideOriginal.qml | 2 +- .../qmlshadersplugintest/TestHorizontalWrap.qml | 2 +- .../qmlshadersplugintest/TestImageFiltering.qml | 2 +- .../qml/qmlshadersplugintest/TestImageMargins.qml | 2 +- .../TestImageMarginsWithTextureSize.qml | 2 +- .../qml/qmlshadersplugintest/TestImageMipmap.qml | 2 +- .../qml/qmlshadersplugintest/TestItemMargins.qml | 2 +- .../TestItemMarginsWithTextureSize.qml | 2 +- .../qml/qmlshadersplugintest/TestLive.qml | 2 +- .../qmlshadersplugintest/TestMeshResolution.qml | 2 +- .../qml/qmlshadersplugintest/TestOneSource.qml | 2 +- .../qml/qmlshadersplugintest/TestOpacity.qml | 2 +- .../qml/qmlshadersplugintest/TestRotation.qml | 2 +- .../qml/qmlshadersplugintest/TestScale.qml | 2 +- .../qml/qmlshadersplugintest/TestTextureSize.qml | 2 +- .../qmlshadersplugintest/TestTwiceOnSameSource.qml | 2 +- .../qml/qmlshadersplugintest/TestTwoSources.qml | 2 +- .../qml/qmlshadersplugintest/TestVertexShader.qml | 2 +- .../qml/qmlshadersplugintest/TestVerticalWrap.qml | 2 +- .../qml/qmlshadersplugintest/TestWrapRepeat.qml | 2 +- .../qml/qmlshadersplugintest/main.qml | 2 +- 44 files changed, 315 insertions(+), 70 deletions(-) diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp index 14ee4db795..05c111aca5 100644 --- a/src/imports/shaders/scenegraph/qsggeometry.cpp +++ b/src/imports/shaders/scenegraph/qsggeometry.cpp @@ -1,10 +1,10 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt scene graph research project. +** This file is part of the QML Shaders plugin of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/imports/shaders/scenegraph/qsggeometry.h b/src/imports/shaders/scenegraph/qsggeometry.h index 0055392a49..b6663f8866 100644 --- a/src/imports/shaders/scenegraph/qsggeometry.h +++ b/src/imports/shaders/scenegraph/qsggeometry.h @@ -1,10 +1,10 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt scene graph research project. +** This file is part of the QML Shaders plugin of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp index a32168e9cd..5bb906ccfb 100644 --- a/src/imports/shaders/shadereffectitem.cpp +++ b/src/imports/shaders/shadereffectitem.cpp @@ -302,7 +302,7 @@ void ShaderEffectItem::setVertexShader(const QString &code) /*! \qmlproperty bool ShaderEffectItem::blending - This property defines wheter item is drawn using blending. + This property defines whether item is drawn using blending. If true, the RGBA pixel output from the fragment shader is blended with the pixel RGBA-values already in the framebuffer. @@ -565,7 +565,7 @@ void ShaderEffectItem::bindGeometry() continue; Q_ASSERT_X(j < m_geometry.attributeCount(), "ShaderEffectItem::bindGeometry()", "Geometry lacks attribute required by material"); const QSGGeometry::Attribute &a = m_geometry.attributes()[j]; - Q_ASSERT_X(j == a.position, "ShaderEffectItem::bindGeometry()", "Geometry does not have continous attribute positions"); + Q_ASSERT_X(j == a.position, "ShaderEffectItem::bindGeometry()", "Geometry does not have continuous attribute positions"); #if defined(QT_OPENGL_ES_2) GLboolean normalize = a.type != GL_FLOAT; #else diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp index 0a133bd6c9..7ceb7c2f44 100644 --- a/src/imports/shaders/shadereffectsource.cpp +++ b/src/imports/shaders/shadereffectsource.cpp @@ -229,7 +229,7 @@ void ShaderEffectSource::setTextureSize(const QSize &size) /*! \property ShaderEffectSource::live - \brief the flag tells wheter source item content is changing between frames. + \brief the flag tells whether source item content is changing between frames. */ void ShaderEffectSource::setLive(bool s) @@ -245,7 +245,7 @@ void ShaderEffectSource::setLive(bool s) /*! \qmlproperty bool ShaderEffectSource::hideSource - This property holds the flag to define wheter the original source item is + This property holds the flag to define whether the original source item is hidden when the effect item is drawn. The default value is false. @@ -253,7 +253,7 @@ void ShaderEffectSource::setLive(bool s) /*! \property ShaderEffectSource::hideSource - \brief the flag tells wheter original source item content should be hidden. + \brief the flag tells whether original source item content should be hidden. */ void ShaderEffectSource::setHideSource(bool hide) diff --git a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro index 6225a8f661..aa0e07a048 100644 --- a/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro +++ b/tests/auto/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -4,15 +4,15 @@ QT += opengl declarative SOURCES += tst_qmlshadersplugin.cpp SOURCES += \ - ../../../../src/imports/shaders/src/shadereffectitem.cpp \ - ../../../../src/imports/shaders/src/shadereffectsource.cpp \ - ../../../../src/imports/shaders/src/shadereffect.cpp \ - ../../../../src/imports/shaders/src/shadereffectbuffer.cpp \ - ../../../../src/imports/shaders/src/scenegraph/qsggeometry.cpp + ../../../../src/imports/shaders/shadereffectitem.cpp \ + ../../../../src/imports/shaders/shadereffectsource.cpp \ + ../../../../src/imports/shaders/shadereffect.cpp \ + ../../../../src/imports/shaders/shadereffectbuffer.cpp \ + ../../../../src/imports/shaders/scenegraph/qsggeometry.cpp HEADERS += \ - ../../../../src/imports/shaders/src/shadereffectitem.h \ - ../../../../src/imports/shaders/src/shadereffectsource.h \ - ../../../../src/imports/shaders/src/shadereffect.h \ - ../../../../src/imports/shaders/src/shadereffectbuffer.h \ - ../../../../src/imports/shaders/src/scenegraph/qsggeometry.h + ../../../../src/imports/shaders/shadereffectitem.h \ + ../../../../src/imports/shaders/shadereffectsource.h \ + ../../../../src/imports/shaders/shadereffect.h \ + ../../../../src/imports/shaders/shadereffectbuffer.h \ + ../../../../src/imports/shaders/scenegraph/qsggeometry.h diff --git a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp index 61fe2ee19f..a904a88946 100644 --- a/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp +++ b/tests/auto/declarative/qmlshadersplugin/tst_qmlshadersplugin.cpp @@ -41,9 +41,9 @@ #include #include -#include "../../../../src/imports/shaders/src/shadereffectitem.h" -#include "../../../../src/imports/shaders/src/shadereffectsource.h" -#include "../../../../src/imports/shaders/src/shadereffect.h" +#include "../../../../src/imports/shaders/shadereffectitem.h" +#include "../../../../src/imports/shaders/shadereffectsource.h" +#include "../../../../src/imports/shaders/shadereffect.h" static const char qt_default_vertex_code[] = "uniform highp mat4 qt_ModelViewProjectionMatrix;\n" diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml index 4424b0b03d..ee4c029622 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianBlur.qml @@ -1,4 +1,45 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml index 33f576b439..e09dde2604 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDirectionalBlur.qml @@ -1,4 +1,45 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 import Qt.labs.shaders 1.0 // Note 1. This shader implements gaussian blur without dynamic array access from inside shader loops (Optional feature in OpenGLES 2.0). diff --git a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml index be78c86c24..4e8c8d30f5 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/GaussianDropShadow.qml @@ -1,4 +1,45 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml index 5843d55358..4831758002 100755 --- a/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestGaussianDropShadow.qml @@ -1,4 +1,45 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml index 4d90950102..c4fbc2aa37 100755 --- a/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/TestWater.qml @@ -1,4 +1,44 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/benchmarks/declarative/qmlshadersplugin/Water.qml b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml index 02486dd0f7..6a1ec1c7cd 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/Water.qml +++ b/tests/benchmarks/declarative/qmlshadersplugin/Water.qml @@ -1,4 +1,45 @@ -import Qt 4.7 +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro index 9fb8852c68..c4f692526c 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro +++ b/tests/benchmarks/declarative/qmlshadersplugin/qmlshadersplugin.pro @@ -4,18 +4,18 @@ TARGET = tst_performance SOURCES += \ tst_performance.cpp \ - ../../../../src/imports/shaders/src/shadereffectitem.cpp \ - ../../../../src/imports/shaders/src/shadereffectsource.cpp \ - ../../../../src/imports/shaders/src/shadereffect.cpp \ - ../../../../src/imports/shaders/src/shadereffectbuffer.cpp \ - ../../../../src/imports/shaders/src/scenegraph/qsggeometry.cpp + ../../../../src/imports/shaders/shadereffectitem.cpp \ + ../../../../src/imports/shaders/shadereffectsource.cpp \ + ../../../../src/imports/shaders/shadereffect.cpp \ + ../../../../src/imports/shaders/shadereffectbuffer.cpp \ + ../../../../src/imports/shaders/scenegraph/qsggeometry.cpp HEADERS += \ - ../../../../src/imports/shaders/src/shadereffectitem.h \ - ../../../../src/imports/shaders/src/shadereffectsource.h \ - ../../../../src/imports/shaders/src/shadereffect.h \ - ../../../../src/imports/shaders/src/shadereffectbuffer.h \ - ../../../../src/imports/shaders/src/scenegraph/qsggeometry.h + ../../../../src/imports/shaders/shadereffectitem.h \ + ../../../../src/imports/shaders/shadereffectsource.h \ + ../../../../src/imports/shaders/shadereffect.h \ + ../../../../src/imports/shaders/shadereffectbuffer.h \ + ../../../../src/imports/shaders/scenegraph/qsggeometry.h OTHER_FILES += \ *.qml \ diff --git a/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp index 6ee6979aef..728334a554 100644 --- a/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp +++ b/tests/benchmarks/declarative/qmlshadersplugin/tst_performance.cpp @@ -41,8 +41,8 @@ #include #include -#include "../../../../src/imports/shaders/src/shadereffectitem.h" -#include "../../../../src/imports/shaders/src/shadereffectsource.h" +#include "../../../../src/imports/shaders/shadereffectitem.h" +#include "../../../../src/imports/shaders/shadereffectsource.h" //#include "../../../src/shadereffect.h" class BenchmarkItem : public QDeclarativeItem diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml index 8aaee0dfcb..303c7db11c 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestActive.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml index c7ec9084a4..b70cac09d4 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBasic.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml index d7ce837bf0..0c31419a90 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlending.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml index bd60c68172..47f5bc358a 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestBlendingModes.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Item { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml index e3a4c80d11..1cad5b1f14 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectHierarchy.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml index ab845570e5..1446f9ba87 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestEffectInsideAnotherEffect.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml index 9b1c697a03..df5e06d8ff 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFormat.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml index 0a7f261af6..d17035865b 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestFragmentShader.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml index 6a2083529a..08e9319c11 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestGrab.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml index 40277459ae..1cd449f057 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHideOriginal.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml index 92436a8aa6..3b94389bd2 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml index 07da7b8f98..9d990d0a96 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageFiltering.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml index 8bfafa9624..3ad2b50063 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMargins.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml index 61f947a7ee..453bbaff79 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMarginsWithTextureSize.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml index 56b81686e2..a51068db10 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestImageMipmap.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml index 26c6f57dde..94f7824ee4 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMargins.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml index abbf8f4833..83784c35f0 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestItemMarginsWithTextureSize.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml index 0d3553b561..6db568d6f9 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestLive.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml index e8ddc61d85..255df36153 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestMeshResolution.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml index 8b92247a49..117ae65cb4 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOneSource.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml index af5ecf75b8..00af373ea6 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestOpacity.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml index 4262ebc7cb..c4435faf34 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestRotation.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml index b60747c80c..3488eabd8a 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestScale.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml index 5ca08cbd4f..7369efcb50 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTextureSize.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml index e84b84ba66..8098a4daff 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwiceOnSameSource.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml index c8f12af96f..e651cd929b 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestTwoSources.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml index 0e122574af..a7530dc37d 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml index 96171efa06..726b23761d 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml index 35f6b92a06..514e15046b 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 import Qt.labs.shaders 1.0 Rectangle { diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml index 2a857a9f56..1abf524714 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/main.qml @@ -39,7 +39,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 1.0 Item { id: main -- cgit v1.2.3 From 180e6ca43cde0c80dd6e3f9539236ffd259d2bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Niemel=C3=A4?= Date: Thu, 26 May 2011 15:01:49 +0300 Subject: Fixed more CI-errors caused by qmlshadersplugin addition. These are additional fixes for CI-issues caused by db20b6c03b6a93ab3e483cd85d5d0a923c3d3430 Reviewed-by: Kim Gronholm --- src/imports/shaders/shadereffectsource.cpp | 2 +- .../qmlapplicationviewer/qmlapplicationviewer.cpp | 41 ++++++++++++++++++++++ .../qmlapplicationviewer/qmlapplicationviewer.h | 41 ++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp index 7ceb7c2f44..dec3bb040e 100644 --- a/src/imports/shaders/shadereffectsource.cpp +++ b/src/imports/shaders/shadereffectsource.cpp @@ -216,7 +216,7 @@ void ShaderEffectSource::setTextureSize(const QSize &size) /*! \qmlproperty bool ShaderEffectSource::live - This property holds the optimization flag to define wheter the source item content is changing or + This property holds the optimization flag to define whether the source item content is changing or static. If value true is assigned to this property, source item content is re-rendered into a diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp index 51b5fcc835..b5b43bfd83 100644 --- a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.cpp @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + // checksum 0xdf1f version 0x10008 #include "qmlapplicationviewer.h" diff --git a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h index ea784310cf..4d1a38c8d3 100644 --- a/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h +++ b/tests/manual/declarative/qmlshadersplugin/qmlapplicationviewer/qmlapplicationviewer.h @@ -1,3 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QML Shaders plugin of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, 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. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + // checksum 0x39ee version 0x10008 #ifndef QMLAPPLICATIONVIEWER_H #define QMLAPPLICATIONVIEWER_H -- cgit v1.2.3 From 1a5efee93dd78d5c4962e69ee1f6d6b99d8b9aab Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 26 May 2011 16:26:04 +0300 Subject: Predictive text is not committed when writing in a QLineEdit QCoeFepInputContext is very aggressive committing its preedit string. When AVKON FEP opens any of its subwindows, it steals the focus from editable widget, which causes preedit string to get committed. This makes the input context almost unusable with T9 word prediction. As it is rather difficult to prevent focus loss in these types of use scenarios, replace the committed string with user selected word when suggested word list is closed. Task-number: QTBUG-15031 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_p.h | 1 + src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 32 +++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index 913d19887c..e929880253 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -159,6 +159,7 @@ private: MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler; QBasicTimer m_tempPreeditStringTimeout; bool m_hasTempPreeditString; + QString m_cachedPreeditString; int m_splitViewResizeBy; Qt::WindowStates m_splitViewPreviousWindowStates; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 4f9c4c9fd2..67330e21ed 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -136,6 +136,16 @@ QCoeFepInputContext::~QCoeFepInputContext() void QCoeFepInputContext::reset() { + Qt::InputMethodHints currentHints = Qt::ImhNone; + if (focusWidget()) { + QWidget *proxy = focusWidget()->focusProxy(); + currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints(); + } + // Store a copy of preedit text, if prediction is active and input context is reseted. + // This is to ensure that we can replace preedit string after losing focus to FEP manager's + // internal sub-windows. + if (m_cachedPreeditString.isEmpty() && !(currentHints & Qt::ImhNoPredictiveText)) + m_cachedPreeditString = m_preeditString; commitCurrentString(true); } @@ -170,6 +180,8 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w) void QCoeFepInputContext::widgetDestroyed(QWidget *w) { + m_cachedPreeditString.clear(); + // Make sure that the input capabilities of whatever new widget got focused are queried. CCoeControl *ctrl = w->effectiveWinId(); if (ctrl->IsFocused()) { @@ -903,6 +915,8 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, if (!w) return; + m_cachedPreeditString.clear(); + commitTemporaryPreeditString(); QList attributes; @@ -959,7 +973,10 @@ void QCoeFepInputContext::UpdateFepInlineTextL(const TDesC& aNewInlineText, QVariant())); QString newPreeditString = qt_TDesC2QString(aNewInlineText); QInputMethodEvent event(newPreeditString, attributes); - if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) { + if (!m_cachedPreeditString.isEmpty()) { + event.setCommitString(QLatin1String(""), -m_cachedPreeditString.length(), m_cachedPreeditString.length()); + m_cachedPreeditString.clear(); + } else if (newPreeditString.isEmpty() && m_preeditString.isEmpty()) { // In Symbian world this means "erase last character". event.setCommitString(QLatin1String(""), -1, 1); } @@ -1149,7 +1166,18 @@ void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction) m_hasTempPreeditString = false; - if (cancelFepTransaction) { + //Only cancel FEP transactions with prediction, when there is still active window. + Qt::InputMethodHints currentHints = Qt::ImhNone; + if (focusWidget()) { + if (focusWidget()->focusProxy()) + currentHints = focusWidget()->focusProxy()->inputMethodHints(); + else + currentHints = focusWidget()->inputMethodHints(); + } + bool predictive = !(currentHints & Qt::ImhNoPredictiveText); + bool widgetAndWindowAvailable = QApplication::activeWindow() && focusWidget(); + + if (cancelFepTransaction && ((predictive && widgetAndWindowAvailable) || !predictive)) { CCoeFep* fep = CCoeEnv::Static()->Fep(); if (fep) fep->CancelTransaction(); -- cgit v1.2.3 From fbe0d24bdd429248dbf9e9be592f15fd7b1648bc Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 14 Apr 2011 10:36:38 +0300 Subject: Remove unnecessary QtQuick 1.1 effectiveLayoutDirection, effectiveHorizontalAlignment and anchors.mirror properties * these properties are seldomly used * they confuse developers that do not care about right-to-left user interfaces * LayoutMirroring.enabled property can be used instead to determine if mirroring is enabled * if needed, you can easily determine the effective layout directions and alignments with a little bit of JavaScript: function effectiveLayoutDirection() { if (LayoutMirroring.enabled) return (listView.layoutDirection == Qt.LeftToRight) ? Qt.RightToLeft : Qt.LeftToRight; else return listView.layoutDirection; } Task-number: QTBUG-11042 Reviewed-by: Martin Jones --- doc/src/declarative/righttoleft.qdoc | 17 +++---- doc/src/declarative/whatsnew.qdoc | 14 +---- .../layoutdirection/layoutdirection.qml | 12 ++++- .../graphicsitems/qdeclarativeanchors_p.h | 2 - .../graphicsitems/qdeclarativegridview.cpp | 22 +++----- .../graphicsitems/qdeclarativegridview_p.h | 2 - src/declarative/graphicsitems/qdeclarativeitem.cpp | 1 - .../graphicsitems/qdeclarativelistview.cpp | 20 +++----- .../graphicsitems/qdeclarativelistview_p.h | 2 - .../graphicsitems/qdeclarativepositioners.cpp | 59 +++++++--------------- .../graphicsitems/qdeclarativepositioners_p.h | 6 --- src/declarative/graphicsitems/qdeclarativetext.cpp | 9 +--- src/declarative/graphicsitems/qdeclarativetext_p.h | 2 - .../graphicsitems/qdeclarativetextedit.cpp | 8 +-- .../graphicsitems/qdeclarativetextedit_p.h | 2 - .../graphicsitems/qdeclarativetextinput.cpp | 9 ++-- .../graphicsitems/qdeclarativetextinput_p.h | 2 - .../tst_qdeclarativeanchors.cpp | 5 +- 18 files changed, 58 insertions(+), 136 deletions(-) diff --git a/doc/src/declarative/righttoleft.qdoc b/doc/src/declarative/righttoleft.qdoc index 7db61367b5..cafc702404 100644 --- a/doc/src/declarative/righttoleft.qdoc +++ b/doc/src/declarative/righttoleft.qdoc @@ -64,8 +64,7 @@ This default locale-based alignment can be overriden by setting the \c horizonta property for the text element, or by enabling layout mirroring using the \l LayoutMirroring attached property, which causes any explicit left and right horizontal alignments to be mirrored. Note that when \l LayoutMirroring is set, the \c horizontalAlignment property value remains unchanged; -the effective alignment of the text element that takes the mirroring into account can be read from the -\c effectiveHorizontalAlignment property. +use the property \c LayoutMirroring.enabled instead to query whether the mirroring is in effect. \snippet doc/src/snippets/declarative/righttoleft.qml 0 @@ -79,9 +78,9 @@ property for controlling the horizontal direction of the layouts. Setting \c lay the left-to-right layout direction. The horizontal layout direction can also be reversed through the \l LayoutMirroring attached property. -This causes the effective \c layoutDirection of positioners and views to be mirrored. Note the actual value -of the \c layoutDirection property will remain unchanged; the effective layout direction of positioners and -views that takes the mirroring into account can be read from the \c effectiveLayoutDirection property. +This causes the effective \c layoutDirection of positioners and views to be mirrored. Note though that the actual +value of the \c layoutDirection property will remain unchanged; use the property \c LayoutMirroring.enabled instead +to query whether the mirroring is in effect. \snippet doc/src/snippets/declarative/righttoleft.qml 1 @@ -101,12 +100,8 @@ Or set all child elements to also inherit the layout direction: \snippet doc/src/snippets/declarative/righttoleft.qml 3 Applying mirroring in this manner does not change the actual value of the relevant anchor, -\c layoutDirection or \c horizontalAlignment properties. The separate read-only property -\c effectiveLayoutDirection can be used to query the effective layout -direction of positioners and model views that takes the mirroring into account. Similarly the \l Text, -\l TextInput and \l TextEdit elements have gained the read-only property \c effectiveHorizontalAlignment -for querying the effective visual alignment of text. For anchors, the read only -\l {Item::anchors}{anchors.mirrored} property reflects whether anchors have been mirrored. +\c layoutDirection or \c horizontalAlignment properties. You can use \c LayoutMirroring.enabled to +query whether the mirroring is in effect. Note that application layouts and animations that are defined using \l {Item::}{x} property values (as opposed to anchors or positioner elements) are not affected by the \l LayoutMirroring attached property. diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc index 6eb1548ab2..c36a88c7ff 100644 --- a/doc/src/declarative/whatsnew.qdoc +++ b/doc/src/declarative/whatsnew.qdoc @@ -41,13 +41,6 @@ PinchArea provides support for the common two finger pinch gesture. \l {LayoutMirroring}{Layout mirroring} is useful when you need to support both left-to-right and right-to-left layout versions of your application that target different language areas. -\section2 Anchors - -Added the following property: -\list -\o \l {Item::}{anchors.mirrored} -\endlist - \section2 Text Added the following properties: @@ -57,7 +50,6 @@ Added the following properties: \o \l {Text::}{lineCount} \o \l {Text::}{maximumLineCount} \o \l {Text::}{truncated} -\o \l {Text::}{effectiveHorizontalAlignment} \endlist horizontalAlignment now accepts Text.AlignJustify alignment mode. @@ -70,7 +62,6 @@ Added the following properties, methods and signal handlers: \o \l {TextEdit::}{lineCount} \o \l {TextEdit::}{inputMethodComposing} \o \l {TextEdit::}{mouseSelectionMode} -\o \l {TextEdit::}{effectiveHorizontalAlignment} \o \l {TextEdit::}{deselect()} \o \l {TextEdit::}{isRightToLeft()} \o \l {TextEdit::}{moveCursorSelection()} to enable selection by word @@ -84,7 +75,6 @@ Added the following properties and methods: \o \l {TextInput::}{canPaste} \o \l {TextInput::}{inputMethodComposing} \o \l {TextInput::}{mouseSelectionMode} -\o \l {TextInput::}{effectiveHorizontalAlignment} \o \l {TextInput::}{deselect()} \o \l {TextInput::}{isRightToLeft()} \o \l {TextInput::}{moveCursorSelection()} to enable selection by word @@ -125,17 +115,15 @@ Added the following property: Added the following properties and methods: \list \o \l{ListView::}{layoutDirection} -\o \l{ListView::}{effectiveLayoutDirection} \o \l{ListView::}{positionViewAtBeginning()} \o \l{ListView::}{positionViewAtEnd()} \endlist \section2 Flow, Grid and Row -Added the following properties: +Added the following property: \list \o \l{Flow::}{layoutDirection} -\o \l{Flow::}{effectiveLayoutDirection} \endlist \section2 Repeater diff --git a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml index b4efebe61a..197ea39e86 100644 --- a/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml +++ b/examples/declarative/righttoleft/layoutdirection/layoutdirection.qml @@ -226,7 +226,17 @@ Rectangle { Component { id: viewDelegate Item { - width: (listView.effectiveLayoutDirection == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50 + function effectiveLayoutDirection() { + if (LayoutMirroring.enabled) + if (listView.layoutDirection == Qt.LeftToRight) + return Qt.RightToLeft; + else + return Qt.LeftToRight; + else + return listView.layoutDirection; + } + + width: (effectiveLayoutDirection() == Qt.LeftToRight ? (index == 48 - 1) : (index == 0)) ? 40 : 50 Rectangle { width: 40; height: 40 color: Qt.rgba(0.5+(48 - index)*Math.random()/48, diff --git a/src/declarative/graphicsitems/qdeclarativeanchors_p.h b/src/declarative/graphicsitems/qdeclarativeanchors_p.h index 388d6b9c34..f07ac23910 100644 --- a/src/declarative/graphicsitems/qdeclarativeanchors_p.h +++ b/src/declarative/graphicsitems/qdeclarativeanchors_p.h @@ -79,7 +79,6 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAnchors : public QObject Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) Q_PROPERTY(QGraphicsObject *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged) Q_PROPERTY(QGraphicsObject *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged) - Q_PROPERTY(bool mirrored READ mirrored NOTIFY mirroredChanged REVISION 1) public: QDeclarativeAnchors(QObject *parent=0); @@ -184,7 +183,6 @@ Q_SIGNALS: void verticalCenterOffsetChanged(); void horizontalCenterOffsetChanged(); void baselineOffsetChanged(); - Q_REVISION(1) void mirroredChanged(); private: friend class QDeclarativeItem; diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 460f2c3597..184569e109 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -206,7 +206,6 @@ public: void mirrorChange() { Q_Q(QDeclarativeGridView); regenerate(); - emit q->effectiveLayoutDirectionChanged(); } qreal position() const { @@ -1802,9 +1801,12 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode) on the \l GridView:flow property. \endlist - \bold Note: If GridView::flow is set to GridView.LeftToRight, this is not to be confused if - GridView::layoutDirection is set to Qt.RightToLeft. The GridView.LeftToRight flow value simply - indicates that the flow is horizontal. + When using the attached property \l {LayoutMirroring::enabled} for locale layouts, + the layout direction of the grid view will be mirrored. However, the actual property + \c layoutDirection will remain unchanged. You can use the property + \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored. + + \sa {LayoutMirroring}{LayoutMirroring} */ Qt::LayoutDirection QDeclarativeGridView::layoutDirection() const @@ -1820,21 +1822,9 @@ void QDeclarativeGridView::setLayoutDirection(Qt::LayoutDirection layoutDirectio d->layoutDirection = layoutDirection; d->regenerate(); emit layoutDirectionChanged(); - emit effectiveLayoutDirectionChanged(); } } -/*! - \qmlproperty enumeration GridView::effectiveLayoutDirection - This property holds the effective layout direction of the grid. - - When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, - the visual layout direction of the grid will be mirrored. However, the - property \l {GridView::layoutDirection}{layoutDirection} will remain unchanged. - - \sa GridView::layoutDirection, {LayoutMirroring}{LayoutMirroring} -*/ - Qt::LayoutDirection QDeclarativeGridView::effectiveLayoutDirection() const { Q_D(const QDeclarativeGridView); diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h index 4d99a14d78..628e98ec41 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview_p.h +++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h @@ -75,7 +75,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeGridView : public QDeclarativeFlickable Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1) - Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1) Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged) Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) Q_PROPERTY(int cellWidth READ cellWidth WRITE setCellWidth NOTIFY cellWidthChanged) @@ -194,7 +193,6 @@ Q_SIGNALS: void delegateChanged(); void flowChanged(); Q_REVISION(1) void layoutDirectionChanged(); - Q_REVISION(1) void effectiveLayoutDirectionChanged(); void keyNavigationWrapsChanged(); void cacheBufferChanged(); void snapModeChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 6602dda28b..93d32229a1 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -898,7 +898,6 @@ void QDeclarativeItemPrivate::setLayoutMirror(bool mirror) _anchors->d_func()->fillChanged(); _anchors->d_func()->centerInChanged(); _anchors->d_func()->updateHorizontalAnchors(); - emit _anchors->mirroredChanged(); } mirrorChange(); if (attachedLayoutDirection) { diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 79d67e72fb..734c73240e 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -298,7 +298,6 @@ public: void mirrorChange() { Q_Q(QDeclarativeListView); regenerate(); - emit q->effectiveLayoutDirectionChanged(); } bool isRightToLeft() const { @@ -2169,7 +2168,12 @@ void QDeclarativeListView::setOrientation(QDeclarativeListView::Orientation orie \o Qt.RightToLeft - Items will be laid out from right to let. \endlist - \sa ListView::effectiveLayoutDirection + When using the attached property \l {LayoutMirroring::enabled} for locale layouts, + the layout direction of the horizontal list will be mirrored. However, the actual property + \c layoutDirection will remain unchanged. You can use the property + \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored. + + \sa {LayoutMirroring}{LayoutMirroring} */ Qt::LayoutDirection QDeclarativeListView::layoutDirection() const @@ -2185,21 +2189,9 @@ void QDeclarativeListView::setLayoutDirection(Qt::LayoutDirection layoutDirectio d->layoutDirection = layoutDirection; d->regenerate(); emit layoutDirectionChanged(); - emit effectiveLayoutDirectionChanged(); } } -/*! - \qmlproperty enumeration ListView::effectiveLayoutDirection - This property holds the effective layout direction of the horizontal list. - - When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, - the visual layout direction of the horizontal list will be mirrored. However, the - property \l {ListView::layoutDirection}{layoutDirection} will remain unchanged. - - \sa ListView::layoutDirection, {LayoutMirroring}{LayoutMirroring} -*/ - Qt::LayoutDirection QDeclarativeListView::effectiveLayoutDirection() const { Q_D(const QDeclarativeListView); diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 3b12225588..70ca9de650 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -114,7 +114,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeListView : public QDeclarativeFlickable Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged) Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1) - Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1) Q_PROPERTY(bool keyNavigationWraps READ isWrapEnabled WRITE setWrapEnabled NOTIFY keyNavigationWrapsChanged) Q_PROPERTY(int cacheBuffer READ cacheBuffer WRITE setCacheBuffer NOTIFY cacheBufferChanged) Q_PROPERTY(QDeclarativeViewSection *section READ sectionCriteria CONSTANT) @@ -229,7 +228,6 @@ Q_SIGNALS: void spacingChanged(); void orientationChanged(); Q_REVISION(1) void layoutDirectionChanged(); - Q_REVISION(1) void effectiveLayoutDirectionChanged(); void currentIndexChanged(); void currentSectionChanged(); void highlightMoveSpeedChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index e76fc03cd2..55ec96137b 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -597,7 +597,12 @@ QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent) the right anchor remains to the right of the row. \endlist - \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + When using the attached property \l {LayoutMirroring::enabled} for locale layouts, + the visual layout direction of the row positioner will be mirrored. However, the + property \c layoutDirection will remain unchanged. You can use the property + \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored. + + \sa Grid::layoutDirection, Flow::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring} */ Qt::LayoutDirection QDeclarativeRow::layoutDirection() const { @@ -616,21 +621,9 @@ void QDeclarativeRow::setLayoutDirection(Qt::LayoutDirection layoutDirection) d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry); prePositioning(); emit layoutDirectionChanged(); - emit effectiveLayoutDirectionChanged(); } } -/*! - \qmlproperty enumeration Row::effectiveLayoutDirection - This property holds the effective layout direction of the row positioner. - - When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, - the visual layout direction of the row positioner will be mirrored. However, the - property \l {Row::layoutDirection}{layoutDirection} will remain unchanged. - - \sa Row::layoutDirection, {LayoutMirroring}{LayoutMirroring} -*/ - Qt::LayoutDirection QDeclarativeRow::effectiveLayoutDirection() const { return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this); @@ -900,7 +893,12 @@ void QDeclarativeGrid::setFlow(Flow flow) \l Grid::flow property. \endlist - \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + When using the attached property \l {LayoutMirroring::enabled} for locale layouts, + the visual layout direction of the grid positioner will be mirrored. However, the + property \c layoutDirection will remain unchanged. You can use the property + \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored. + + \sa Flow::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring} */ Qt::LayoutDirection QDeclarativeGrid::layoutDirection() const { @@ -918,22 +916,10 @@ void QDeclarativeGrid::setLayoutDirection(Qt::LayoutDirection layoutDirection) else d->removeItemChangeListener(d, QDeclarativeItemPrivate::Geometry); prePositioning(); - emit layoutDirectionChanged(); - emit effectiveLayoutDirectionChanged(); + emit layoutDirectionChanged();; } } -/*! - \qmlproperty enumeration Grid::effectiveLayoutDirection - This property holds the effective layout direction of the grid positioner. - - When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, - the visual layout direction of the grid positioner will be mirrored. However, the - property \l {Grid::layoutDirection}{layoutDirection} will remain unchanged. - - \sa Grid::layoutDirection, {LayoutMirroring}{LayoutMirroring} -*/ - Qt::LayoutDirection QDeclarativeGrid::effectiveLayoutDirection() const { return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this); @@ -1265,7 +1251,12 @@ void QDeclarativeFlow::setFlow(Flow flow) \l Flow::flow property. \endlist - \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example} + When using the attached property \l {LayoutMirroring::enabled} for locale layouts, + the visual layout direction of the flow positioner will be mirrored. However, the + property \c layoutDirection will remain unchanged. You can use the property + \l {LayoutMirroring::enabled} to determine whether the direction has been mirrored. + + \sa Grid::layoutDirection, Row::layoutDirection, {declarative/righttoleft/layoutdirection}{Layout directions example}, {LayoutMirroring}{LayoutMirroring} */ Qt::LayoutDirection QDeclarativeFlow::layoutDirection() const @@ -1281,21 +1272,9 @@ void QDeclarativeFlow::setLayoutDirection(Qt::LayoutDirection layoutDirection) d->layoutDirection = layoutDirection; prePositioning(); emit layoutDirectionChanged(); - emit effectiveLayoutDirectionChanged(); } } -/*! - \qmlproperty enumeration Flow::effectiveLayoutDirection - This property holds the effective layout direction of the flow positioner. - - When using the attached property \l {LayoutMirroring::enabled}{LayoutMirroring::enabled} for locale layouts, - the visual layout direction of the grid positioner will be mirrored. However, the - property \l {Flow::layoutDirection}{layoutDirection} will remain unchanged. - - \sa Flow::layoutDirection, {LayoutMirroring}{LayoutMirroring} -*/ - Qt::LayoutDirection QDeclarativeFlow::effectiveLayoutDirection() const { return QDeclarativeBasePositionerPrivate::getEffectiveLayoutDirection(this); diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h index 214c04ff85..5c6c3c8911 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h +++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h @@ -130,7 +130,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeRow: public QDeclarativeBasePositioner { Q_OBJECT Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1) - Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1) public: QDeclarativeRow(QDeclarativeItem *parent=0); @@ -140,7 +139,6 @@ public: Q_SIGNALS: Q_REVISION(1) void layoutDirectionChanged(); - Q_REVISION(1) void effectiveLayoutDirectionChanged(); protected: virtual void doPositioning(QSizeF *contentSize); @@ -156,7 +154,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeGrid : public QDeclarativeBasePositioner Q_PROPERTY(int columns READ columns WRITE setColumns NOTIFY columnsChanged) Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1) - Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1) public: QDeclarativeGrid(QDeclarativeItem *parent=0); @@ -180,7 +177,6 @@ Q_SIGNALS: void columnsChanged(); void flowChanged(); Q_REVISION(1) void layoutDirectionChanged(); - Q_REVISION(1) void effectiveLayoutDirectionChanged(); protected: virtual void doPositioning(QSizeF *contentSize); @@ -199,7 +195,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeFlow: public QDeclarativeBasePositioner Q_OBJECT Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged REVISION 1) - Q_PROPERTY(Qt::LayoutDirection effectiveLayoutDirection READ effectiveLayoutDirection NOTIFY effectiveLayoutDirectionChanged REVISION 1) public: QDeclarativeFlow(QDeclarativeItem *parent=0); @@ -214,7 +209,6 @@ public: Q_SIGNALS: void flowChanged(); Q_REVISION(1) void layoutDirectionChanged(); - Q_REVISION(1) void effectiveLayoutDirectionChanged(); protected: virtual void doPositioning(QSizeF *contentSize); diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 1d51840783..c2947bef3f 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -1063,7 +1063,6 @@ void QDeclarativeText::setStyleColor(const QColor &color) /*! \qmlproperty enumeration Text::horizontalAlignment \qmlproperty enumeration Text::verticalAlignment - \qmlproperty enumeration Text::effectiveHorizontalAlignment Sets the horizontal and vertical alignment of the text within the Text items width and height. By default, the text is vertically aligned to the top. Horizontal @@ -1079,10 +1078,10 @@ void QDeclarativeText::setStyleColor(const QColor &color) need to either modify the Item::anchors, or set horizontalAlignment to Text.AlignHCenter and bind the width to that of the parent. - When using the attached property LayoutMirroring::enabled to mirror application + When using the attached property \l {LayoutMirroring::enabled} to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment - of Text, use the read-only property \c effectiveHorizontalAlignment. + of Text, use the property \l {LayoutMirroring::enabled}. */ QDeclarativeText::HAlignment QDeclarativeText::hAlign() const { @@ -1132,10 +1131,7 @@ bool QDeclarativeTextPrivate::setHAlign(QDeclarativeText::HAlignment alignment, if (hAlign != alignment || forceAlign) { QDeclarativeText::HAlignment oldEffectiveHAlign = q->effectiveHAlign(); hAlign = alignment; - emit q->horizontalAlignmentChanged(hAlign); - if (oldEffectiveHAlign != q->effectiveHAlign()) - emit q->effectiveHorizontalAlignmentChanged(); return true; } return false; @@ -1157,7 +1153,6 @@ void QDeclarativeTextPrivate::mirrorChange() if (q->isComponentComplete()) { if (!hAlignImplicit && (hAlign == QDeclarativeText::AlignRight || hAlign == QDeclarativeText::AlignLeft)) { updateLayout(); - emit q->effectiveHorizontalAlignmentChanged(); } } } diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h index a1153c254e..d1f5906bc8 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p.h @@ -70,7 +70,6 @@ class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeText : public QDeclarativeImplici Q_PROPERTY(TextStyle style READ style WRITE setStyle NOTIFY styleChanged) Q_PROPERTY(QColor styleColor READ styleColor WRITE setStyleColor NOTIFY styleColorChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged) - Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1) Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged) Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1) @@ -191,7 +190,6 @@ Q_SIGNALS: void paintedSizeChanged(); Q_REVISION(1) void lineHeightChanged(qreal lineHeight); Q_REVISION(1) void lineHeightModeChanged(LineHeightMode mode); - Q_REVISION(1) void effectiveHorizontalAlignmentChanged(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index af2c8f38d7..93fa8a50e3 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -459,7 +459,6 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color) /*! \qmlproperty enumeration TextEdit::horizontalAlignment \qmlproperty enumeration TextEdit::verticalAlignment - \qmlproperty enumeration TextEdit::effectiveHorizontalAlignment Sets the horizontal and vertical alignment of the text within the TextEdit item's width and height. By default, the text alignment follows the natural alignment @@ -481,10 +480,10 @@ void QDeclarativeTextEdit::setSelectedTextColor(const QColor &color) \o TextEdit.AlignVCenter \endlist - When using the attached property LayoutMirroring::enabled to mirror application + When using the attached property \l {LayoutMirroring::enabled} to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment - of TextEdit, use the read-only property \c effectiveHorizontalAlignment. + of TextEdit, use the property \l {LayoutMirroring::enabled}. */ QDeclarativeTextEdit::HAlignment QDeclarativeTextEdit::hAlign() const { @@ -539,8 +538,6 @@ bool QDeclarativeTextEditPrivate::setHAlign(QDeclarativeTextEdit::HAlignment ali QDeclarativeTextEdit::HAlignment oldEffectiveHAlign = q->effectiveHAlign(); hAlign = alignment; emit q->horizontalAlignmentChanged(alignment); - if (oldEffectiveHAlign != q->effectiveHAlign()) - emit q->effectiveHorizontalAlignmentChanged(); return true; } return false; @@ -563,7 +560,6 @@ void QDeclarativeTextEditPrivate::mirrorChange() if (!hAlignImplicit && (hAlign == QDeclarativeTextEdit::AlignRight || hAlign == QDeclarativeTextEdit::AlignLeft)) { updateDefaultTextOption(); q->updateSize(); - emit q->effectiveHorizontalAlignmentChanged(); } } } diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h index 25ca1e7497..7a17bd847f 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h @@ -73,7 +73,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextEdit : public QDeclarativeImplicitSizePa Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged) - Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1) Q_PROPERTY(VAlignment verticalAlignment READ vAlign WRITE setVAlign NOTIFY verticalAlignmentChanged) Q_PROPERTY(WrapMode wrapMode READ wrapMode WRITE setWrapMode NOTIFY wrapModeChanged) Q_PROPERTY(int lineCount READ lineCount NOTIFY lineCountChanged REVISION 1) @@ -249,7 +248,6 @@ Q_SIGNALS: Q_REVISION(1) void linkActivated(const QString &link); Q_REVISION(1) void canPasteChanged(); Q_REVISION(1) void inputMethodComposingChanged(); - Q_REVISION(1) void effectiveHorizontalAlignmentChanged(); public Q_SLOTS: void selectAll(); diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 226cce954d..0d10bb62a5 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -326,7 +326,6 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color) /*! \qmlproperty enumeration TextInput::horizontalAlignment - \qmlproperty enumeration TextInput::effectiveHorizontalAlignment Sets the horizontal alignment of the text within the TextInput item's width and height. By default, the text alignment follows the natural alignment @@ -342,10 +341,10 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color) The valid values for \c horizontalAlignment are \c TextInput.AlignLeft, \c TextInput.AlignRight and \c TextInput.AlignHCenter. - When using the attached property LayoutMirroring::enabled to mirror application + When using the attached property \l {LayoutMirroring::enabled} to mirror application layouts, the horizontal alignment of text will also be mirrored. However, the property \c horizontalAlignment will remain unchanged. To query the effective horizontal alignment - of TextInput, use the read-only property \c effectiveHorizontalAlignment. + of TextInput, use the property \l {LayoutMirroring::enabled}. */ QDeclarativeTextInput::HAlignment QDeclarativeTextInput::hAlign() const { @@ -398,8 +397,6 @@ bool QDeclarativeTextInputPrivate::setHAlign(QDeclarativeTextInput::HAlignment a QDeclarativeTextInput::HAlignment oldEffectiveHAlign = q->effectiveHAlign(); hAlign = alignment; emit q->horizontalAlignmentChanged(alignment); - if (oldEffectiveHAlign != q->effectiveHAlign()) - emit q->effectiveHorizontalAlignmentChanged(); return true; } return false; @@ -422,7 +419,7 @@ void QDeclarativeTextInputPrivate::mirrorChange() if (q->isComponentComplete()) { if (!hAlignImplicit && (hAlign == QDeclarativeTextInput::AlignRight || hAlign == QDeclarativeTextInput::AlignLeft)) { q->updateCursorRectangle(); - emit q->effectiveHorizontalAlignmentChanged(); + updateHorizontalScroll(); } } } diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h index 171db92742..04c6ff453e 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h @@ -71,7 +71,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeTextInput : public QDeclarativeImplicitSizeP Q_PROPERTY(QColor selectedTextColor READ selectedTextColor WRITE setSelectedTextColor NOTIFY selectedTextColorChanged) Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) Q_PROPERTY(HAlignment horizontalAlignment READ hAlign WRITE setHAlign RESET resetHAlign NOTIFY horizontalAlignmentChanged) - Q_PROPERTY(HAlignment effectiveHorizontalAlignment READ effectiveHAlign NOTIFY effectiveHorizontalAlignmentChanged REVISION 1) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged) Q_PROPERTY(bool cursorVisible READ isCursorVisible WRITE setCursorVisible NOTIFY cursorVisibleChanged) Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged) @@ -247,7 +246,6 @@ Q_SIGNALS: Q_REVISION(1) void mouseSelectionModeChanged(SelectionMode mode); Q_REVISION(1) void canPasteChanged(); Q_REVISION(1) void inputMethodComposingChanged(); - Q_REVISION(1) void effectiveHorizontalAlignmentChanged(); protected: virtual void geometryChanged(const QRectF &newGeometry, diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 0442350d0c..3d8d2d94e7 100644 --- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -58,7 +58,6 @@ Q_DECLARE_METATYPE(QDeclarativeAnchors::Anchor) Q_DECLARE_METATYPE(QDeclarativeAnchorLine::AnchorLine) - class tst_qdeclarativeanchors : public QObject { Q_OBJECT @@ -291,7 +290,7 @@ void tst_qdeclarativeanchors::basicAnchorsRTL() QDeclarativeItem* rootItem = qobject_cast(view->rootObject()); foreach(QObject *child, rootItem->children()) { - bool mirrored = QDeclarativeItemPrivate::get(qobject_cast(child))->anchors()->property("mirrored").toBool(); + bool mirrored = QDeclarativeItemPrivate::get(qobject_cast(child))->anchors()->mirrored(); QCOMPARE(mirrored, false); } @@ -299,7 +298,7 @@ void tst_qdeclarativeanchors::basicAnchorsRTL() mirrorAnchors(qobject_cast(child)); foreach(QObject *child, rootItem->children()) { - bool mirrored = QDeclarativeItemPrivate::get(qobject_cast(child))->anchors()->property("mirrored").toBool(); + bool mirrored = QDeclarativeItemPrivate::get(qobject_cast(child))->anchors()->mirrored(); QCOMPARE(mirrored, true); } -- cgit v1.2.3 From 53cdd1c64b0c73fa5fc4833512c0253224b6f013 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 27 May 2011 10:48:18 +0300 Subject: Fix SYMBIAN_VERSION_* ifdeffing QFileDialog and QSoftkeyManager broke in S60 5.3 platform because incorrect version ifdeffing. Task-number: QT-5065 Reviewed-by: Sami Merila --- src/gui/dialogs/qfiledialog_symbian.cpp | 6 +++--- src/gui/kernel/qsoftkeymanager.cpp | 6 +++--- src/gui/kernel/qsoftkeymanager_common_p.h | 2 +- src/gui/kernel/qsoftkeymanager_s60.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp index a4a7a228ba..16ef5b6e3f 100644 --- a/src/gui/dialogs/qfiledialog_symbian.cpp +++ b/src/gui/dialogs/qfiledialog_symbian.cpp @@ -44,7 +44,7 @@ #ifndef QT_NO_FILEDIALOG #include -#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3) +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) #include #include #include @@ -58,7 +58,7 @@ extern QStringList qt_make_filter_list(const QString &filter); // defined in qfi extern QStringList qt_clean_filter_list(const QString &filter); // defined in qfiledialog.cpp enum DialogMode { DialogOpen, DialogSave, DialogFolder }; -#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3) +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) class CExtensionFilter : public MAknFileFilter { public: @@ -104,7 +104,7 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st const QString filter, DialogMode dialogMode) { QString selection; -#if defined(Q_WS_S60) && defined(SYMBIAN_VERSION_SYMBIAN3) +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) TFileName startFolder; if (!startDirectory.isEmpty()) { QString dir = QDir::toNativeSeparators(QFileDialogPrivate::workingDirectory(startDirectory)); diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 7d7c56fe84..c2c4fb2a84 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -50,7 +50,7 @@ #include "private/qsoftkeymanager_s60_p.h" #endif -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 #include "private/qt_s60_p.h" #endif @@ -105,7 +105,7 @@ QSoftKeyManager::QSoftKeyManager() : QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) { QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 int key = 0; switch (standardKey) { case OkSoftKey: @@ -171,7 +171,7 @@ void QSoftKeyManager::cleanupHash(QObject *obj) Q_D(QSoftKeyManager); QAction *action = qobject_cast(obj); d->keyedActions.remove(action); -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 d->softKeyCommandActions.remove(action); #endif } diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h index bf4c747223..830881d954 100644 --- a/src/gui/kernel/qsoftkeymanager_common_p.h +++ b/src/gui/kernel/qsoftkeymanager_common_p.h @@ -72,7 +72,7 @@ protected: QMultiHash requestedSoftKeyActions; QWidget *initialSoftKeySource; bool pendingUpdate; -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 QHash softKeyCommandActions; #endif }; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index cd1b4448b2..503277b6b5 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -113,7 +113,7 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba) { -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 QT_TRAP_THROWING( //EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3 cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC); @@ -303,7 +303,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, QString text = softkeyText(*action); TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; -#ifdef SYMBIAN_VERSION_SYMBIAN3 +#ifndef SYMBIAN_VERSION_9_4 if (softKeyCommandActions.contains(action)) command = softKeyCommandActions.value(action); #endif -- cgit v1.2.3 From 552bdd2b5f4ff71fe04574172abca24c898e3f41 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 27 May 2011 12:34:08 +0300 Subject: Fix non-Symbian builds broken by previous commit. Task-number: QT-5065 Reviewed-by: Sami Merila --- src/gui/kernel/qsoftkeymanager.cpp | 6 +++--- src/gui/kernel/qsoftkeymanager_common_p.h | 2 +- src/gui/kernel/qsoftkeymanager_s60.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index c2c4fb2a84..11506012ac 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -50,7 +50,7 @@ #include "private/qsoftkeymanager_s60_p.h" #endif -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) #include "private/qt_s60_p.h" #endif @@ -105,7 +105,7 @@ QSoftKeyManager::QSoftKeyManager() : QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) { QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) int key = 0; switch (standardKey) { case OkSoftKey: @@ -171,7 +171,7 @@ void QSoftKeyManager::cleanupHash(QObject *obj) Q_D(QSoftKeyManager); QAction *action = qobject_cast(obj); d->keyedActions.remove(action); -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) d->softKeyCommandActions.remove(action); #endif } diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h index 830881d954..5b76e60e9f 100644 --- a/src/gui/kernel/qsoftkeymanager_common_p.h +++ b/src/gui/kernel/qsoftkeymanager_common_p.h @@ -72,7 +72,7 @@ protected: QMultiHash requestedSoftKeyActions; QWidget *initialSoftKeySource; bool pendingUpdate; -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) QHash softKeyCommandActions; #endif }; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 503277b6b5..773743adaf 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -113,7 +113,7 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba) { -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) QT_TRAP_THROWING( //EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3 cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC); @@ -303,7 +303,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, QString text = softkeyText(*action); TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; -#ifndef SYMBIAN_VERSION_9_4 +#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) if (softKeyCommandActions.contains(action)) command = softKeyCommandActions.value(action); #endif -- cgit v1.2.3 From b68dffb7d852915d3962afcf947606e0cb1e05d2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 27 May 2011 13:45:34 +0300 Subject: Documented Symbian peculiarity about QDesktopWidget::availableGeometry In Symbian QDesktopWidget::availableGeometry() is not guaranteed to return correct values at the time the resize event related to the geometry change is passed to the widgets. There is a similar issue with QDesktopWidget::screenGeometry(). Documented this fact. Task-number: QTBUG-14058 Reviewed-by: Sami Merila --- src/gui/kernel/qdesktopwidget.qdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/kernel/qdesktopwidget.qdoc b/src/gui/kernel/qdesktopwidget.qdoc index f71155e117..b93bcb3405 100644 --- a/src/gui/kernel/qdesktopwidget.qdoc +++ b/src/gui/kernel/qdesktopwidget.qdoc @@ -151,6 +151,11 @@ on Mac OS X, or the task bar on Windows). The default screen is used if \a screen is -1. + \note In Symbian devices the available geometry reported by QDesktopWidget is + not guaranteed to be correct at the time the geometry change resize event + is passed to widgets. The correct way to listen for available geometry changes + is to connect to the workAreaResized() signal of QDesktopWidget. + \sa screenNumber(), screenGeometry() */ @@ -179,6 +184,11 @@ Returns the geometry of the screen with index \a screen. The default screen is used if \a screen is -1. + \note In Symbian devices the screen geometry reported by QDesktopWidget is + not guaranteed to be correct at the time the geometry change resize event + is passed to widgets. The correct way to listen for screen geometry changes + is to connect to the resized() signal of QDesktopWidget. + \sa screenNumber() */ -- cgit v1.2.3 From 1ad251132816e0cde703d41138a002b7b3b74867 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 27 May 2011 16:31:56 +0300 Subject: QToolButton autotest trigger() fails in E6 In E6 device, QToolButton autotest trigger() fails due to mouse click not hitting the context menu at all. Task-number: QT-5055 Reviewed-by: Miikka Heikkinen --- tests/auto/qtoolbutton/tst_qtoolbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp index 427a505e23..a4aa312f3a 100644 --- a/tests/auto/qtoolbutton/tst_qtoolbutton.cpp +++ b/tests/auto/qtoolbutton/tst_qtoolbutton.cpp @@ -231,7 +231,7 @@ void tst_QToolButton::task176137_autoRepeatOfAction() void tst_QToolButton::sendMouseClick() { - QTest::mouseClick(w, Qt::LeftButton, 0, QPoint(7,7)); + QTest::mouseClick(w, Qt::LeftButton, 0); } QTEST_MAIN(tst_QToolButton) -- cgit v1.2.3 From f32377e2038369cbf2822875cd8836b1f70feb6e Mon Sep 17 00:00:00 2001 From: Tomi Vihria Date: Mon, 30 May 2011 12:50:29 +0300 Subject: Fixed contains check casing in mmf.pro file Contains check in mmf.pro was spelled in upper case, but qmake's internal contains function isn't case-insensitive and needs to be spelled in lower case. Reviewed-by: Miikka Heikkinen --- src/plugins/phonon/mmf/mmf.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 75e42af99b..752c403ab3 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -129,7 +129,7 @@ symbian { LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream # These are for effects. - CONTAINS(config, is_using_gnupoc) { + contains(CONFIG, is_using_gnupoc) { LIBS += -laudioequalizereffect -lbassboosteffect -ldistanceattenuationeffect -ldopplerbase -leffectbase -lenvironmentalreverbeffect -llistenerdopplereffect -llistenerlocationeffect -llistenerorientationeffect -llocationbase -lloudnesseffect -lorientationbase -lsourcedopplereffect -lsourcelocationeffect -lsourceorientationeffect -lstereowideningeffect } else { LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerbase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v1.2.3 From f370dd07560c449ba17d13475721f7d3b46e6b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 30 May 2011 09:38:47 +0200 Subject: Fixed clipping errors for non-extended paint engines. Partially revert change a33ef62469fd71bec for the non-extended paint engine path. Task-number: QTBUG-19525 Reviewed-by: Andy Shaw --- src/gui/painting/qpainter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index dfb9a0477e..a4ab00ac31 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2788,6 +2788,9 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipRegion = rect; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -2843,6 +2846,9 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipRegion = r; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -3248,6 +3254,9 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipPath = path; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) -- cgit v1.2.3 From 48ff7e5af99923396243940979d15d4ec2e2730c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 30 May 2011 11:39:18 +0200 Subject: Missing glyphs transforming QStaticText on X11/raster with subpixel AA Static text took an untested and broken code path for the combo of subpixel AA, X11, raster engine and transformation. This would cause missing glyphs. The reason was that QStaticText took an unused code path which turned out not to work. The workaround is to use gray AA on transformed text, like we already do for the GL engine. In Qt 4.8, the static text code path has been rewritten to use the Freetype cache instead of the image glyph cache, so the bug will be fixed more properly there. Reviewed-by: Samuel --- src/gui/painting/qpaintengine_raster.cpp | 10 +++++++++- src/gui/painting/qtextureglyphcache.cpp | 8 ++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 01b22dada1..cd9206cfb9 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3105,7 +3105,15 @@ void QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, Q_D(QRasterPaintEngine); QRasterPaintEngineState *s = state(); - QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType; + QFontEngineGlyphCache::Type glyphType; + if (fontEngine->glyphFormat >= 0) { + glyphType = QFontEngineGlyphCache::Type(fontEngine->glyphFormat); + } else if (s->matrix.type() > QTransform::TxTranslate + && d->glyphCacheType == QFontEngineGlyphCache::Raster_RGBMask) { + glyphType = QFontEngineGlyphCache::Raster_A8; + } else { + glyphType = d->glyphCacheType; + } QImageTextureGlyphCache *cache = static_cast(fontEngine->glyphCache(0, glyphType, s->matrix)); diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 16df6c1d08..2c1da241a0 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -178,14 +178,10 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g) const { #if defined(Q_WS_X11) - if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { + if (m_type != Raster_RGBMask && m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None; QImage::Format imageFormat = QImage::Format_Invalid; switch (m_type) { - case Raster_RGBMask: - format = QFontEngineFT::Format_A32; - imageFormat = QImage::Format_RGB32; - break; case Raster_A8: format = QFontEngineFT::Format_A8; imageFormat = QImage::Format_Indexed8; @@ -266,7 +262,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g) } #endif - if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { + if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()), qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(), m_image.format()); -- cgit v1.2.3 From a9c76a7403b573ebe69d324d0b2f16f367c3a458 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 30 May 2011 13:22:06 +0300 Subject: Fix QMenuBar autotest failures for Symbian Effectively three fixes to reach same autotest results as on other Symbian devices and to make the case not crash (itself, or Qt). a) Fix null pointer usage in QWidget. This is mostly theoretic case, since it requires that previous focus widget has widget, yet it doesn't have internal winId. Still test case manages to make this happen, so lets prevent the null pointer use. b) Skip activatedCount_noQt3() test case, since it would require shortcut support and leads to test crash. Qt for Symbian should have shortcut support as a result of task http://bugreports.qt.nokia.com/browse/QTBUG-5730 c) Ensure that menu has at least 360 width in tests that send keypresses to the menu. Otherwise, menuitems might get set into menu extension, which makes highlight tests fail (since item is not visible). Task-number: QT-5053 Reviewed-by: Tomi Vihria --- src/gui/kernel/qapplication_s60.cpp | 2 +- tests/auto/qmenubar/tst_qmenubar.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index b3f9eec38b..96ac6f462f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -2005,7 +2005,7 @@ void QApplicationPrivate::openPopup(QWidget *popup) QApplicationPrivate::popupWidgets->append(popup); // Cancel focus widget pointer capture and long tap timer - if (QApplication::focusWidget()) { + if (QApplication::focusWidget() && QApplication::focusWidget()->effectiveWinId()) { static_cast(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); QApplication::focusWidget()->effectiveWinId()->SetPointerCapture(false); } diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp index 72048d9a00..d548a51a33 100644 --- a/tests/auto/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/qmenubar/tst_qmenubar.cpp @@ -515,6 +515,10 @@ void tst_QMenuBar::activatedCount_noQt3() #if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM) QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll); #endif +#ifdef Q_OS_SYMBIAN + QSKIP("On Symbian OS, native key events are needed to test menu action activation", SkipAll); +#endif + // create a popup menu with menu items set the accelerators later... initSimpleMenubar_noQt3(); @@ -1573,6 +1577,12 @@ void tst_QMenuBar::task256322_highlight() file2->setText("file2"); QAction *nothing = win.menuBar()->addAction("nothing"); +#ifdef Q_WS_S60 + // Set minimum width to ensure that menu items are not added to the menu extension. + // Minimum width 360 is the minimal screen width in any supported Symbian device. + win.menuBar()->setMinimumWidth(360); +#endif + win.show(); QTest::qWait(200); -- cgit v1.2.3 From 8fb90ce32dde5d4045c23ff44f29d19054db0d9b Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 30 May 2011 14:02:15 +0300 Subject: Fix for BCM2727 chip detection on Symbian QSymbianGraphcisSystemEx::hasBCM2727() uses bool QApplicationPrivate::useTranslucentEGLSurfaces to decide if Symbian is running on BCM2727 chip which is not entirely correct. bool QApplicationPrivate::useTranslucentEGLSurfaces should be assigned according to QSymbianGraphcisSystemEx::hasBCM2727() and QSymbianGraphcisSystemEx::hasBCM2727() should be also static function. Task-number: QTBUG-19578 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qapplication_s60.cpp | 23 ++++------------ src/gui/painting/qgraphicssystemex_symbian.cpp | 36 +++++++++++++++++++++----- src/gui/painting/qgraphicssystemex_symbian_p.h | 3 ++- src/opengl/qgl_symbian.cpp | 4 +-- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 96ac6f462f..6d1b96f266 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -74,6 +74,7 @@ # include # include "qs60mainappui.h" # include "qinputcontext.h" +# include #endif #if defined(Q_WS_S60) @@ -1835,26 +1836,12 @@ void qt_init(QApplicationPrivate * /* priv */, int) #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE QApplicationPrivate::instance()->useTranslucentEGLSurfaces = true; - const TUid KIvePropertyCat = {0x2726beef}; - enum TIvePropertyChipType { - EVCBCM2727B1 = 0x00000000, - EVCBCM2763A0 = 0x04000100, - EVCBCM2763B0 = 0x04000102, - EVCBCM2763C0 = 0x04000103, - EVCBCM2763C1 = 0x04000104, - EVCBCMUnknown = 0x7fffffff - }; - - TInt chipType = EVCBCMUnknown; - if (RProperty::Get(KIvePropertyCat, 0 /*chip type*/, chipType) == KErrNone) { - if (chipType == EVCBCM2727B1) { - // We have only 32MB GPU memory. Use raster surfaces - // for transparent TLWs. - QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; - } - } else { + if (QSymbianGraphicsSystemEx::hasBCM2727()) { + // We have only 32MB GPU memory. Use raster surfaces + // for transparent TLWs. QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; } + if (QApplicationPrivate::graphics_system_name == QLatin1String("raster")) QApplicationPrivate::instance()->useTranslucentEGLSurfaces = false; #else diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp index 980f72ce46..dc4dd929a0 100644 --- a/src/gui/painting/qgraphicssystemex_symbian.cpp +++ b/src/gui/painting/qgraphicssystemex_symbian.cpp @@ -45,10 +45,39 @@ #include "private/qapplication_p.h" #include "qwidget_p.h" -#include +#include QT_BEGIN_NAMESPACE +static bool bcm2727Initialized = false; +static bool bcm2727 = false; + +bool QSymbianGraphicsSystemEx::hasBCM2727() +{ + if (bcm2727Initialized) + return bcm2727; + + const TUid KIvePropertyCat = {0x2726beef}; + enum TIvePropertyChipType { + EVCBCM2727B1 = 0x00000000, + EVCBCM2763A0 = 0x04000100, + EVCBCM2763B0 = 0x04000102, + EVCBCM2763C0 = 0x04000103, + EVCBCM2763C1 = 0x04000104, + EVCBCMUnknown = 0x7fffffff + }; + + TInt chipType = EVCBCMUnknown; + if (RProperty::Get(KIvePropertyCat, 0, chipType) == KErrNone) { + if (chipType == EVCBCM2727B1) + bcm2727 = true; + } + + bcm2727Initialized = true; + + return bcm2727; +} + void QSymbianGraphicsSystemEx::releaseCachedGpuResources() { // Do nothing here @@ -65,11 +94,6 @@ void QSymbianGraphicsSystemEx::releaseAllGpuResources() } } -bool QSymbianGraphicsSystemEx::hasBCM2727() -{ - return !QApplicationPrivate::instance()->useTranslucentEGLSurfaces; -} - void QSymbianGraphicsSystemEx::forceToRaster(QWidget *window) { if (window && window->isWindow()) { diff --git a/src/gui/painting/qgraphicssystemex_symbian_p.h b/src/gui/painting/qgraphicssystemex_symbian_p.h index c1d1bdf2e3..1f2a7c650c 100644 --- a/src/gui/painting/qgraphicssystemex_symbian_p.h +++ b/src/gui/painting/qgraphicssystemex_symbian_p.h @@ -62,9 +62,10 @@ class QWidget; class Q_GUI_EXPORT QSymbianGraphicsSystemEx : public QGraphicsSystemEx { public: + static bool hasBCM2727(); + virtual void releaseCachedGpuResources(); virtual void releaseAllGpuResources(); - virtual bool hasBCM2727(); virtual void forceToRaster(QWidget *window); }; diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 91904d045c..86176c947f 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -183,9 +183,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); - QGraphicsSystemEx *ex = QApplicationPrivate::graphicsSystem()->platformExtension(); - QSymbianGraphicsSystemEx *symex = static_cast(ex); - if (symex && !symex->hasBCM2727()) { + if (!QSymbianGraphicsSystemEx::hasBCM2727()) { // Most likely we have hw support for multisampling // so let's enable it. d->glFormat.setSampleBuffers(1); -- cgit v1.2.3 From 20dbb967f030041d1dc94b989b0b085ca84baa33 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 30 May 2011 14:23:00 +0300 Subject: Fix QHeaderView test case for VGA Symbian devices. Minimum section size is bigger than expected in VGA devices, which was not taken into accound in two test cases. Task-number: QT-5049 Reviewed-by: Sami Merila --- tests/auto/qheaderview/tst_qheaderview.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index 3a659aa2d1..52eeee4f18 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -563,7 +563,7 @@ void tst_QHeaderView::sectionSize() QFETCH(int, lastVisibleSectionSize); QFETCH(int, persistentSectionSize); -#ifdef Q_OS_WINCE +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) // We test on a device with doubled pixels. Therefore we need to specify // different boundaries. initialDefaultSize = qMax(view->minimumSectionSize(), 30); @@ -676,6 +676,16 @@ void tst_QHeaderView::visualIndexAt() QFETCH(QList, coordinate); QFETCH(QList, visual); +#ifdef Q_OS_SYMBIAN + // Some Symbian devices have larger minimum section size than what is expected. + // Need to do this here instead of visualIndexAt_data() as view pointer doesn't + // seem to be valid there. + int minSize = view->minimumSectionSize(); + if (minSize > 30) { + coordinate.clear(); + coordinate << -1 << 0 << minSize + 1 << (minSize * 3) + 1 << 99999; + } +#endif view->setStretchLastSection(true); topLevel->show(); -- cgit v1.2.3 From 8293336590722f6a92a6b4af401485683b5508fa Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 31 May 2011 11:22:14 +0300 Subject: Fix tst_QGraphicsItem::sorting() test case for Symbian Some devices have bigger than expected minimum width for scrollbars, which broke the sorting test case as some objects that were expected to be painted were fully obscured by scrollbars and therefore skipped. Task-number: QT-5048 Reviewed-by: Janne Koskinen --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 15ed242885..37893d88cd 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -8029,7 +8029,16 @@ void tst_QGraphicsItem::sorting() QGraphicsView view(&scene); view.setResizeAnchor(QGraphicsView::NoAnchor); view.setTransformationAnchor(QGraphicsView::NoAnchor); +#ifdef Q_OS_SYMBIAN + // Adjust area in devices where scrollbars are thicker than 25 pixels as they will + // obstruct painting otherwise. + int scrollWidth = qMax(25, view.verticalScrollBar()->width()); + int scrollHeight = qMax(25, view.horizontalScrollBar()->height()); + + view.resize(95 + scrollWidth, 75 + scrollHeight); +#else view.resize(120, 100); +#endif view.setFrameStyle(0); view.show(); #ifdef Q_WS_X11 -- cgit v1.2.3 From e159f97f6ecefb49d50a82b1084fd1b1b9e5e2cf Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 31 May 2011 11:29:46 +0200 Subject: Fix glyph metrics with QStaticText/Freetype/raster and light/no hinting This is a back-port of part of cad70d64d0bbada. In the raster engine's drawCachedGlyphs(), which is used by QStaticText, we would use the wrong metrics to lay out the glyphs, because loadGlyphMetrics() would assume full hinting. A visible effect of this was that the baseline of rotated text became wavy. Task-number: QTBUG-18185 Reviewed-by: Jiang Jiang --- src/gui/text/qfontengine_ft.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index c4e89d5536..1056aedf64 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -762,9 +762,18 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph return g; int load_flags = FT_LOAD_DEFAULT | default_load_flags; + int load_target = default_hint_style == HintLight + ? FT_LOAD_TARGET_LIGHT + : FT_LOAD_TARGET_NORMAL; + if (set->outline_drawing) load_flags = FT_LOAD_NO_BITMAP; + if (default_hint_style == HintNone) + load_flags |= FT_LOAD_NO_HINTING; + else + load_flags |= load_target; + // apply our matrix to this, but note that the metrics will not be affected by this. FT_Face face = lockFace(); FT_Matrix matrix = this->matrix; -- cgit v1.2.3 From 348894a550510e54e7709d18676b4b10c9e5e9e3 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 31 May 2011 12:15:55 +0200 Subject: Avoid buffer overrun in QMacPixmapData resizing Shouldn't use size bigger than the original (source) pixels buffer or the new one (just allocated). Task-number: QTBUG-18547 Reviewed-by: aavit --- src/gui/image/qpixmap_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index aac159e382..6872cfa319 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -637,7 +637,7 @@ void QMacPixmapData::macCreatePixels() } if (pixels) - memcpy(base_pixels, pixels, pixelsSize); + memcpy(base_pixels, pixels, qMin(pixelsSize, (uint) numBytes)); pixels = base_pixels; pixelsSize = numBytes; } -- cgit v1.2.3 From daba0c0d588c55e3f1591ab8ce0ef0946d1447fd Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 31 May 2011 12:51:05 +0100 Subject: Revert "Fix QNetworkConfigurationManager usage outside main thread first" This reverts commit 5f241ec1426447380b1e938ac7888fb16cde94f8. Reason for reverting: Some already published applications suffer from the deadlock behaviour, causing regressions. Conflicts: tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp --- src/network/bearer/qnetworkconfigmanager_p.cpp | 15 ++------ .../tst_qnetworkconfigurationmanager.cpp | 44 ---------------------- .../tst_qnetworkproxyfactory.cpp | 31 +-------------- 3 files changed, 4 insertions(+), 86 deletions(-) diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 2391a34153..7297b0ec80 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -392,6 +392,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer))); connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)), this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer))); + + QMetaObject::invokeMethod(engine, "initialize"); } } @@ -421,19 +423,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() startPolling(); } - if (firstUpdate) { + if (firstUpdate) firstUpdate = false; - QList enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex - Qt::ConnectionType connectionType; - if (QCoreApplicationPrivate::mainThread() == QThread::currentThread()) - connectionType = Qt::DirectConnection; - else - connectionType = Qt::BlockingQueuedConnection; - locker.unlock(); - foreach (QBearerEngine* engine, enginesToInitialize) { - QMetaObject::invokeMethod(engine, "initialize", connectionType); - } - } } void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp index d29ef77347..57bf5836a7 100644 --- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp +++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp @@ -62,7 +62,6 @@ public slots: void cleanup(); private slots: - void usedInThread(); // this test must be first, or it will falsely pass void allConfigurations(); void defaultConfiguration(); void configurationFromIdentifier(); @@ -330,49 +329,6 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier() QVERIFY(!invalid.isValid()); } -class QNCMTestThread : public QThread -{ -protected: - virtual void run() - { - QNetworkConfigurationManager manager; - preScanConfigs = manager.allConfigurations(); - QSignalSpy spy(&manager, SIGNAL(updateCompleted())); - manager.updateConfigurations(); //initiate scans - QTRY_VERIFY(spy.count() == 1); //wait for scan to complete - configs = manager.allConfigurations(); - } -public: - QList configs; - QList preScanConfigs; -}; - -// regression test for QTBUG-18795 -void tst_QNetworkConfigurationManager::usedInThread() -{ -#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN) - QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll); -#else - QNCMTestThread thread; - connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - thread.start(); - QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread - QVERIFY(!QTestEventLoop::instance().timeout()); - qDebug() << "prescan:" << thread.preScanConfigs.count(); - qDebug() << "postscan:" << thread.configs.count(); - - QNetworkConfigurationManager manager; - QList preScanConfigs = manager.allConfigurations(); - QSignalSpy spy(&manager, SIGNAL(updateCompleted())); - manager.updateConfigurations(); //initiate scans - QTRY_VERIFY(spy.count() == 1); //wait for scan to complete - QList configs = manager.allConfigurations(); - QCOMPARE(thread.configs, configs); - //Don't compare pre scan configs, because these may be cached and therefore give different results - //which makes the test unstable. The post scan results should have all configurations every time - //QCOMPARE(thread.preScanConfigs, preScanConfigs); -#endif -} QTEST_MAIN(tst_QNetworkConfigurationManager) #include "tst_qnetworkconfigurationmanager.moc" diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index c56fedb3e0..954b36912d 100644 --- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** @@ -41,17 +41,14 @@ #include -#include #include #include #include -#include class tst_QNetworkProxyFactory : public QObject { Q_OBJECT private slots: - void systemProxyForQueryCalledFromThread(); void systemProxyForQuery() const; private: @@ -99,31 +96,5 @@ void tst_QNetworkProxyFactory::systemProxyForQuery() const QFAIL("One or more system proxy lookup failures occurred."); } -class QSPFQThread : public QThread -{ -protected: - virtual void run() - { - proxies = QNetworkProxyFactory::systemProxyForQuery(query); - } -public: - QNetworkProxyQuery query; - QList proxies; -}; - -//regression test for QTBUG-18799 -void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread() -{ - QUrl url(QLatin1String("http://qt.nokia.com")); - QNetworkProxyQuery query(url); - QSPFQThread thread; - thread.query = query; - connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - thread.start(); - QTestEventLoop::instance().enterLoop(5); - QVERIFY(thread.isFinished()); - QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query)); -} - QTEST_MAIN(tst_QNetworkProxyFactory) #include "tst_qnetworkproxyfactory.moc" -- cgit v1.2.3 From 9ca1ebfbe94228c565ff6ac86eac06c6b41721a2 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Tue, 31 May 2011 15:58:19 +0300 Subject: Fix pixel metrics for Symbian VGA devices Pixel metrics for focus frame (PM_FocusFrameVMargin and PM_FocusFrameHMargin) had invalid values for VGA screens. Additionally these same pixel metrics were adjusted for nHD. Now, all but one QTreeView test cases pass for either screensize. Task-number: QT-5056 Reviewed-by: Tomi Vihria --- src/gui/styles/qs60style.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 168041d3dc..d3e5957de2 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -108,10 +108,10 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** {5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, {5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, -{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,3,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,3,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106}, -{9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} +{9,0,-909,0,0,2,0,5,-1,30,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,2,2,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184} // *** End of generated data *** }; -- cgit v1.2.3 From c2022fa4cda76ba839b7ffe0f325da5c87efc916 Mon Sep 17 00:00:00 2001 From: Jaakko Koskenkorva Date: Tue, 31 May 2011 17:34:39 +0300 Subject: Increase SSL readbuffer 1 -> 16 kB Reading incoming data in Symbian is slow when it is done from the native RSocket in 1kB blocks. Typically other native apps use 16 kB or even 24 kB (browser). This contributes (among other slow tasks such as writing to mass memory) to the TCP window filling up. This case, even though it should be recoverable, has proven to be problematic in some scenarios including downloading from Ovi Store via 3G. The fix just increases the amount of data read, which speeds things up and makes the problematic window fill-up less common. Reviewed-by: Shane Kearns Task-number: QTBUG-18943 --- src/network/ssl/qsslsocket_openssl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 78699fccaf..565ab2cc16 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -1291,9 +1291,9 @@ bool QSslSocketBackendPrivate::startHandshake() sslErrors.clear(); } - // if we have a max read buffer size, reset the plain socket's to 1k + // if we have a max read buffer size, reset the plain socket's to 16k if (readBufferMaxSize) - plainSocket->setReadBufferSize(1024); + plainSocket->setReadBufferSize(16384); connectionEncrypted = true; emit q->encrypted(); -- cgit v1.2.3 From 887b19ce9313d09eb996e765c18fa19a09a5cf95 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 1 Jun 2011 16:15:13 +0300 Subject: Fix QTreeWidget autotest cases on Symbian/VGA Make two autotest cases pass on Symbian/VGA devices. Task-number: QT-5057 Reviewed-by: Miikka Heikkinen --- tests/auto/qtreewidget/tst_qtreewidget.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp index dc878c4818..7d2cdfb926 100644 --- a/tests/auto/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include "../../shared/util.h" @@ -3102,10 +3104,21 @@ void tst_QTreeWidget::task206367_duplication() QWidget topLevel; QTreeWidget treeWidget(&topLevel); topLevel.show(); +#ifndef Q_WS_S60 treeWidget.resize(200, 200); +#endif treeWidget.setSortingEnabled(true); QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") ); +#ifdef Q_WS_S60 + // Ensure that eight items fit into tree widget. In Symbian VGA devices 8 rows of + // data will take more than 200 pixels. + int calculatedHeight = treeWidget.visualItemRect(treeWidget.topLevelItem(0)).height() + + 2 * QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, 0); + calculatedHeight *= 8; // eight 'rows': header, root and 2 items with 2 children + treeWidget.resize(200, qMax(200, calculatedHeight)); +#endif + for (int nFile = 0; nFile < 2; nFile++ ) { QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, QStringList(QString::number(nFile))); for (int nRecord = 0; nRecord < 2; nRecord++) @@ -3211,6 +3224,13 @@ void tst_QTreeWidget::task239150_editorWidth() { //we check that an item with no text will get an editor with a correct size QTreeWidget tree; +#ifdef Q_OS_SYMBIAN + //By default widgets are 640*360 in Symbian. Call to create_sys() sets the real size of the widget. + //Therefore, with VGA Symbian devices, we need to update the widget width to match screen width. + //As VGA devices have larger font, longer texts wouldn't otherwise fit into tree widget. + if (QApplication::desktop() && QApplication::desktop()->availableGeometry().width() > tree.width()) + tree.resize(QApplication::desktop()->availableGeometry().size()); +#endif QStyleOptionFrameV2 opt; opt.init(&tree); -- cgit v1.2.3 From f8d71ee8c5f29eabb759ff4b0d5c8a153023a254 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 31 May 2011 17:57:14 +0200 Subject: QDeclarative: Fix QPerformanceTimer on Symbian QPerformanceTimer::elapsed() always returned 0 on Symbian. This is because Q_OS_UNIX define is also set for Symbian. Fixed by moving Q_OS_SYMBIAN before Q_OS_SYMBIAN, and fixing the logic. Reviewed-by: Alessandro Portale Task-number: QTBUG-19669 --- src/declarative/declarative.pro | 2 +- src/declarative/qml/qperformancetimer.cpp | 55 ++++++++++++++++--------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index f3a7db934b..27ceaf08eb 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -26,7 +26,7 @@ include(debugger/debugger.pri) symbian: { TARGET.UID3=0x2001E623 - LIBS += -lefsrv + LIBS += -lefsrv -lhal } linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND diff --git a/src/declarative/qml/qperformancetimer.cpp b/src/declarative/qml/qperformancetimer.cpp index 1d7ca800e9..bdd5da17f6 100644 --- a/src/declarative/qml/qperformancetimer.cpp +++ b/src/declarative/qml/qperformancetimer.cpp @@ -45,14 +45,15 @@ #include #include #include -#elif defined(Q_OS_UNIX) -#include -#include -#include #elif defined(Q_OS_SYMBIAN) #include #include #include +#include +#elif defined(Q_OS_UNIX) +#include +#include +#include #elif defined(Q_OS_WIN) #include #endif @@ -84,6 +85,29 @@ qint64 QPerformanceTimer::elapsed() const return absoluteToNSecs(cpu_time - t1); } +////////////////////////////// Symbian ////////////////////////////// +#elif defined(Q_OS_SYMBIAN) + +static qint64 getTimeFromTick(quint64 elapsed) +{ + static TInt freq = 0; + if (!freq) + HAL::Get(HALData::EFastCounterFrequency, freq); + + return (elapsed * 1000000000) / freq; +} + +void QPerformanceTimer::start() +{ + t1 = User::FastCounter(); +} + +qint64 QPerformanceTimer::elapsed() const +{ + return getTimeFromTick(User::FastCounter() - t1); +} + + ////////////////////////////// Unix ////////////////////////////// #elif defined(Q_OS_UNIX) @@ -158,29 +182,6 @@ qint64 QPerformanceTimer::elapsed() const return sec * Q_INT64_C(1000000000) + frac; } -////////////////////////////// Symbian ////////////////////////////// -#elif defined(Q_OS_SYMBIAN) - -static qint64 getTimeFromTick(quint64 elapsed) -{ - static TInt freq; - if (!freq) - HAL::Get(HALData::EFastCounterFrequency, freq); - - // ### not sure on units - return elapsed / freq; -} - -void QPerformanceTimer::start() -{ - t1 = User::FastCounter(); -} - -qint64 QPerformanceTimer::elapsed() const -{ - return getTimeFromTick(User::FastCounter() - t1); -} - ////////////////////////////// Windows ////////////////////////////// #elif defined(Q_OS_WIN) -- cgit v1.2.3 From 5b1a0a5564a69331d581bcf4f94da0e11d14a31f Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 2 Jun 2011 11:07:21 +1000 Subject: Add private method for flushing the pixmap cache. Change-Id: I7330383b89a3a313dd845274d17d38c714db20ce Reviewed-by: Martin Jones --- src/declarative/util/qdeclarativepixmapcache.cpp | 14 ++++++++++++++ src/declarative/util/qdeclarativepixmapcache_p.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index a29854fa84..831aa75070 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -584,6 +584,7 @@ public: void unreferencePixmap(QDeclarativePixmapData *); void referencePixmap(QDeclarativePixmapData *); + void flushCache(); protected: virtual void timerEvent(QTimerEvent *); @@ -682,6 +683,14 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *) } } +/* + Remove all unreferenced pixmaps from the cache. +*/ +void QDeclarativePixmapStore::flushCache() +{ + shrinkCache(m_unreferencedCost); +} + QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d) : data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0) { @@ -1075,6 +1084,11 @@ bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method) return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method); } +void QDeclarativePixmap::flushCache() +{ + pixmapStore()->flushCache(); +} + QT_END_NAMESPACE #include diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h index 1cf76dda71..48c9f8b2d1 100644 --- a/src/declarative/util/qdeclarativepixmapcache_p.h +++ b/src/declarative/util/qdeclarativepixmapcache_p.h @@ -103,6 +103,8 @@ public: bool connectDownloadProgress(QObject *, const char *); bool connectDownloadProgress(QObject *, int); + static void flushCache(); + private: Q_DISABLE_COPY(QDeclarativePixmap) QDeclarativePixmapData *d; -- cgit v1.2.3 From 8b80ff8b127c2ef5a52267bd778f44b2b2c20215 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 2 Jun 2011 11:15:33 +0300 Subject: Fix for winscw QtGui.def Reviewed-by: TRUSTME --- src/s60installs/bwins/QtGuiu.def | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 3e848ec251..ca4af4aa1e 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -13104,11 +13104,11 @@ EXPORTS ??_EQTextEngine@@QAE@I@Z @ 13103 NONAME ABSENT ; QTextEngine::~QTextEngine(unsigned int) ??4QStyleOptionTitleBar@@QAEAAV0@ABV0@@Z @ 13104 NONAME ABSENT ; class QStyleOptionTitleBar & QStyleOptionTitleBar::operator=(class QStyleOptionTitleBar const &) ??4Value@QCss@@QAEAAU01@ABU01@@Z @ 13105 NONAME ABSENT ; struct QCss::Value & QCss::Value::operator=(struct QCss::Value const &) - ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 13106 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) - ??0QDragLeaveEvent@@QAE@ABV0@@Z @ 13107 NONAME ABSENT ; QDragLeaveEvent::QDragLeaveEvent(class QDragLeaveEvent const &) - ??4QBitmap@@QAEAAV0@ABV0@@Z @ 13108 NONAME ABSENT ; class QBitmap & QBitmap::operator=(class QBitmap const &) - ??0QItemSelection@@QAE@ABV0@@Z @ 13109 NONAME ABSENT ; QItemSelection::QItemSelection(class QItemSelection const &) - ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13110 NONAME ABSENT ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &) - ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13111 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool) - ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13112 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void) + ??0QDragLeaveEvent@@QAE@ABV0@@Z @ 13106 NONAME ABSENT ; QDragLeaveEvent::QDragLeaveEvent(class QDragLeaveEvent const &) + ??4QBitmap@@QAEAAV0@ABV0@@Z @ 13107 NONAME ABSENT ; class QBitmap & QBitmap::operator=(class QBitmap const &) + ??0QItemSelection@@QAE@ABV0@@Z @ 13108 NONAME ABSENT ; QItemSelection::QItemSelection(class QItemSelection const &) + ??4QTextFrameFormat@@QAEAAV0@ABV0@@Z @ 13109 NONAME ABSENT ; class QTextFrameFormat & QTextFrameFormat::operator=(class QTextFrameFormat const &) + ?setInstantInvalidatePropagation@QGraphicsLayout@@SAX_N@Z @ 13110 NONAME ; void QGraphicsLayout::setInstantInvalidatePropagation(bool) + ?instantInvalidatePropagation@QGraphicsLayout@@SA_NXZ @ 13111 NONAME ; bool QGraphicsLayout::instantInvalidatePropagation(void) + ?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 13112 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) -- cgit v1.2.3 From de48af046a093834b8178238a2afb2efc8636efd Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 3 Jun 2011 11:19:44 +1000 Subject: Revert some of "Make QMLViewer startup animation stop after a while" This reverts most of commit c6e6a35aeb8794d68a3ca0c4e27a3a1181c066b5. Only the startup.qml changes were meant to go in. The other stuff is an experimental feature that was not supposed to be merged in. Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 16 ---------------- src/declarative/graphicsitems/qdeclarativemousearea_p.h | 3 --- .../graphicsitems/qdeclarativemousearea_p_p.h | 17 ----------------- 3 files changed, 36 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 66332561b7..ea04c19d05 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -496,9 +496,6 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event) d->pressAndHoldTimer.start(PressAndHoldDelay, this); setKeepMouseGrab(d->stealMouse); event->setAccepted(setPressed(true)); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } } @@ -576,9 +573,6 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit positionChanged(&me); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } @@ -600,9 +594,6 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (s && s->mouseGrabberItem() == this) ungrabMouse(); setKeepMouseGrab(false); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } d->doubleClick = false; } @@ -994,11 +985,4 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() */ -QDeclarativeListProperty QDeclarativeMouseArea::forwardTo() -{ - Q_D(QDeclarativeMouseArea); - return d->forwardTo; -} - - QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 0fe8c6abb6..b0dbc3041f 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -130,7 +130,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged) Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ??? Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1) - Q_PROPERTY(QDeclarativeListProperty forwardTo READ forwardTo); public: QDeclarativeMouseArea(QDeclarativeItem *parent=0); @@ -158,8 +157,6 @@ public: bool preventStealing() const; void setPreventStealing(bool prevent); - QDeclarativeListProperty forwardTo(); - Q_SIGNALS: void hoveredChanged(); void pressedChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h index 7248c92777..67694fb7ae 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h @@ -70,8 +70,6 @@ public: : absorb(true), hovered(false), pressed(false), longPress(false), moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0) { - Q_Q(QDeclarativeMouseArea); - forwardTo = QDeclarativeListProperty(q, forwardToList); } ~QDeclarativeMouseAreaPrivate(); @@ -91,18 +89,6 @@ public: lastModifiers = event->modifiers(); } - void forwardEvent(QGraphicsSceneMouseEvent* event) - { - Q_Q(QDeclarativeMouseArea); - for(int i=0; i < forwardToList.count(); i++){ - event->setPos(forwardToList[i]->mapFromScene(event->scenePos())); - forwardToList[i]->scene()->sendEvent(forwardToList[i], event); - if(event->isAccepted()) - break; - } - event->setPos(q->mapFromScene(event->scenePos())); - } - bool isPressAndHoldConnected() { Q_Q(QDeclarativeMouseArea); static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)"); @@ -135,9 +121,6 @@ public: Qt::MouseButtons lastButtons; Qt::KeyboardModifiers lastModifiers; QBasicTimer pressAndHoldTimer; - - QDeclarativeListProperty forwardTo; - QList forwardToList; }; QT_END_NAMESPACE -- cgit v1.2.3 From 7eb590b5bb00e5cfb8e153938f55013eebe94880 Mon Sep 17 00:00:00 2001 From: Takumi ASAKI Date: Mon, 6 Jun 2011 12:13:58 +0200 Subject: Update Japanese translations. * Fix some inconsistent translations. * Translate some missing messages. * Update Japanese phrasebook. Merge-request: 1249 Reviewed-by: ossi --- tools/linguist/phrasebooks/japanese.qph | 15 ++- translations/assistant_ja.ts | 2 +- translations/designer_ja.ts | 52 ++++---- translations/linguist_ja.ts | 124 ++++++++++--------- translations/qt_help_ja.ts | 18 +-- translations/qt_ja.ts | 209 +++++++++++++++++++++----------- translations/qtconfig_ja.ts | 22 +++- 7 files changed, 274 insertions(+), 168 deletions(-) diff --git a/tools/linguist/phrasebooks/japanese.qph b/tools/linguist/phrasebooks/japanese.qph index 3ecd9e332c..b04e525634 100644 --- a/tools/linguist/phrasebooks/japanese.qph +++ b/tools/linguist/phrasebooks/japanese.qph @@ -1,4 +1,5 @@ - + + About について @@ -1018,4 +1019,16 @@ Yes はい + + &Next + 次を検索(&N) + + + List View + 一覧表示 + + + &Run + 実行(&R) + diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts index a3169ab233..5c990deb50 100644 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -610,7 +610,7 @@ Reason: Next - 進む + 次へ Case Sensitive diff --git a/translations/designer_ja.ts b/translations/designer_ja.ts index ab876448d5..7fcc66d21d 100644 --- a/translations/designer_ja.ts +++ b/translations/designer_ja.ts @@ -764,7 +764,7 @@ The skin configuration file '%1' could not be opened. - スキンの設定ファイル '%1' がオープンできませんでした。 + スキンの設定ファイル '%1' を開けませんでした。 Syntax error: %1 @@ -1060,7 +1060,7 @@ Parsing grid layout minimum size values &Open... - オープン(&O)... + 開く(&O)... &Recent Forms @@ -1304,7 +1304,7 @@ UI ファイルの記述が矛盾しています。 Unknown error - 不明なエラー + 未知のエラー An error occurred while running the script for %1: %2 @@ -1451,7 +1451,7 @@ Do you want to update the file location or generate a new form? Could not open file - ファイルをオープンできませんでした + ファイルを開けませんでした Saved image %1. @@ -1471,7 +1471,7 @@ Do you want to update the file location or generate a new form? Could not write file - ファイルに書き込むことができませんでした + ファイルに書き込めませんでした &Close Preview @@ -1491,7 +1491,7 @@ Do you want to update the file location or generate a new form? Save &As... - 名前をつけて保存(&A)... + 名前を付けて保存(&A)... Save A&ll @@ -1525,7 +1525,7 @@ Do you want to update the file location or generate a new form? The file %1 could not be opened. Reason: %2 Would you like to retry or select a different file? - ファイル %1 はオープンできませんでした。 + ファイル %1 を開けませんでした。 原因: %2 リトライしますか、それとも他のファイルを選択しますか? @@ -1533,7 +1533,7 @@ Would you like to retry or select a different file? It was not possible to write the entire file %1 to disk. Reason:%2 Would you like to retry? - ファイル %1 の全体をディスクに書き込むことができませんでした。 + ファイル %1 の全体をディスクに書き込めませんでした。 原因: %2 リトライしますか? @@ -1876,7 +1876,7 @@ Container pages should only be added by specifying them in XML returned by the d The file <b>%1</b> could not be opened. - ファイル <b>%1</b> はオープンできませんでした。 + ファイル <b>%1</b> を開けませんでした。 There are %n forms with unsaved changes. Do you want to review these changes before quitting? @@ -2164,7 +2164,7 @@ Empty class name passed to widget factory method What's This - ヘルプ + ヒント Busy @@ -2190,7 +2190,7 @@ Empty class name passed to widget factory method Italic - イタリック + 斜体 Underline @@ -2778,7 +2778,7 @@ to Could not write %1: %2 - %1 に書き込むことが出来ませんでした: %2 + %1 に書き込めませんでした: %2 Open Resource File @@ -2790,11 +2790,11 @@ to Move Up - 上へ移動 + 上に移動 Move Down - 下へ移動 + 下に移動 Add Prefix @@ -3082,7 +3082,7 @@ Do you want overwrite the template? There was an error opening template %1 for writing. Reason: %2 - %1 というテンプレートを書き込み用にオープンしようとしてエラーになりました。理由: %2 + %1 というテンプレートを書き込み用に開こうととしてエラーになりました。理由: %2 Write Error @@ -3534,7 +3534,7 @@ Do you want overwrite the template? The file %1 could not be opened: %2 - ファイル %1 はオープンできませんでした: %2 + ファイル %1 を開けませんでした: %2 The file %1 could not be written: %2 @@ -3797,19 +3797,19 @@ Do you want overwrite the template? Unable to open the file '%1' for writing: %2 - ファイル '%1' を書き込み用にオープンできませんでした: %2 + ファイル '%1' を書き込み用に開けません: %2 Open profile - プロファイルをオープン + プロファイルを開く Open Profile - Error - プロファイルをオープン - Error + プロファイルを開く - エラー Unable to open the file '%1' for reading: %2 - ファイル '%1' を読み込み用にオープンできませんでした: %2 + ファイル '%1' を読み込み用に開けません: %2 '%1' is not a valid profile: %2 @@ -4558,7 +4558,7 @@ Please select another name. Unable to open the form template file '%1': %2 - フォームのテンプレートファイル '%1' をオープンできません: %2 + フォームのテンプレートファイル '%1' を開けません: %2 Internal error: No template selected. @@ -4761,7 +4761,7 @@ Please select another name. Refresh - リフレッシュ + 更新 Scan for newly installed custom widget plugins. @@ -5256,7 +5256,7 @@ Class: %2 &OK - OK(&O) + &OK &Cancel @@ -5287,7 +5287,7 @@ Class: %2 Italic - イタリック + 斜体 CTRL+I @@ -5730,7 +5730,7 @@ Class: %2 List View - リスト表示 + 一覧表示 Icon View @@ -5792,7 +5792,7 @@ UI ファイルに矛盾が発生しています。 qdesigner_internal::WizardContainerWidgetTaskMenu Next - 進む + 次へ Back diff --git a/translations/linguist_ja.ts b/translations/linguist_ja.ts index 40bb778248..9164b75a39 100644 --- a/translations/linguist_ja.ts +++ b/translations/linguist_ja.ts @@ -83,6 +83,10 @@ DataModel + + The translation file '%1' will not be loaded because it is empty. + 翻訳ファイル '%1' が空のためロードできません。 + <qt>Duplicate messages found in '%1': <qt>'%1' に重複したメッセージが見つかりました: @@ -345,7 +349,7 @@ Return value: 2 on read failures 3 on write failures - + 使い方: lconvert [オプション] <入力ファイル> [<入力ファイル>...] @@ -365,8 +369,8 @@ lconvert は Qt Linguist ツールチェインの一部です。 -i <入力ファイル> --input-file <入力ファイル> 入力ファイルを指定します。<入力ファイル> の指定はダッシュ記号で始まっていてもよいです。 - This option can be used several times to merge inputs. - May be '-' (標準入力) for use in a pipe. + このオプションはマージする入力ファイルを指定する際に複数回使用できます。 + パイプで利用する場合には '-' で標準入力を指定します。 -o <出力ファイル> --output-file <出力ファイル> @@ -382,29 +386,30 @@ lconvert は Qt Linguist ツールチェインの一部です。 出力形式を指定します。-if を参照してください。 --input-codec <コーデック> - Specify encoding for QM and PO input files. Default is 'Latin1' - for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for - QM, corresponding to the possible use of the trUtf8() function. + QM や PO ファイルのエンコーディングを指定します。デフォルトでは + QM ファイルでは 'Latin1' を PO ファイルでは 'UTF-8' を使用します。 + QM ファイルでは通常 trUtf8() 関数が組み合わせて利用されるため、 + UTF-8 の利用も試みます。 --output-codec <コーデック> - Specify encoding for PO output files.デフォルトは 'UTF-8' です。 + PO 出力ファイルのエンコーディングを指定します。デフォルトは 'UTF-8' です。 --drop-tags <正規表現> - Drop named extra tags when writing TS or XLIFF files. - May be specified repeatedly. + TS ファイルや XLIFF ファイルに出力する際に名前付き拡張タグを削除します。 + 複数回指定可能です。 --drop-translations - Drop existing translations and reset the status to 'unfinished'. - 注意: --no-obsolete と同等です。 + 既存の翻訳を削除してステータスを'未完了'にリセットします。 + 注意: --no-obsolete の指定を含みます。 --source-language <language>[_<region>] - Specify/override the language of the source strings. Defaults to - POSIX if not specified and the file does not name it yet. + ソーステキストの言語を指定もしくは上書きします。 + 未指定でファイルにも記述されていない場合、POSIX をデフォルトで使用します。 --target-language <language>[_<region>] - Specify/override the language of the translation. - The target language is guessed from the file name if this option - is not specified and the file contents name no language yet. + 翻訳で使用される言語を指定もしくは上書きします。 + オプションやファイル内で言語が指定されていない場合は、 + ファイル名から言語を推測します。 --no-obsolete 未使用のメッセージを取り除きます。 @@ -416,14 +421,14 @@ lconvert は Qt Linguist ツールチェインの一部です。 出力する TS ファイル内のコンテキストをアルファベット順にソートします。 --locations {absolute|relative|none} - Override how source code references are saved in TS files. - Default is absolute. + TS ファイル内に保存されているソースコードへの参照を上書きします。 + デフォルトは absolute (絶対パス) です。 --no-ui-lines UI ファイルを参照している行番号を取り除きます。 --verbose - be a bit more verbose + より詳しいログを出力します。 長すぎるオプションの指定はダッシュ記号で括る事で1つにできます。 @@ -489,13 +494,14 @@ Options: -version Display the version of lrelease and exit - 使い方: + 使い方: lrelease [オプション] project-file lrelease [オプション] ts-files [-qm qm-file] -lrelease is part of Qt's Linguist tool chain. It can be used as a -stand-alone tool to convert XML-based translations files in the TS -format into the 'compiled' QM format used by QTranslator objects. +lrelease は Qt Linguist ツールチェインの一部です。 +XMLベースの翻訳ファイルであるTSフォーマットを +QTranslatorで利用可能な「コンパイル済み」のQMフォーマットに +変換する事ができるスタンドアロンのツールです。 オプション: -help このヘルプを表示して終了します @@ -506,13 +512,13 @@ format into the 'compiled' QM format used by QTranslator objects. -nounfinished 未完了の翻訳をインクルードしません -removeidentical - If the translated text is the same as - the source text, do not include the message + 翻訳後の文字列がソースと同じ場合、 + メッセージをQMファイルに組み込みません -markuntranslated <プレフィクス> - If a message has no real translation, use the source text - prefixed with the given string instead + メッセージが翻訳されていない場合、ソースの文字列に + <プレフィックス>を追加した文字列を代わりに使用します -silent - 完了した事を通知しません + 実行内容を表示しません -version lrelease のバージョンを表示して終了します @@ -823,62 +829,62 @@ Options: @lst-file Read additional file names (one per line) from lst-file. - 使い方: + 使い方: lupdate [オプション] [プロジェクトファイル]... lupdate [オプション] [source-file|path|@lst-file]... -ts ts-files|@lst-file -lupdate は Qt' Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、 +lupdate は Qt Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、 JavaScript/QtScript のソースコードからメッセージを抽出します。 -Extracted messages are stored in textual translation source files (typically -Qt TS XML). 新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージから -マージされます。 +抽出されたメッセージは原文として翻訳ソースファイル(通常は Qt TS XML)に保存されます。 +新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージからマージされます。 オプション: -help このヘルプを表示して終了します。 -no-obsolete - すべての未使用の文字列を取り除きます。 + すべての未使用の文字列を取り除きます。 -extensions <ext>[,<ext>]... - 与えられた拡張子のファイルだけ処理します。 - 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。 - デフォルト: '%1' + 与えられた拡張子のファイルだけを処理します。 + 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。 + デフォルト: '%1' -pluralonly - 複数形のメッセージだけインクルードします。 + 複数形のメッセージだけインクルードします。 -silent - 完了した事を通知しません + 完了した事を通知しません -no-sort - TS ファイル内のコンテキストをソートしません。 + TS ファイル内のコンテキストをソートしません。 -no-recursive - ディレクトリ内を再帰的に処理しません。 + ディレクトリ内を再帰的に処理しません。 -recursive - ディレクトリ内を再帰的に処理します。(デフォルト) + ディレクトリ内を再帰的に処理します。(デフォルト) -I <includepath> or -I<includepath> - Additional location to look for include files. - May be specified multiple times. + include ファイルを検索するパスを追加します。 + 複数回の指定が可能です。 -locations {absolute|relative|none} - Specify/override how source code references are saved in TS files. - Default is absolute. + TS ファイルに保存されるソースコードの参照方法を指定/上書きします。 + デフォルトは absolute (絶対パス)です。 -no-ui-lines - UI ファイルを参照する行番号を記録しません。 + UI ファイルを参照する行番号を記録しません。 -disable-heuristic {sametext|similartext|number} - Disable the named merge heuristic. Can be specified multiple times. + 指定された手法のあいまいマージを行いません。複数回の指定が可能です。 -pro <ファイル名> - .pro ファイルの名前を指定します。Useful for files with .pro file syntax but - different file suffix. Projects are recursed into and merged. + .pro ファイルの名前を指定します。.pro ファイルの書式に従いながら、 + 拡張子が異なる場合に有用です。 + プロジェクトは再帰的に検索し、複数指定時はマージされます。 -source-language <language>[_<region>] - Specify the language of the source strings for new files. - Defaults to POSIX if not specified. + 新しくファイルを作成する場合のソース文字列の言語を指定します。 + 指定されない場合のデフォルトは POSIX です。 -target-language <language>[_<region>] - Specify the language of the translations for new files. - Guessed from the file name if not specified. + 新しくファイルを作成する場合の翻訳言語を指定します。 + 指定されない場合はファイル名から推測されます。 -ts <ts-file>... - 出力ファイルを指定します。This will override the TRANSLATIONS - and nullify the CODECFORTR from possibly specified project files. + 出力ファイルを指定します。プロジェクトファイルで指定された + TRANSLATIONS と CODECFORTR は無視されます。 -codecfortr <codec> - Specify the codec assumed for tr() calls. Effective only with -ts. + tr() の呼び出し時に想定されるコーデックを指定します。-ts オプションを指定した場合にのみ有効です。 -version - lupdate のバージョン情報を表示して終了します。 + lupdate のバージョン情報を表示して終了します。 @lst-file - Read additional file names (one per line) from lst-file. + lst-file を使って追加で読み込むファイル名(1行に1ファイル)を指定します。 diff --git a/translations/qt_help_ja.ts b/translations/qt_help_ja.ts index 2a725cab02..59036e05b1 100644 --- a/translations/qt_help_ja.ts +++ b/translations/qt_help_ja.ts @@ -43,7 +43,7 @@ Cannot open collection file: %1 - コレクションファイルをオープンできません: %1 + コレクションファイルを開けません: %1 Cannot create tables in file %1! @@ -67,7 +67,7 @@ Cannot open database '%1' to optimize! - 最適化用にデータベース '%1' をオープンできません! + 最適化用にデータベース '%1' を開けません! Cannot create directory: %1 @@ -83,7 +83,7 @@ Cannot open documentation file %1! - ドキュメントファイル %1 をオープンできません! + ドキュメントファイル %1 を開けません! The namespace %1 was not registered! @@ -99,14 +99,14 @@ Cannot open database '%1' '%2': %3 The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string - データベース '%1' '%2' がオープンできません: %3 + データベース '%1' '%2' を開けません: %3 QHelpEngineCore Cannot open documentation file %1: %2! - ドキュメントファイル %1 をオープンできません: %2! + ドキュメントファイル %1 を開けません: %2! The specified namespace does not exist! @@ -133,7 +133,7 @@ Cannot open data base file %1! - データベースファイル %1 をオープンできません! + データベースファイル %1 を開けません! Cannot register namespace %1! @@ -177,7 +177,7 @@ Cannot open file %1! Skipping it. - ファイル %1 をオープンできません! スキップします。 + ファイル %1 を開けません! スキップします。 The filter %1 is already registered! @@ -209,7 +209,7 @@ File '%1' cannot be opened. - ファイル '%1' をオープンできません。 + ファイル '%1' を開けません。 File '%1' contains an invalid link to file '%2' @@ -256,7 +256,7 @@ The input file %1 could not be opened! - 入力ファイル %1 がオープンできません! + 入力ファイル %1 を開けません! diff --git a/translations/qt_ja.ts b/translations/qt_ja.ts index db8a917116..094e34db19 100644 --- a/translations/qt_ja.ts +++ b/translations/qt_ja.ts @@ -75,7 +75,7 @@ Accessibility - アクセシビリティ + ユーザー補助 @@ -136,7 +136,7 @@ libgstreamer-plugins-base はインストールされていますか。 Could not open media source. - メディアソースを開くことができません。 + メディアソースを開けませんでした。 Invalid source type. @@ -148,11 +148,11 @@ libgstreamer-plugins-base はインストールされていますか。 Could not open audio device. The device is already in use. - オーディオデバイスを開くことができません。デバイスは既に他のプロセスにより使用されています。 + オーディオデバイスを開けませんでした。デバイスは既に他のプロセスにより使用されています。 Could not decode media source. - メディアソースを開くことができません。見つからないか、未知の形式です。 + メディアソースを開けませんでした。見つからないか、未知の形式です。 @@ -320,6 +320,10 @@ libgstreamer-plugins-base はインストールされていますか。Playback complete 再生が終了しました + + Download error + ダウンロードエラー + Phonon::MMF::AbstractVideoPlayer @@ -439,6 +443,10 @@ libgstreamer-plugins-base はインストールされていますか。Error opening source: media type could not be determined ソースのオープン時にエラーが発生しました: メディアのタイプが不明です + + Failed to set requested IAP + 要求されたIAPのセットに失敗しました + Phonon::MMF::StereoWidening @@ -511,7 +519,7 @@ libgstreamer-plugins-base はインストールされていますか。 Open - オープン + 開く Select a Directory @@ -559,7 +567,7 @@ libgstreamer-plugins-base はインストールされていますか。 &OK - OK(&O) + &OK Look &in: @@ -607,7 +615,7 @@ libgstreamer-plugins-base はインストールされていますか。 Read-only - 読み込み専用 + 読み取り専用 Write-only @@ -643,7 +651,7 @@ libgstreamer-plugins-base はインストールされていますか。 Open - オープン + 開く Save As @@ -651,7 +659,7 @@ libgstreamer-plugins-base はインストールされていますか。 &Open - オープン(&O) + 開く(&O) &Save @@ -1168,7 +1176,7 @@ to QComboBox Open - オープン + 開く False @@ -1215,6 +1223,11 @@ to QSystemSemaphore %1: リソース不足です + + %1: permission denied + QSystemSemaphore + %1: 許可されていません + %1: unknown error %2 QSystemSemaphore @@ -1290,11 +1303,11 @@ to QDeclarativeAbstractAnimation Cannot animate non-existent property "%1" - 存在しないプロパティ "%1" はアニメーション出来ません + 存在しないプロパティ "%1" はアニメーションできません Cannot animate read-only property "%1" - 読込専用のプロパティ "%1" はアニメーション出来ません + 読込専用のプロパティ "%1" はアニメーションできません Animation is an abstract class @@ -1320,7 +1333,7 @@ to Cannot anchor to an item that isn't a parent or sibling. - 親でも兄弟でもない要素にはアンカー出来ません。 + 親でも兄弟でもない要素にはアンカーできません。 Possible anchor loop detected on vertical anchor. @@ -1336,15 +1349,15 @@ to Cannot anchor to a null item. - 空の要素にはアンカー出来ません。 + 空の要素にはアンカーできません。 Cannot anchor a horizontal edge to a vertical edge. - 横方向のエッジから縦方向のエッジへはアンカー出来ません。 + 横方向のエッジから縦方向のエッジへはアンカーできません。 Cannot anchor item to self. - 自分自身へはアンカー出来ません。 + 自分自身へはアンカーできません。 Cannot specify top, bottom, and vcenter anchors. @@ -1356,7 +1369,7 @@ to Cannot anchor a vertical edge to a horizontal edge. - 縦方向のエッジから横方向のエッジへはアンカー出来ません。 + 縦方向のエッジから横方向のエッジへはアンカーできません。 @@ -1366,6 +1379,13 @@ to Qt は QMovie のサポートを外してビルドされています + + QDeclarativeApplication + + Application is an abstract class + Application は抽象クラスです + + QDeclarativeBehavior @@ -1493,13 +1513,21 @@ to Cannot create empty component specification 仕様が空であるコンポーネントは作成できません + + "%1.%2" is not available in %3 %4.%5. + %3 %4.%5 で "%1.%2" は利用できません。 + + + "%1.%2" is not available due to component versioning. + コンポーネントのバージョンの問題により "%1.%2" は利用できません。 + Incorrectly specified signal assignment 仕様と異なるシグナルが割り当てられています Cannot assign a value to a signal (expecting a script to be run) - 値をシグナルに割り当てることはできません(ただし、スクリプトは除きます) + 値はシグナルに割り当てできません(ただし、スクリプトは除きます) Empty signal assignment @@ -1551,7 +1579,7 @@ to Cannot assign a value directly to a grouped property - グループ化されたプロパティに直接値を割り当てることはできません + グループ化されたプロパティに直接値を割り当てできません Invalid property use @@ -1563,15 +1591,15 @@ to Single property assignment expected - プロパティに複数の値は割り当てられません + プロパティに複数の値は割り当てできません Unexpected object assignment - オブジェクトを割り当てることはできません + オブジェクトを割り当てできません Cannot assign object to list - オブジェクトをリストに割り当てることはできません + オブジェクトをリストに割り当てできません Can only assign one binding to lists @@ -1579,19 +1607,23 @@ to Cannot assign primitives to lists - プリミティブをリストに割り当てることはできません + プリミティブをリストに割り当てできません Cannot assign multiple values to a script property - 複数の値をスクリプトプロパティに割り当てることはできません + 複数の値をスクリプトプロパティに割り当てできません Invalid property assignment: script expected 無効なプロパティの値: スクリプトを指定してください + + Cannot assign multiple values to a singular property + 複数の値を単数プロパティに割り当てできません + Cannot assign object to property - オブジェクトをプロパティに割り当てることはできません + オブジェクトをプロパティに割り当てできません "%1" cannot operate on "%2" @@ -1647,7 +1679,7 @@ to Cannot override FINAL property - FINAL プロパティを上書きすることはできません + FINAL プロパティは上書きできません Invalid property type @@ -1675,19 +1707,27 @@ to No property alias location - プロパティのエイリアスのパスがありません + プロパティのエイリアスへのパスがありません Invalid alias location 無効なエイリアスのパス + + Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property> + 無効なエイリアスの参照です。エイリアスの参照先は <ID>, <ID>.<プロパティ> もしくは <ID>.<値プロパティ>.<プロパティ> のいずれかでなくてはいけません + + + Alias property exceeds alias bounds + エイリアスプロパティがエイリアスの境界を越えています + Invalid alias reference. An alias reference must be specified as <id> or <id>.<property> - 無効なエイリアスの参照です。エイリアスの参照先は <ID> もしくは <ID>.<プロパティ> でなくてはいけません + 無効なエイリアスの参照です。エイリアスの参照先は <ID> もしくは <ID>.<プロパティ> でなくてはいけません Invalid alias reference. Unable to find id "%1" - 無効なエイリアスの参照です。 ID "%1" が見つかりません + 無効なエイリアスの参照です。ID "%1" が見つかりません @@ -1696,6 +1736,10 @@ to Invalid empty URL 空の URL は無効です + + createObject: value is not an object + createObject: 値がオブジェクトではありません + QDeclarativeCompositeTypeManager @@ -1775,6 +1819,10 @@ to QDeclarativeImportDatabase + + cannot load module "%1": File name case mismatch for "%2" + モジュール "%1" がロードできません: ファイル名の大文字小文字が "%2" に合っていません + module "%1" definition "%2" not readable "%1" モジュールの定義 "%2" が読めません @@ -1831,19 +1879,34 @@ to is not a type は型ではありません + + File name case mismatch for "%2" + ファイル名の大文字小文字が "%2" に合っていません + QDeclarativeKeyNavigationAttached KeyNavigation is only available via attached properties - KeyNavigation はアタッチド・プロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます + KeyNavigation はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます QDeclarativeKeysAttached Keys is only available via attached properties - Keys はアタッチド・プロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます + Keys はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます + + + + QDeclarativeLayoutMirroringAttached + + LayoutDirection attached property only works with Items + アタッチされたプロパティ LayoutDirection はアイテムでのみ利用できます + + + LayoutMirroring is only available via attached properties + LayoutMirroring はアタッチされたプロパティ(Attached Property: 型名.プロパティ名)の形式でのみ利用できます @@ -2146,7 +2209,7 @@ to Cannot assign object type %1 with no default method - 型 %1 のオブジェクトをデフォルトメソッドなしに割り当てることはできません + デフォルトメソッドの無い型 %1 のオブジェクトは割り当てできません Cannot connect mismatched signal/slot %1 %vs. %2 @@ -2220,7 +2283,7 @@ to QDialog What's This? - ヒント? + ヒント Done @@ -2267,7 +2330,7 @@ to Open - オープン + 開く &Cancel @@ -2323,7 +2386,7 @@ to &OK - OK(&O) + &OK @@ -2397,7 +2460,7 @@ to &OK - OK(&O) + &OK @@ -2420,7 +2483,7 @@ to Cannot open for output - コピー先のファイルをオープンできません + コピー先のファイルを開けません Failure to write block @@ -2451,7 +2514,7 @@ to &Open - オープン(&O) + 開く(&O) &Save @@ -2459,7 +2522,7 @@ to Open - オープン + 開く %1 already exists. @@ -2477,7 +2540,7 @@ Please verify the correct file name was given. My Computer - マイ コンピュータ + マイコンピュータ %1 @@ -2692,7 +2755,7 @@ Do you want to delete it anyway? My Computer - マイ コンピュータ + マイコンピュータ Computer @@ -2732,7 +2795,7 @@ Do you want to delete it anyway? Italic - イタリック + 斜体 Oblique @@ -3207,7 +3270,7 @@ Do you want to delete it anyway? QIBaseDriver Error opening database - データベースのオープンでエラーが発生しました + データベースのオープン時にエラーが発生しました Could not start transaction @@ -3234,7 +3297,7 @@ Do you want to delete it anyway? Unable to open BLOB - バイナリラージオブジェクトをオープンできません + バイナリラージオブジェクトを開けません Unable to read BLOB @@ -3390,11 +3453,11 @@ Do you want to delete it anyway? Cannot load library %1: %2 - ライブラリ '%1' を読み込むことができません: %2 + ライブラリ '%1' を読み込めません: %2 Cannot unload library %1: %2 - ライブラリ %1 を解放することができません: %2 + ライブラリ %1 を解放できません: %2 Cannot resolve symbol "%1" in %2: %3 @@ -3502,7 +3565,7 @@ Do you want to delete it anyway? QMYSQLDriver Unable to open database ' - データベースをオープンできません ' + データベースを開けません ' Unable to connect @@ -3659,7 +3722,7 @@ Do you want to delete it anyway? Open - オープン + 開く Execute @@ -3833,7 +3896,7 @@ Do you want to delete it anyway? QNetworkAccessCacheBackend Error opening %1 - オープンのエラー %1 + オープン時のエラー %1 @@ -3870,7 +3933,7 @@ Do you want to delete it anyway? Error opening %1: %2 - %1 をオープンする時にエラーが発生しました: %2 + %1 のオープン時にエラーが発生しました: %2 Write error writing to %1: %2 @@ -3878,7 +3941,7 @@ Do you want to delete it anyway? Cannot open %1: Path is a directory - %1 をオープンできません。指定されたパスはディレクトリです + %1 を開けません。指定されたパスはディレクトリです Read error reading from %1: %2 @@ -3893,7 +3956,7 @@ Do you want to delete it anyway? Cannot open %1: is a directory - %1 をオープンできません。指定されたパスはディレクトリです + %1 を開けません。指定されたパスはディレクトリです Logging in to %1 failed: authentication required @@ -4623,7 +4686,7 @@ Please choose a different file name. QPrintPreviewDialog Page Setup - ページの設定 + ページ設定 %1% @@ -4691,7 +4754,7 @@ Please choose a different file name. Page setup - ページの設定 + ページ設定 Close @@ -4847,11 +4910,11 @@ Please choose a different file name. QProcess Could not open input redirection for reading - 標準入力リダイレクトを読み込みのためにオープンすることができません + 標準入力リダイレクトを読み込みのために開けませんでした Could not open output redirection for writing - 標準出力リダイレクトを書き込みのためにオープンすることができません + 標準出力リダイレクトを書き込みのために開けませんでした Resource error (fork failure): %1 @@ -4893,7 +4956,7 @@ Please choose a different file name. QPushButton Open - オープン + 開く @@ -4954,7 +5017,7 @@ Please choose a different file name. QSQLite2Driver Error opening database - データベースのオープンでエラーが発生しました + データベースのオープン時にエラーが発生しました Unable to begin transaction @@ -4984,11 +5047,11 @@ Please choose a different file name. QSQLiteDriver Error opening database - データベースのオープンでエラーが発生しました + データベースのオープン時にエラーが発生しました Error closing database - データベースのクローズでエラーが発生しました + データベースのクローズ時にエラーが発生しました Unable to begin transaction @@ -5495,11 +5558,11 @@ Please choose a different file name. Pause - Pause + 一時停止 Print - Print + 印刷 SysReq @@ -6113,11 +6176,11 @@ Please choose a different file name. Insert - Insert + 挿入 Delete - Delete + 削除 Escape @@ -6129,7 +6192,7 @@ Please choose a different file name. Select - Select + 選択 Yes @@ -6430,7 +6493,7 @@ Please choose a different file name. Select - セレクト + 選択 Done @@ -6553,6 +6616,10 @@ Please choose a different file name. Error during SSL handshake: %1 SSL ハンドシェーク時にエラーが発生しました: %1 + + The peer certificate is blacklisted + 通信相手の証明書がブラックリストに載っています + No error エラーはありません @@ -6760,7 +6827,7 @@ Please choose a different file name. Open - オープン + 開く @@ -6906,7 +6973,7 @@ Please choose a different file name. Choose File title for file button used in HTML forms - ファイルを選ぶ + ファイルを選択 No file selected @@ -7061,7 +7128,7 @@ Please choose a different file name. Italic Italic context menu item - イタリック + 斜体 Underline @@ -7141,7 +7208,7 @@ Please choose a different file name. Slider Media controller element - スライダ + スライダー Slider Thumb @@ -7586,7 +7653,7 @@ Please choose a different file name. QWhatsThisAction What's This? - ヒント? + ヒント diff --git a/translations/qtconfig_ja.ts b/translations/qtconfig_ja.ts index cf3ec13aa0..8440389e8c 100644 --- a/translations/qtconfig_ja.ts +++ b/translations/qtconfig_ja.ts @@ -3,6 +3,26 @@ MainWindow + + <p><b><font size+=2>Appearance</font></b></p><hr><p>Use this tab to customize the appearance of your Qt applications.</p><p>You can select the default GUI Style from the drop down list and customize the colors.</p><p>Any GUI Style plugins in your plugin path will automatically be added to the list of built-in Qt styles. (See the Library Paths tab for information on adding new plugin paths.)</p><p>When you choose 3-D Effects and Window Background colors, the Qt Configuration program will automatically generate a palette for you. To customize colors further, press the Tune Palette button to open the advanced palette editor.<p>The Preview Window shows what the selected Style and colors look like. + + + + <p><b><font size+=2>Fonts</font></b></p><hr><p>Use this tab to select the default font for your Qt applications. The selected font is shown (initially as 'Sample Text') in the line edit below the Family, Style and Point Size drop down lists.</p><p>Qt has a powerful font substitution feature that allows you to specify a list of substitute fonts. Substitute fonts are used when a font cannot be loaded, or if the specified font doesn't have a particular character.<p>For example, if you select the font Lucida, which doesn't have Korean characters, but need to show some Korean text using the Mincho font family you can do so by adding Mincho to the list. Once Mincho is added, any Korean characters that are not found in the Lucida font will be taken from the Mincho font. Because the font substitutions are lists, you can also select multiple families, such as Song Ti (for use with Chinese text). + + + + <p><b><font size+=2>Interface</font></b></p><hr><p>Use this tab to customize the feel of your Qt applications.</p><p>If the Resolve Symlinks checkbox is checked Qt will follow symlinks when handling URLs. For example, in the file dialog, if this setting is turned on and /usr/tmp is a symlink to /var/tmp, entering the /usr/tmp directory will cause the file dialog to change to /var/tmp. With this setting turned off, symlinks are not resolved or followed.</p><p>The Global Strut setting is useful for people who require a minimum size for all widgets (e.g. when using a touch panel or for users who are visually impaired). Leaving the Global Strut width and height at 0 will disable the Global Strut feature</p><p>XIM (Extended Input Methods) are used for entering characters in languages that have large character sets, for example, Chinese and Japanese. + + + + <p><b><font size+=2>Printer</font></b></p><hr><p>Use this tab to configure the way Qt generates output for the printer.You can specify if Qt should try to embed fonts into its generated output.If you enable font embedding, the resulting postscript will be more portable and will more accurately reflect the visual output on the screen; however the resulting postscript file size will be bigger.<p>When using font embedding you can select additional directories where Qt should search for embeddable font files. By default, the X server font path is used. + + + + <p><b><font size+=2>Phonon</font></b></p><hr><p>Use this tab to configure the Phonon GStreamer multimedia backend. <p>It is reccommended to leave all settings on "Auto" to let Phonon determine your settings automatically. + + Desktop Settings (Default) デスクトップの設定(デフォルト) @@ -364,7 +384,7 @@ Browse... - ブラウズ... + 参照... Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. -- cgit v1.2.3 From 53d1557f1ef4969bd5c8d68b82a0151ae03f004a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 6 Jun 2011 12:21:37 +0200 Subject: Have -small-screen enabled in certain examples on Symbian always. --- demos/deform/main.cpp | 4 ++++ demos/pathstroke/main.cpp | 4 ++++ examples/draganddrop/fridgemagnets/main.cpp | 5 +++++ examples/script/context2d/main.cpp | 5 +++++ examples/widgets/wiggly/main.cpp | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/demos/deform/main.cpp b/demos/deform/main.cpp index 70e4bec0b9..21ce7fb313 100644 --- a/demos/deform/main.cpp +++ b/demos/deform/main.cpp @@ -50,7 +50,11 @@ int main(int argc, char **argv) QApplication app(argc, argv); +#ifdef Q_OS_SYMBIAN + bool smallScreen = true; +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); +#endif PathDeformWidget deformWidget(0, smallScreen); diff --git a/demos/pathstroke/main.cpp b/demos/pathstroke/main.cpp index 2e9153f93e..6d688c3fe8 100644 --- a/demos/pathstroke/main.cpp +++ b/demos/pathstroke/main.cpp @@ -48,7 +48,11 @@ int main(int argc, char **argv) QApplication app(argc, argv); +#ifdef Q_OS_SYMBIAN + bool smallScreen = true; +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); +#endif PathStrokeWidget pathStrokeWidget(smallScreen); QStyle *arthurStyle = new ArthurStyle(); diff --git a/examples/draganddrop/fridgemagnets/main.cpp b/examples/draganddrop/fridgemagnets/main.cpp index 1166abbcaa..e87ef5b39b 100644 --- a/examples/draganddrop/fridgemagnets/main.cpp +++ b/examples/draganddrop/fridgemagnets/main.cpp @@ -51,7 +51,12 @@ int main(int argc, char *argv[]) #endif DragWidget window; +#ifdef Q_OS_SYMBIAN + bool smallScreen = true; +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); +#endif + if (smallScreen) window.showFullScreen(); else diff --git a/examples/script/context2d/main.cpp b/examples/script/context2d/main.cpp index 3d56910102..20df178869 100644 --- a/examples/script/context2d/main.cpp +++ b/examples/script/context2d/main.cpp @@ -48,7 +48,12 @@ int main(int argc, char **argv) QApplication app(argc, argv); Window win; +#ifdef Q_OS_SYMBIAN + bool smallScreen = true; +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); +#endif + if (!smallScreen) { win.show(); } else { diff --git a/examples/widgets/wiggly/main.cpp b/examples/widgets/wiggly/main.cpp index 91cd1b8c4b..7ba6d3649a 100644 --- a/examples/widgets/wiggly/main.cpp +++ b/examples/widgets/wiggly/main.cpp @@ -45,7 +45,11 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); +#ifdef Q_OS_SYMBIAN + bool smallScreen = true; +#else bool smallScreen = QApplication::arguments().contains("-small-screen"); +#endif Dialog dialog(0, smallScreen); -- cgit v1.2.3 From 40191387a77552b2ba6df547b87de040e126220a Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 6 Jun 2011 13:53:36 +0200 Subject: Close context menus during orientation change. Make non-native QMenus, i.e. context menus, work like in Avkon. Reviewed-by: Miikka Heikkinen Reviewed-by: Sami Merila Task-number: QTBUG-19656 --- src/gui/kernel/qapplication_s60.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 6d1b96f266..d3b0e99e92 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -2243,6 +2243,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent #if defined(Q_SYMBIAN_SUPPORTS_MULTIPLE_SCREENS) case EEventDisplayChanged: #endif + { if (callSymbianEventFilters(symbianEvent)) return 1; if (S60) @@ -2254,6 +2255,12 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent QResizeEvent e(qt_desktopWidget->size(), oldSize); QApplication::sendEvent(qt_desktopWidget, &e); } + // Close non-native QMenus (that should act like context menus, i.e. close + // automatically when the orientation changes). + QMenu *activeMenu = qobject_cast(QApplication::activePopupWidget()); + if (activeMenu) + activeMenu->close(); + } return 0; // Propagate to CONE case EEventWindowVisibilityChanged: if (controlInMap) { -- cgit v1.2.3 From 34b888b2c6455cdcd4f931f6a5a038636cf951eb Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Tue, 7 Jun 2011 11:08:59 +0300 Subject: KERN-EXEC 3 panic in QCoeFepInputContext::translateInputWidget() There is no check if graphics view pointer is null in the SLOT function translateInputWidget(). Task-number: QTBUG-19734 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 67330e21ed..f057e0a962 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -868,6 +868,8 @@ void QCoeFepInputContext::ensureInputCapabilitiesChanged() void QCoeFepInputContext::translateInputWidget() { QGraphicsView *gv = qobject_cast(S60->splitViewLastWidget); + if (!gv) + return; QRect splitViewRect = qt_TRect2QRect(static_cast(S60->appUi())->ClientRect()); QRectF cursor = gv->scene()->inputMethodQuery(Qt::ImMicroFocus).toRectF(); -- cgit v1.2.3 From 071088a8bd1bac104adfcb648cd81e6c020e4e69 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 7 Jun 2011 15:32:58 +0300 Subject: Reset input context in Symbian when another window is opened. When symbol menu is opened, input context needs to be reset or preedit string duplication may occur after symbol menu is closed. Task-number: QTBUG-19528 Reviewed-by: Sami Merila --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index f057e0a962..b5133658cf 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -360,6 +360,11 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE } } + if (event->type() == QSymbianEvent::ResourceChangeEvent + && event->resourceChangeType() == KEikMessageFadeAllWindows) { + reset(); + } + return false; } -- cgit v1.2.3 From a2f52802bd7183ecb2ac2ba967393f0781fa7126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Niemel=C3=A4?= Date: Wed, 8 Jun 2011 10:14:56 +0300 Subject: Fixed qmlshadersplugin on windows VC2008 toolchain. This fix is originally submitted by George Tavares. APIENTRY is a Win32 macro defined as stdcall__ * Reviewed-by: Kim Gronholm --- src/imports/shaders/glfunctions.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/imports/shaders/glfunctions.h b/src/imports/shaders/glfunctions.h index 03b88d1cbc..8529519560 100755 --- a/src/imports/shaders/glfunctions.h +++ b/src/imports/shaders/glfunctions.h @@ -45,26 +45,26 @@ #ifndef QT_OPENGL_ES #ifndef Q_WS_MAC -# ifndef QGLF_APIENTRYP -# ifdef QGLF_APIENTRY -# define QGLF_APIENTRYP QGLF_APIENTRY * +# ifndef APIENTRYP +# ifdef APIENTRY +# define APIENTRYP APIENTRY * # else -# define QGLF_APIENTRY -# define QGLF_APIENTRYP * +# define APIENTRY +# define APIENTRYP * # endif # endif #else -# define QGLF_APIENTRY -# define QGLF_APIENTRYP * +# define APIENTRY +# define APIENTRYP * #endif #define GL_TEXTURE0 0x84C0 #define GL_CLAMP_TO_EDGE 0x812F #define GL_BGRA 0x80E1 -typedef void (QGLF_APIENTRYP type_glActiveTexture)(GLenum texture); -typedef void (QGLF_APIENTRYP type_glGenerateMipmap)(GLenum target); -typedef void (QGLF_APIENTRYP type_glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +typedef void (APIENTRYP type_glActiveTexture)(GLenum texture); +typedef void (APIENTRYP type_glGenerateMipmap)(GLenum target); +typedef void (APIENTRYP type_glVertexAttribPointer)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); #define glActiveTexture ((type_glActiveTexture)QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture"))) #define glGenerateMipmap ((type_glGenerateMipmap)QGLContext::currentContext()->getProcAddress(QLatin1String("glGenerateMipmap"))) -- cgit v1.2.3 From 7b0762c17f9899e68c0f67480a81b25c6f0c7dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Niemel=C3=A4?= Date: Wed, 8 Jun 2011 10:16:38 +0300 Subject: Fixed qmlshadersplugin manual test shaders on SGX family GPU:s. SGX GPU requires precision definitions for all variables. Additionally some unnecessary semicolons were removed. Reviewed-by: Kim Gronholm --- .../qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml | 2 +- .../qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml | 4 ++-- .../qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml | 2 +- .../qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml index 3b94389bd2..ec372ca1b4 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestHorizontalWrap.qml @@ -70,7 +70,7 @@ Rectangle { uniform lowp sampler2D source; varying highp vec2 qt_TexCoord0; void main() { - vec2 tex = qt_TexCoord0 * 4.0; + highp vec2 tex = qt_TexCoord0 * 4.0; gl_FragColor = texture2D(source, tex); } " diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml index a7530dc37d..4edb06530e 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVertexShader.qml @@ -67,7 +67,7 @@ Rectangle { { qt_TexCoord0 = qt_MultiTexCoord0; gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex; - }; + } " property string dummyVertexShader: " @@ -79,7 +79,7 @@ Rectangle { { qt_TexCoord0 = qt_MultiTexCoord0; gl_Position = qt_Vertex * vec4(0.0, 0.0, 0.0, 0.0001); - }; + } " vertexShader: defaultVertexShader diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml index 726b23761d..b7d6db4bb7 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestVerticalWrap.qml @@ -69,7 +69,7 @@ Rectangle { uniform lowp sampler2D source; varying highp vec2 qt_TexCoord0; void main() { - vec2 tex = qt_TexCoord0 * 4.0; + highp vec2 tex = qt_TexCoord0 * 4.0; gl_FragColor = texture2D(source, tex); } " diff --git a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml index 514e15046b..e09673cc85 100644 --- a/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml +++ b/tests/manual/declarative/qmlshadersplugin/qml/qmlshadersplugintest/TestWrapRepeat.qml @@ -69,7 +69,7 @@ Rectangle { uniform lowp sampler2D source; varying highp vec2 qt_TexCoord0; void main() { - vec2 tex = qt_TexCoord0 * 4.0; + highp vec2 tex = qt_TexCoord0 * 4.0; gl_FragColor = texture2D(source, tex); } " -- cgit v1.2.3 From ab00a395bb00ccd130a01d49bf18c2bc597a1fe6 Mon Sep 17 00:00:00 2001 From: Xizhi Zhu Date: Wed, 8 Jun 2011 11:44:41 +0300 Subject: Update internal state before emitting configurationChanged() signals. PMO Bug 257336. --- src/plugins/bearer/icd/qicdengine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp index c793e52cf9..79be2cee0c 100644 --- a/src/plugins/bearer/icd/qicdengine.cpp +++ b/src/plugins/bearer/icd/qicdengine.cpp @@ -929,6 +929,7 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg) configLocker.unlock(); locker.unlock(); + emit iapStateChanged(iapid, icd_connection_state); emit configurationChanged(ptr); locker.relock(); -- cgit v1.2.3