summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-06-08 18:47:57 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-06-08 18:47:57 (GMT)
commitd7d55ab51381f5805d52523d98623e63a99db2cf (patch)
tree5b760b92f84bdb2137fe7d53e16d78c0693fd2f4 /src
parentc5de4176dac960d8f7c6d2d77b0d8bf3c7311da9 (diff)
parent2ae808a23ce05bf9768ad9df107c16bb0c555ee7 (diff)
downloadQt-d7d55ab51381f5805d52523d98623e63a99db2cf.zip
Qt-d7d55ab51381f5805d52523d98623e63a99db2cf.tar.gz
Qt-d7d55ab51381f5805d52523d98623e63a99db2cf.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: tools/qdoc3/test/qt-html-templates.qdocconf
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp8
-rw-r--r--src/3rdparty/phonon/mmf/abstractaudioeffect.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/abstractaudioeffect.h4
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.cpp3
-rw-r--r--src/3rdparty/phonon/mmf/bassboost.cpp1
-rw-r--r--src/3rdparty/phonon/mmf/effectfactory.cpp5
-rw-r--r--src/3rdparty/phonon/mmf/loudness.cpp1
-rw-r--r--src/3rdparty/webkit/.tag2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog15
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h4
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog232
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.gypi2
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro48
-rw-r--r--src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp18
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h1
-rw-r--r--src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp30
-rw-r--r--src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h1
-rw-r--r--src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl3
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.h3
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/ScrollView.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp25
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/NetworkStateNotifier.h9
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm (renamed from src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp)5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog66
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc425
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp83
-rw-r--r--src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri (renamed from src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri)0
-rw-r--r--src/corelib/global/qconfig-medium.h3
-rw-r--r--src/corelib/global/qconfig-minimal.h3
-rw-r--r--src/corelib/global/qconfig-small.h3
-rw-r--r--src/corelib/global/qfeatures.h3
-rw-r--r--src/corelib/global/qfeatures.txt6
-rw-r--r--src/corelib/global/qnamespace.h21
-rw-r--r--src/corelib/global/qnamespace.qdoc19
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.h8
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp2
-rw-r--r--src/corelib/tools/qhash.h9
-rw-r--r--src/corelib/tools/qmap.h9
-rw-r--r--src/corelib/tools/qstring.cpp13
-rw-r--r--src/declarative/QmlChanges.txt1
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp25
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp185
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp31
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp50
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp59
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp101
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp112
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h7
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p_p.h12
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp136
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp6
-rw-r--r--src/declarative/qml/qdeclarative.h2
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h2
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h2
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp6
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp23
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp31
-rw-r--r--src/declarative/util/qdeclarativepackage_p.h2
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp2
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp2
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation_p_p.h2
-rw-r--r--src/declarative/util/qdeclarativestate_p.h2
-rw-r--r--src/declarative/util/qdeclarativetimeline_p_p.h8
-rw-r--r--src/declarative/util/qdeclarativetimer.cpp23
-rw-r--r--src/declarative/util/qdeclarativetransitionmanager_p_p.h2
-rw-r--r--src/gui/embedded/qwsmanager_qws.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp11
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h4
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp13
-rw-r--r--src/gui/graphicsview/qgraphicsscene.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/gui/image/qiconloader.cpp16
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/image/qpixmap.cpp11
-rw-r--r--src/gui/kernel/qapplication.cpp9
-rw-r--r--src/gui/kernel/qapplication.h2
-rw-r--r--src/gui/kernel/qapplication_p.h9
-rw-r--r--src/gui/kernel/qapplication_s60.cpp27
-rw-r--r--src/gui/kernel/qapplication_win.cpp17
-rw-r--r--src/gui/kernel/qapplication_x11.cpp2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm10
-rw-r--r--src/gui/kernel/qevent.cpp5
-rw-r--r--src/gui/kernel/qevent.h4
-rw-r--r--src/gui/kernel/qevent_p.h3
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm2
-rw-r--r--src/gui/kernel/qgesture.cpp4
-rw-r--r--src/gui/kernel/qgesture.h4
-rw-r--r--src/gui/kernel/qgesture_p.h4
-rw-r--r--src/gui/kernel/qgesturemanager.cpp5
-rw-r--r--src/gui/kernel/qgesturemanager_p.h4
-rw-r--r--src/gui/kernel/qgesturerecognizer.cpp4
-rw-r--r--src/gui/kernel/qgesturerecognizer.h4
-rw-r--r--src/gui/kernel/qkeysequence.cpp30
-rw-r--r--src/gui/kernel/qmacgesturerecognizer_mac.mm4
-rw-r--r--src/gui/kernel/qmacgesturerecognizer_mac_p.h4
-rw-r--r--src/gui/kernel/qstandardgestures.cpp4
-rw-r--r--src/gui/kernel/qstandardgestures_p.h4
-rw-r--r--src/gui/kernel/qwidget.cpp66
-rw-r--r--src/gui/kernel/qwidget.h4
-rw-r--r--src/gui/kernel/qwidget_mac.mm4
-rw-r--r--src/gui/kernel/qwidget_p.h49
-rw-r--r--src/gui/kernel/qwidget_s60.cpp10
-rw-r--r--src/gui/kernel/qwidget_win.cpp2
-rw-r--r--src/gui/kernel/qwinnativepangesturerecognizer_win.cpp4
-rw-r--r--src/gui/kernel/qwinnativepangesturerecognizer_win_p.h5
-rw-r--r--src/gui/painting/qbackingstore.cpp6
-rw-r--r--src/gui/painting/qbrush.cpp7
-rw-r--r--src/gui/painting/qdrawutil.cpp5
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp7
-rw-r--r--src/gui/painting/qpainter.cpp48
-rw-r--r--src/gui/statemachine/qguistatemachine.cpp2
-rw-r--r--src/gui/styles/qgtkpainter.cpp51
-rw-r--r--src/gui/styles/qgtkstyle.cpp58
-rw-r--r--src/gui/styles/qplastiquestyle.cpp37
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--src/gui/styles/qwindowsstyle.cpp5
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp76
-rw-r--r--src/gui/text/qfontengine_s60.cpp172
-rw-r--r--src/gui/text/qfontengine_s60_p.h25
-rw-r--r--src/gui/text/qfontmetrics.cpp25
-rw-r--r--src/gui/text/qfontmetrics.h1
-rw-r--r--src/gui/text/qstatictext.cpp37
-rw-r--r--src/gui/text/qstatictext_p.h7
-rw-r--r--src/gui/text/qtextcursor.cpp87
-rw-r--r--src/gui/text/qtextcursor.h6
-rw-r--r--src/gui/text/qtextcursor_p.h3
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp58
-rw-r--r--src/gui/text/qtextengine.cpp8
-rw-r--r--src/gui/text/qtextengine_p.h1
-rw-r--r--src/gui/text/qtextlayout.cpp4
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp8
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
-rw-r--r--src/gui/widgets/qprogressbar.h6
-rw-r--r--src/gui/widgets/qstackedwidget.cpp8
-rw-r--r--src/imports/gestures/plugin.cpp3
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp4
-rw-r--r--src/imports/gestures/qdeclarativegesturearea_p.h4
-rw-r--r--src/imports/webkit/qdeclarativewebview.cpp3
-rw-r--r--src/imports/webkit/qdeclarativewebview_p.h4
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp9
-rw-r--r--src/network/access/qnetworkcookie.cpp2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp6
-rw-r--r--src/network/ssl/qsslcertificate.cpp23
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp33
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h3
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp5
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h1
-rw-r--r--src/opengl/qgl.cpp22
-rw-r--r--src/opengl/qgl.h4
-rw-r--r--src/opengl/qgl_x11.cpp3
-rw-r--r--src/opengl/qglframebufferobject.cpp30
-rw-r--r--src/opengl/qglframebufferobject.h2
-rw-r--r--src/openvg/qpaintengine_vg.cpp45
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp4
-rw-r--r--src/plugins/s60/s60pluginbase.pri17
-rw-r--r--src/qbase.pri2
-rw-r--r--src/s60installs/qt.iby15
-rw-r--r--src/s60installs/s60installs.pro74
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp4
-rw-r--r--src/svg/qgraphicssvgitem.cpp6
197 files changed, 2787 insertions, 776 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
index 022689b..b3c229e 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp
@@ -1094,6 +1094,10 @@ RVCT()
#define DEFINE_STUB_FUNCTION(rtype, op) rtype JIT_STUB cti_##op(STUB_ARGS_DECLARATION)
#endif
+#if COMPILER(GCC)
+#pragma GCC visibility push(hidden)
+#endif
+
DEFINE_STUB_FUNCTION(EncodedJSValue, op_convert_this)
{
STUB_INIT_STACK_FRAME(stackFrame);
@@ -3205,6 +3209,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, to_object)
return JSValue::encode(stackFrame.args[0].jsValue().toObject(callFrame));
}
+#if COMPILER(GCC)
+#pragma GCC visibility pop
+#endif
+
} // namespace JSC
#endif // ENABLE(JIT)
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
index 6cfeb76..9b64ab3 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp
@@ -184,6 +184,8 @@ int AbstractAudioEffect::effectParameterChanged(
const EffectParameter &param, const QVariant &value)
{
// Default implementation
+ Q_UNUSED(param)
+ Q_UNUSED(value)
Q_ASSERT_X(false, Q_FUNC_INFO, "Effect has no parameters");
return 0;
}
diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.h b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
index d71993b..70adcf6 100644
--- a/src/3rdparty/phonon/mmf/abstractaudioeffect.h
+++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.h
@@ -118,6 +118,10 @@ private:
// for each of the effects. Using this reduces repetition of boilerplate
// in the implementations of the backend effect nodes.
+#ifdef Q_CC_NOKIAX86
+# pragma warn_illtokenpasting off
+#endif
+
#define PHONON_MMF_DEFINE_EFFECT_FUNCTIONS(Effect) \
\
void Effect##::createEffect(AudioPlayer::NativePlayer *player) \
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp
index c6be20b..3588683 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.cpp
+++ b/src/3rdparty/phonon/mmf/audiooutput.cpp
@@ -78,6 +78,9 @@ bool MMF::AudioOutput::setOutputDevice(int index)
{
Q_ASSERT_X(index == AudioOutputDeviceID, Q_FUNC_INFO,
"We only support one output device, with id 0");
+#ifdef QT_NO_DEBUG
+ Q_UNUSED(index)
+#endif
return true;
}
diff --git a/src/3rdparty/phonon/mmf/bassboost.cpp b/src/3rdparty/phonon/mmf/bassboost.cpp
index c7af939..67076f6 100644
--- a/src/3rdparty/phonon/mmf/bassboost.cpp
+++ b/src/3rdparty/phonon/mmf/bassboost.cpp
@@ -49,6 +49,7 @@ const char* BassBoost::description()
bool BassBoost::getParameters(CMdaAudioOutputStream *stream,
QList<EffectParameter> &parameters)
{
+ Q_UNUSED(parameters)
QScopedPointer<CBassBoost> effect;
TRAPD(err, effect.reset(CBassBoost::NewL(*stream)));
return (KErrNone == err);
diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp
index c5e33d5..4643978 100644
--- a/src/3rdparty/phonon/mmf/effectfactory.cpp
+++ b/src/3rdparty/phonon/mmf/effectfactory.cpp
@@ -183,8 +183,9 @@ EffectFactory::EffectData EffectFactory::getData()
/* defaultValue */ QVariant(bool(true)));
data.m_parameters.append(param);
- if (data.m_supported = BackendNode::getParameters
- (stream.data(), data.m_parameters)) {
+ data.m_supported = BackendNode::getParameters(stream.data(),
+ data.m_parameters);
+ if (data.m_supported) {
const QString description = QCoreApplication::translate
("Phonon::MMF::EffectFactory", BackendNode::description());
data.m_descriptions.insert("name", description);
diff --git a/src/3rdparty/phonon/mmf/loudness.cpp b/src/3rdparty/phonon/mmf/loudness.cpp
index 1079a35..ca05ab0 100644
--- a/src/3rdparty/phonon/mmf/loudness.cpp
+++ b/src/3rdparty/phonon/mmf/loudness.cpp
@@ -49,6 +49,7 @@ const char* Loudness::description()
bool Loudness::getParameters(CMdaAudioOutputStream *stream,
QList<EffectParameter> &parameters)
{
+ Q_UNUSED(parameters)
QScopedPointer<CLoudness> effect;
TRAPD(err, effect.reset(CLoudness::NewL(*stream)));
return (KErrNone == err);
diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 8cb0e53..09a4fe2 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-f59a934694947496cedecc5256a71bff60c43c4c
+f943ead2759537527faa7f3cb057d995291663b9
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index 016e0dd..d9b2987 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-07 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Crash when compiling on Snow Leopard and running on Leopard
+ https://bugs.webkit.org/show_bug.cgi?id=31403
+
+ Disable the use of pthread_setname_np and other symbols
+ when targetting Leopard.
+
+ Use the defines TARGETING_XX instead of BUILDING_ON_XX
+ for features that cannot be used before Snow Leopard.
+
+ * wtf/Platform.h:
+
2010-04-20 Csaba Osztrogonác <ossy@webkit.org>
[Qt] Unreviewed speculative buildfix for WinCE after r57882
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
index fac477e..876e60e 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h
@@ -700,11 +700,11 @@
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TIMEB_H 1
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
#define HAVE_DISPATCH_H 1
-#if !PLATFORM(IPHONE) && !PLATFORM(QT)
+#if !PLATFORM(IPHONE)
#define HAVE_MADV_FREE_REUSE 1
#define HAVE_MADV_FREE 1
#define HAVE_PTHREAD_SETNAME_NP 1
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index fb78e36..a19b85a 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
and has the sha1 checksum
- c58dc2f491a824ac56e31c440fcf7fe16dab09c4
+ 6db5de6d18c3ab8b74809303e4d79abacfc570a8
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index ff7d214..1d9d739 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,235 @@
+2010-06-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix text selection drawing.
+ https://bugs.webkit.org/show_bug.cgi?id=40221
+
+ The regression was introduced in r60169.
+
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::drawTextCommon):
+
+2010-06-04 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix compilation with QT_NO_FEATURE
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ The #ifdef QT_NO_GRAPHICSEFFECT was in the wrong place, would have
+ made AC not work at all.
+
+ No new tests.
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::flushChanges):
+
+2010-05-24 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix compilation with QT_NO_TEMPORARYFILE
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * platform/qt/FileSystemQt.cpp:
+ (WebCore::openTemporaryFile):
+
+2010-05-21 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_GRAPHICSEFFECT
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::GraphicsLayerQtImpl::flushChanges):
+
+2010-05-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_BEARERMANAGEMENT
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * platform/network/NetworkStateNotifier.h:
+ * platform/network/qt/NetworkStateNotifierQt.cpp:
+
+2010-05-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_LINEEDIT
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * platform/qt/RenderThemeQt.cpp:
+ (WebCore::RenderThemeQt::~RenderThemeQt):
+ (WebCore::RenderThemeQt::findFrameLineWidth):
+
+2010-06-04 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Compilation fails when compiling against Qt 4.7 and Qt Mobility is installed
+ https://bugs.webkit.org/show_bug.cgi?id=40116
+
+ CONFIG += mobility has the side-effect of pulling in mobility includes, which conflict
+ with Qt 4.7's bearer managenent includes and break the build.
+
+ * WebCore.pro:
+
+2010-06-03 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix NPAPI support on Mac OS X/Cocoa-32
+
+ qt_mac_window_for() returns a NSWindow on Cocoa, so we were
+ passing in a NSWindow instead of a WindowRef as part of the
+ NP_CGContext.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38762
+
+ * WebCore.gypi: Reflect rename
+ * WebCore.pro: Reflect rename
+ * plugins/mac/PluginViewMac.cpp: Renamed to PluginViewMac.mm
+ and fix bug by getting the Carbon windowRef from the NSWindow.
+ * wscript: Reflect rename
+
+2010-06-02 Nico Weber <thakis@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Scroll events are sent twice per keypress for ports that don't have a platformWidget scrollbar
+ https://bugs.webkit.org/show_bug.cgi?id=39918
+
+ This was regressed by http://trac.webkit.org/changeset/58615 . Fix this by slightly tweaking
+ that patch.
+
+ Test: editing/input/page-up-down-scrolls.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollPositionChanged):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::valueChanged):
+ * platform/ScrollView.h:
+ (WebCore::ScrollView::repaintFixedElementsAfterScrolling):
+
+2010-06-02 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix make install on Symbian for headers in package builds when INSTALL_HEADERS is not defined
+
+ First we wrote inst_headers.output with $$[QT_INSTALL_HEADERS] and then
+ overwrote it with the $$INSTALL_HEADERS variant without checking if the
+ variable was set.
+
+ Fixed and cleaned up the logic of falling back to $$[QT_INSTALL_HEADERS].
+
+ * WebCore.pro:
+
+2010-06-01 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] GraphicsLayer: warnings when reloading page
+ https://bugs.webkit.org/show_bug.cgi?id=39694
+
+ Made sure recaching and masks aren't attempted on zero-size layers.
+
+ No new tests. Old tests (e.g. LayoutTests/compositing/masks) show the problem.
+
+ * platform/graphics/qt/GraphicsLayerQt.cpp:
+ (WebCore::MaskEffectQt::draw):
+ (WebCore::GraphicsLayerQtImpl::recache):
+
+2010-05-10 Rodrigo Belem <rodrigo.belem@openbossa.org>
+
+ Reviewed by Kenneth Christiansen , Simon Hausmann and Gustavo Noronha.
+
+ [Qt, Gtk] Allows build-webkit script to receive an install prefix as parameter
+ https://bugs.webkit.org/show_bug.cgi?id=26224
+
+ This patch adds the ability, in the QtWebkit build system, to change
+ the installation path.
+
+ * WebCore.pro:
+
+2010-06-01 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Fix installation of the QtWebKit module .pri file when building inside of Qt
+
+ * WebCore.pro:
+
+2010-06-01 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix a QtWebKit.pc corruption problem.
+ https://bugs.webkit.org/show_bug.cgi?id=36826
+
+ The problem occurs while installing QtWebKit from trunk
+ or a source package.
+
+ * WebCore.pro:
+
+2010-06-01 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Fix Symbian package dependencies of apps against QtWebKit when installing into Qt
+
+ Install the versioning qt_webkit_version.pri into $$[QMAKE_MKSPECS]/modules, which is
+ where mkspecs/features/qt.prf expects it.
+
+ * WebCore.pro:
+
+2010-05-17 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Bring CanvasRenderingContext2D's createImageData() in line with HTML5 spec
+ Added createImageData(ImageData) which returns a new ImageData with the same size as the one passed.
+ Changed createImageData(width, height) to use the absolute values of width and height.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39189
+
+ Spec link:
+ http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-createimagedata
+
+ Test: fast/canvas/canvas-createImageData.html
+
+ * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+ (WebCore::JSCanvasRenderingContext2D::createImageData):
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::createImageData):
+ * html/canvas/CanvasRenderingContext2D.h:
+ * html/canvas/CanvasRenderingContext2D.idl:
+
+2010-05-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Properly handle invalid arguments to CanvasRenderingContext2D's getImageData() and putImageData().
+ Both should throw NOT_SUPPORTED_ERR when called with nonfinite arguments.
+ getImageData() should throw INDEX_SIZE_ERR if either width or height is 0.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39175
+
+ Spec link:
+ http://www.whatwg.org/specs/web-apps/current-work/#pixel-manipulation
+
+ Test: fast/canvas/canvas-getImageData-invalid.html
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::createImageData):
+ (WebCore::CanvasRenderingContext2D::getImageData):
+ (WebCore::CanvasRenderingContext2D::putImageData):
+
2010-05-31 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.gypi b/src/3rdparty/webkit/WebCore/WebCore.gypi
index 1e92f1f..94a6052 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.gypi
+++ b/src/3rdparty/webkit/WebCore/WebCore.gypi
@@ -2920,7 +2920,7 @@
'plugins/gtk/xembed.h',
'plugins/mac/PluginDataMac.mm',
'plugins/mac/PluginPackageMac.cpp',
- 'plugins/mac/PluginViewMac.cpp',
+ 'plugins/mac/PluginViewMac.mm',
'plugins/qt/PluginDataQt.cpp',
'plugins/qt/PluginPackageQt.cpp',
'plugins/qt/PluginViewQt.cpp',
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 63e78a7..048fc93 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -74,7 +74,8 @@ CONFIG(QTDIR_build) {
!static: DEFINES += QT_MAKEDLL
symbian: TARGET =$$TARGET$${QT_LIBINFIX}
}
-include($$PWD/../WebKit/qt/qtwebkit_version.pri)
+moduleFile=$$PWD/../WebKit/qt/qt_webkit_version.pri
+include($$moduleFile)
VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
unix {
@@ -2165,7 +2166,7 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) {
mac {
SOURCES += \
plugins/mac/PluginPackageMac.cpp \
- plugins/mac/PluginViewMac.cpp
+ plugins/mac/PluginViewMac.mm
OBJECTIVE_SOURCES += \
platform/text/mac/StringImplMac.mm \
platform/mac/WebCoreNSStringExtras.mm
@@ -2495,8 +2496,12 @@ contains(DEFINES, ENABLE_QT_BEARER=1) {
SOURCES += \
platform/network/qt/NetworkStateNotifierQt.cpp
- CONFIG += mobility
- MOBILITY += bearer
+ # Bearer management is part of Qt 4.7, so don't accidentially
+ # pull in Qt Mobility when building against >= 4.7
+ !greaterThan(QT_MINOR_VERSION, 6) {
+ CONFIG += mobility
+ MOBILITY += bearer
+ }
}
contains(DEFINES, ENABLE_SVG=1) {
@@ -2840,24 +2845,45 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
include($$PWD/../WebKit/qt/Api/headers.pri)
HEADERS += $$WEBKIT_API_HEADERS
-!CONFIG(QTDIR_build) {
+CONFIG(QTDIR_build) {
+ modfile.files = $$moduleFile
+ modfile.path = $$[QMAKE_MKSPECS]/modules
+
+ INSTALLS += modfile
+} else {
exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
!symbian {
headers.files = $$WEBKIT_INSTALL_HEADERS
- headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
- target.path = $$[QT_INSTALL_LIBS]
- INSTALLS += target headers
+ !isEmpty(INSTALL_HEADERS): headers.path = $$INSTALL_HEADERS/QtWebKit
+ else: headers.path = $$[QT_INSTALL_HEADERS]/QtWebKit
+
+ !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
+ else: target.path = $$[QT_INSTALL_LIBS]
+
+ modfile.files = $$moduleFile
+ modfile.path = $$[QMAKE_MKSPECS]/modules
+
+ INSTALLS += target headers modfile
} else {
# INSTALLS is not implemented in qmake's s60 generators, copy headers manually
inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
inst_headers.input = WEBKIT_INSTALL_HEADERS
- inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+
+ !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+ else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
+
QMAKE_EXTRA_COMPILERS += inst_headers
- install.depends += compiler_inst_headers_make_all
+ inst_modfile.commands = $$inst_headers.commands
+ inst_modfile.input = moduleFile
+ inst_modfile.output = $$[QMAKE_MKSPECS]/modules
+
+ QMAKE_EXTRA_COMPILERS += inst_modfile
+
+ install.depends += compiler_inst_headers_make_all compiler_inst_modfile_make_all
QMAKE_EXTRA_TARGETS += install
}
@@ -2875,7 +2901,7 @@ HEADERS += $$WEBKIT_API_HEADERS
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$headers.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
- lib_replace.match = $$DESTDIR
+ lib_replace.match = $$re_escape($$DESTDIR)
lib_replace.replace = $$[QT_INSTALL_LIBS]
QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
}
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index a271923..0254d0f 100644
--- a/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/src/3rdparty/webkit/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -361,6 +361,24 @@ JSValue JSCanvasRenderingContext2D::createPattern(ExecState* exec, const ArgList
return jsUndefined();
}
+JSValue JSCanvasRenderingContext2D::createImageData(ExecState* exec, const ArgList& args)
+{
+ // createImageData has two variants
+ // createImageData(ImageData)
+ // createImageData(width, height)
+ CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
+ RefPtr<ImageData> imageData = 0;
+
+ ExceptionCode ec = 0;
+ if (args.size() == 1)
+ imageData = context->createImageData(toImageData(args.at(0)), ec);
+ else if (args.size() == 2)
+ imageData = context->createImageData(args.at(0).toFloat(exec), args.at(1).toFloat(exec), ec);
+
+ setDOMException(exec, ec);
+ return toJS(exec, globalObject(), WTF::getPtr(imageData));
+}
+
JSValue JSCanvasRenderingContext2D::putImageData(ExecState* exec, const ArgList& args)
{
// putImageData has two variants
diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp
index a991e8d..d97b54a 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp
+++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.cpp
@@ -165,7 +165,7 @@ static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[45] =
{ "drawImageFromRect", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect), (intptr_t)0 },
{ "setShadow", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetShadow), (intptr_t)0 },
{ "createPattern", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreatePattern), (intptr_t)0 },
- { "createImageData", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t)2 },
+ { "createImageData", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionCreateImageData), (intptr_t)0 },
{ "getImageData", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionGetImageData), (intptr_t)4 },
{ "putImageData", DontDelete|Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionPutImageData), (intptr_t)0 },
{ 0, 0, 0, 0 }
@@ -1018,15 +1018,7 @@ JSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionCreateImageData
if (!thisValue.inherits(&JSCanvasRenderingContext2D::s_info))
return throwError(exec, TypeError);
JSCanvasRenderingContext2D* castedThisObj = static_cast<JSCanvasRenderingContext2D*>(asObject(thisValue));
- CanvasRenderingContext2D* imp = static_cast<CanvasRenderingContext2D*>(castedThisObj->impl());
- ExceptionCode ec = 0;
- float sw = args.at(0).toFloat(exec);
- float sh = args.at(1).toFloat(exec);
-
-
- JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->createImageData(sw, sh, ec)));
- setDOMException(exec, ec);
- return result;
+ return castedThisObj->createImageData(exec, args);
}
JSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionGetImageData(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
diff --git a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h
index 218e455..92fabb7 100644
--- a/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h
+++ b/src/3rdparty/webkit/WebCore/generated/JSCanvasRenderingContext2D.h
@@ -61,6 +61,7 @@ public:
JSC::JSValue drawImageFromRect(JSC::ExecState*, const JSC::ArgList&);
JSC::JSValue setShadow(JSC::ExecState*, const JSC::ArgList&);
JSC::JSValue createPattern(JSC::ExecState*, const JSC::ArgList&);
+ JSC::JSValue createImageData(JSC::ExecState*, const JSC::ArgList&);
JSC::JSValue putImageData(JSC::ExecState*, const JSC::ArgList&);
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 398e4d8..9cec7a9 100644
--- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -1278,14 +1278,30 @@ static PassRefPtr<ImageData> createEmptyImageData(const IntSize& size)
return data.get();
}
+PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(PassRefPtr<ImageData> imageData, ExceptionCode& ec) const
+{
+ if (!imageData) {
+ ec = NOT_SUPPORTED_ERR;
+ return 0;
+ }
+
+ IntSize size(imageData->width(), imageData->height());
+ return createEmptyImageData(size);
+}
+
PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionCode& ec) const
{
ec = 0;
+ if (!sw || !sh) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
if (!isfinite(sw) || !isfinite(sh)) {
ec = NOT_SUPPORTED_ERR;
return 0;
}
- FloatSize unscaledSize(sw, sh);
+
+ FloatSize unscaledSize(fabs(sw), fabs(sh));
IntSize scaledSize = canvas()->convertLogicalToDevice(unscaledSize);
if (scaledSize.width() < 1)
scaledSize.setWidth(1);
@@ -1301,7 +1317,15 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy,
ec = SECURITY_ERR;
return 0;
}
-
+ if (!sw || !sh) {
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+ if (!isfinite(sx) || !isfinite(sy) || !isfinite(sw) || !isfinite(sh)) {
+ ec = NOT_SUPPORTED_ERR;
+ return 0;
+ }
+
FloatRect unscaledRect(sx, sy, sw, sh);
IntRect scaledRect = canvas()->convertLogicalToDevice(unscaledRect);
if (scaledRect.width() < 1)
@@ -1332,7 +1356,7 @@ void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy,
}
if (!isfinite(dx) || !isfinite(dy) || !isfinite(dirtyX) ||
!isfinite(dirtyY) || !isfinite(dirtyWidth) || !isfinite(dirtyHeight)) {
- ec = INDEX_SIZE_ERR;
+ ec = NOT_SUPPORTED_ERR;
return;
}
diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h
index 553ffd2..2220f7e 100644
--- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -178,6 +178,7 @@ namespace WebCore {
PassRefPtr<CanvasPattern> createPattern(HTMLImageElement*, const String& repetitionType, ExceptionCode&);
PassRefPtr<CanvasPattern> createPattern(HTMLCanvasElement*, const String& repetitionType, ExceptionCode&);
+ PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData> imageData, ExceptionCode&) const;
PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const;
PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const;
void putImageData(ImageData*, float dx, float dy, ExceptionCode&);
diff --git a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl
index f93a752..3f7ead7 100644
--- a/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl
+++ b/src/3rdparty/webkit/WebCore/html/canvas/CanvasRenderingContext2D.idl
@@ -105,13 +105,12 @@ module html {
[Custom] void drawImageFromRect(/* 10 */);
[Custom] void setShadow(/* 3 */);
[Custom] void createPattern(/* 2 */);
+ [Custom] ImageData createImageData(/* 3 */);
attribute [Custom] custom strokeStyle;
attribute [Custom] custom fillStyle;
// pixel manipulation
- ImageData createImageData(in float sw, in float sh)
- raises (DOMException);
ImageData getImageData(in float sx, in float sy, in float sw, in float sh)
raises(DOMException);
[Custom] void putImageData(/* in ImageData imagedata, in float dx, in float dy [, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight] */);
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index 39c92de..bc0519f 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -1060,7 +1060,11 @@ void FrameView::setScrollPosition(const IntPoint& scrollPoint)
void FrameView::scrollPositionChanged()
{
frame()->eventHandler()->sendScrollEvent();
+ repaintFixedElementsAfterScrolling();
+}
+void FrameView::repaintFixedElementsAfterScrolling()
+{
// For fixed position elements, update widget positions and compositing layers after scrolling,
// but only if we're not inside of layout.
// FIXME: we could skip this if we knew the page had no fixed position elements.
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h
index 7119975..71e2966 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.h
@@ -139,7 +139,8 @@ public:
virtual void scrollRectIntoViewRecursively(const IntRect&);
virtual void setScrollPosition(const IntPoint&);
- virtual void scrollPositionChanged();
+ void scrollPositionChanged();
+ virtual void repaintFixedElementsAfterScrolling();
String mediaType() const;
void setMediaType(const String&);
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
index e50ab55..5753e1d 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp
@@ -292,7 +292,7 @@ void ScrollView::valueChanged(Scrollbar* scrollbar)
if (scrollbarsSuppressed())
return;
- scrollPositionChanged();
+ repaintFixedElementsAfterScrolling();
scrollContents(scrollDelta);
}
diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
index 118a310..0f79fa8 100644
--- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h
+++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h
@@ -303,7 +303,7 @@ private:
void updateScrollbars(const IntSize& desiredOffset);
// Called when the scroll position within this view changes. FrameView overrides this to generate repaint invalidations.
- virtual void scrollPositionChanged() {}
+ virtual void repaintFixedElementsAfterScrolling() {}
void platformInit();
void platformDestroy();
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
index b707f9d..ae1033e 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
@@ -146,6 +146,7 @@ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const Float
line.draw(p, pt);
p->restore();
}
+ p->setPen(textFillPen);
line.draw(p, pt);
p->restore();
return;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
index 02bf25e..be44fca 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsLayerQt.cpp
@@ -43,6 +43,7 @@
namespace WebCore {
+#ifndef QT_NO_GRAPHICSEFFECT
class MaskEffectQt : public QGraphicsEffect {
public:
MaskEffectQt(QObject* parent, QGraphicsItem* maskLayer)
@@ -57,7 +58,12 @@ public:
// It's more efficient to do it this way because
// (a) we don't need the QBrush abstraction - we always end up using QGraphicsItem::paint from the mask layer
// (b) QGraphicsOpacityEffect detaches the pixmap, which is inefficient on OpenGL.
- QPixmap maskPixmap(sourceBoundingRect().toAlignedRect().size());
+ const QSize maskSize = sourceBoundingRect().toAlignedRect().size();
+ if (!maskSize.isValid() || maskSize.isEmpty()) {
+ drawSource(painter);
+ return;
+ }
+ QPixmap maskPixmap(maskSize);
// we need to do this so the pixmap would have hasAlpha()
maskPixmap.fill(Qt::transparent);
@@ -91,6 +97,7 @@ public:
QGraphicsItem* m_maskLayer;
};
+#endif // QT_NO_GRAPHICSEFFECT
class GraphicsLayerQtImpl : public QGraphicsObject {
Q_OBJECT
@@ -179,7 +186,9 @@ public:
TransformationMatrix m_transformRelativeToRootLayer;
bool m_transformAnimationRunning;
bool m_opacityAnimationRunning;
+#ifndef QT_NO_GRAPHICSEFFECT
QWeakPointer<MaskEffectQt> m_maskEffect;
+#endif
struct ContentData {
QPixmap pixmap;
@@ -294,7 +303,7 @@ const GraphicsLayerQtImpl* GraphicsLayerQtImpl::rootLayer() const
QPixmap GraphicsLayerQtImpl::recache(const QRegion& regionToUpdate)
{
- if (!m_layer->drawsContent())
+ if (!m_layer->drawsContent() || m_size.isEmpty() ||!m_size.isValid())
return QPixmap();
QRegion region = regionToUpdate;
@@ -515,6 +524,7 @@ void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform
// we can't paint here, because we don't know if the mask layer
// itself is ready... we'll have to wait till this layer tries to paint
setFlag(ItemClipsChildrenToShape, m_layer->maskLayer() || m_layer->masksToBounds());
+#ifndef QT_NO_GRAPHICSEFFECT
setGraphicsEffect(0);
if (m_layer->maskLayer()) {
if (GraphicsLayerQtImpl* mask = qobject_cast<GraphicsLayerQtImpl*>(m_layer->maskLayer()->platformLayer()->toGraphicsObject())) {
@@ -522,6 +532,7 @@ void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform
setGraphicsEffect(mask->m_maskEffect.data());
}
}
+#endif
}
if (m_changeMask & SizeChange) {
@@ -596,11 +607,15 @@ void GraphicsLayerQtImpl::flushChanges(bool recursive, bool forceUpdateTransform
if ((m_changeMask & ContentsOpaqueChange) && m_state.contentsOpaque != m_layer->contentsOpaque())
prepareGeometryChange();
+#ifndef QT_NO_GRAPHICSEFFECT
if (m_maskEffect)
m_maskEffect.data()->update();
- else if (m_changeMask & DisplayChange) {
- // Recache now: all the content is ready and we don't want to wait until the paint event. We only need to do this for HTML content,
- // there's no point in caching directly composited content like images or solid rectangles.
+ else
+#endif
+ if (m_changeMask & DisplayChange) {
+ // Recache now: all the content is ready and we don't want to wait until the paint event.
+ // We only need to do this for HTML content, there's no point in caching directly composited
+ // content like images or solid rectangles.
if (m_pendingContent.contentType == HTMLContentType)
recache(m_pendingContent.regionToUpdate);
update(m_pendingContent.regionToUpdate.boundingRect());
diff --git a/src/3rdparty/webkit/WebCore/platform/network/NetworkStateNotifier.h b/src/3rdparty/webkit/WebCore/platform/network/NetworkStateNotifier.h
index 781259c..d1f2db4 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/NetworkStateNotifier.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/NetworkStateNotifier.h
@@ -44,6 +44,15 @@ typedef const struct __SCDynamicStore * SCDynamicStoreRef;
#include <windows.h>
+#elif PLATFORM(QT)
+
+#include <QtCore/qglobal.h>
+
+#ifdef QT_NO_BEARERMANAGEMENT
+#undef ENABLE_QT_BEARER
+#define ENABLE_QT_BEARER 0
+#endif
+
#endif
namespace WebCore {
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
index 52512aa..3aae92a 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/NetworkStateNotifierQt.cpp
@@ -20,6 +20,8 @@
#include "config.h"
#include "NetworkStateNotifier.h"
+#if PLATFORM(QT) && ENABLE(QT_BEARER)
+
#include "NetworkStateNotifierPrivate.h"
#include "qnetworkconfigmanager.h"
@@ -89,4 +91,6 @@ void NetworkStateNotifier::setNetworkAccessAllowed(bool isAllowed)
} // namespace WebCore
+#endif
+
#include "moc_NetworkStateNotifierPrivate.cpp"
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
index f9ced98..54ecbf1 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/FileSystemQt.cpp
@@ -117,6 +117,7 @@ Vector<String> listDirectory(const String& path, const String& filter)
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
{
+#ifndef QT_NO_TEMPORARYFILE
QTemporaryFile* tempFile = new QTemporaryFile(QLatin1String(prefix));
tempFile->setAutoRemove(false);
QFile* temp = tempFile;
@@ -124,6 +125,7 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
handle = temp;
return String(temp->fileName()).utf8();
}
+#endif
handle = invalidPlatformFileHandle;
return CString();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
index 577903b..08b7aca 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
@@ -163,7 +163,9 @@ RenderThemeQt::RenderThemeQt(Page* page)
RenderThemeQt::~RenderThemeQt()
{
delete m_fallbackStyle;
+#ifndef QT_NO_LINEEDIT
delete m_lineEdit;
+#endif
}
#if USE(QT_MOBILE_THEME)
@@ -264,11 +266,17 @@ bool RenderThemeQt::supportsControlTints() const
int RenderThemeQt::findFrameLineWidth(QStyle* style) const
{
+#ifndef QT_NO_LINEEDIT
if (!m_lineEdit)
m_lineEdit = new QLineEdit();
+#endif
QStyleOptionFrameV2 opt;
- return style->pixelMetric(QStyle::PM_DefaultFrameWidth, &opt, m_lineEdit);
+ QWidget* widget = 0;
+#ifndef QT_NO_LINEEDIT
+ widget = m_lineEdit;
+#endif
+ return style->pixelMetric(QStyle::PM_DefaultFrameWidth, &opt, widget);
}
static QRect inflateButtonRect(const QRect& originalRect, QStyle* style)
diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm
index 1fd4676..57d74ab 100644
--- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.mm
@@ -103,9 +103,12 @@ static inline WindowRef nativeWindowFor(PlatformWidget widget)
{
#if PLATFORM(QT)
if (widget)
+#if QT_MAC_USE_COCOA
+ return static_cast<WindowRef>([qt_mac_window_for(widget) windowRef]);
+#else
return static_cast<WindowRef>(qt_mac_window_for(widget));
#endif
-#if PLATFORM(WX)
+#elif PLATFORM(WX)
if (widget)
return (WindowRef)widget->MacGetTopLevelWindowRef();
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 564c6fe..2788085 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1370,6 +1370,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
ev->accept();
}
+#ifndef QT_NO_PROPERTIES
void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event)
{
if (event->propertyName() == "_q_viewMode") {
@@ -1424,6 +1425,7 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev
}
#endif
}
+#endif
void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
{
@@ -2808,9 +2810,11 @@ bool QWebPage::event(QEvent *ev)
d->touchEvent(static_cast<QTouchEvent*>(ev));
break;
#endif
+#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange:
d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev));
break;
+#endif
default:
return QObject::event(ev);
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 5350cd9..1b90a66 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -112,7 +112,9 @@ public:
void inputMethodEvent(QInputMethodEvent*);
+#ifndef QT_NO_PROPERTIES
void dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent*);
+#endif
void shortcutOverrideEvent(QKeyEvent*);
void leaveEvent(QEvent*);
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 81823f6..a5fc794 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -48,9 +48,7 @@
#include <QUrl>
#include <QFileInfo>
-#if ENABLE(QT_BEARER)
#include "NetworkStateNotifier.h"
-#endif
void QWEBKIT_EXPORT qt_networkAccessAllowed(bool isAllowed)
{
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index b6cbf92..3deb9ac 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,69 @@
+2010-06-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [Qt] Fix compilation with QT_NO_PROPERTIES
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * Api/qwebpage.cpp:
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::openInspectorFrontend):
+
+2010-05-17 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix compilation with QT_NO_COMBOBOX
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+ * WebCoreSupport/QtFallbackWebPopup.cpp:
+ * WebCoreSupport/QtFallbackWebPopup.h:
+
+2010-05-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_BEARERMANAGEMENT
+ https://bugs.webkit.org/show_bug.cgi?id=38324
+
+ * Api/qwebsettings.cpp:
+
+2010-03-24 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ Auto-uppercase and predictive text need to be disabled for S60 (as for maemo)
+ https://bugs.webkit.org/show_bug.cgi?id=33176
+
+ * WebCoreSupport/EditorClientQt.cpp:
+
+2010-06-01 Noam Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add documentation to the QtWebkit bridge
+ https://bugs.webkit.org/show_bug.cgi?id=35861
+
+ This patch includes comprehensive qdoc documentation for the QtWebkit bridge.
+
+ * docs/qtwebkit-bridge.qdoc: Added.
+ * docs/qtwebkit.qdoc:
+ * docs/webkitsnippets/doc_src_qtscript.qdoc: Added.
+ * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: Added.
+ (wrapInFunction):
+
+2010-06-01 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Rename versioning .pri file to what Qt's mkspecs/features/qt.pri expects.
+
+ * qt_webkit_version.pri: Renamed from WebKit/qt/qtwebkit_version.pri.
+
2010-05-31 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 4e742fc..7d1c794 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -573,8 +573,10 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
{
#if defined(Q_WS_MAEMO_5)
return new QtMaemoWebPopup;
-#else
+#elif !defined(QT_NO_COMBOBOX)
return new QtFallbackWebPopup;
+#else
+ return result;
#endif
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 7b7f610..0ce6383 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -613,11 +613,11 @@ void EditorClientQt::setInputMethodState(bool active)
}
}
webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField);
-#ifdef Q_WS_MAEMO_5
- // Maemo 5 MicroB Browser disables auto-uppercase and predictive text, thus, so do we.
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
+ // disables auto-uppercase and predictive text for mobile devices
webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true);
webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true);
-#endif // Q_WS_MAEMO_5
+#endif // Q_WS_MAEMO_5 || Q_OS_SYMBIAN
#endif // QT_VERSION check
webPageClient->setInputMethodEnabled(active);
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 725c5fb..2d11700 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -93,7 +93,10 @@ void InspectorClientQt::openInspectorFrontend(WebCore::InspectorController*)
// Web inspector. This is used for SDK purposes. Please keep this hook
// around and don't remove it.
// https://bugs.webkit.org/show_bug.cgi?id=35340
- QUrl inspectorUrl = inspector->property("_q_inspectorUrl").toUrl();
+ QUrl inspectorUrl;
+#ifndef QT_NO_PROPERTIES
+ inspectorUrl = inspector->property("_q_inspectorUrl").toUrl();
+#endif
if (!inspectorUrl.isValid())
inspectorUrl = QUrl("qrc:/webkit/inspector/inspector.html");
inspectorView->page()->mainFrame()->load(inspectorUrl);
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
index 7514077..26420e5 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "QtFallbackWebPopup.h"
+#ifndef QT_NO_COMBOBOX
+
#include "HostWindow.h"
#include "PopupMenuClient.h"
#include "QWebPageClient.h"
@@ -225,3 +227,5 @@ void QtFallbackWebPopup::activeChanged(int index)
}
}
+
+#endif // QT_NO_COMBOBOX
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
index 62b8aea..6d2e1ff 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h
@@ -23,6 +23,8 @@
#include "QtAbstractWebPopup.h"
#include <QComboBox>
+#ifndef QT_NO_COMBOBOX
+
QT_BEGIN_NAMESPACE
class QGraphicsProxyWidget;
QT_END_NAMESPACE
@@ -67,4 +69,6 @@ private:
}
+#endif // QT_NO_COMBOBOX
+
#endif // QtFallbackWebPopup_h
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
new file mode 100644
index 0000000..4f41d29
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -0,0 +1,425 @@
+/*!
+ \inmodule QtWebKit
+ \page qtwebkit-bridge.html
+ \title The QtWebKit Bridge
+ \contentspage QtWebKit
+ \section1 Overview
+ \section2 The technology
+
+ The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
+ objects that are represented as QObjects. It takes advantage of the inherent introspection of the
+ \l{Qt Object Model}, which has a natural alignment to the way JavaScript worked.
+
+ For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
+ pair under one name.
+
+ \section2 Use Cases
+
+ There are two main use cases for the QtWebKit bridge. Web content in a native application, and Thin Client.
+
+ \section3 Web Content in a Native Application
+
+ This is a common use case in classic Qt application, and a design pattern used by several modern
+ applications. For example, an application that contains both a media-player, playlist manager, and
+ a music store. The playlist manager is usually best authored as a classic desktop application,
+ with the native-looking robust \l{QWidget}s helping with producing that application.
+ The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
+ or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
+ from the internet, and gets modified rapidly, is best authored in HTML and maintained on the server.
+
+ With the QtWebKit bridge, that music store component can interact with native parts of the application,
+ for example, if a file needs to be saved to a specific location.
+
+ \section3 Thin Client
+
+ Another use case is using Qt as a native backend to a full web application,
+ referred to here as a thin client. In this use-case, the entire UI is driven by
+ HTML, JavaScript and CSS, and native Qt-based components are used to allow that application
+ access to native features not usually exposed to the web, or to enable helper components that
+ are best written with C++.
+
+ An example for such client is a UI for a video-on-demand service on a TV. The entire content and
+ UI can be kept on the server, served dynamically through HTTP and rendered with WebKit, with additional
+ native components for accessing hardware-specific features like extracting the list of images
+ out of the video.
+
+ \section2 Difference from Other Bridge Technologies
+
+ Of course QtWebKit is not the only bridge technology out there. NPAPI, for example,
+ is a long-time standard or web-native bridging. Due to Qt's meta-object system, full applications
+ built partially with web-technologies are much easier to develop. NPAPI, however, is more geared
+ towards cross-browser plugins, due to it being an accepted standard.
+
+ When developing a plugin for a browser, NPAPI is recommended. When developing a full application
+ that utilizes HTML-rendering, the QtWebKit bridge is recommended.
+
+ \section2 Relationship with QtScript
+
+ The QtWebKit bridge is similar to \l{QtScript}, especially to some of the features described in the
+ \l{Making Applications Scriptable} page. However, as of Qt 4.7, full QtScript API is not supported for web applications.
+ That is planned as an enhancement for future versions. You might notice that some of the features
+ described here are an exact copy of the ones described in the \l{Making Applications Scriptable} page. That is because
+ the QtWebKit bridge is a subset of that functionality, and this page tries to capture the full
+ capabilities available through the QtWebKit bridge specifically.
+
+ \section1 Accessing QObjects
+
+ \section2 Creating the link via QWebFrame
+
+ By default, no QObjects are accessible through the web environment, for security reasons.
+ To enable web content access to a native QObject, the application has to explicitly grant it access,
+ using the following call:
+
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 0
+
+ See \l{QWebFrame::addToJavaScriptWindowObject()} for more information.
+
+ \section2 Using Signals and Slots
+
+ Qt Script adapts Qt's central \l{Signals and Slots} feature for
+ scripting. There are three principal ways to use signals and slots
+ with Qt Script:
+
+ \list
+ \i \bold{Hybrid C++/script}: C++ application code connects a
+ signal to a script function. The script function can, for example, be
+ a function that the user has typed in, or one that you have read from a
+ file. This approach is useful if you have a QObject but don't want
+ to expose the object itself to the scripting environment; you just
+ want a script to be able to define how a signal should be reacted
+ to, and leave it up to the C++ side of your application to establish
+ the connection.
+
+ \i \bold{Hybrid script/C++}: A script can connect signals and slots
+ to establish connections between pre-defined objects that the
+ application exposes to the scripting environment. In this scenario,
+ the slots themselves are still written in C++, but the definition of
+ the connections is fully dynamic (script-defined).
+
+ \i \bold{Purely script-defined}: A script can both define signal
+ handler functions (effectively "slots written in Qt Script"),
+ \e{and} set up the connections that utilize those handlers. For
+ example, a script can define a function that will handle the
+ QLineEdit::returnPressed() signal, and then connect that signal to the
+ script function.
+ \endlist
+
+ Note that QtScript functions such as qScriptConnect are unavilable in the web environment.
+
+ \section3 Signal to Function Connections
+
+ \c{connect(function)}
+
+ In this form of connection, the argument to \c{connect()} is the
+ function to connect to the signal.
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 2
+
+ The argument can be a Qt Script function, as in the above
+ example, or it can be a QObject slot, as in
+ the following example:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 3
+
+ When the argument is a QObject slot, the argument types of the
+ signal and slot do not necessarily have to be compatible;
+ the QtWebKit bridge will, if necessary, perform conversion of the signal
+ arguments to match the argument types of the slot.
+
+ To disconnect from a signal, you invoke the signal's
+ \c{disconnect()} function, passing the function to disconnect
+ as argument:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 4
+
+ When a script function is invoked in response to a signal, the
+ \c this object will be the Global Object.
+
+ \section3 Signal to Member Function Connections
+
+ \c{connect(thisObject, function)}
+
+ In this form of the \c{connect()} function, the first argument
+ is the object that will be bound to the variable, \c this, when
+ the function specified using the second argument is invoked.
+
+ If you have a push button in a form, you typically want to do
+ something involving the form in response to the button's
+ \c{clicked} signal; passing the form as the \c this object
+ makes sense in such a case.
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 5
+
+ To disconnect from the signal, pass the same arguments to \c{disconnect()}:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 6
+
+ \section3 Signal to Named Member Function Connections
+
+ \c{connect(thisObject, functionName)}
+
+ In this form of the \c{connect()} function, the first argument is
+ the object that will be bound to the variable, \c this, when
+ a function is invoked in response to the signal. The second argument
+ specifies the name of a function that is connected to the signal,
+ and this refers to a member function of the object passed as the
+ first argument (\c thisObject in the above scheme).
+
+ Note that the function is resolved when the connection is made, not
+ when the signal is emitted.
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 7
+
+ To disconnect from the signal, pass the same arguments to \c{disconnect()}:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 8
+
+ \section3 Error Handling
+
+ When \c{connect()} or \c{disconnect()} succeeds, the function will
+ return \c{undefined}; otherwise, it will throw a script exception.
+ You can obtain an error message from the resulting \c{Error} object.
+ Example:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 9
+
+ \section3 Emitting Signals from Scripts
+
+ To emit a signal from script code, you simply invoke the signal
+ function, passing the relevant arguments:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 10
+
+ It is currently not possible to define a new signal in a script;
+ i.e., all signals must be defined by C++ classes.
+
+ \section3 Overloaded Signals and Slots
+
+ When a signal or slot is overloaded, the QtWebKit bridge will attempt to
+ pick the right overload based on the actual types of the QScriptValue arguments
+ involved in the function invocation. For example, if your class has slots
+ \c{myOverloadedSlot(int)} and \c{myOverloadedSlot(QString)}, the following
+ script code will behave reasonably:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 11
+
+ You can specify a particular overload by using array-style property access
+ with the \l{QMetaObject::normalizedSignature()}{normalized signature} of
+ the C++ function as the property name:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 12
+
+ If the overloads have different number of arguments, the QtWebKit bridge will
+ pick the overload with the argument count that best matches the
+ actual number of arguments passed to the slot.
+
+ For overloaded signals, JavaScript will throw an error if you try to connect
+ to the signal by name; you have to refer to the signal with the full
+ normalized signature of the particular overload you want to connect to.
+
+ \section3 Invokable Methods
+
+ Both slots and signals are invokable from script by default. In addition, it's also
+ possible to define a method that's invokable from script without it being a signal or a slot.
+ This is especially useful for functions with return types, as slots normally do not return anything
+ (it would be meaningless to return values from a slot, as the connected signals don't handle the returned data).
+ To make a non-slot method invokable, simply add the Q_INVOKABLE macro before its definition:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 20
+
+ \section2 Accessing Properties
+
+ The properties of the QObject are available as properties
+ of the corresponding JavaScript object. When you manipulate
+ a property in script code, the C++ get/set method for that
+ property will automatically be invoked. For example, if your
+ C++ class has a property declared as follows:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 13
+
+ then script code can do things like the following:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 14
+
+ \section2 Accessing Child QObjects
+
+ Every named child of the QObject (that is, for which
+ QObject::objectName() is not an empty string) is by default available as
+ a property of the JavaScript wrapper object. For example,
+ if you have a QDialog with a child widget whose \c{objectName} property is
+ \c{"okButton"}, you can access this object in script code through
+ the expression
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 15
+
+ Since \c{objectName} is itself a Q_PROPERTY, you can manipulate
+ the name in script code to, for example, rename an object:
+
+ \snippet webkitsnippets/doc_src_qtscript.qdoc 16
+
+ \section2 Data types
+
+ When calling slots, receiving signals or accessing properties, usually some payload is involved.
+ For example, a property "text" might return a \l{QString} parameter.
+ The QtWebKit bridge does the job of converting between a given JavaScript data-type, and the
+ expected or given Qt type. Each Qt type has a coresponding set of rules of how JavaScript treats it.
+
+ The data type conversions are also applicable for the data returned from non-void invokable methods.
+
+ \section3 Numbers
+
+ All Qt numeric data types are converted to or from a JavaScript number. These include int, short, float,
+ double, and the porable Qt types (qreal, qint etc). A special case is \l{QChar};
+ If a slot expects a QChar, the QtWebKit bridge would use the unicode value in case of a number,
+ or the first character in a string.
+
+ Note that non-standard (typedefed) number types are not automatically converted to
+ or from a JavaScript number - it's advised to use standard number types for signal, slots
+ and properties.
+
+ When a non-number is passed as an argument to a method or property that expects a number,
+ the appropriate JavaScript conversion function (parseInt / parseFloat) would be used.
+
+ \section3 Strings
+
+ When JavaScript accesses methods or properties that expect a \l{QString}, the QtWebKit bridge
+ will automatically convert the value to a string (if it's not already a string), using the
+ built-in JavaScript toString method.
+
+ When a QString is passed to JavaScript from a signal or a property, The QtWebKit bridge will
+ convert it into a JavaScript string.
+
+ \section3 Date & Time
+
+ Both \l{QDate}, \l{QTime} and \l{QDateTime} are automatically translated to or from the JavaScript
+ Date object. If a number is passed as an argument to a method that expects one of the date/time
+ types, the QtWebKit bridge would treat it as a timestamp. If a sting is passed, QtWebKit would
+ try different Qt date parsing functions to find the right one.
+
+ \section3 Regular Expressions
+
+ The QtWebKit bridge would automatically convert JavaScript RegEx object to a \l{QRegExp}.
+ If a string is passed to a method expecting a \l{QRegExp}, the string would be converted
+ to that \l{QRegExp}.
+
+ \section3 Lists
+
+ The QtWebKit bridge treats several types of lists in a special way: \l{QVariantList}, \l{QStringList},
+ \l{QObjectList} and \l{QList}<int>. When a slot or property expects one of those list types,
+ the QtWebKit bridge would try to convert a JavaScript array into that type, converting each of
+ the array's elements to the single-element type of the list.
+
+ The most useful type of list is perhaps \l{QVariantList}, which can be converted to from any
+ JavaScript array.
+
+ \section3 Compound (JSON) objects
+
+ JavaScript compound objects, also known as JSON objects, are variables which hold a list
+ of key-value pairs, where all the keys are strings and the values can have any type.
+ This translates very well to \l{QVariantMap}, which is nothing more than a \l{QMap} of \l{QString}
+ to \l{QVariant}.
+
+ The seamless conversion between JSON objects and \l{QVariantMap} allows for a very convenient
+ way of passing arbitrary structured data between C++ and the JavaScript environment. The native \l{QObject} has
+ to make sure that compound values are converted to \l{QVariantMap}s and \l{QVariantList}s, and JavaScript is
+ guaranteed to receive them in a meaningful way.
+
+ Note that types that are not supported by JSON, such as JavaScript functions and getters/setters,
+ are not converted.
+
+ \section3 QVariants
+
+ When a slot or property accepts a \l{QVariant}, the QtWebKit bridge would create a \l{QVariant} that best
+ matches the argument passed by JavaScript. A string, for example, would become a \l{QVariant} holding a \l{QString},
+ a normal JSON object would become a \l{QVariantMap}, and a JavaScript array would become a \l{QVariantList}.
+
+ Using \l{QVariant}s generously in C++ in that way makes C++ programming feel a bit more like JavaScript programming,
+ as it adds another level of indirection - passing \l{QVariant}s around is very flexible, as the program can figure out
+ the type of argument in runtime just like JavaScript would do, but it also takes away from the type-safety and robust
+ nature of C++. It's recommended to use \l{QVariant}s only for convenience high-level functions, and to keep most of your
+ \l{QObject}s somewhat type-safe.
+
+ \section3 QObjects
+
+ A pointer to a \l{QObject} or a \l{QWidget} can be passed as payload in signals, slots and properties. That object
+ can then be used like an object that's exposed directly; i.e. its slots can be invoked, its signals connected to etc.
+ However, this functionality is fairly limited - the type used has to be \l{QObject}* or \l{QWidget}*. If the type
+ specified is a pointer to a non-\l{QWidget} subclass of \l{QObject}, the QtWebKit bridge would not recognize it to be
+ a \l{QObject}.
+
+ In general its advised to use care when passing \l{QObject}s as arguments, as those objects don't become owned by
+ the Javascipt engine; That means that the application developer has to be extra careful not to try to access
+ \l{QObject}s that have already been deleted by the native environment.
+
+ \section3 Pixmaps and Images
+
+ \since 4.7
+
+ The QtWebKit bridge handles \l{QPixmap}s and \l{QImage}s in a special way. Since QtWebKit stores \l{QPixmap}s to
+ represent HTML images, \l{QPixmap}s coming from the native environment can be used directly inside WebKit.
+ A \l{QImage} or a \l{QPixmap} coming from the Qt environment would convert to an intermediate JavaScript object,
+ that can be represented like this:
+
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 1
+
+ The JavaScript environment can then use the pixmap it gets from Qt and display it inside the HTML environment,
+ by assigning it to an existing <img /> element using assignToHTMLImageElement. It can also use the toDataURL() function,
+ which allows using the pixmap as the src attribute of an image or as a background-image url. Note that the toDataURL()
+ function is costly and should be used with caution.
+
+ Example code:
+
+ C++:
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 2
+
+ HTML:
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 3
+
+ When a Qt object expects a \l{QImage} or a \l{QPixmap} as input, and the argument passed is an HTML image element,
+ the QtWebKit bridge would convert the pixmap assigned to that image element into a \l{QPixmap} or a \l{QImage}.
+
+ \since 4.7
+
+ \section3 QWebElement
+
+ A signal, slot or property that expects or returns a \l{QWebElement} can work seamlessly with JavaScript references
+ to DOM elements. The JavaScript environment can select DOM elements, keep them in variables, then pass them to Qt as
+ a \l{QWebElement}, and receive them back. Example:
+
+ C++:
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 4
+
+ HTML:
+ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 5
+
+ This is specifically useful to create custom renderers or extensions to the web environment. Instead of forcing Qt
+ to select the element, the web environment already selects the element and then send the selected element directly to Qt.
+
+ Note that \l{QWebElement}s are not thread safe - an object handling them has to live in the UI thread.
+
+ \section1 Architecture issues
+
+ \section2 Limiting the Scope of the Hybrid Layer
+
+ When using QtWebKit's hybrid features, it's a common pitfall to make the API exposed to JavaScript very rich and
+ use all its features. This, however, leads to complexity and can create bugs that are hard to trace.
+ Instead, it's advisable to keep the hybrid layer small and manageable: create a gate only when
+ there's an actual need for it, i.e. there's a new native enabler that requires a direct interface
+ to the application layer. Sometimes new functionality is better handled internally in the native layer
+ or in the web layer; simplicity is your friend.
+
+ This usually becomes more apparent when the hybrid layer can create or destroy objects, or uses
+ signals slots or properties with a \l{QObject}* argument. It's advised to be very careful and to treat
+ an exposed \l{QObject} as a system - with careful attention to memory management and object ownership.
+
+ \section2 Internet Security
+
+ When exposing native object to an open web environment, it's important to understand the security
+ implications. Think whether the exposed object enables the web environment access to things that
+ shouldn't be open, and whether the web content loaded by that web page comes from a trusted. In general, when
+ exposing native QObjects that give the web environment access to private information or to functionality
+ that's potentially harmful to the client, such exposure should be balanced by limiting the web page's
+ access to trusted URLs only with HTTPS and other security measures.
+
+
+*/
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
index c6dd550..d3f5502 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc
@@ -20,8 +20,9 @@
scripted with JavaScript.
A bridge between the JavaScript execution environment and the Qt object
- model makes it possible for custom QObjects to be scripted. Integration
- with the Qt networking module enables Web pages to be transparently loaded
+ model makes it possible for custom QObjects to be scripted. For detailed
+ documentation see \l{The QtWebkit Bridge}.
+ Integration with the Qt networking module enables Web pages to be transparently loaded
from Web servers, the local file system or even the Qt resource system.
In addition to providing pure rendering features, HTML documents can be
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
new file mode 100644
index 0000000..d83ab3f
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
@@ -0,0 +1,83 @@
+
+void wrapInFunction()
+{
+
+//! [0]
+ // ...
+ QWebFrame *frame = myWebPage->mainFrame();
+ frame->addToJavaScriptWindowObject("someNameForMyObject", myObject);
+ // ...
+//! [0]
+#if 0
+ //! [1]
+ {
+ width: ...,
+ height: ...,
+ toDataURL: function() { ... },
+ assignToHTMLImageElement: function(element) { ... }
+ }
+ //! [1]
+#endif
+ //! [2]
+ class MyObject : QObject {
+ Q_OBJECT
+ Q_PROPERTY(QPixmap myPixmap READ getPixmap)
+
+ public:
+ QPixmap getPixmap() const;
+ };
+
+ /* ... */
+
+ MyObject myObject;
+ myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
+
+ //! [2]
+ #if 0
+ //! [3]
+ <html>
+ <head>
+ <script>
+ function loadImage() {
+ myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement"));
+ }
+ </script>
+ </head>
+ <body onload="loadImage()">
+ <img id="imageElement" width="300" height="200" />
+ </body>
+ </html>
+ //! [3]
+ #endif
+ //! [4]
+ class MyObject : QObject {
+ Q_OBJECT
+
+ public slots:
+ void doSomethingWithWebElement(const QWebElement&);
+ };
+
+ /* ... */
+
+ MyObject myObject;
+ myWebPage.mainFrame()->addToJavaScriptWindowObject("myObject", &myObject);
+
+ //! [4]
+ #if 0
+ //! [5]
+ <html>
+ <head>
+ <script>
+ function runExample() {
+ myObject.doSomethingWithWebElement(document.getElementById("someElement"));
+ }
+ </script>
+ </head>
+ <body onload="runExample()">
+ <span id="someElement">Text</span>
+ </body>
+ </html>
+ //! [5]
+ #endif
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index ffd192c..ffd192c 100644
--- a/src/3rdparty/webkit/WebKit/qt/qtwebkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h
index ccd6759..6cb6c2c 100644
--- a/src/corelib/global/qconfig-medium.h
+++ b/src/corelib/global/qconfig-medium.h
@@ -213,6 +213,9 @@
#ifndef QT_NO_UNDOVIEW
# define QT_NO_UNDOVIEW
#endif
+#ifndef QT_NO_GESTURES
+# define QT_NO_GESTURES
+#endif
/* Widgets */
#ifndef QT_NO_LCDNUMBER
diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h
index 99b16e8..c285e99 100644
--- a/src/corelib/global/qconfig-minimal.h
+++ b/src/corelib/global/qconfig-minimal.h
@@ -447,6 +447,9 @@
#ifndef QT_NO_UNDOVIEW
# define QT_NO_UNDOVIEW
#endif
+#ifndef QT_NO_GESTURES
+# define QT_NO_GESTURES
+#endif
/* Widgets */
#ifndef QT_NO_GROUPBOX
diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h
index 1716b8d..dd74dcf 100644
--- a/src/corelib/global/qconfig-small.h
+++ b/src/corelib/global/qconfig-small.h
@@ -250,6 +250,9 @@
#ifndef QT_NO_SYSTEMTRAYICON
# define QT_NO_SYSTEMTRAYICON
#endif
+#ifndef QT_NO_GESTURES
+# define QT_NO_GESTURES
+#endif
/* Widgets */
#ifndef QT_NO_LCDNUMBER
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index a333153..b606843 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -85,6 +85,9 @@
// Freetype Font Engine
//#define QT_NO_FREETYPE
+// Gesture
+//#define QT_NO_GESTURES
+
// QGroupBox
//#define QT_NO_GROUPBOX
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 3e6af24..4d938a9 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -1185,6 +1185,12 @@ Requires: PROPERTIES
Name: State machine
SeeAlso: ???
+Feature: GESTURES
+Description: Provides a framework for gestures.
+Section: Utilities
+Requires:
+Name: Gesture
+SeeAlso: ???
# SVG
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 08674d2..a9c56f6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -236,7 +236,8 @@ public:
TextJustificationForced = 0x10000,
TextForceLeftToRight = 0x20000,
TextForceRightToLeft = 0x40000,
- TextLongestVariant = 0x80000
+ TextLongestVariant = 0x80000,
+ TextBypassShaping = 0x100000
#if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN)
,SingleLine = TextSingleLine,
@@ -947,6 +948,8 @@ public:
#endif
Key_MediaNext = 0x01000083,
Key_MediaRecord = 0x01000084,
+ Key_MediaPause = 0x1000085,
+ Key_MediaTogglePlayPause = 0x1000086,
Key_HomePage = 0x01000090,
Key_Favorites = 0x01000091,
Key_Search = 0x01000092,
@@ -1089,11 +1092,15 @@ public:
Key_Context2 = 0x01100001,
Key_Context3 = 0x01100002,
Key_Context4 = 0x01100003,
- Key_Call = 0x01100004,
- Key_Hangup = 0x01100005,
+ Key_Call = 0x01100004, // set absolute state to in a call (do not toggle state)
+ Key_Hangup = 0x01100005, // set absolute state to hang up (do not toggle state)
Key_Flip = 0x01100006,
- Key_Camera = 0x01100007,
- Key_CameraFocus = 0x01100008,
+ Key_ToggleCallHangup = 0x01100007, // a toggle key for answering, or hanging up, based on current call state
+ Key_VoiceDial = 0x01100008,
+ Key_LastNumberRedial = 0x01100009,
+
+ Key_Camera = 0x01100020,
+ Key_CameraFocus = 0x01100021,
Key_unknown = 0x01ffffff
};
@@ -1719,6 +1726,7 @@ public:
};
Q_DECLARE_FLAGS(TouchPointStates, TouchPointState)
+#ifndef QT_NO_GESTURES
enum GestureState
{
NoGesture,
@@ -1748,6 +1756,7 @@ public:
IgnoredGesturesPropagateToParent = 0x04
};
Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
+#endif // QT_NO_GESTURES
enum NavigationMode
{
@@ -1777,7 +1786,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates)
+#ifndef QT_NO_GESTURES
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags)
+#endif
typedef bool (*qInternalCallback)(void **);
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index f71ba9d..7eae3a5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1317,7 +1317,7 @@
\value Key_Enter Typically located on the keypad.
\value Key_Insert
\value Key_Delete
- \value Key_Pause
+ \value Key_Pause The Pause/Break key (\note Not anything to do with pausing media)
\value Key_Print
\value Key_SysReq
\value Key_Clear
@@ -1615,12 +1615,14 @@
\value Key_BassDown
\value Key_TrebleUp
\value Key_TrebleDown
- \value Key_MediaPlay
- \value Key_MediaStop
+ \value Key_MediaPlay A key setting the state of the media player to play
+ \value Key_MediaStop A key setting the state of the media player to stop
\value Key_MediaPrevious
\omitvalue Key_MediaPrev
\value Key_MediaNext
\value Key_MediaRecord
+ \value Key_MediaPause A key setting the state of the media player to pause (\note not the pause/break key)
+ \value Key_MediaTogglePlayPause A key to toggle the play/pause state in the media player (rather than setting an absolute state)
\value Key_HomePage
\value Key_Favorites
\value Key_Search
@@ -1741,18 +1743,21 @@
\value Key_MediaLast
\value Key_unknown
- \value Key_Call
- \value Key_Camera
- \value Key_CameraFocus
+ \value Key_Call A key to answer or initiate a call (\see Key_ToggleCallHangup for a key to toggle current call state)
+ \value Key_Camera A key to activate the camera shutter
+ \value Key_CameraFocus A key to focus the camera
\value Key_Context1
\value Key_Context2
\value Key_Context3
\value Key_Context4
\value Key_Flip
- \value Key_Hangup
+ \value Key_Hangup A key to end an ongoing call (\see Key_ToggleCallHangup for a key to toggle current call state)
\value Key_No
\value Key_Select
\value Key_Yes
+ \value Key_ToggleCallHangup A key to toggle the current call state (ie. either answer, or hangup) depending on current call state
+ \value Key_VoiceDial
+ \value Key_LastNumberRedial
\value Key_Execute
\value Key_Printer
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 8e76e9e..ce9c57e 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
#define QT_USE_MMAP
#endif
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index a20d171..9d3513a 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -275,17 +275,19 @@ public:
TouchUpdate = 195,
TouchEnd = 196,
+#ifndef QT_NO_GESTURES
NativeGesture = 197, // Internal for platform gesture support
-
+#endif
RequestSoftwareInputPanel = 199,
CloseSoftwareInputPanel = 200,
UpdateSoftKeys = 201, // Internal for compressing soft key updates
WinIdChange = 203,
+#ifndef QT_NO_GESTURES
Gesture = 198,
GestureOverride = 202,
-
+#endif
// 512 reserved for Qt Jambi's MetaCall event
// 513 reserved for Qt Jambi's DeleteOnMainThread event
@@ -327,7 +329,9 @@ private:
friend class QGraphicsView;
friend class QGraphicsViewPrivate;
friend class QGraphicsScenePrivate;
+#ifndef QT_NO_GESTURES
friend class QGestureManager;
+#endif
};
class Q_CORE_EXPORT QTimerEvent : public QEvent
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 1cb8455..9d8ee5a 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -484,9 +484,9 @@ void QSelectThread::run()
} // end for
// traversed all, so update
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
- updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
break;
case EINTR: // Should never occur on Symbian, but this is future proof!
@@ -496,9 +496,9 @@ void QSelectThread::run()
break;
}
} else {
+ updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
- updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
}
m_waitCond.wait(&m_mutex);
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 135ec303..cede810 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -71,10 +71,12 @@ extern uint qGlobalPostedEventsCount();
#ifndef WM_TOUCH
# define WM_TOUCH 0x0240
#endif
+#ifndef QT_NO_GESTURES
#ifndef WM_GESTURE
# define WM_GESTURE 0x0119
# define WM_GESTURENOTIFY 0x011A
#endif
+#endif // QT_NO_GESTURES
enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
@@ -738,8 +740,10 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
|| msg.message == WM_MOUSEWHEEL
|| msg.message == WM_MOUSEHWHEEL
|| msg.message == WM_TOUCH
+#ifndef QT_NO_GESTURES
|| msg.message == WM_GESTURE
|| msg.message == WM_GESTURENOTIFY
+#endif
|| msg.message == WM_CLOSE)) {
// queue user input events for later processing
haveMessage = false;
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index ca54c6c..1321b14 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -56,7 +56,7 @@
#include "qhash.h"
#include "qtranslator_p.h"
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
#define QT_USE_MMAP
#include "private/qcore_unix_p.h"
#endif
diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp
index 28dfc23..cb5e701 100644
--- a/src/corelib/tools/qelapsedtimer.cpp
+++ b/src/corelib/tools/qelapsedtimer.cpp
@@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE
used.
\value SystemTime The human-readable system time. This clock is not monotonic.
- \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is not monotonic and does not overflow.
+ \value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is monotonic and does not overflow.
\value TickCounter The system's tick counter, used on Windows and Symbian systems. This clock may overflow.
\value MachAbsoluteTime The Mach kernel's absolute time (Mac OS X). This clock is monotonic and does not overflow.
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 3374c80..0777f06 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -931,7 +931,7 @@ public:
{ return QHash<Key, T>::insertMulti(key, value); }
inline QMultiHash &operator+=(const QMultiHash &other)
- { unite(other); return *this; }
+ { this->unite(other); return *this; }
inline QMultiHash operator+(const QMultiHash &other) const
{ QMultiHash result = *this; result += other; return result; }
@@ -1006,12 +1006,7 @@ Q_INLINE_TEMPLATE int QMultiHash<Key, T>::remove(const Key &key, const T &value)
typename QHash<Key, T>::iterator end(QHash<Key, T>::end());
while (i != end && i.key() == key) {
if (i.value() == value) {
-#if defined(Q_CC_RVCT)
- // RVCT has problems with scoping, apparently.
- i = QHash<Key, T>::erase(i);
-#else
- i = erase(i);
-#endif
+ i = this->erase(i);
++n;
} else {
++i;
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 5696ba6..e4b73a1 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -977,7 +977,7 @@ public:
{ return QMap<Key, T>::insertMulti(key, value); }
inline QMultiMap &operator+=(const QMultiMap &other)
- { unite(other); return *this; }
+ { this->unite(other); return *this; }
inline QMultiMap operator+(const QMultiMap &other) const
{ QMultiMap result = *this; result += other; return result; }
@@ -1052,12 +1052,7 @@ Q_INLINE_TEMPLATE int QMultiMap<Key, T>::remove(const Key &key, const T &value)
typename QMap<Key, T>::iterator end(QMap<Key, T>::end());
while (i != end && !qMapLessThanKey<Key>(key, i.key())) {
if (i.value() == value) {
-#if defined(Q_CC_RVCT)
- // RVCT has problems with scoping, apparently.
- i = QMap<Key, T>::erase(i);
-#else
- i = erase(i);
-#endif
+ i = this->erase(i);
++n;
} else {
++i;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index e1167fa..c8d641a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -129,7 +129,7 @@ static inline bool qt_ends_with(const QChar *haystack, int haystackLen,
static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const ushort *be)
{
if (a == b)
- return 0;
+ return (ae - be);
if (a == 0)
return 1;
if (b == 0)
@@ -141,7 +141,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const ushort *b, const u
uint alast = 0;
uint blast = 0;
- while (a != e) {
+ while (a < e) {
// qDebug() << hex << alast << blast;
// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);
// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);
@@ -170,7 +170,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b)
if (b == 0)
return -1;
- while (a != ae && *b) {
+ while (a < ae && *b) {
int diff = foldCase(*a) - foldCase(*b);
if ((diff))
return diff;
@@ -4665,9 +4665,12 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
return length1;
if (cs == Qt::CaseSensitive) {
- while (uc != e && *c && *uc == *c)
+ while (uc < e && *c && *uc == *c)
uc++, c++;
+ if (uc == e)
+ return -*c;
+
return *uc - *c;
} else {
return ucstricmp(uc, e, c);
@@ -7118,7 +7121,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
*/
QString &QString::setRawData(const QChar *unicode, int size)
{
- if (d->ref != 1 || d->alloc) {
+ if (d->ref != 1 || (d->data == d->array && d->alloc)) {
*this = fromRawData(unicode, size);
} else {
#ifdef QT3_SUPPORT
diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt
index 0df5f10..5735b1e 100644
--- a/src/declarative/QmlChanges.txt
+++ b/src/declarative/QmlChanges.txt
@@ -2,7 +2,6 @@
The changes below are pre Qt 4.7.0 RC
TextInput and TextEdit:
- - showInputPanelOnFocus property added
- openSoftwareInputPanel() and closeSoftwareInputPanel() functions added
Flickable:
- overShoot is replaced by boundsBehavior enumeration
diff --git a/src/declarative/debugger/qdeclarativedebugtrace_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h
index 5ba49a8..704c49a 100644
--- a/src/declarative/debugger/qdeclarativedebugtrace_p.h
+++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h
@@ -50,7 +50,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QUrl;
-class QDeclarativeDebugTrace : public QDeclarativeDebugService
+class Q_AUTOTEST_EXPORT QDeclarativeDebugTrace : public QDeclarativeDebugService
{
public:
enum EventType {
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index a05e426..261cc5c 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -72,13 +72,22 @@ QT_BEGIN_NAMESPACE
\o \image animatedimageitem.gif
\o
\qml
-Item {
- width: anim.width; height: anim.height+8
- AnimatedImage { id: anim; source: "pics/games-anim.gif" }
- Rectangle { color: "red"; width: 4; height: 8; y: anim.height
- x: (anim.width-width)*anim.currentFrame/(anim.frameCount-1)
+ import Qt 4.7
+
+ Rectangle {
+ width: animation.width; height: animation.height + 8
+
+ AnimatedImage { id: animation; source: "animation.gif" }
+
+ Rectangle {
+ property int frames: animation.frameCount
+
+ width: 4; height: 8
+ x: (animation.width - width) * animation.currentFrame / frames
+ y: animation.height
+ color: "red"
+ }
}
-}
\endqml
\endtable
*/
@@ -96,7 +105,7 @@ QDeclarativeAnimatedImage::~QDeclarativeAnimatedImage()
/*!
\qmlproperty bool AnimatedImage::paused
- This property holds whether the animated image is paused or not
+ This property holds whether the animated image is paused.
Defaults to false, and can be set to true when you want to pause.
*/
@@ -120,7 +129,7 @@ void QDeclarativeAnimatedImage::setPaused(bool pause)
}
/*!
\qmlproperty bool AnimatedImage::playing
- This property holds whether the animated image is playing or not
+ This property holds whether the animated image is playing.
Defaults to true, so as to start playing immediately.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index d926119..8c9d2dd 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -74,7 +74,7 @@ public:
\inherits Item
Flipable is an item that can be visibly "flipped" between its front and
- back sides. It is used together with Rotation and State/Transition to
+ back sides. It is used together with \l Rotation and \l {State}/\l {Transition} to
produce a flipping effect.
Here is a Flipable that flips whenever it is clicked:
@@ -83,10 +83,12 @@ public:
\image flipable.gif
- The Rotation element is used to specify the angle and axis of the flip,
- and the State defines the changes in angle which produce the flipping
- effect. Finally, the Transition creates the animation that changes the
+ The \l Rotation element is used to specify the angle and axis of the flip,
+ and the \l State defines the changes in angle which produce the flipping
+ effect. Finally, the \l Transition creates the animation that changes the
angle over one second.
+
+ \sa {declarative/ui-components/flipable}{Flipable example}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 906f1fc..ffffc2f 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -904,28 +904,43 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
\inherits Flickable
\brief The GridView item provides a grid view of items provided by a model.
- The model is typically provided by a QAbstractListModel "C++ model object",
- but can also be created directly in QML.
+ A GridView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
- The items are laid out top to bottom (vertically) or left to right (horizontally)
- and may be flicked to scroll.
+ A GridView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed. Items in a
+ GridView are laid out horizontally or vertically. Grid views are inherently flickable
+ as GridView inherits from \l Flickable.
- The below example creates a very simple grid, using a QML model.
+ For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
- \image gridview.png
+ \snippet doc/src/snippets/declarative/gridview/ContactModel.qml 0
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 3
+ Another component can display this model data in a GridView, like this:
- The model is defined as a ListModel using QML:
- \quotefile doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs simple
+ \image gridview-simple.png
- In this case ListModel is a handy way for us to test our UI. In practice
- the model would be implemented in C++, or perhaps via a SQL data source.
+ Here, the GridView creates a \c ContactModel component for its model, and a \l Column element
+ (containing \l Image and \ Text elements) for its delegate. The view will create a new delegate
+ for each item in the model. Notice the delegate is able to access the model's \c name and
+ \c portrait data directly.
+
+ An improved grid view is shown below. The delegate is visually improved and is moved
+ into a separate \c contactDelegate component. Also, the currently selected item is highlighted
+ with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true
+ to enable keyboard navigation for the grid view.
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml classdocs advanced
+ \image gridview-highlight.png
Delegates are instantiated as needed and may be destroyed at any time.
State should \e never be stored in a delegate.
- \bold Note that views do not enable \e clip automatically. If the view
+ \note Views do not enable \e clip automatically. If the view
is not clipped by another item or the screen, it will be necessary
to set \e {clip: true} in order to have the out of view items clipped
nicely.
@@ -971,19 +986,7 @@ QDeclarativeGridView::~QDeclarativeGridView()
The example below ensures that the animation completes before
the item is removed from the grid.
- \code
- Component {
- id: myDelegate
- Item {
- id: wrapper
- GridView.onRemove: SequentialAnimation {
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true }
- NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad }
- PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false }
- }
- }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml delayRemove
*/
/*!
@@ -1001,10 +1004,10 @@ QDeclarativeGridView::~QDeclarativeGridView()
\qmlproperty model GridView::model
This property holds the model providing data for the grid.
- The model provides a set of data that is used to create the items
- for the view. For large or dynamic datasets the model is usually
- provided by a C++ model object. The C++ model object must be a \l
- {QAbstractItemModel} subclass, a VisualModel, or a simple list.
+ The model provides the set of data that is used to create the items
+ in the view. Models can be created directly in QML using \l ListModel, \l XmlListModel
+ or \l VisualItemModel, or provided by C++ model classes. If a C++ model class is
+ used, it must be a subclass of \l QAbstractItemModel or a simple list.
\sa {qmlmodels}{Data Models}
*/
@@ -1079,11 +1082,11 @@ void QDeclarativeGridView::setModel(const QVariant &model)
that is not needed for the normal display of the delegate in a \l Loader which
can load additional elements when needed.
- Note that the GridView will layout the items based on the size of the root item
+ The GridView will layout the items based on the size of the root item
in the delegate.
- Here is an example delegate:
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 0
+ \note Delegates are instantiated as needed and may be destroyed at any time.
+ State should \e never be stored in a delegate.
*/
QDeclarativeComponent *QDeclarativeGridView::delegate() const
{
@@ -1157,8 +1160,7 @@ QDeclarativeItem *QDeclarativeGridView::currentItem()
/*!
\qmlproperty Item GridView::highlightItem
- \c highlightItem holds the highlight item, which was created
- from the \l highlight component.
+ This holds the highlight item created from the \l highlight component.
The highlightItem is managed by the view unless
\l highlightFollowsCurrentItem is set to false.
@@ -1189,13 +1191,10 @@ int QDeclarativeGridView::count() const
\qmlproperty Component GridView::highlight
This property holds the component to use as the highlight.
- An instance of the highlight component will be created for each view.
- The geometry of the resultant component instance will be managed by the view
+ An instance of the highlight component is created for each view.
+ The geometry of the resulting component instance will be managed by the view
so as to stay with the current item, unless the highlightFollowsCurrentItem property is false.
- The below example demonstrates how to make a simple highlight:
- \snippet doc/src/snippets/declarative/gridview/gridview.qml 1
-
\sa highlightItem, highlightFollowsCurrentItem
*/
QDeclarativeComponent *QDeclarativeGridView::highlight() const
@@ -1218,21 +1217,14 @@ void QDeclarativeGridView::setHighlight(QDeclarativeComponent *highlight)
\qmlproperty bool GridView::highlightFollowsCurrentItem
This property sets whether the highlight is managed by the view.
- If highlightFollowsCurrentItem is true, the highlight will be moved smoothly
- to follow the current item. If highlightFollowsCurrentItem is false, the
- highlight will not be moved by the view, and must be implemented
- by the highlight component, for example:
-
- \code
- Component {
- id: myHighlight
- Rectangle {
- id: wrapper; color: "lightsteelblue"; radius: 4; width: 320; height: 60
- SpringFollow on y { source: wrapper.GridView.view.currentItem.y; spring: 3; damping: 0.2 }
- SpringFollow on x { source: wrapper.GridView.view.currentItem.x; spring: 3; damping: 0.2 }
- }
- }
- \endcode
+ If this property is true, the highlight is moved smoothly
+ to follow the current item. Otherwise, the
+ highlight is not moved by the view, and any movement must be implemented
+ by the highlight.
+
+ Here is a highlight with its motion defined by a \l {SpringFollow} item:
+
+ \snippet doc/src/snippets/declarative/gridview/gridview.qml highlightFollowsCurrentItem
*/
bool QDeclarativeGridView::highlightFollowsCurrentItem() const
{
@@ -1290,32 +1282,30 @@ void QDeclarativeGridView::setHighlightMoveDuration(int duration)
\qmlproperty real GridView::preferredHighlightEnd
\qmlproperty enumeration GridView::highlightRangeMode
- These properties set the preferred range of the highlight (current item)
- within the view.
+ These properties define the preferred range of the highlight (for the current item)
+ within the view. The \c preferredHighlightBegin value must be less than the
+ \c preferredHighlightEnd value.
- Note that this is the correct way to influence where the
- current item ends up when the view scrolls. For example, if you want the
- currently selected item to be in the middle of the list, then set the
- highlight range to be where the middle item would go. Then, when the view scrolls,
- the currently selected item will be the item at that spot. This also applies to
- when the currently selected item changes - it will scroll to within the preferred
- highlight range. Furthermore, the behaviour of the current item index will occur
- whether or not a highlight exists.
+ These properties affect the position of the current item when the view is scrolled.
+ For example, if the currently selected item should stay in the middle of the
+ view when it is scrolled, set the \c preferredHighlightBegin and
+ \c preferredHighlightEnd values to the top and bottom coordinates of where the middle
+ item would be. If the \c currentItem is changed programmatically, the view will
+ automatically scroll so that the current item is in the middle of the view.
+ Furthermore, the behavior of the current item index will occur whether or not a
+ highlight exists.
- If highlightRangeMode is set to \e GridView.ApplyRange the view will
- attempt to maintain the highlight within the range, however
- the highlight can move outside of the range at the ends of the list
- or due to a mouse interaction.
+ Valid values for \c highlightRangeMode are:
- If highlightRangeMode is set to \e GridView.StrictlyEnforceRange the highlight will never
- move outside of the range. This means that the current item will change
- if a keyboard or mouse action would cause the highlight to move
- outside of the range.
-
- The default value is \e GridView.NoHighlightRange.
-
- Note that a valid range requires preferredHighlightEnd to be greater
- than or equal to preferredHighlightBegin.
+ \list
+ \o GridView.ApplyRange - the view attempts to maintain the highlight within the range.
+ However, the highlight can move outside of the range at the ends of the view or due
+ to mouse interaction.
+ \o GridView.StrictlyEnforceRange - the highlight never moves outside of the range.
+ The current item changes if a keyboard or mouse action would cause the highlight to move
+ outside of the range.
+ \o GridView.NoHighlightRange - this is the default value.
+ \endlist
*/
qreal QDeclarativeGridView::preferredHighlightBegin() const
{
@@ -1370,10 +1360,12 @@ void QDeclarativeGridView::setHighlightRangeMode(HighlightRangeMode mode)
\qmlproperty enumeration GridView::flow
This property holds the flow of the grid.
- Possible values are \c GridView.LeftToRight (default) and \c GridView.TopToBottom.
+ Possible values:
- If \a flow is \c GridView.LeftToRight, the view will scroll vertically.
- If \a flow is \c GridView.TopToBottom, the view will scroll horizontally.
+ \list
+ \o GridView.LeftToRight (default) - Items are laid out from left to right, and the view scrolls vertically
+ \o GridView.TopToBottom - Items are laid out from top to bottom, and the view scrolls horizontally
+ \endlist
*/
QDeclarativeGridView::Flow QDeclarativeGridView::flow() const
{
@@ -1405,8 +1397,9 @@ void QDeclarativeGridView::setFlow(Flow flow)
\qmlproperty bool GridView::keyNavigationWraps
This property holds whether the grid wraps key navigation
- If this property is true then key presses to move off of one end of the grid will cause the
- selection to jump to the other side.
+ If this is true, key navigation that would move the current item selection
+ past one end of the view instead wraps around and moves the selection to
+ the other end of the view.
*/
bool QDeclarativeGridView::isWrapEnabled() const
{
@@ -1463,7 +1456,7 @@ void QDeclarativeGridView::setCacheBuffer(int buffer)
\qmlproperty int GridView::cellWidth
\qmlproperty int GridView::cellHeight
- These properties holds the width and height of each cell in the grid
+ These properties holds the width and height of each cell in the grid.
The default cell size is 100x100.
*/
@@ -1503,14 +1496,14 @@ void QDeclarativeGridView::setCellHeight(int cellHeight)
/*!
\qmlproperty enumeration GridView::snapMode
- This property determines where the view will settle following a drag or flick.
- The allowed values are:
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
\list
- \o GridView.NoSnap (default) - the view will stop anywhere within the visible area.
- \o GridView.SnapToRow - the view will settle with a row (or column for TopToBottom flow)
+ \o GridView.NoSnap (default) - the view stops anywhere within the visible area.
+ \o GridView.SnapToRow - the view settles with a row (or column for \c GridView.TopToBottom flow)
aligned with the start of the view.
- \o GridView.SnapOneRow - the view will settle no more than one row (or column for TopToBottom flow)
+ \o GridView.SnapOneRow - the view will settle no more than one row (or column for \c GridView.TopToBottom flow)
away from the first visible row at the time the mouse button is released.
This mode is particularly useful for moving one page at a time.
\endlist
@@ -1789,22 +1782,22 @@ void QDeclarativeGridView::moveCurrentIndexRight()
\a mode:
\list
- \o Beginning - position item at the top (or left for TopToBottom flow) of the view.
- \o Center- position item in the center of the view.
- \o End - position item at bottom (or right for horizontal orientation) of the view.
- \o Visible - if any part of the item is visible then take no action, otherwise
+ \o GridView.Beginning - position item at the top (or left for \c GridView.TopToBottom flow) of the view.
+ \o GridView.Center - position item in the center of the view.
+ \o GridView.End - position item at bottom (or right for horizontal orientation) of the view.
+ \o GridView.Visible - if any part of the item is visible then take no action, otherwise
bring the item into view.
- \o Contain - ensure the entire item is visible. If the item is larger than
- the view the item is positioned at the top (or left for TopToBottom flow) of the view.
+ \o GridView.Contain - ensure the entire item is visible. If the item is larger than
+ the view the item is positioned at the top (or left for \c GridView.TopToBottom flow) of the view.
\endlist
If positioning the view at the index would cause empty space to be displayed at
the beginning or end of the view, the view will be positioned at the boundary.
- It is not recommended to use contentX or contentY to position the view
+ It is not recommended to use \l {Flickable::}{contentX} or \l {Flickable::}{contentY} to position the view
at a particular index. This is unreliable since removing items from the start
of the view does not cause all other items to be repositioned.
- The correct way to bring an item into view is with positionViewAtIndex.
+ The correct way to bring an item into view is with \c positionViewAtIndex.
*/
void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 4593cf8..94240c2 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -275,11 +275,6 @@ qreal QDeclarativeImage::paintedHeight() const
\o Image.Error - an error occurred while loading the image
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened with the image internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
-
Use this status to provide an update or respond to the status change in some way.
For example, you could:
diff --git a/src/declarative/graphicsitems/qdeclarativeimage_p.h b/src/declarative/graphicsitems/qdeclarativeimage_p.h
index 5ea700d..fa5b2a9 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeimage_p.h
@@ -87,8 +87,6 @@ protected:
QDeclarativeImage(QDeclarativeImagePrivate &dd, QDeclarativeItem *parent);
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
void pixmapChange();
-
-protected Q_SLOTS:
void updatePaintedGeometry();
private:
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 134bd6d..9949e65 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -97,9 +97,11 @@ QT_BEGIN_NAMESPACE
The Translate object provides independent control over position in addition to the Item's x and y properties.
- The following example moves the Y axis of the Rectangles while still allowing the Row element
+ The following example moves the Y axis of the \l Rectangle elements while still allowing the \l Row element
to lay the items out as if they had not been transformed:
\qml
+ import Qt 4.7
+
Row {
Rectangle {
width: 100; height: 100
@@ -113,6 +115,8 @@ QT_BEGIN_NAMESPACE
}
}
\endqml
+
+ \image translate.png
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
index 4add66d..38d5f59 100644
--- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
@@ -58,7 +58,10 @@ QT_BEGIN_NAMESPACE
taking its size hints into account, and you can propagate this to the other elements in your UI via anchors and bindings.
This is a QGraphicsLayoutItem subclass, and its properties merely expose the QGraphicsLayoutItem functionality to QML.
- See the QGraphicsLayoutItem documentation for further details.
+
+ The \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem example}
+ demonstrates how a LayoutItem can be used within a \l{Graphics View Framework}{Graphics View}
+ scene.
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 01928a1..dbd1976 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -427,6 +427,8 @@ public:
scheduleLayout();
}
}
+ if (currentItem && currentItem->item == item)
+ updateHighlight();
if (trackedItem && trackedItem->item == item)
q->trackedPositionChanged();
}
@@ -1103,7 +1105,9 @@ void QDeclarativeListViewPrivate::updateHeader()
void QDeclarativeListViewPrivate::fixupPosition()
{
- moveReason = Other;
+ if ((haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange)
+ || snapMode != QDeclarativeListView::NoSnap)
+ moveReason = Other;
if (orient == QDeclarativeListView::Vertical)
fixupY();
else
@@ -1325,13 +1329,11 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
Another component can display this model data in a ListView, like this:
- \table
- \row
- \o \snippet doc/src/snippets/declarative/listview/listview.qml import
+ \snippet doc/src/snippets/declarative/listview/listview.qml import
\codeline
\snippet doc/src/snippets/declarative/listview/listview.qml classdocs simple
- \o \image listview-simple.png
- \endtable
+
+ \image listview-simple.png
Here, the ListView creates a \c ContactModel component for its model, and a \l Text element
for its delegate. The view will create a new \l Text component for each item in the model. Notice
@@ -1342,13 +1344,10 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
with a blue \l Rectangle using the \l highlight property, and \c focus is set to \c true
to enable keyboard navigation for the list view.
- \table
- \row
- \o \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced
- \o \image listview-highlight.png
- \endtable
+ \snippet doc/src/snippets/declarative/listview/listview.qml classdocs advanced
+ \image listview-highlight.png
- In a ListView, delegates are instantiated as needed and may be destroyed at any time.
+ In a GridView, delegates are instantiated as needed and may be destroyed at any time.
State should \e never be stored in a delegate.
\note Views do not enable \e clip automatically. If the view
@@ -1634,7 +1633,7 @@ int QDeclarativeListView::count() const
This property holds the component to use as the highlight.
An instance of the highlight component is created for each list.
- The geometry of the resultant component instance is managed by the list
+ The geometry of the resulting component instance is managed by the list
so as to stay with the current item, unless the highlightFollowsCurrentItem
property is false.
@@ -1667,7 +1666,7 @@ void QDeclarativeListView::setHighlight(QDeclarativeComponent *highlight)
highlight is not moved by the view, and any movement must be implemented
by the highlight.
- Here is a highlight with its motion defined by the a \l {SpringFollow} item:
+ Here is a highlight with its motion defined by a \l {SpringFollow} item:
\snippet doc/src/snippets/declarative/listview/listview.qml highlightFollowsCurrentItem
@@ -2042,8 +2041,8 @@ void QDeclarativeListView::setHighlightResizeDuration(int duration)
/*!
\qmlproperty enumeration ListView::snapMode
- This property determines where the view's scrolling behavior stops following a drag or flick.
- The allowed values are:
+ This property determines how the view scrolling will settle following a drag or flick.
+ The possible values are:
\list
\o ListView.NoSnap (default) - the view stops anywhere within the visible area.
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 4995baf..898c5a5 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -115,27 +115,37 @@ void QDeclarativeLoaderPrivate::initResize()
subtree from a QML URL or Component.
Loader instantiates an item from a component. The component to
- instantiate may be specified directly by the \c sourceComponent
- property, or loaded from a URL via the \c source property.
+ instantiate may be specified directly by the \l sourceComponent
+ property, or loaded from a URL via the \l source property.
It is also an effective means of delaying the creation of a component
until it is required:
\code
+ import Qt 4.7
+
Loader { id: pageLoader }
+
Rectangle {
- MouseArea { anchors.fill: parent; onClicked: pageLoader.source = "Page1.qml" }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: pageLoader.source = "Page1.qml"
+ }
}
\endcode
If the Loader source is changed, any previous items instantiated
- will be destroyed. Setting \c source to an empty string, or setting
+ will be destroyed. Setting \l source to an empty string, or setting
sourceComponent to \e undefined
will destroy the currently instantiated items, freeing resources
and leaving the Loader empty. For example:
\code
pageLoader.source = ""
+ \endcode
+
or
+
+ \code
pageLoader.sourceComponent = undefined
\endcode
@@ -340,19 +350,31 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
\o Loader.Error - an error occurred while loading the QML source
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened to the loader internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
- \list
- \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = Loader.Ready;}
- \o Do something inside the onLoaded signal handler, e.g. Loader{id: loader; onLoaded: console.log('Loaded');}
- \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=Loader.Ready){'Not Loaded';}else{'Loaded';}}
- \endlist
- \sa progress
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \e {Trigger a state change:}
+ \qml
+ State { name: 'loaded'; when: loader.status = Loader.Ready }
+ \endqml
+
+ \e {Implement an \c onStatusChanged signal handler:}
+ \qml
+ Loader {
+ id: loader
+ onStatusChanged: if (loader.status == Loader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \e {Bind to the status value:}
+ \qml
+ Text { text: loader.status != Loader.Ready ? 'Not Loaded' : 'Loaded' }
+ \endqml
Note that if the source is a local file, the status will initially be Ready (or Error). While
there will be no onStatusChanged signal in that case, the onLoaded will still be invoked.
+
+ \sa progress
*/
QDeclarativeLoader::Status QDeclarativeLoader::status() const
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 1947c00..6fca283 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -172,17 +172,21 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
A MouseArea is typically used in conjunction with a visible item,
where the MouseArea effectively 'proxies' mouse handling for that
- item. For example, we can put a MouseArea in a Rectangle that changes
- the Rectangle color to red when clicked:
- \snippet doc/src/snippets/declarative/mouseregion.qml 0
+ item. For example, we can put a MouseArea in a \l Rectangle that changes
+ the \l Rectangle color to red when clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/mousearea.qml intro
Many MouseArea signals pass a \l {MouseEvent}{mouse} parameter that contains
additional information about the mouse event, such as the position, button,
and any key modifiers.
- Below we have the previous
- example extended so as to give a different color when you right click.
- \snippet doc/src/snippets/declarative/mouseregion.qml 1
+ Here is an extension of the previous example that produces a different
+ color when the area is right clicked:
+
+ \snippet doc/src/snippets/declarative/mousearea.qml intro-extended
For basic key handling, see the \l {Keys}{Keys attached property}.
@@ -238,7 +242,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
releasing is also considered a click).
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -262,7 +266,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
This handler is called when there is a release.
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -282,7 +286,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
This handler is called when there is a double-click (a press followed by a release followed by a press).
The \l {MouseEvent}{mouse} parameter provides information about the click, including the x and y
- position of the release of the click, and whether the click wasHeld.
+ position of the release of the click, and whether the click was held.
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
@@ -328,10 +332,10 @@ QDeclarativeMouseArea::~QDeclarativeMouseArea()
while a button is pressed, and will remain valid as long as the button is held
even if the mouse is moved outside the area.
- If hoverEnabled is true then these properties will be valid:
+ If hoverEnabled is true then these properties will be valid when:
\list
- \i when no button is pressed, but the mouse is within the MouseArea (containsMouse is true).
- \i if a button is pressed and held, even if it has since moved out of the area.
+ \i no button is pressed, but the mouse is within the MouseArea (containsMouse is true).
+ \i a button is pressed and held, even if it has since moved out of the area.
\endlist
The coordinates are relative to the MouseArea.
@@ -378,18 +382,7 @@ void QDeclarativeMouseArea::setEnabled(bool a)
\endlist
The code below displays "right" when the right mouse buttons is pressed:
- \code
- Text {
- text: mr.pressedButtons & Qt.RightButton ? "right" : ""
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- MouseArea {
- id: mr
- acceptedButtons: Qt.LeftButton | Qt.RightButton
- anchors.fill: parent
- }
- }
- \endcode
+ \snippet doc/src/snippets/declarative/mousearea.qml mousebuttons
\sa acceptedButtons
*/
@@ -705,7 +698,7 @@ void QDeclarativeMouseArea::setHovered(bool h)
MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton }
\endcode
- The default is to accept the Left button.
+ The default value is \c Qt.LeftButton.
*/
Qt::MouseButtons QDeclarativeMouseArea::acceptedButtons() const
{
@@ -765,17 +758,19 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag()
\qmlproperty real MouseArea::drag.minimumY
\qmlproperty real MouseArea::drag.maximumY
- drag provides a convenient way to make an item draggable.
+ \c drag provides a convenient way to make an item draggable.
\list
- \i \c target specifies the item to drag.
- \i \c active specifies if the target item is being currently dragged.
- \i \c axis specifies whether dragging can be done horizontally (Drag.XAxis), vertically (Drag.YAxis), or both (Drag.XandYAxis)
- \i the minimum and maximum properties limit how far the target can be dragged along the corresponding axes.
+ \i \c drag.target specifies the item to drag.
+ \i \c drag.active specifies if the target item is currently being dragged.
+ \i \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XandYAxis)
+ \i \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes.
\endlist
- The following example uses drag to reduce the opacity of an image as it moves to the right:
- \snippet doc/src/snippets/declarative/drag.qml 0
+ The following example displays an image that can be dragged along the X-axis. The opacity
+ of the image is reduced when it is dragged to the right.
+
+ \snippet doc/src/snippets/declarative/mousearea.qml drag
*/
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index 141a938..a904869 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -628,7 +628,7 @@ void QDeclarativePathLine::addToPath(QPainterPath &path)
\qml
Path {
startX: 0; startY: 0
- PathQuad x: 200; y: 0; controlX: 100; controlY: 150 }
+ PathQuad { x: 200; y: 0; controlX: 100; controlY: 150 }
}
\endqml
\endtable
@@ -713,8 +713,9 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path)
Path {
startX: 20; startY: 0
PathCubic {
- x: 180; y: 0; control1X: -10; control1Y: 90
- control2X: 210; control2Y: 90
+ x: 180; y: 0
+ control1X: -10; control1Y: 90
+ control2X: 210; control2Y: 90
}
}
\endqml
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 448ec06..f58b054 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -310,11 +310,21 @@ void QDeclarativePathViewPrivate::regenerate()
\brief The PathView element lays out model-provided items on a path.
\inherits Item
- The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in QML.
+ A PathView displays data from models created from built-in QML elements like ListModel
+ and XmlListModel, or custom model classes defined in C++ that inherit from
+ QAbstractListModel.
+ A ListView has a \l model, which defines the data to be displayed, and
+ a \l delegate, which defines how the data should be displayed.
The \l delegate is instantiated for each item on the \l path.
The items may be flicked to move them along the path.
+ For example, if there is a simple list model defined in a file \c ContactModel.qml like this:
+
+ \snippet doc/src/snippets/declarative/pathview/ContactModel.qml 0
+
+ This data can be represented as a PathView, like this:
+
\snippet doc/src/snippets/declarative/pathview/pathview.qml 0
\image pathview.gif
@@ -885,6 +895,7 @@ void QDeclarativePathView::setPathItemCount(int i)
if (i < 1)
i = 1;
d->pathItems = i;
+ d->updateMappedRange();
if (d->isValid() && isComponentComplete()) {
d->regenerate();
}
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 8796e63..20cc46b 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -302,7 +302,7 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
/*!
\qmlclass Column QDeclarativeColumn
\since 4.7
- \brief The Column item lines up its children vertically.
+ \brief The Column item arranges its children vertically.
\inherits Item
The Column item positions its child items so that they are vertically
@@ -346,7 +346,8 @@ Column {
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Column.
*/
/*!
@@ -396,7 +397,7 @@ Column {
spacing is the amount in pixels left empty between each adjacent
item, and defaults to 0.
- The below example places a Grid containing a red, a blue and a
+ The below example places a \l Grid containing a red, a blue and a
green rectangle on a gray background. The area the grid positioner
occupies is colored white. The top positioner has the default of no spacing,
and the bottom positioner has its spacing set to 2.
@@ -468,17 +469,15 @@ void QDeclarativeColumn::reportConflictingAnchors()
/*!
\qmlclass Row QDeclarativeRow
\since 4.7
- \brief The Row item lines up its children horizontally.
+ \brief The Row item arranges its children horizontally.
\inherits Item
The Row item positions its child items so that they are
- horizontally aligned and not overlapping. Spacing can be added between the
- items, and a margin around all items can also be added. It also provides for
- transitions to be set when items are added, moved, or removed in the
- positioner. Adding and removing apply both to items which are deleted or have
- their position in the document changed so as to no longer be children of the
- positioner, as well as to items which have their opacity set to or from zero
- so as to appear or disappear.
+ horizontally aligned and not overlapping.
+
+ Use \l spacing to set the spacing between items in a Row, and use the
+ \l add and \l move properties to set the transitions that should be applied
+ when items are added to, removed from, or re-positioned within the Row.
The below example lays out differently shaped rectangles using a Row.
\qml
@@ -495,8 +494,8 @@ Row {
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
width of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
-
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Row.
*/
/*!
\qmlproperty Transition Row::add
@@ -504,12 +503,10 @@ Row {
The transition will only be applied to the added item(s).
Positioner transitions will only affect the position (x,y) of items.
- Added can mean that either the object has been created or
- reparented, and thus is now a child or the positioner, or that the
+ An object is considered to be added to the positioner if it has been
+ created or reparented and thus is now a child or the positioner, or if the
object has had its opacity increased from zero, and thus is now
visible.
-
-
*/
/*!
\qmlproperty Transition Row::move
@@ -540,7 +537,7 @@ Row {
spacing is the amount in pixels left empty between each adjacent
item, and defaults to 0.
- The below example places a Grid containing a red, a blue and a
+ The below example places a \l Grid containing a red, a blue and a
green rectangle on a gray background. The area the grid positioner
occupies is colored white. The top positioner has the default of no spacing,
and the bottom positioner has its spacing set to 2.
@@ -610,18 +607,20 @@ void QDeclarativeRow::reportConflictingAnchors()
\inherits Item
The Grid item positions its child items so that they are
- aligned in a grid and are not overlapping. Spacing can be added
- between the items. It also provides for transitions to be set when items are
+ aligned in a grid and are not overlapping.
+
+ Spacing can be added
+ between child items. It also provides for transitions to be set when items are
added, moved, or removed in the positioner. Adding and removing apply
both to items which are deleted or have their position in the
document changed so as to no longer be children of the positioner, as
well as to items which have their opacity set to or from zero so
as to appear or disappear.
- The Grid defaults to using four columns, and as many rows as
- are necessary to fit all the child items. The number of rows
- and/or the number of columns can be constrained by setting the rows
- or columns properties. The grid positioner calculates a grid with
+ A Grid defaults to four columns, and as many rows as
+ are necessary to fit all child items. The number of rows
+ and/or the number of columns can be constrained by setting the \l rows
+ or \l columns properties. The grid positioner calculates a grid with
rectangular cells of sufficient size to hold all items, and then
places the items in the cells, going across then down, and
positioning each item at the (0,0) corner of the cell. The below
@@ -648,7 +647,8 @@ Grid {
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
width or height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Grid.
*/
/*!
\qmlproperty Transition Grid::add
@@ -658,12 +658,10 @@ Grid {
as that is all the positioners affect. To animate other property change
you will have to do so based on how you have changed those properties.
- Added can mean that either the object has been created or
- reparented, and thus is now a child or the positioner, or that the
+ An object is considered to be added to the positioner if it has been
+ created or reparented and thus is now a child or the positioner, or if the
object has had its opacity increased from zero, and thus is now
visible.
-
-
*/
/*!
\qmlproperty Transition Grid::move
@@ -714,18 +712,16 @@ QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
\qmlproperty int Grid::columns
This property holds the number of columns in the grid.
- When the columns property is set the Grid will always have
- that many columns. Note that if you do not have enough items to
- fill this many columns some columns will be of zero width.
+ If the grid does not have enough items to fill the specified
+ number of columns, some columns will be of zero width.
*/
/*!
\qmlproperty int Grid::rows
This property holds the number of rows in the grid.
- When the rows property is set the Grid will always have that
- many rows. Note that if you do not have enough items to fill this
- many rows some rows will be of zero width.
+ If the grid does not have enough items to fill the specified
+ number of rows, some rows will be of zero width.
*/
void QDeclarativeGrid::setColumns(const int columns)
@@ -750,12 +746,14 @@ void QDeclarativeGrid::setRows(const int rows)
\qmlproperty enumeration Grid::flow
This property holds the flow of the layout.
- Possible values are \c Grid.LeftToRight (default) and \c Grid.TopToBottom.
+ Possible values are:
- If \a flow is \c Grid.LeftToRight, the items are positioned next to
- to each other from left to right, then wrapped to the next line.
- If \a flow is \c Grid.TopToBottom, the items are positioned next to each
- other from top to bottom, then wrapped to the next column.
+ \list
+ \o Grid.LeftToRight (default) - Items are positioned next to
+ to each other from left to right, then wrapped to the next line.
+ \o Grid.TopToBottom - Items are positioned next to each
+ other from top to bottom, then wrapped to the next column.
+ \endlist
*/
QDeclarativeGrid::Flow QDeclarativeGrid::flow() const
{
@@ -893,14 +891,18 @@ void QDeclarativeGrid::reportConflictingAnchors()
/*!
\qmlclass Flow QDeclarativeFlow
\since 4.7
- \brief The Flow item lines up its children side by side, wrapping as necessary.
+ \brief The Flow item arranges its children side by side, wrapping as necessary.
\inherits Item
+ The Flow item positions its child items so that they are side by side and are
+ not overlapping.
+
Note that the positioner assumes that the x and y positions of its children
will not change. If you manually change the x or y properties in script, bind
the x or y properties, use anchors on a child of a positioner, or have the
width or height of a child depend on the position of a child, then the
- positioner may exhibit strange behaviour.
+ positioner may exhibit strange behaviour. If you need to perform any of these
+ actions, consider positioning the items without the use of a Flow.
*/
/*!
@@ -909,9 +911,10 @@ void QDeclarativeGrid::reportConflictingAnchors()
The transition will only be applied to the added item(s).
Positioner transitions will only affect the position (x,y) of items.
- Added can mean that either the object has been created or reparented, and thus is now a child or the positioner, or that the object has had its opacity increased from zero, and thus is now visible.
-
-
+ An object is considered to be added to the positioner if it has been
+ created or reparented and thus is now a child or the positioner, or if the
+ object has had its opacity increased from zero, and thus is now
+ visible.
*/
/*!
\qmlproperty Transition Flow::move
@@ -965,14 +968,16 @@ QDeclarativeFlow::QDeclarativeFlow(QDeclarativeItem *parent)
\qmlproperty enumeration Flow::flow
This property holds the flow of the layout.
- Possible values are \c Flow.LeftToRight (default) and \c Flow.TopToBottom.
+ Possible values are:
- If \a flow is \c Flow.LeftToRight, the items are positioned next to
+ \list
+ \o Flow.LeftToRight (default) - Items are positioned next to
to each other from left to right until the width of the Flow
is exceeded, then wrapped to the next line.
- If \a flow is \c Flow.TopToBottom, the items are positioned next to each
+ \o Flow.TopToBottom - Items are positioned next to each
other from top to bottom until the height of the Flow is exceeded,
then wrapped to the next column.
+ \endlist
*/
QDeclarativeFlow::Flow QDeclarativeFlow::flow() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index de3dbcd..2756877 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -160,6 +160,8 @@ void QDeclarativeGradient::doUpdate()
You can also create rounded rectangles using the \l radius property.
\qml
+ import Qt 4.7
+
Rectangle {
width: 100
height: 100
@@ -206,7 +208,7 @@ void QDeclarativeRectangle::doUpdate()
border smoothness. Also, the border is rendered evenly on either side of the
rectangle's boundaries, and the spare pixel is rendered to the right and below the
rectangle (as documented for QRect rendering). This can cause unintended effects if
- \c border.width is 1 and the rectangle is \l{clip}{clipped} by a parent item:
+ \c border.width is 1 and the rectangle is \l{Item::clip}{clipped} by a parent item:
\table
\row
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 55cef8b..f4722c3 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -119,6 +119,8 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
A Text item can display both plain and rich text. For example:
\qml
+ import Qt 4.7
+
Text { text: "Hello World!"; font.family: "Helvetica"; font.pointSize: 24; color: "red" }
Text { text: "<b>Hello</b> <i>World!</i>" }
\endqml
@@ -477,6 +479,7 @@ void QDeclarativeText::setHAlign(HAlignment align)
return;
d->hAlign = align;
+ update();
emit horizontalAlignmentChanged(align);
}
@@ -493,6 +496,7 @@ void QDeclarativeText::setVAlign(VAlignment align)
return;
d->vAlign = align;
+ update();
emit verticalAlignmentChanged(align);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index ffb7dfe..94973f2 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -1056,6 +1056,7 @@ void QDeclarativeTextEdit::select(int start, int end)
updateSelectionMarkers();
}
+#ifndef QT_NO_CLIPBOARD
/*!
\qmlmethod TextEdit::cut()
@@ -1088,7 +1089,7 @@ void QDeclarativeTextEdit::paste()
Q_D(QDeclarativeTextEdit);
d->control->paste();
}
-
+#endif // QT_NO_CLIPBOARD
/*!
\overload
@@ -1106,9 +1107,15 @@ void QDeclarativeTextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
- if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
- // re-open input panel on press if already focused
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (hasFocus() && hadFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasFocus() && !hadFocus) {
+ d->clickCausedFocus = true;
+ }
}
}
if (event->type() != QEvent::GraphicsSceneMouseDoubleClick || d->selectByMouse)
@@ -1125,6 +1132,17 @@ void QDeclarativeTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextEdit);
d->control->processEvent(event, QPointF(0, -d->yoff));
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
+
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
}
@@ -1372,10 +1390,14 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextEdit element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextEdit element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
@@ -1384,12 +1406,19 @@ void QDeclarativeTextEditPrivate::updateDefaultTextOption()
TextEdit {
id: textEdit
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textEdit.openSoftwareInputPanel()
+ onClicked: {
+ if (!textEdit.focus) {
+ textEdit.focus = true;
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ textEdit.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputpanel()
}
\endcode
*/
@@ -1412,10 +1441,14 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextEdit element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextEdit and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextEdit element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
@@ -1424,12 +1457,19 @@ void QDeclarativeTextEdit::openSoftwareInputPanel()
TextEdit {
id: textEdit
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textEdit.openSoftwareInputPanel()
+ onClicked: {
+ if (!textEdit.focus) {
+ textEdit.focus = true;
+ textEdit.openSoftwareInputPanel();
+ } else {
+ textEdit.focus = false;
+ textEdit.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputpanel()
}
\endcode
*/
@@ -1445,35 +1485,13 @@ void QDeclarativeTextEdit::closeSoftwareInputPanel()
}
}
-/*!
- \qmlproperty bool TextEdit::showInputPanelOnFocus
- Whether input panels are automatically shown when TextEdit element gains
- focus and hidden when focus is lost. By default this is set to true.
-
- Only relevant on platforms, which provide virtual keyboards.
-*/
-bool QDeclarativeTextEdit::showInputPanelOnFocus() const
-{
- Q_D(const QDeclarativeTextEdit);
- return d->showInputPanelOnFocus;
-}
-
-void QDeclarativeTextEdit::setShowInputPanelOnFocus(bool showOnFocus)
-{
- Q_D(QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus == showOnFocus)
- return;
-
- d->showInputPanelOnFocus = showOnFocus;
-
- emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
-}
-
void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusInEvent(event);
}
@@ -1481,8 +1499,10 @@ void QDeclarativeTextEdit::focusInEvent(QFocusEvent *event)
void QDeclarativeTextEdit::focusOutEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextEdit);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
- closeSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusOutEvent(event);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
index 3abfc35..0ecb2f3 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p.h
@@ -86,7 +86,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextEdit : public QDeclarativePaintedItem
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
- Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
Q_PROPERTY(Qt::InputMethodHints inputMethodHints READ inputMethodHints WRITE setInputMethodHints)
@@ -167,9 +166,6 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool on);
- bool showInputPanelOnFocus() const;
- void setShowInputPanelOnFocus(bool showOnFocus);
-
bool persistentSelection() const;
void setPersistentSelection(bool on);
@@ -222,15 +218,16 @@ Q_SIGNALS:
void persistentSelectionChanged(bool isPersistentSelection);
void textMarginChanged(qreal textMargin);
void selectByMouseChanged(bool selectByMouse);
- void showInputPanelOnFocusChanged(bool showOnFocus);
public Q_SLOTS:
void selectAll();
void selectWord();
void select(int start, int end);
+#ifndef QT_NO_CLIPBOARD
void cut();
void copy();
void paste();
+#endif
private Q_SLOTS:
void updateImgCache(const QRectF &rect);
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
index 8e1d630..4092e65 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextedit_p_p.h
@@ -70,12 +70,17 @@ public:
QDeclarativeTextEditPrivate()
: color("black"), hAlign(QDeclarativeTextEdit::AlignLeft), vAlign(QDeclarativeTextEdit::AlignTop),
imgDirty(true), dirty(false), richText(false), cursorVisible(false), focusOnPress(true),
- showInputPanelOnFocus(true), persistentSelection(true), textMargin(0.0), lastSelectionStart(0),
- lastSelectionEnd(0), cursorComponent(0), cursor(0), format(QDeclarativeTextEdit::AutoText),
- document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
+ showInputPanelOnFocus(true), clickCausedFocus(false), persistentSelection(true), textMargin(0.0),
+ lastSelectionStart(0), lastSelectionEnd(0), cursorComponent(0), cursor(0),
+ format(QDeclarativeTextEdit::AutoText), document(0), wrapMode(QDeclarativeTextEdit::NoWrap),
selectByMouse(false),
yoff(0)
{
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
+ showInputPanelOnFocus = false;
+ }
+#endif
}
void init();
@@ -102,6 +107,7 @@ public:
bool cursorVisible : 1;
bool focusOnPress : 1;
bool showInputPanelOnFocus : 1;
+ bool clickCausedFocus : 1;
bool persistentSelection : 1;
qreal textMargin;
int lastSelectionStart;
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 7b96c0c..1202101 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -891,6 +891,22 @@ void QDeclarativeTextInput::keyPressEvent(QKeyEvent* ev)
QDeclarativePaintedItem::keyPressEvent(ev);
}
+/*!
+\overload
+Handles the given mouse \a event.
+*/
+void QDeclarativeTextInput::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QDeclarativeTextInput);
+ if (d->selectByMouse) {
+ int cursor = d->xToPos(event->pos().x());
+ d->control->selectWordAtPos(cursor);
+ event->setAccepted(true);
+ } else {
+ QDeclarativePaintedItem::mouseDoubleClickEvent(event);
+ }
+}
+
void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
@@ -903,12 +919,17 @@ void QDeclarativeTextInput::mousePressEvent(QGraphicsSceneMouseEvent *event)
p = p->parentItem();
}
setFocus(true);
- if (hasFocus() == hadFocus && d->showInputPanelOnFocus && !isReadOnly()) {
- // re-open input panel on press w already focused
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (hasFocus() && hadFocus && !isReadOnly()) {
+ // re-open input panel on press if already focused
+ openSoftwareInputPanel();
+ }
+ } else { // show input panel on click
+ if (hasFocus() && !hadFocus) {
+ d->clickCausedFocus = true;
+ }
}
}
-
bool mark = event->modifiers() & Qt::ShiftModifier;
int cursor = d->xToPos(event->pos().x());
d->control->moveCursor(cursor, mark);
@@ -933,6 +954,16 @@ Handles the given mouse \a event.
void QDeclarativeTextInput::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QDeclarativeTextInput);
+ if (!d->showInputPanelOnFocus) { // input panel on click
+ if (d->focusOnPress && !isReadOnly() && boundingRect().contains(event->pos())) {
+ if (QGraphicsView * view = qobject_cast<QGraphicsView*>(qApp->focusWidget())) {
+ if (view->scene() && view->scene() == scene()) {
+ qt_widget_private(view)->handleSoftwareInputPanel(event->button(), d->clickCausedFocus);
+ }
+ }
+ }
+ }
+ d->clickCausedFocus = false;
d->control->processEvent(event);
if (!event->isAccepted())
QDeclarativePaintedItem::mouseReleaseEvent(event);
@@ -949,10 +980,9 @@ bool QDeclarativeTextInput::event(QEvent* ev)
case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneMouseMove:
case QEvent::GraphicsSceneMouseRelease:
+ case QEvent::GraphicsSceneMouseDoubleClick:
break;
default:
- if (ev->type() == QEvent::GraphicsSceneMouseDoubleClick && !d->selectByMouse)
- break;
handled = d->control->processEvent(ev);
if (ev->type() == QEvent::InputMethod)
updateSize();
@@ -1203,26 +1233,37 @@ void QDeclarativeTextInput::moveCursorSelection(int position)
customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextInput element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextInput element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
- \code
+ \qml
import Qt 4.7
TextInput {
id: textInput
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textInput.openSoftwareInputPanel()
+ onClicked: {
+ if (!textInput.focus) {
+ textInput.focus = true;
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ textInput.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputPanel()
}
- \endcode
+ \endqml
*/
void QDeclarativeTextInput::openSoftwareInputPanel()
{
@@ -1243,26 +1284,37 @@ void QDeclarativeTextInput::openSoftwareInputPanel()
for customizing when you want the input keyboard to be shown and hidden in
your application.
- By default input panels are shown when TextInput element gains focus and hidden
- when the focus is lost. You can disable the automatic behavior by setting the
- property showInputPanelOnFocus to false and use functions openSoftwareInputPanel()
- and closeSoftwareInputPanel() to implement the behavior you want.
+ By default the opening of input panels follows the platform style. On Symbian^1 and
+ Symbian^3 -based devices the panels are opened by clicking TextInput and need to be
+ manually closed by the user. On other platforms the panels are automatically opened
+ when TextInput element gains focus and closed when the focus is lost.
+
+ . You can disable the automatic behavior by setting the property \c focusOnPress to false
+ and use functions openSoftwareInputPanel() and closeSoftwareInputPanel() to implement
+ the behavior you want.
Only relevant on platforms, which provide virtual keyboards.
- \code
+ \qml
import Qt 4.7
TextInput {
id: textInput
text: "Hello world!"
- showInputPanelOnFocus: false
+ focusOnPress: false
MouseArea {
anchors.fill: parent
- onClicked: textInput.openSoftwareInputPanel()
+ onClicked: {
+ if (!textInput.focus) {
+ textInput.focus = true;
+ textInput.openSoftwareInputPanel();
+ } else {
+ textInput.focus = false;
+ textInput.closeSoftwareInputPanel();
+ }
+ }
}
- onFocusChanged: if (!focus) closeSoftwareInputPanel()
}
- \endcode
+ \endqml
*/
void QDeclarativeTextInput::closeSoftwareInputPanel()
{
@@ -1277,35 +1329,13 @@ void QDeclarativeTextInput::closeSoftwareInputPanel()
}
}
-/*!
- \qmlproperty bool TextInput::showInputPanelOnFocus
- Whether input panels are automatically shown when TextInput element gains
- focus and hidden when focus is lost. By default this is set to true.
-
- Only relevant on platforms, which provide virtual keyboards.
-*/
-bool QDeclarativeTextInput::showInputPanelOnFocus() const
-{
- Q_D(const QDeclarativeTextInput);
- return d->showInputPanelOnFocus;
-}
-
-void QDeclarativeTextInput::setShowInputPanelOnFocus(bool showOnFocus)
-{
- Q_D(QDeclarativeTextInput);
- if (d->showInputPanelOnFocus == showOnFocus)
- return;
-
- d->showInputPanelOnFocus = showOnFocus;
-
- emit showInputPanelOnFocusChanged(d->showInputPanelOnFocus);
-}
-
void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
- openSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly() && event->reason() != Qt::ActiveWindowFocusReason) {
+ openSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusInEvent(event);
}
@@ -1313,8 +1343,10 @@ void QDeclarativeTextInput::focusInEvent(QFocusEvent *event)
void QDeclarativeTextInput::focusOutEvent(QFocusEvent *event)
{
Q_D(const QDeclarativeTextInput);
- if (d->showInputPanelOnFocus && !isReadOnly()) {
- closeSoftwareInputPanel();
+ if (d->showInputPanelOnFocus) {
+ if (d->focusOnPress && !isReadOnly()) {
+ closeSoftwareInputPanel();
+ }
}
QDeclarativePaintedItem::focusOutEvent(event);
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
index 6bc6fc4..e34634a 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p.h
@@ -88,7 +88,6 @@ class Q_DECLARATIVE_EXPORT QDeclarativeTextInput : public QDeclarativePaintedIte
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput NOTIFY acceptableInputChanged)
Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode NOTIFY echoModeChanged)
Q_PROPERTY(bool focusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY focusOnPressChanged)
- Q_PROPERTY(bool showInputPanelOnFocus READ showInputPanelOnFocus WRITE setShowInputPanelOnFocus NOTIFY showInputPanelOnFocusChanged)
Q_PROPERTY(QString passwordCharacter READ passwordCharacter WRITE setPasswordCharacter NOTIFY passwordCharacterChanged)
Q_PROPERTY(QString displayText READ displayText NOTIFY displayTextChanged)
Q_PROPERTY(bool autoScroll READ autoScroll WRITE setAutoScroll NOTIFY autoScrollChanged)
@@ -177,9 +176,6 @@ public:
bool focusOnPress() const;
void setFocusOnPress(bool);
- bool showInputPanelOnFocus() const;
- void setShowInputPanelOnFocus(bool showOnFocus);
-
bool autoScroll() const;
void setAutoScroll(bool);
@@ -216,7 +212,6 @@ Q_SIGNALS:
void focusOnPressChanged(bool focusOnPress);
void autoScrollChanged(bool autoScroll);
void selectByMouseChanged(bool selectByMouse);
- void showInputPanelOnFocusChanged(bool showOnFocus);
protected:
virtual void geometryChanged(const QRectF &newGeometry,
@@ -225,6 +220,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent(QKeyEvent* ev);
bool event(QEvent *e);
void focusInEvent(QFocusEvent *event);
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
index f44d014..6865147 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativetextinput_p_p.h
@@ -72,9 +72,15 @@ public:
color((QRgb)0), style(QDeclarativeText::Normal),
styleColor((QRgb)0), hAlign(QDeclarativeTextInput::AlignLeft),
hscroll(0), oldScroll(0), focused(false), focusOnPress(true),
- showInputPanelOnFocus(true), cursorVisible(false), autoScroll(true),
- selectByMouse(false)
+ showInputPanelOnFocus(true), clickCausedFocus(false), cursorVisible(false),
+ autoScroll(true), selectByMouse(false)
{
+#ifdef Q_OS_SYMBIAN
+ if (QSysInfo::symbianVersion() == QSysInfo::SV_SF_1 || QSysInfo::symbianVersion() == QSysInfo::SV_SF_3) {
+ showInputPanelOnFocus = false;
+ }
+#endif
+
}
~QDeclarativeTextInputPrivate()
@@ -116,6 +122,7 @@ public:
bool focused;
bool focusOnPress;
bool showInputPanelOnFocus;
+ bool clickCausedFocus;
bool cursorVisible;
bool autoScroll;
bool selectByMouse;
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index c6ee46f..2a88a80 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -119,11 +119,11 @@ public:
visual delegate (items).
An item can determine its index within the
- model via the VisualItemModel.index attached property.
+ model via the \c VisualItemModel.index attached property.
The example below places three colored rectangles in a ListView.
\code
- Item {
+ Rectangle {
VisualItemModel {
id: itemModel
Rectangle { height: 30; width: 80; color: "red" }
@@ -137,6 +137,8 @@ public:
}
}
\endcode
+
+ \image visualitemmodel.png
*/
QDeclarativeVisualItemModel::QDeclarativeVisualItemModel(QObject *parent)
: QDeclarativeVisualModel(*(new QDeclarativeVisualItemModelPrivate), parent)
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index d75f0a8..53ff51c 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -67,7 +67,7 @@ QT_BEGIN_HEADER
QML_DECLARE_TYPE_HASMETATYPE(INTERFACE)
enum { /* TYPEINFO flags */
- QML_HAS_ATTACHED_PROPERTIES = 0x01,
+ QML_HAS_ATTACHED_PROPERTIES = 0x01
};
#define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 6b6cd0a..1f5aaf1 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -108,7 +108,7 @@ public:
class QDeclarativeComponentAttached;
class QDeclarativeGuardedContextData;
-class QDeclarativeContextData
+class Q_AUTOTEST_EXPORT QDeclarativeContextData
{
public:
QDeclarativeContextData();
diff --git a/src/declarative/qml/qdeclarativeinstruction_p.h b/src/declarative/qml/qdeclarativeinstruction_p.h
index dc5f2f8..4627eb3 100644
--- a/src/declarative/qml/qdeclarativeinstruction_p.h
+++ b/src/declarative/qml/qdeclarativeinstruction_p.h
@@ -158,7 +158,7 @@ public:
//
// Deferred creation
//
- Defer, /* defer */
+ Defer /* defer */
};
QDeclarativeInstruction()
: line(0) {}
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index b01e5cc..72cfeba 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeEngine;
class QMetaProperty;
-class QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+class Q_AUTOTEST_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
QDeclarativePropertyCache(QDeclarativeEngine *);
diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
index 476c73d..3eaecc1 100644
--- a/src/declarative/qml/qdeclarativevaluetype_p.h
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -446,7 +446,7 @@ public:
InBounce = QEasingCurve::InBounce, OutBounce = QEasingCurve::OutBounce,
InOutBounce = QEasingCurve::InOutBounce, OutInBounce = QEasingCurve::OutInBounce,
InCurve = QEasingCurve::InCurve, OutCurve = QEasingCurve::OutCurve,
- SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve,
+ SineCurve = QEasingCurve::SineCurve, CosineCurve = QEasingCurve::CosineCurve
};
QDeclarativeEasingValueType(QObject *parent = 0);
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index 2ca030e..e0ee84f 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -521,7 +521,7 @@ void QDeclarativeWorkerScriptEngine::run()
that the main GUI thread is not blocked.
Messages can be passed between the new thread and the parent thread
- using sendMessage() and the onMessage() handler.
+ using \l sendMessage() and the \l {WorkerScript::onMessage}{onMessage()} handler.
Here is an example:
@@ -555,7 +555,7 @@ QDeclarativeWorkerScript::~QDeclarativeWorkerScript()
/*!
\qmlproperty url WorkerScript::source
- This holds the url of the javascript file that implements the
+ This holds the url of the JavaScript file that implements the
\tt WorkerScript.onMessage() handler for threaded operations.
*/
QUrl QDeclarativeWorkerScript::source() const
@@ -576,7 +576,7 @@ void QDeclarativeWorkerScript::setSource(const QUrl &source)
emit sourceChanged();
}
-/*
+/*!
\qmlmethod WorkerScript::sendMessage(jsobject message)
Sends the given \a message to a worker script handler in another
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index de1c0cb..0eae136 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -557,6 +557,8 @@ void QDeclarativeAbstractAnimation::timelineComplete()
NumberAnimation { ... duration: 200 }
}
\endcode
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -627,6 +629,8 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
When used in a transition, ColorAnimation will by default animate
all properties of type color that are changing. If a property or properties
are explicitly set for the animation, then those will be used instead.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -1082,11 +1086,13 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
\inherits PropertyAnimation
\brief The NumberAnimation element allows you to animate changes in properties of type qreal.
- Animate a set of properties over 200ms, from their values in the start state to
+ For example, to animate a set of properties over 200ms, from their values in the start state to
their values in the end state of the transition:
\code
NumberAnimation { properties: "x,y,scale"; duration: 200 }
\endcode
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1156,6 +1162,8 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
\since 4.7
\inherits PropertyAnimation
\brief The Vector3dAnimation element allows you to animate changes in properties of type QVector3d.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1224,7 +1232,8 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
When used in a transition RotationAnimation will rotate all
properties named "rotation" or "angle". You can override this by providing
- your own properties via \c properties or \c property.
+ your own properties via \l {PropertyAnimation::properties}{properties} or
+ \l {PropertyAnimation::property}{property}.
In the following example we use RotationAnimation to animate the rotation
between states via the shortest path.
@@ -1238,6 +1247,8 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
RotationAnimation { direction: RotationAnimation.Shortest }
}
\endqml
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
@@ -1446,7 +1457,7 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
}
\endcode
- \sa ParallelAnimation
+ \sa ParallelAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativeSequentialAnimation::QDeclarativeSequentialAnimation(QObject *parent) :
@@ -1508,7 +1519,7 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
}
\endcode
- \sa SequentialAnimation
+ \sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
\internal
@@ -1657,6 +1668,8 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
Depending on how the animation is used, the set of properties normally used will be
different. For more information see the individual property documentation, as well
as the \l{QML Animation} introduction.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativePropertyAnimation::QDeclarativePropertyAnimation(QObject *parent)
@@ -2319,6 +2332,8 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
When used in a transition, ParentAnimation will by default animate
all ParentChanges.
+
+ \sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
/*!
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index c73f827..3c2e239 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -83,6 +83,8 @@ public:
Example:
\qml
+ import Qt 4.7
+
FontLoader { id: fixedFont; name: "Courier" }
FontLoader { id: webFont; source: "http://www.mysite.com/myfont.ttf" }
@@ -183,15 +185,26 @@ void QDeclarativeFontLoader::setName(const QString &name)
\o FontLoader.Error - an error occurred while loading the font
\endlist
- Note that a change in the status property does not cause anything to happen
- (although it reflects what has happened to the font loader internally). If you wish
- to react to the change in status you need to do it yourself, for example in one
- of the following ways:
- \list
- \o Create a state, so that a state change occurs, e.g. State{name: 'loaded'; when: loader.status = FontLoader.Ready;}
- \o Do something inside the onStatusChanged signal handler, e.g. FontLoader{id: loader; onStatusChanged: if(loader.status == FontLoader.Ready) console.log('Loaded');}
- \o Bind to the status variable somewhere, e.g. Text{text: if(loader.status!=FontLoader.Ready){'Not Loaded';}else{'Loaded';}}
- \endlist
+ Use this status to provide an update or respond to the status change in some way.
+ For example, you could:
+
+ \e {Trigger a state change:}
+ \qml
+ State { name: 'loaded'; when: loader.status = FontLoader.Ready }
+ \endqml
+
+ \e {Implement an \c onStatusChanged signal handler:}
+ \qml
+ FontLoader {
+ id: loader
+ onStatusChanged: if (loader.status == FontLoader.Ready) console.log('Loaded')
+ }
+ \endqml
+
+ \e {Bind to the status value:}
+ \qml
+ Text { text: loader.status != FontLoader.Ready ? 'Not Loaded' : 'Loaded' }
+ \endqml
*/
QDeclarativeFontLoader::Status QDeclarativeFontLoader::status() const
{
diff --git a/src/declarative/util/qdeclarativepackage_p.h b/src/declarative/util/qdeclarativepackage_p.h
index 87d9b80..57d9c22 100644
--- a/src/declarative/util/qdeclarativepackage_p.h
+++ b/src/declarative/util/qdeclarativepackage_p.h
@@ -58,7 +58,7 @@ QT_MODULE(Declarative)
class QDeclarativePackagePrivate;
class QDeclarativePackageAttached;
-class QDeclarativePackage : public QObject
+class Q_AUTOTEST_EXPORT QDeclarativePackage : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePackage)
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 08f4750..e98afeb 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
PropertyChanges provides a state change that modifies the properties of an item.
- Here is a property change that modifies the text and color of a Text element
+ Here is a property change that modifies the text and color of a \l Text element
when it is clicked:
\qml
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index bd48ef0..6b6df4d 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -307,7 +307,7 @@ Rectangle {
set to a value such as 0.5 units/second. Animating from 0 to 1.0 with a velocity
of 0.5 will take 2000 ms to complete.
- \sa SpringFollow
+ \sa SpringFollow, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
QDeclarativeSmoothedAnimation::QDeclarativeSmoothedAnimation(QObject *parent)
diff --git a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
index 81cd229..8cdbea2 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
+++ b/src/declarative/util/qdeclarativesmoothedanimation_p_p.h
@@ -65,7 +65,7 @@
QT_BEGIN_NAMESPACE
-class QSmoothedAnimation : public QAbstractAnimation
+class Q_AUTOTEST_EXPORT QSmoothedAnimation : public QAbstractAnimation
{
public:
QSmoothedAnimation(QObject *parent=0);
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
index 25715c6..37b24cb 100644
--- a/src/declarative/util/qdeclarativestate_p.h
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -84,7 +84,7 @@ public:
void deleteFromBinding();
};
-class QDeclarativeActionEvent
+class Q_AUTOTEST_EXPORT QDeclarativeActionEvent
{
public:
virtual ~QDeclarativeActionEvent();
diff --git a/src/declarative/util/qdeclarativetimeline_p_p.h b/src/declarative/util/qdeclarativetimeline_p_p.h
index 598c897..61f6bcd 100644
--- a/src/declarative/util/qdeclarativetimeline_p_p.h
+++ b/src/declarative/util/qdeclarativetimeline_p_p.h
@@ -63,7 +63,7 @@ class QDeclarativeTimeLineValue;
class QDeclarativeTimeLineCallback;
struct QDeclarativeTimeLinePrivate;
class QDeclarativeTimeLineObject;
-class QDeclarativeTimeLine : public QAbstractAnimation
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLine : public QAbstractAnimation
{
Q_OBJECT
public:
@@ -117,7 +117,7 @@ private:
QDeclarativeTimeLinePrivate *d;
};
-class QDeclarativeTimeLineObject
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineObject
{
public:
QDeclarativeTimeLineObject();
@@ -129,7 +129,7 @@ protected:
QDeclarativeTimeLine *_t;
};
-class QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineValue : public QDeclarativeTimeLineObject
{
public:
QDeclarativeTimeLineValue(qreal v = 0.) : _v(v) {}
@@ -147,7 +147,7 @@ private:
qreal _v;
};
-class QDeclarativeTimeLineCallback
+class Q_AUTOTEST_EXPORT QDeclarativeTimeLineCallback
{
public:
typedef void (*Callback)(void *);
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
index 53a9d83..9e18eb5 100644
--- a/src/declarative/util/qdeclarativetimer.cpp
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -80,17 +80,22 @@ public:
the text every 500 milliseconds:
\qml
- Timer {
- interval: 500; running: true; repeat: true
- onTriggered: time.text = Date().toString()
- }
- Text {
- id: time
+ import Qt 4.7
+
+ Item {
+ Timer {
+ interval: 500; running: true; repeat: true
+ onTriggered: time.text = Date().toString()
+ }
+
+ Text {
+ id: time
+ }
}
\endqml
- QDeclarativeTimer is synchronized with the animation timer. Since the animation
- timer is usually set to 60fps, the resolution of QDeclarativeTimer will be
+ The Timer element is synchronized with the animation timer. Since the animation
+ timer is usually set to 60fps, the resolution of Timer will be
at best 16ms.
If the Timer is running and one of its properties is changed, the
@@ -98,8 +103,6 @@ public:
1000ms has its \e repeat property changed 500ms after starting, the
elapsed time will be reset to 0, and the Timer will be triggered
1000ms later.
-
- \sa {QtDeclarative}
*/
QDeclarativeTimer::QDeclarativeTimer(QObject *parent)
diff --git a/src/declarative/util/qdeclarativetransitionmanager_p_p.h b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
index 2e23898..75d11a9 100644
--- a/src/declarative/util/qdeclarativetransitionmanager_p_p.h
+++ b/src/declarative/util/qdeclarativetransitionmanager_p_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class QDeclarativeStatePrivate;
class QDeclarativeTransitionManagerPrivate;
-class QDeclarativeTransitionManager
+class Q_AUTOTEST_EXPORT QDeclarativeTransitionManager
{
public:
QDeclarativeTransitionManager();
diff --git a/src/gui/embedded/qwsmanager_qws.cpp b/src/gui/embedded/qwsmanager_qws.cpp
index 79076c5..b0259b9 100644
--- a/src/gui/embedded/qwsmanager_qws.cpp
+++ b/src/gui/embedded/qwsmanager_qws.cpp
@@ -394,7 +394,7 @@ void QWSManagerPrivate::dirtyRegion(int decorationRegion,
const QRegion &clip)
{
QTLWExtra *topextra = managed->d_func()->extra->topextra;
- QWidgetBackingStore *bs = topextra->backingStore;
+ QWidgetBackingStore *bs = topextra->backingStore.data();
const bool pendingUpdateRequest = bs->isDirty();
if (decorationRegion == QDecoration::All) {
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index b867345..74e5e73 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1427,12 +1427,14 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->inDestructor = 1;
d_ptr->removeExtraItemCache();
+#ifndef QT_NO_GESTURES
if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) {
QGraphicsObject *o = static_cast<QGraphicsObject *>(this);
QGestureManager *manager = QGestureManager::instance();
foreach (Qt::GestureType type, d_ptr->gestureContext.keys())
manager->cleanupCachedGestures(o, type);
}
+#endif
clearFocus();
@@ -5687,18 +5689,20 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect)
return;
}
- // Find pixmap in cache, then remove to avoid deep copy when modifying.s
+ // Find pixmap in cache.
QPixmap cachedPixmap;
if (!QPixmapCache::find(cache->key, &cachedPixmap)) {
update(rect);
return;
}
- QPixmapCache::remove(cache->key);
QRect scrollRect = (rect.isNull() ? boundingRect() : rect).toAlignedRect();
if (!scrollRect.intersects(cache->boundingRect))
return; // Nothing to scroll.
+ // Remove from cache to avoid deep copy when modifying.
+ QPixmapCache::remove(cache->key);
+
QRegion exposed;
cachedPixmap.scroll(dx, dy, scrollRect.translated(-cache->boundingRect.topLeft()), &exposed);
@@ -7569,6 +7573,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
QGraphicsItem::d_ptr->isObject = true;
}
+#ifndef QT_NO_GESTURES
/*!
Subscribes the graphics object to the given \a gesture with specific \a flags.
@@ -7592,6 +7597,8 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
if (QGraphicsItem::d_ptr->gestureContext.remove(gesture) && QGraphicsItem::d_ptr->scene)
QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture);
}
+#endif // QT_NO_GESTURES
+
/*!
Updates the item's micro focus. This is slot for convenience.
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index 9891af3..d7d5332 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -485,7 +485,9 @@ private:
friend class QGraphicsSceneBspTreeIndexPrivate;
friend class QGraphicsItemEffectSourcePrivate;
friend class QGraphicsTransformPrivate;
+#ifndef QT_NO_GESTURES
friend class QGestureManager;
+#endif
friend class ::tst_QGraphicsItem;
friend bool qt_closestLeaf(const QGraphicsItem *, const QGraphicsItem *);
friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *);
@@ -572,8 +574,10 @@ public:
using QObject::children;
#endif
+#ifndef QT_NO_GESTURES
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
void ungrabGesture(Qt::GestureType type);
+#endif
protected Q_SLOTS:
void updateMicroFocus();
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index e812f29..bde6e7d 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -525,7 +525,9 @@ public:
QGraphicsItem *focusScopeItem;
Qt::InputMethodHints imHints;
QGraphicsItem::PanelModality panelModality;
+#ifndef QT_NO_GESTURES
QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
+#endif
// Packed 32 bits
quint32 acceptedMouseButtons : 5;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 22c3f92..7b0722e 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -699,6 +699,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
if (!selectionChanging && selectedItems.size() != oldSelectedItemsSize)
emit q->selectionChanged();
+#ifndef QT_NO_GESTURES
QHash<QGesture *, QGraphicsObject *>::iterator it;
for (it = gestureTargets.begin(); it != gestureTargets.end();) {
if (it.value() == item)
@@ -706,6 +707,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
else
++it;
}
+
QGraphicsObject *dummy = static_cast<QGraphicsObject *>(item);
cachedTargetItems.removeOne(dummy);
cachedItemGestures.remove(dummy);
@@ -713,6 +715,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
foreach (Qt::GestureType gesture, item->d_ptr->gestureContext.keys())
ungrabGesture(item, gesture);
+#endif // QT_NO_GESTURES
}
/*!
@@ -1180,11 +1183,13 @@ bool QGraphicsScenePrivate::filterEvent(QGraphicsItem *item, QEvent *event)
bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event)
{
if (QGraphicsObject *object = item->toGraphicsObject()) {
+#ifndef QT_NO_GESTURES
QGestureManager *gestureManager = QApplicationPrivate::instance()->gestureManager;
if (gestureManager) {
if (gestureManager->filterEvent(object, event))
return true;
}
+#endif // QT_NO_GESTURES
}
if (filterEvent(item, event))
@@ -2602,8 +2607,10 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
d->enableTouchEventsOnViews();
}
+#ifndef QT_NO_GESTURES
foreach (Qt::GestureType gesture, item->d_ptr->gestureContext.keys())
d->grabGesture(item, gesture);
+#endif
// Update selection lists
if (item->isSelected())
@@ -3525,10 +3532,12 @@ bool QGraphicsScene::event(QEvent *event)
case QEvent::TouchEnd:
d->touchEventHandler(static_cast<QTouchEvent *>(event));
break;
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
case QEvent::GestureOverride:
d->gestureEventHandler(static_cast<QGestureEvent *>(event));
break;
+#endif // QT_NO_GESTURES
default:
return QObject::event(event);
}
@@ -5637,8 +5646,10 @@ bool QGraphicsScene::sendEvent(QGraphicsItem *item, QEvent *event)
void QGraphicsScenePrivate::addView(QGraphicsView *view)
{
views << view;
+#ifndef QT_NO_GESTURES
foreach (Qt::GestureType gesture, grabbedGestures.keys())
view->viewport()->grabGesture(gesture);
+#endif
}
void QGraphicsScenePrivate::removeView(QGraphicsView *view)
@@ -5968,6 +5979,7 @@ void QGraphicsScenePrivate::leaveModal(QGraphicsItem *panel)
dispatchHoverEvent(&hoverEvent);
}
+#ifndef QT_NO_GESTURES
void QGraphicsScenePrivate::gestureTargetsAtHotSpots(const QSet<QGesture *> &gestures,
Qt::GestureFlag flag,
QHash<QGraphicsObject *, QSet<QGesture *> > *targets,
@@ -6356,6 +6368,7 @@ void QGraphicsScenePrivate::ungrabGesture(QGraphicsItem *item, Qt::GestureType g
view->viewport()->ungrabGesture(gesture);
}
}
+#endif // QT_NO_GESTURES
QT_END_NAMESPACE
diff --git a/src/gui/graphicsview/qgraphicsscene.h b/src/gui/graphicsview/qgraphicsscene.h
index c34a303..f8615f4 100644
--- a/src/gui/graphicsview/qgraphicsscene.h
+++ b/src/gui/graphicsview/qgraphicsscene.h
@@ -313,7 +313,9 @@ private:
friend class QGraphicsSceneBspTreeIndex;
friend class QGraphicsSceneBspTreeIndexPrivate;
friend class QGraphicsItemEffectSourcePrivate;
+#ifndef QT_NO_GESTURES
friend class QGesture;
+#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGraphicsScene::SceneLayers)
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index 8ad2a0a..f28dfe9 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -299,6 +299,7 @@ public:
void enableTouchEventsOnViews();
QList<QGraphicsObject *> cachedTargetItems;
+#ifndef QT_NO_GESTURES
QHash<QGraphicsObject *, QSet<QGesture *> > cachedItemGestures;
QHash<QGraphicsObject *, QSet<QGesture *> > cachedAlreadyDeliveredGestures;
QHash<QGesture *, QGraphicsObject *> gestureTargets;
@@ -313,6 +314,7 @@ public:
void cancelGesturesForChildren(QGesture *original);
void grabGesture(QGraphicsItem *, Qt::GestureType gesture);
void ungrabGesture(QGraphicsItem *, Qt::GestureType gesture);
+#endif // QT_NO_GESTURES
void updateInputMethodSensitivityInViews();
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index a83b528..0674610 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2688,10 +2688,12 @@ void QGraphicsView::setupViewport(QWidget *widget)
if (d->scene && !d->scene->d_func()->allItemsIgnoreTouchEvents)
widget->setAttribute(Qt::WA_AcceptTouchEvents);
+#ifndef QT_NO_GESTURES
if (d->scene) {
foreach (Qt::GestureType gesture, d->scene->d_func()->grabbedGestures.keys())
widget->grabGesture(gesture);
}
+#endif
widget->setAcceptDrops(acceptDrops());
}
@@ -2838,6 +2840,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
return true;
}
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
case QEvent::GestureOverride:
{
@@ -2851,6 +2854,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
}
return true;
}
+#endif // QT_NO_GESTURES
default:
break;
}
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index a515ef8..34f40a9 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -63,6 +63,8 @@
#include <private/qt_x11_p.h>
#endif
+#include <private/qstylehelper_p.h>
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QIconLoader, iconLoaderInstance)
@@ -488,14 +490,12 @@ QPixmap PixmapEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State st
basePixmap.load(filename);
int actualSize = qMin(size.width(), size.height());
- QString key = QLatin1String("$qt_theme_")
- + QString::number(basePixmap.cacheKey(), 16)
- + QLatin1Char('_')
- + QString::number(mode)
- + QLatin1Char('_')
- + QString::number(qApp->palette().cacheKey(), 16)
- + QLatin1Char('_')
- + QString::number(actualSize);
+
+ QString key = QLatin1Literal("$qt_theme_")
+ % HexString<qint64>(basePixmap.cacheKey())
+ % HexString<int>(mode)
+ % HexString<qint64>(qApp->palette().cacheKey())
+ % HexString<int>(actualSize);
QPixmap cachedPixmap;
if (QPixmapCache::find(key, &cachedPixmap)) {
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 98f235e..d89ffe6 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -272,6 +272,8 @@ bool QImageData::checkForAlphaPixels() const
switch (format) {
+ case QImage::Format_Mono:
+ case QImage::Format_MonoLSB:
case QImage::Format_Indexed8:
has_alpha_pixels = has_alpha_clut;
break;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 3013726..20e4b50 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -82,6 +82,7 @@
#endif
#include "qpixmap_raster_p.h"
+#include "private/qstylehelper_p.h"
QT_BEGIN_NAMESPACE
@@ -829,8 +830,14 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers
return false;
QFileInfo info(fileName);
- QString key = QLatin1String("qt_pixmap_") + info.absoluteFilePath() + QLatin1Char('_') + QString::number(info.lastModified().toTime_t()) + QLatin1Char('_') +
- QString::number(info.size()) + QLatin1Char('_') + QString::number(data ? data->pixelType() : QPixmapData::PixmapType);
+ if (!info.exists())
+ return false;
+
+ QString key = QLatin1Literal("qt_pixmap")
+ % info.absoluteFilePath()
+ % HexString<uint>(info.lastModified().toTime_t())
+ % HexString<quint64>(info.size())
+ % HexString<uint>(data ? data->pixelType() : QPixmapData::PixmapType);
if (QPixmapCache::find(key, *this))
return true;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 6caa7ee..72e5c58 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -185,8 +185,10 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T
directPainters = 0;
#endif
+#ifndef QT_NO_GESTURES
gestureManager = 0;
gestureWidget = 0;
+#endif // QT_NO_GESTURES
#if defined(Q_WS_X11) || defined(Q_WS_WIN)
move_cursor = 0;
@@ -3711,6 +3713,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
#endif // !QT_NO_WHEELEVENT || !QT_NO_TABLETEVENT
}
+#ifndef QT_NO_GESTURES
// walk through parents and check for gestures
if (d->gestureManager) {
switch (e->type()) {
@@ -3755,7 +3758,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
}
}
-
+#endif // QT_NO_GESTURES
// User input and window activation makes tooltips sleep
switch (e->type()) {
@@ -4260,6 +4263,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
res = d->notify_helper(receiver, e);
break;
+#ifndef QT_NO_GESTURES
case QEvent::NativeGesture:
{
// only propagate the first gesture event (after the GID_BEGIN)
@@ -4338,6 +4342,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
break;
}
+#endif // QT_NO_GESTURES
default:
res = d->notify_helper(receiver, e);
break;
@@ -5770,6 +5775,7 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window,
QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints);
}
+#ifndef QT_NO_GESTURES
QGestureManager* QGestureManager::instance()
{
QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
@@ -5777,6 +5783,7 @@ QGestureManager* QGestureManager::instance()
qAppPriv->gestureManager = new QGestureManager(qApp);
return qAppPriv->gestureManager;
}
+#endif // QT_NO_GESTURES
// These pixmaps approximate the images in the Windows User Interface Guidelines.
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index f93f24a..3613f95 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -399,7 +399,9 @@ private:
friend class QDirectPainter;
friend class QDirectPainterPrivate;
#endif
+#ifndef QT_NO_GESTURES
friend class QGestureManager;
+#endif
#if defined(Q_WS_MAC) || defined(Q_WS_X11)
Q_PRIVATE_SLOT(d_func(), void _q_alertTimeOut())
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 9a5714b..97ceea9 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -84,7 +84,9 @@ class QInputContext;
class QObject;
class QWidget;
class QSocketNotifier;
+#ifndef QT_NO_GESTURES
class QGestureManager;
+#endif
extern bool qt_is_gui_used;
#ifndef QT_NO_CLIPBOARD
@@ -200,6 +202,7 @@ typedef BOOL (WINAPI *PtrRegisterTouchWindow)(HWND, ULONG);
typedef BOOL (WINAPI *PtrGetTouchInputInfo)(HANDLE, UINT, PVOID, int);
typedef BOOL (WINAPI *PtrCloseTouchInputHandle)(HANDLE);
+#ifndef QT_NO_GESTURES
typedef BOOL (WINAPI *PtrGetGestureInfo)(HANDLE, PVOID);
typedef BOOL (WINAPI *PtrGetGestureExtraArgs)(HANDLE, UINT, PBYTE);
typedef BOOL (WINAPI *PtrCloseGestureInfoHandle)(HANDLE);
@@ -263,6 +266,8 @@ typedef struct tagGESTURECONFIG
#define GID_ROLLOVER 0xf003
#endif
+#endif // QT_NO_GESTURES
+
#endif // Q_WS_WIN
class QScopedLoopLevelCounter
@@ -517,6 +522,7 @@ public:
void sendSyntheticEnterLeave(QWidget *widget);
#endif
+#ifndef QT_NO_GESTURES
QGestureManager *gestureManager;
QWidget *gestureWidget;
#if defined(Q_WS_X11) || defined(Q_WS_WIN)
@@ -524,6 +530,7 @@ public:
QPixmap *copy_cursor;
QPixmap *link_cursor;
#endif
+#endif
#if defined(Q_WS_WIN)
QPixmap *ignore_cursor;
#endif
@@ -552,6 +559,7 @@ public:
QHash<DWORD, int> touchInputIDToTouchPointID;
bool translateTouchEvent(const MSG &msg);
+#ifndef QT_NO_GESTURES
PtrGetGestureInfo GetGestureInfo;
PtrGetGestureExtraArgs GetGestureExtraArgs;
PtrCloseGestureInfoHandle CloseGestureInfoHandle;
@@ -560,6 +568,7 @@ public:
PtrBeginPanningFeedback BeginPanningFeedback;
PtrUpdatePanningFeedback UpdatePanningFeedback;
PtrEndPanningFeedback EndPanningFeedback;
+#endif // QT_NO_GESTURES
#endif
#ifdef QT_RX71_MULTITOUCH
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 82c3545..9f47112 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1032,6 +1032,9 @@ void QSymbianControl::SizeChanged()
qwidget->d_func()->syncBackingStore();
if (!slowResize && tlwExtra)
tlwExtra->inTopLevelResize = false;
+ } else {
+ QResizeEvent *e = new QResizeEvent(newSize, oldSize);
+ QApplication::postEvent(qwidget, e);
}
}
@@ -1800,19 +1803,27 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
return 1;
const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
QWidget *w = QWidgetPrivate::mapper->value(control);
- if (!w->d_func()->maybeTopData())
+ QWidget *const window = w->window();
+ if (!window->d_func()->maybeTopData())
break;
+ QRefCountedWidgetBackingStore &backingStore = window->d_func()->maybeTopData()->backingStore;
if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) {
- delete w->d_func()->topData()->backingStore;
- w->d_func()->topData()->backingStore = 0;
+ // Decrement backing store reference count
+ backingStore.deref();
// In order to ensure that any resources used by the window surface
// are immediately freed, we flush the WSERV command buffer.
S60->wsSession().Flush();
- } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
- && !w->d_func()->maybeBackingStore()) {
- w->d_func()->topData()->backingStore = new QWidgetBackingStore(w);
- w->d_func()->invalidateBuffer(w->rect());
- w->repaint();
+ } else if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) {
+ if (backingStore.data()) {
+ // Increment backing store reference count
+ backingStore.ref();
+ } else {
+ // Create backing store with an initial reference count of 1
+ backingStore.create(window);
+ backingStore.ref();
+ w->d_func()->invalidateBuffer(w->rect());
+ w->repaint();
+ }
}
return 1;
}
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 60fc5e1..09535fa 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -52,9 +52,11 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c
#include <windowsm.h>
#include <tpcshell.h>
#ifdef QT_WINCE_GESTURES
+#ifndef QT_NO_GESTURES
#include <gesture.h>
#endif
#endif
+#endif
#include "qapplication.h"
#include "qdesktopwidget.h"
@@ -198,6 +200,7 @@ struct SHRGINFO {
#define SPI_SETSIPINFO 224
#endif
+#ifndef QT_NO_GESTURES
typedef DWORD (API *AygRecognizeGesture)(SHRGINFO*);
static AygRecognizeGesture ptrRecognizeGesture = 0;
static bool aygResolved = false;
@@ -211,6 +214,7 @@ static void resolveAygLibs()
ptrRecognizeGesture = (AygRecognizeGesture) ayglib.resolve("SHRecognizeGesture");
}
}
+#endif // QT_NO_GESTURES
#endif
@@ -463,7 +467,9 @@ public:
bool translateConfigEvent(const MSG &msg);
bool translateCloseEvent(const MSG &msg);
bool translateTabletEvent(const MSG &msg, PACKET *localPacketBuf, int numPackets);
+#ifndef QT_NO_GESTURES
bool translateGestureEvent(const MSG &msg, const GESTUREINFO &gi);
+#endif
void repolishStyle(QStyle &style);
inline void showChildren(bool spontaneous) { d_func()->showChildren(spontaneous); }
inline void hideChildren(bool spontaneous) { d_func()->hideChildren(spontaneous); }
@@ -843,6 +849,7 @@ void qt_init(QApplicationPrivate *priv, int)
ptrSetProcessDPIAware();
#endif
+#ifndef QT_NO_GESTURES
priv->GetGestureInfo = 0;
priv->GetGestureExtraArgs = 0;
priv->CloseGestureInfoHandle = 0;
@@ -883,6 +890,7 @@ void qt_init(QApplicationPrivate *priv, int)
(PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"),
"EndPanningFeedback");
#endif
+#endif // QT_NO_GESTURES
}
/*****************************************************************************
@@ -1542,7 +1550,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
case WM_SETTINGCHANGE:
#ifdef Q_WS_WINCE
// CE SIP hide/show
- if (wParam == SPI_SETSIPINFO) {
+ if (qt_desktopWidget && wParam == SPI_SETSIPINFO) {
QResizeEvent re(QSize(0, 0), QSize(0, 0)); // Calculated by QDesktopWidget
QApplication::sendEvent(qt_desktopWidget, &re);
break;
@@ -1667,12 +1675,14 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
shrg.ptDown.y = GET_Y_LPARAM(lParam);
shrg.dwFlags = SHRG_RETURNCMD | SHRG_NOANIMATION;
resolveAygLibs();
+#ifndef QT_NO_GESTURES
if (ptrRecognizeGesture && (ptrRecognizeGesture(&shrg) == GN_CONTEXTMENU)) {
if (QApplication::activePopupWidget())
QApplication::activePopupWidget()->close();
QContextMenuEvent e(QContextMenuEvent::Mouse, pos, globalPos);
result = qt_sendSpontaneousEvent(alienWidget, &e);
}
+#endif // QT_NO_GESTURES
}
}
}
@@ -2556,6 +2566,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
}
result = false;
break;
+#ifndef QT_NO_GESTURES
#if !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
case WM_GESTURE: {
GESTUREINFO gi;
@@ -2590,6 +2601,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa
break;
}
#endif // !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
+#endif // QT_NO_GESTURES
#ifndef QT_NO_CURSOR
case WM_SETCURSOR: {
QCursor *ovr = QApplication::overrideCursor();
@@ -3825,6 +3837,7 @@ bool QETWidget::translateCloseEvent(const MSG &)
return d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
}
+#ifndef QT_NO_GESTURES
bool QETWidget::translateGestureEvent(const MSG &, const GESTUREINFO &gi)
{
const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y);
@@ -3863,7 +3876,7 @@ bool QETWidget::translateGestureEvent(const MSG &, const GESTUREINFO &gi)
qt_sendSpontaneousEvent(widget, &event);
return true;
}
-
+#endif // QT_NO_GESTURES
void QApplication::setCursorFlashTime(int msecs)
{
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 78fc704..3664743 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -5268,7 +5268,7 @@ bool QETWidget::translateConfigEvent(const XEvent *event)
if (isVisible() && data->crect.size() != oldSize) {
Q_ASSERT(d->extra->topextra);
- QWidgetBackingStore *bs = d->extra->topextra->backingStore;
+ QWidgetBackingStore *bs = d->extra->topextra->backingStore.data();
const bool hasStaticContents = bs && bs->hasStaticContents();
// If we have a backing store with static contents, we have to disable the top-level
// resize optimization in order to get invalidated regions for resized widgets.
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 86c4025..772016a 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -952,12 +952,14 @@ static int qCocoaViewCount = 0;
if (!QApplicationPrivate::tryModalHelper(qwidget, 0))
return;
+#ifndef QT_NO_GESTURES
QNativeGestureEvent qNGEvent;
qNGEvent.gestureType = QNativeGestureEvent::Zoom;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
qNGEvent.percentage = [event magnification];
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
+#endif // QT_NO_GESTURES
}
- (void)rotateWithEvent:(NSEvent *)event;
@@ -965,12 +967,14 @@ static int qCocoaViewCount = 0;
if (!QApplicationPrivate::tryModalHelper(qwidget, 0))
return;
+#ifndef QT_NO_GESTURES
QNativeGestureEvent qNGEvent;
qNGEvent.gestureType = QNativeGestureEvent::Rotate;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
qNGEvent.percentage = -[event rotation];
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
+#endif // QT_NO_GESTURES
}
- (void)swipeWithEvent:(NSEvent *)event;
@@ -978,6 +982,7 @@ static int qCocoaViewCount = 0;
if (!QApplicationPrivate::tryModalHelper(qwidget, 0))
return;
+#ifndef QT_NO_GESTURES
QNativeGestureEvent qNGEvent;
qNGEvent.gestureType = QNativeGestureEvent::Swipe;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
@@ -991,6 +996,7 @@ static int qCocoaViewCount = 0;
else if ([event deltaY] == -1)
qNGEvent.angle = 270.0f;
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
+#endif // QT_NO_GESTURES
}
- (void)beginGestureWithEvent:(NSEvent *)event;
@@ -998,11 +1004,13 @@ static int qCocoaViewCount = 0;
if (!QApplicationPrivate::tryModalHelper(qwidget, 0))
return;
+#ifndef QT_NO_GESTURES
QNativeGestureEvent qNGEvent;
qNGEvent.gestureType = QNativeGestureEvent::GestureBegin;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
+#endif // QT_NO_GESTURES
}
- (void)endGestureWithEvent:(NSEvent *)event;
@@ -1010,11 +1018,13 @@ static int qCocoaViewCount = 0;
if (!QApplicationPrivate::tryModalHelper(qwidget, 0))
return;
+#ifndef QT_NO_GESTURES
QNativeGestureEvent qNGEvent;
qNGEvent.gestureType = QNativeGestureEvent::GestureEnd;
NSPoint p = [[event window] convertBaseToScreen:[event locationInWindow]];
qNGEvent.position = flipPoint(p).toPoint();
qt_sendSpontaneousEvent(qwidget, &qNGEvent);
+#endif // QT_NO_GESTURES
}
- (void)frameDidChange:(NSNotification *)note
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 055c127..f75495a 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3421,9 +3421,11 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
case QEvent::ChildRemoved: n = n ? n : "ChildRemoved";
dbg.nospace() << "QChildEvent(" << n << ", " << (static_cast<const QChildEvent*>(e))->child();
return dbg.space();
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
n = "Gesture";
break;
+#endif
default:
dbg.nospace() << "QEvent(" << (const void *)e << ", type = " << e->type() << ')';
return dbg.space();
@@ -4254,6 +4256,7 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T
return *this;
}
+#ifndef QT_NO_GESTURES
/*!
\class QGestureEvent
\since 4.6
@@ -4558,4 +4561,6 @@ const QGestureEventPrivate *QGestureEvent::d_func() const
*/
#endif
+#endif // QT_NO_GESTURES
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 90242fe..9c70c02 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -62,7 +62,9 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
class QAction;
+#ifndef QT_NO_GESTURES
class QGesture;
+#endif
class Q_GUI_EXPORT QInputEvent : public QEvent
{
@@ -824,6 +826,7 @@ protected:
friend class QApplicationPrivate;
};
+#ifndef QT_NO_GESTURES
class QGesture;
class QGestureEventPrivate;
class Q_GUI_EXPORT QGestureEvent : public QEvent
@@ -875,6 +878,7 @@ private:
friend class QApplication;
friend class QGestureManager;
};
+#endif // QT_NO_GESTURES
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 5c94a23..e323aa9 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -120,6 +120,7 @@ public:
qreal pressure;
};
+#ifndef QT_NO_GESTURES
class QNativeGestureEvent : public QEvent
{
public:
@@ -164,7 +165,7 @@ public:
QMap<Qt::GestureType, bool> accepted;
QMap<Qt::GestureType, QWidget *> targetWidgets;
};
-
+#endif // QT_NO_GESTURES
class QFileOpenEventPrivate
{
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 0d93b9f..e26fbde 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -492,6 +492,7 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
case NSOtherMouseDown:
case NSOtherMouseUp:
case NSOtherMouseDragged:
+#ifndef QT_NO_GESTURES
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
case NSEventTypeGesture: // touch events
case NSEventTypeMagnify:
@@ -500,6 +501,7 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
case NSEventTypeBeginGesture:
case NSEventTypeEndGesture:
#endif
+#endif // QT_NO_GESTURES
result = true;
break;
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 49bdea7..f5688f4 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -42,6 +42,8 @@
#include "qgesture.h"
#include "private/qgesture_p.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
/*!
@@ -725,3 +727,5 @@ void QTapAndHoldGesture::setPosition(const QPointF &value)
}
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index c9bdce6..8c10895 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -49,6 +49,8 @@
#include <QtCore/qrect.h>
#include <QtCore/qmetatype.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_HEADER
Q_DECLARE_METATYPE(Qt::GestureState)
@@ -258,4 +260,6 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QGesture::GestureCancelPolicy)
QT_END_HEADER
+#endif // QT_NO_GESTURES
+
#endif // QGESTURE_H
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index bf60f97..f5474c1 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -59,6 +59,8 @@
#include "qelapsedtimer.h"
#include "private/qobject_p.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QGesturePrivate : public QObjectPrivate
@@ -179,4 +181,6 @@ public:
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#endif // QGESTURE_P_H
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 43facef..2af031b 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -66,6 +66,8 @@
# define DEBUG qDebug
#endif
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
QGestureManager::QGestureManager(QObject *parent)
@@ -684,6 +686,7 @@ void QGestureManager::recycle(QGesture *gesture)
if (recognizer) {
gesture->setGestureCancelPolicy(QGesture::CancelNone);
recognizer->reset(gesture);
+ m_activeGestures.remove(gesture);
} else {
cleanupGesturesForRemovedRecognizer(gesture);
}
@@ -691,4 +694,6 @@ void QGestureManager::recycle(QGesture *gesture)
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#include "moc_qgesturemanager_p.cpp"
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index c452f49..747cb1a 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -58,6 +58,8 @@
#include "private/qwidget_p.h"
#include "qgesturerecognizer.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QBasicTimer;
@@ -143,4 +145,6 @@ private:
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#endif // QGESTUREMANAGER_P_H
diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp
index 9dcca17..3e23bbf 100644
--- a/src/gui/kernel/qgesturerecognizer.cpp
+++ b/src/gui/kernel/qgesturerecognizer.cpp
@@ -44,6 +44,8 @@
#include "private/qgesture_p.h"
#include "private/qgesturemanager_p.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
/*!
@@ -231,3 +233,5 @@ void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type)
}
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qgesturerecognizer.h b/src/gui/kernel/qgesturerecognizer.h
index 3e17c99..5afb43f 100644
--- a/src/gui/kernel/qgesturerecognizer.h
+++ b/src/gui/kernel/qgesturerecognizer.h
@@ -45,6 +45,8 @@
#include <QtCore/qglobal.h>
#include <QtCore/qnamespace.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -95,4 +97,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_GESTURES
+
#endif // QGESTURERECOGNIZER_H
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index b038fde..562227a 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -439,6 +439,10 @@ static const struct {
{ Qt::Key_MediaPrevious, QT_TRANSLATE_NOOP("QShortcut", "Media Previous") },
{ Qt::Key_MediaNext, QT_TRANSLATE_NOOP("QShortcut", "Media Next") },
{ Qt::Key_MediaRecord, QT_TRANSLATE_NOOP("QShortcut", "Media Record") },
+ //: Media player pause button
+ { Qt::Key_MediaPause, QT_TRANSLATE_NOOP("QShortcut", "Media Pause") },
+ //: Media player button to toggle between playing and paused
+ { Qt::Key_MediaTogglePlayPause, QT_TRANSLATE_NOOP("QShortcut", "Toggle Media Play/Pause") },
{ Qt::Key_HomePage, QT_TRANSLATE_NOOP("QShortcut", "Home Page") },
{ Qt::Key_Favorites, QT_TRANSLATE_NOOP("QShortcut", "Favorites") },
{ Qt::Key_Search, QT_TRANSLATE_NOOP("QShortcut", "Search") },
@@ -575,13 +579,25 @@ static const struct {
// --------------------------------------------------------------
// Device keys
- { Qt::Key_Context1, QT_TRANSLATE_NOOP("QShortcut", "Context1") },
- { Qt::Key_Context2, QT_TRANSLATE_NOOP("QShortcut", "Context2") },
- { Qt::Key_Context3, QT_TRANSLATE_NOOP("QShortcut", "Context3") },
- { Qt::Key_Context4, QT_TRANSLATE_NOOP("QShortcut", "Context4") },
- { Qt::Key_Call, QT_TRANSLATE_NOOP("QShortcut", "Call") },
- { Qt::Key_Hangup, QT_TRANSLATE_NOOP("QShortcut", "Hangup") },
- { Qt::Key_Flip, QT_TRANSLATE_NOOP("QShortcut", "Flip") },
+ { Qt::Key_Context1, QT_TRANSLATE_NOOP("QShortcut", "Context1") },
+ { Qt::Key_Context2, QT_TRANSLATE_NOOP("QShortcut", "Context2") },
+ { Qt::Key_Context3, QT_TRANSLATE_NOOP("QShortcut", "Context3") },
+ { Qt::Key_Context4, QT_TRANSLATE_NOOP("QShortcut", "Context4") },
+ //: Button to start a call (note: a separate button is used to end the call)
+ { Qt::Key_Call, QT_TRANSLATE_NOOP("QShortcut", "Call") },
+ //: Button to end a call (note: a separate button is used to start the call)
+ { Qt::Key_Hangup, QT_TRANSLATE_NOOP("QShortcut", "Hangup") },
+ //: Button that will hang up if we're in call, or make a call if we're not.
+ { Qt::Key_ToggleCallHangup, QT_TRANSLATE_NOOP("QShortcut", "Toggle Call/Hangup") },
+ { Qt::Key_Flip, QT_TRANSLATE_NOOP("QShortcut", "Flip") },
+ //: Button to trigger voice dialling
+ { Qt::Key_VoiceDial, QT_TRANSLATE_NOOP("QShortcut", "Voice Dial") },
+ //: Button to redial the last number called
+ { Qt::Key_LastNumberRedial, QT_TRANSLATE_NOOP("QShortcut", "Last Number Redial") },
+ //: Button to trigger the camera shutter (take a picture)
+ { Qt::Key_Camera, QT_TRANSLATE_NOOP("QShortcut", "Camera Shutter") },
+ //: Button to focus the camera
+ { Qt::Key_CameraFocus, QT_TRANSLATE_NOOP("QShortcut", "Camera Focus") },
// --------------------------------------------------------------
// Japanese keyboard support
diff --git a/src/gui/kernel/qmacgesturerecognizer_mac.mm b/src/gui/kernel/qmacgesturerecognizer_mac.mm
index fba839b..0ccbb52 100644
--- a/src/gui/kernel/qmacgesturerecognizer_mac.mm
+++ b/src/gui/kernel/qmacgesturerecognizer_mac.mm
@@ -47,6 +47,8 @@
#include "qwidget.h"
#include "qdebug.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
QMacSwipeGestureRecognizer::QMacSwipeGestureRecognizer()
@@ -260,3 +262,5 @@ void QMacPanGestureRecognizer::reset(QGesture *gesture)
#endif // QT_MAC_USE_COCOA
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qmacgesturerecognizer_mac_p.h b/src/gui/kernel/qmacgesturerecognizer_mac_p.h
index dd8a150..f48c160 100644
--- a/src/gui/kernel/qmacgesturerecognizer_mac_p.h
+++ b/src/gui/kernel/qmacgesturerecognizer_mac_p.h
@@ -57,6 +57,8 @@
#include "qpoint.h"
#include "qgesturerecognizer.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QMacSwipeGestureRecognizer : public QGestureRecognizer
@@ -99,4 +101,6 @@ private:
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#endif // QMACSWIPEGESTURERECOGNIZER_MAC_P_H
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index a575717..6960838 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -47,6 +47,8 @@
#include "qabstractscrollarea.h"
#include "qdebug.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
QPanGestureRecognizer::QPanGestureRecognizer()
@@ -563,3 +565,5 @@ void QTapAndHoldGestureRecognizer::reset(QGesture *state)
}
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h
index 64505d8..da73b85 100644
--- a/src/gui/kernel/qstandardgestures_p.h
+++ b/src/gui/kernel/qstandardgestures_p.h
@@ -56,6 +56,8 @@
#include "qgesturerecognizer.h"
#include "private/qgesture_p.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QPanGestureRecognizer : public QGestureRecognizer
@@ -110,4 +112,6 @@ public:
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#endif // QSTANDARDGESTURES_P_H
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index a891be0..77d416b 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -161,6 +161,51 @@ static inline bool hasBackingStoreSupport()
extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp
extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp
+
+QRefCountedWidgetBackingStore::QRefCountedWidgetBackingStore()
+ : m_ptr(0)
+ , m_count(0)
+{
+
+}
+
+QRefCountedWidgetBackingStore::~QRefCountedWidgetBackingStore()
+{
+ delete m_ptr;
+}
+
+void QRefCountedWidgetBackingStore::create(QWidget *widget)
+{
+ destroy();
+ m_ptr = new QWidgetBackingStore(widget);
+ m_count = 0;
+}
+
+void QRefCountedWidgetBackingStore::destroy()
+{
+ delete m_ptr;
+ m_ptr = 0;
+ m_count = 0;
+}
+
+void QRefCountedWidgetBackingStore::ref()
+{
+ Q_ASSERT(m_ptr);
+ ++m_count;
+}
+
+void QRefCountedWidgetBackingStore::deref()
+{
+ if (m_count) {
+ Q_ASSERT(m_ptr);
+ if (0 == --m_count) {
+ delete m_ptr;
+ m_ptr = 0;
+ }
+ }
+}
+
+
QWidgetPrivate::QWidgetPrivate(int version)
: QObjectPrivate(version)
, extra(0)
@@ -202,7 +247,9 @@ QWidgetPrivate::QWidgetPrivate(int version)
, picture(0)
#elif defined(Q_WS_WIN)
, noPaintOnScreen(0)
+ #ifndef QT_NO_GESTURES
, nativeGesturePanEnabled(0)
+ #endif
#elif defined(Q_WS_MAC)
, needWindowChange(0)
, hasAlienChildren(0)
@@ -1348,11 +1395,9 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
// a real toplevel window needs a backing store
if (isWindow() && windowType() != Qt::Desktop) {
- delete d->topData()->backingStore;
- // QWidgetBackingStore will check this variable, hence it must be 0
- d->topData()->backingStore = 0;
+ d->topData()->backingStore.destroy();
if (hasBackingStoreSupport())
- d->topData()->backingStore = new QWidgetBackingStore(this);
+ d->topData()->backingStore.create(this);
}
d->setModal_sys();
@@ -1397,8 +1442,10 @@ QWidget::~QWidget()
qWarning("QWidget: %s (%s) deleted while being painted", className(), name());
#endif
+#ifndef QT_NO_GESTURES
foreach (Qt::GestureType type, d->gestureContext.keys())
ungrabGesture(type);
+#endif
// force acceptDrops false before winId is destroyed.
d->registerDropSite(false);
@@ -1478,8 +1525,7 @@ QWidget::~QWidget()
// the backing store will delete its window surface, which may or may
// not have a reference to this widget that will be used later to
// notify the window it no longer has a surface.
- delete d->extra->topextra->backingStore;
- d->extra->topextra->backingStore = 0;
+ d->extra->topextra->backingStore.destroy();
}
#endif
if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
@@ -1577,7 +1623,6 @@ void QWidgetPrivate::createTLExtra()
QTLWExtra* x = extra->topextra = new QTLWExtra;
x->icon = 0;
x->iconPixmap = 0;
- x->backingStore = 0;
x->windowSurface = 0;
x->sharedPainter = 0;
x->incw = x->inch = 0;
@@ -1661,7 +1706,7 @@ void QWidgetPrivate::deleteExtra()
#endif
if (extra->topextra) {
deleteTLSysExtra();
- delete extra->topextra->backingStore;
+ extra->topextra->backingStore.destroy();
delete extra->topextra->icon;
delete extra->topextra->iconPixmap;
#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER)
@@ -8540,9 +8585,11 @@ bool QWidget::event(QEvent *event)
#endif // Q_WS_MAC
break;
}
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
event->ignore();
break;
+#endif
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
@@ -11975,6 +12022,7 @@ QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const
Synonym for QList<QWidget *>.
*/
+#ifndef QT_NO_GESTURES
/*!
Subscribes the widget to a given \a gesture with specific \a flags.
@@ -12002,7 +12050,7 @@ void QWidget::ungrabGesture(Qt::GestureType gesture)
manager->cleanupCachedGestures(this, gesture);
}
}
-
+#endif // QT_NO_GESTURES
/*!
\typedef WId
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index e12148b..941bd68 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -360,8 +360,10 @@ public:
void setGraphicsEffect(QGraphicsEffect *effect);
#endif //QT_NO_GRAPHICSEFFECT
+#ifndef QT_NO_GESTURES
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
void ungrabGesture(Qt::GestureType type);
+#endif
public Q_SLOTS:
void setWindowTitle(const QString &);
@@ -742,8 +744,10 @@ private:
friend class QGraphicsProxyWidgetPrivate;
friend class QStyleSheetStyle;
friend struct QWidgetExceptionCleaner;
+#ifndef QT_NO_GESTURES
friend class QGestureManager;
friend class QWinNativePanGestureRecognizer;
+#endif // QT_NO_GESTURES
friend class QWidgetEffectSourcePrivate;
#ifdef Q_WS_MAC
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 6df9c3b..56e72af 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -757,6 +757,7 @@ static OSWindowRef qt_mac_create_window(QWidget *, WindowClass wclass, WindowAtt
return window;
}
+#ifndef QT_NO_GESTURES
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
/* We build the release package against the 10.4 SDK.
So, to enable gestures for applications running on
@@ -773,6 +774,7 @@ enum {
kEventParamMagnificationAmount = 'magn'
};
#endif
+#endif // QT_NO_GESTURES
// window events
static EventTypeSpec window_events[] = {
@@ -1081,6 +1083,7 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
handled_event = false;
break; }
+#ifndef QT_NO_GESTURES
case kEventClassGesture: {
// First, find the widget that was under
// the mouse when the gesture happened:
@@ -1147,6 +1150,7 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event,
QApplication::sendSpontaneousEvent(widget, &qNGEvent);
break; }
+#endif // QT_NO_GESTURES
default:
handled_event = false;
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 412705a..d432263 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -110,13 +110,53 @@ class QWidgetItemV2;
class QStyle;
+class Q_AUTOTEST_EXPORT QRefCountedWidgetBackingStore
+{
+public:
+ QRefCountedWidgetBackingStore();
+ ~QRefCountedWidgetBackingStore();
+
+ void create(QWidget *tlw);
+ void destroy();
+
+ void ref();
+ void deref();
+
+ inline QWidgetBackingStore* data()
+ {
+ return m_ptr;
+ }
+
+ inline QWidgetBackingStore* operator->()
+ {
+ return m_ptr;
+ }
+
+ inline QWidgetBackingStore& operator*()
+ {
+ return *m_ptr;
+ }
+
+ inline operator bool() const
+ {
+ return (0 != m_ptr);
+ }
+
+private:
+ Q_DISABLE_COPY(QRefCountedWidgetBackingStore)
+
+private:
+ QWidgetBackingStore* m_ptr;
+ int m_count;
+};
+
struct QTLWExtra {
// *************************** Cross-platform variables *****************************
// Regular pointers (keep them together to avoid gaps on 64 bits architectures).
QIcon *icon; // widget icon
QPixmap *iconPixmap;
- QWidgetBackingStore *backingStore;
+ QRefCountedWidgetBackingStore backingStore;
QWindowSurface *windowSurface;
QPainter *sharedPainter;
@@ -686,7 +726,9 @@ public:
#ifndef QT_NO_ACTION
QList<QAction*> actions;
#endif
+#ifndef QT_NO_GESTURES
QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
+#endif
// Bit fields.
uint high_attributes[4]; // the low ones are in QWidget::widget_attributes
@@ -715,8 +757,9 @@ public:
void updateX11AcceptFocus();
#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine()
+#ifndef QT_NO_GESTURES
uint nativeGesturePanEnabled : 1;
-
+#endif
bool shouldShowMaximizeButton();
void winUpdateIsOpaque();
void reparentChildren();
@@ -930,7 +973,7 @@ inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const
{
Q_Q(const QWidget);
QTLWExtra *x = q->window()->d_func()->maybeTopData();
- return x ? x->backingStore : 0;
+ return x ? x->backingStore.data() : 0;
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 02e7cb8..86b858d 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -433,6 +433,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
// Request mouse move events.
drawableWindow->PointerFilter(EPointerFilterEnterExit
| EPointerFilterMove | EPointerFilterDrag, 0);
+ drawableWindow->EnableVisibilityChangeEvents();
if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) {
activateSymbianWindow(control.data());
@@ -487,11 +488,8 @@ void QWidgetPrivate::show_sys()
&& !S60->buttonGroupContainer() && !S60->statusPane()) {
bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
- bool cbaRequested = q->windowFlags() & Qt::WindowSoftkeysVisibleHint;
- // If the window is fullscreen and has not explicitly requested that the CBA be visible
- // we delay the creation even more.
- if ((!isFullscreen || cbaRequested) && !q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ if (!q->testAttribute(Qt::WA_DontShowOnScreen)) {
// Create the status pane and CBA here
CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
@@ -911,14 +909,12 @@ void QWidgetPrivate::registerDropSite(bool /* on */)
void QWidgetPrivate::createTLSysExtra()
{
- extra->topextra->backingStore = 0;
extra->topextra->inExpose = 0;
}
void QWidgetPrivate::deleteTLSysExtra()
{
- delete extra->topextra->backingStore;
- extra->topextra->backingStore = 0;
+ extra->topextra->backingStore.destroy();
}
void QWidgetPrivate::createSysExtra()
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 5482da3..a7e66bf 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -2075,7 +2075,7 @@ void QWidgetPrivate::registerTouchWindow()
void QWidgetPrivate::winSetupGestures()
{
-#if !defined(QT_NO_NATIVE_GESTURES)
+#if !defined(QT_NO_GESTURES) && !defined(QT_NO_NATIVE_GESTURES)
Q_Q(QWidget);
if (!q || !q->isVisible() || !nativeGesturePanEnabled)
return;
diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
index 0bddbf6..780de5d 100644
--- a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
+++ b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
@@ -50,6 +50,8 @@
#include "private/qapplication_p.h"
#include "private/qwidget_p.h"
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_NATIVE_GESTURES)
@@ -127,3 +129,5 @@ void QWinNativePanGestureRecognizer::reset(QGesture *state)
#endif // QT_NO_NATIVE_GESTURES
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
index 146b067..64addeb 100644
--- a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
+++ b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
@@ -54,6 +54,7 @@
//
#include <QGestureRecognizer>
+
#include <objbase.h>
class IInkRectangle;
@@ -87,6 +88,8 @@ DECLARE_INTERFACE_(IInkTablets, IDispatch)
STDMETHOD(IsPacketPropertySupported)(THIS_ BSTR packetPropertyName, VARIANT_BOOL *Supported) PURE;
};
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
#if !defined(QT_NO_NATIVE_GESTURES)
@@ -105,4 +108,6 @@ public:
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#endif // QWINNATIVEPANGESTURERECOGNIZER_WIN_P_H
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index f9cd59b..83751ed 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -909,7 +909,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
QWidgetPrivate *pd = pw->d_func();
QRect clipR(pd->clipRect());
#ifdef Q_WS_QWS
- QWidgetBackingStore *wbs = x->backingStore;
+ QWidgetBackingStore *wbs = x->backingStore.data();
QWSWindowSurface *surface = static_cast<QWSWindowSurface*>(wbs->windowSurface);
clipR = clipR.intersected(surface->clipRegion().translated(-toplevelOffset).boundingRect());
#endif
@@ -939,7 +939,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
invalidateBuffer((newRect & clipR).translated(-data.crect.topLeft()));
} else {
- QWidgetBackingStore *wbs = x->backingStore;
+ QWidgetBackingStore *wbs = x->backingStore.data();
QRegion childExpose(newRect & clipR);
if (sourceRect.isValid() && wbs->bltRect(sourceRect, dx, dy, pw))
@@ -982,7 +982,7 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
if (x->inTopLevelResize)
return;
- QWidgetBackingStore *wbs = x->backingStore;
+ QWidgetBackingStore *wbs = x->backingStore.data();
if (!wbs)
return;
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index b468b11..d3061d8 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -48,6 +48,7 @@
#include "qline.h"
#include "qdebug.h"
#include <QtCore/qcoreapplication.h>
+#include "private/qstylehelper_p.h"
QT_BEGIN_NAMESPACE
@@ -96,9 +97,11 @@ const uchar *qt_patternForBrush(int brushStyle, bool invert)
QPixmap qt_pixmapForBrush(int brushStyle, bool invert)
{
+
QPixmap pm;
- QString key = QLatin1String("$qt-brush$") + QString::number(brushStyle)
- + QString::number((int)invert);
+ QString key = QLatin1Literal("$qt-brush$")
+ % HexString<uint>(brushStyle)
+ % QLatin1Char(invert ? '1' : '0');
if (!QPixmapCache::find(key, pm)) {
pm = QBitmap::fromData(QSize(8, 8), qt_patternForBrush(brushStyle, invert),
QImage::Format_MonoLSB);
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index 3ce95ef..11ea6d5 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -48,6 +48,7 @@
#include <private/qpaintengineex_p.h>
#include <qvarlengtharray.h>
#include <qmath.h>
+#include <private/qstylehelper_p.h>
QT_BEGIN_NAMESPACE
@@ -1018,7 +1019,9 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
;
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
} else { // color pixmap, no mask
- QString k = QString::fromLatin1("$qt-drawitem-%1").arg(pm.cacheKey());
+ QString k = QLatin1Literal("$qt-drawitem")
+ % HexString<qint64>(pm.cacheKey());
+
if (!QPixmapCache::find(k, pm)) {
pm = pm.createHeuristicMask();
pm.setMask((QBitmap&)pm);
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index aef8b80..b8ad9b3 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -79,6 +79,8 @@
#include <private/qtessellator_p.h>
#endif
+#include <private/qstylehelper_p.h>
+
QT_BEGIN_NAMESPACE
extern Drawable qt_x11Handle(const QPaintDevice *pd);
@@ -224,7 +226,10 @@ static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE] = {
static QPixmap qt_patternForAlpha(uchar alpha, int screen)
{
QPixmap pm;
- QString key = QLatin1String("$qt-alpha-brush$") + QString::number(alpha) + QString::number(screen);
+ QString key = QLatin1Literal("$qt-alpha-brush$")
+ % HexString<uchar>(alpha)
+ % HexString<int>(screen);
+
if (!QPixmapCache::find(key, pm)) {
// #### why not use a mono image here????
QImage pattern(DITHER_SIZE, DITHER_SIZE, QImage::Format_ARGB32);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index dd3584a..98db917 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -72,6 +72,7 @@
#include <private/qmath_p.h>
#include <qstatictext.h>
#include <private/qstatictext_p.h>
+#include <private/qstylehelper_p.h>
QT_BEGIN_NAMESPACE
@@ -5855,14 +5856,24 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
+ if (d->extended->type() == QPaintEngine::OpenGL2 && !staticText_d->untransformedCoordinates) {
+ staticText_d->untransformedCoordinates = true;
+ staticText_d->needsRelayout = true;
+ } else if (d->extended->type() != QPaintEngine::OpenGL2 && staticText_d->untransformedCoordinates) {
+ staticText_d->untransformedCoordinates = false;
+ staticText_d->needsRelayout = true;
+ }
+
// Don't recalculate entire layout because of translation, rather add the dx and dy
// into the position to move each text item the correct distance.
- QPointF transformedPosition = topLeftPosition * d->state->matrix;
- QTransform matrix = d->state->matrix;
+ QPointF transformedPosition = topLeftPosition;
+ if (!staticText_d->untransformedCoordinates)
+ transformedPosition = transformedPosition * d->state->matrix;
+ QTransform oldMatrix;
// The translation has been applied to transformedPosition. Remove translation
// component from matrix.
- if (d->state->matrix.isTranslating()) {
+ if (d->state->matrix.isTranslating() && !staticText_d->untransformedCoordinates) {
qreal m11 = d->state->matrix.m11();
qreal m12 = d->state->matrix.m12();
qreal m13 = d->state->matrix.m13();
@@ -5871,6 +5882,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
qreal m23 = d->state->matrix.m23();
qreal m33 = d->state->matrix.m33();
+ oldMatrix = d->state->matrix;
d->state->matrix.setMatrix(m11, m12, m13,
m21, m22, m23,
0.0, 0.0, m33);
@@ -5879,7 +5891,7 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
// If the transform is not identical to the text transform,
// we have to relayout the text (for other transformations than plain translation)
bool staticTextNeedsReinit = staticText_d->needsRelayout;
- if (staticText_d->matrix != d->state->matrix) {
+ if (!staticText_d->untransformedCoordinates && staticText_d->matrix != d->state->matrix) {
staticText_d->matrix = d->state->matrix;
staticTextNeedsReinit = true;
}
@@ -5918,8 +5930,8 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
if (currentColor != oldPen.color())
setPen(oldPen);
- if (matrix.isTranslating())
- d->state->matrix = matrix;
+ if (!staticText_d->untransformedCoordinates && oldMatrix.isTranslating())
+ d->state->matrix = oldMatrix;
}
/*!
@@ -5937,6 +5949,23 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
if (!d->engine || str.isEmpty() || pen().style() == Qt::NoPen)
return;
+ if (tf & Qt::TextBypassShaping) {
+ // Skip harfbuzz complex shaping, shape using glyph advances only
+ int len = str.length();
+ int numGlyphs = len;
+ QVarLengthGlyphLayoutArray glyphs(len);
+ QFontEngine *fontEngine = d->state->font.d->engineForScript(QUnicodeTables::Common);
+ if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0)) {
+ glyphs.resize(numGlyphs);
+ if (!fontEngine->stringToCMap(str.data(), len, &glyphs, &numGlyphs, 0))
+ Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice");
+ }
+
+ QTextItemInt gf(glyphs, &d->state->font, fontEngine);
+ drawTextItem(p, gf);
+ return;
+ }
+
QStackTextEngine engine(str, d->state->font);
engine.option.setTextDirection(d->state->layoutDirection);
if (tf & (Qt::TextForceLeftToRight|Qt::TextForceRightToLeft)) {
@@ -6217,10 +6246,9 @@ static QPixmap generateWavyPixmap(qreal maxRadius, const QPen &pen)
{
const qreal radiusBase = qMax(qreal(1), maxRadius);
- QString key = QLatin1String("WaveUnderline-");
- key += pen.color().name();
- key += QLatin1Char('-');
- key += QString::number(radiusBase);
+ QString key = QLatin1Literal("WaveUnderline-")
+ % pen.color().name()
+ % HexString<qreal>(radiusBase);
QPixmap pixmap;
if (QPixmapCache::find(key, pixmap))
diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp
index 63ad94e..2b4c9c2 100644
--- a/src/gui/statemachine/qguistatemachine.cpp
+++ b/src/gui/statemachine/qguistatemachine.cpp
@@ -474,9 +474,11 @@ static QEvent *cloneEvent(QEvent *e)
case QEvent::TouchEnd:
return new QTouchEvent(*static_cast<QTouchEvent*>(e));
+#ifndef QT_NO_GESTURES
case QEvent::NativeGesture:
Q_ASSERT_X(false, "cloneEvent()", "not implemented");
break;
+#endif
case QEvent::RequestSoftwareInputPanel:
case QEvent::CloseSoftwareInputPanel:
diff --git a/src/gui/styles/qgtkpainter.cpp b/src/gui/styles/qgtkpainter.cpp
index 79c53e9..0217a39 100644
--- a/src/gui/styles/qgtkpainter.cpp
+++ b/src/gui/styles/qgtkpainter.cpp
@@ -241,8 +241,10 @@ void QGtkPainter::paintBoxGap(GtkWidget *gtkWidget, const gchar* part,
if (rect.height() > maxHeight && (gap_side == GTK_POS_TOP || gap_side == GTK_POS_BOTTOM))
rect.setHeight(2 * border + 1);
- QString gapExtras = QString(QLS("s %0 w %1 g %2")).arg(gap_side).arg(width).arg(x);
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + gapExtras;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget)
+ % HexString<uchar>(gap_side)
+ % HexString<gint>(width)
+ % HexString<gint>(x);
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box_gap (style,
@@ -307,7 +309,7 @@ void QGtkPainter::paintBox(GtkWidget *gtkWidget, const gchar* part,
rect.setHeight(2 * border + 1);
QString pixmapName = uniqueName(QLS(part), state, shadow,
- rect.size(), gtkWidget) + pmKey;
+ rect.size(), gtkWidget) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_box (style,
@@ -357,9 +359,11 @@ void QGtkPainter::paintHline(GtkWidget *gtkWidget, const gchar* part,
return;
QPixmap cache;
- QString hLineExtras = QString(QLS("%0 %1 %2")).arg(x1).arg(x2).arg(y);
QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
- + hLineExtras + pmKey;
+ % HexString<int>(x1)
+ % HexString<int>(x2)
+ % HexString<int>(y)
+ % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_hline (style,
pixmap,
@@ -384,9 +388,12 @@ void QGtkPainter::paintVline(GtkWidget *gtkWidget, const gchar* part,
return;
QPixmap cache;
- QString vLineExtras = QString(QLS("%0 %1 %2")).arg(y1).arg(y2).arg(x);
- QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
- gtkWidget) + vLineExtras +pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
+ % HexString<int>(y1)
+ % HexString<int>(y2)
+ % HexString<int>(x)
+ % pmKey;
+
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_vline (style,
pixmap,
@@ -412,8 +419,10 @@ void QGtkPainter::paintExpander(GtkWidget *gtkWidget,
return;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
- gtkWidget) + QString::number(expander_state) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
+ % HexString<uchar>(expander_state)
+ % pmKey;
+
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_expander (style, pixmap,
state, NULL,
@@ -436,7 +445,7 @@ void QGtkPainter::paintFocus(GtkWidget *gtkWidget, const gchar* part,
return;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_focus (style, pixmap, state, NULL,
gtkWidget,
@@ -461,7 +470,7 @@ void QGtkPainter::paintResizeGrip(GtkWidget *gtkWidget, const gchar* part,
return;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_resize_grip (style, pixmap, state,
NULL, gtkWidget,
@@ -486,8 +495,9 @@ void QGtkPainter::paintArrow(GtkWidget *gtkWidget, const gchar* part,
return;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) +
- QString::number((int)arrow_type) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
+ % HexString<uchar>(arrow_type)
+ % pmKey;
GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
int xOffset = m_cliprect.isValid() ? arrowrect.x() - m_cliprect.x() : 0;
@@ -518,7 +528,8 @@ void QGtkPainter::paintHandle(GtkWidget *gtkWidget, const gchar* part, const QRe
QPixmap cache;
QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
- + QString::number(orientation);
+ % HexString<uchar>(orientation);
+
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_handle (style,
pixmap,
@@ -546,7 +557,7 @@ void QGtkPainter::paintSlider(GtkWidget *gtkWidget, const gchar* part, const QRe
return;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_slider (style,
pixmap,
@@ -577,7 +588,7 @@ void QGtkPainter::paintShadow(GtkWidget *gtkWidget, const gchar* part,
QRect r = rect;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_shadow(style, pixmap, state, shadow, NULL,
gtkWidget, part, 0, 0, rect.width(), rect.height()));
@@ -596,7 +607,7 @@ void QGtkPainter::paintFlatBox(GtkWidget *gtkWidget, const gchar* part,
return;
QRect r = rect;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey;
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_flat_box (style,
pixmap,
@@ -623,8 +634,8 @@ void QGtkPainter::paintExtention(GtkWidget *gtkWidget,
QRect r = rect;
QPixmap cache;
- QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget);
- pixmapName += QString::number(gap_pos);
+ QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget)
+ % HexString<uchar>(gap_pos);
if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_extension (style, pixmap, state, shadow,
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 9d6dc9a..b59a033 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -67,6 +67,7 @@
#include <QtGui/QRadioButton>
#include <QtGui/QCheckBox>
#include <QtGui/QTreeView>
+#include <QtGui/QStyledItemDelegate>
#include <qpixmapcache.h>
#undef signals // Collides with GTK stymbols
#include <private/qgtkpainter_p.h>
@@ -692,7 +693,7 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
// thin rectangular images
const int pmSize = 64;
const int border = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget);
- const QString pmKey = QString(QLS("windowframe %0")).arg(option->state);
+ const QString pmKey = QLatin1Literal("windowframe") % HexString<uint>(option->state);
QPixmap pixmap;
QRect pmRect(QPoint(0,0), QSize(pmSize, pmSize));
@@ -817,24 +818,49 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
option->state & State_Open ? openState : closedState , gtkTreeView->style);
}
break;
+
+ case PE_PanelItemViewRow:
+ // This primitive is only used to draw selection behind selected expander arrows.
+ // We try not to decorate the tree branch background unless you inherit from StyledItemDelegate
+ // The reason for this is that a lot of code that relies on custom item delegates will look odd having
+ // a gradient on the branch but a flat shaded color on the item itself.
+ QCommonStyle::drawPrimitive(element, option, painter, widget);
+ if (!option->state & State_Selected) {
+ break;
+ } else {
+ if (const QAbstractItemView *view = qobject_cast<const QAbstractItemView*>(widget)) {
+ if (!qobject_cast<QStyledItemDelegate*>(view->itemDelegate()))
+ break;
+ }
+ } // fall through
+
case PE_PanelItemViewItem:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
- if (vopt->state & State_Selected) {
- QLinearGradient gradient;
- gradient.setStart(option->rect.left(), option->rect.top());
- gradient.setFinalStop(option->rect.left(), option->rect.bottom());
- gradient.setColorAt(0, option->palette.highlight().color().lighter(105));
- gradient.setColorAt(0.5, option->palette.highlight().color().lighter(101));
- gradient.setColorAt(0.51, option->palette.highlight().color().darker(101));
- gradient.setColorAt(1, option->palette.highlight().color().darker(105));
- painter->fillRect(option->rect, gradient);
- } else {
- if (vopt->backgroundBrush.style() != Qt::NoBrush) {
- QPointF oldBO = painter->brushOrigin();
- painter->setBrushOrigin(vopt->rect.topLeft());
- painter->fillRect(vopt->rect, vopt->backgroundBrush);
- painter->setBrushOrigin(oldBO);
+ if (vopt->backgroundBrush.style() != Qt::NoBrush) {
+ QPointF oldBO = painter->brushOrigin();
+ painter->setBrushOrigin(vopt->rect.topLeft());
+ painter->fillRect(vopt->rect, vopt->backgroundBrush);
+ painter->setBrushOrigin(oldBO);
+ if (!(option->state & State_Selected))
+ break;
+ }
+ if (GtkWidget *gtkTreeView = d->gtkWidget("GtkTreeView")) {
+ const char *detail = "cell_even_ruled";
+ if (vopt && vopt->features & QStyleOptionViewItemV2::Alternate)
+ detail = "cell_odd_ruled";
+ bool isActive = option->state & State_Active;
+ QString key;
+ if (isActive ) {
+ // Required for active/non-active window appearance
+ key = QLS("a");
+ GTK_WIDGET_SET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);
}
+ gtkPainter.paintFlatBox(gtkTreeView, detail, option->rect,
+ option->state & State_Selected ? GTK_STATE_SELECTED :
+ option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
+ GTK_SHADOW_OUT, gtkTreeView->style, key);
+ if (isActive )
+ GTK_WIDGET_UNSET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);
}
}
break;
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index c8711f6..20d9bd9 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -488,7 +488,9 @@ static void qBrushSetAlphaF(QBrush *brush, qreal alpha)
// Modify the texture - ridiculously expensive.
QPixmap texture = brush->texture();
QPixmap pixmap;
- QString name = QString::fromLatin1("qbrushtexture-alpha-%1-%2").arg(alpha).arg(texture.cacheKey());
+ QString name = QLatin1Literal("qbrushtexture-alpha")
+ % HexString<qreal>(alpha)
+ % HexString<qint64>(texture.cacheKey());
if (!QPixmapCache::find(name, pixmap)) {
QImage image = texture.toImage();
QRgb *rgb = reinterpret_cast<QRgb *>(image.bits());
@@ -549,7 +551,10 @@ static QBrush qBrushLight(QBrush brush, int light)
// Modify the texture - ridiculously expensive.
QPixmap texture = brush.texture();
QPixmap pixmap;
- QString name = QString::fromLatin1("qbrushtexture-light-%1-%2").arg(light).arg(texture.cacheKey());
+ QString name = QLatin1Literal("qbrushtexture-light")
+ % HexString<int>(light)
+ % HexString<qint64>(texture.cacheKey());
+
if (!QPixmapCache::find(name, pixmap)) {
QImage image = texture.toImage();
QRgb *rgb = reinterpret_cast<QRgb *>(image.bits());
@@ -608,7 +613,10 @@ static QBrush qBrushDark(QBrush brush, int dark)
// Modify the texture - ridiculously expensive.
QPixmap texture = brush.texture();
QPixmap pixmap;
- QString name = QString::fromLatin1("qbrushtexture-dark-%1-%2").arg(dark).arg(brush.texture().cacheKey());
+ QString name = QLatin1Literal("qbrushtexture-dark")
+ % HexString<int>(dark)
+ % HexString<qint64>(texture.cacheKey());
+
if (!QPixmapCache::find(name, pixmap)) {
QImage image = texture.toImage();
QRgb *rgb = reinterpret_cast<QRgb *>(image.bits());
@@ -732,8 +740,12 @@ static QColor mergedColors(const QColor &colorA, const QColor &colorB, int facto
static void qt_plastique_draw_gradient(QPainter *painter, const QRect &rect, const QColor &gradientStart,
const QColor &gradientStop)
{
- QString gradientName;
- gradientName.sprintf("%dx%d-%x-%x", rect.width(), rect.height(), gradientStart.rgba(), gradientStop.rgba());
+ QString gradientName = QLatin1Literal("qplastique-g")
+ % HexString<int>(rect.width())
+ % HexString<int>(rect.height())
+ % HexString<QRgb>(gradientStart.rgba())
+ % HexString<QRgb>(gradientStop.rgba());
+
QPixmap cache;
QPainter *p = painter;
QRect r = rect;
@@ -1092,14 +1104,6 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
Q_ASSERT(option);
QColor borderColor = option->palette.background().color().darker(178);
- QColor gradientStartColor = option->palette.button().color().lighter(104);
- QColor gradientStopColor = option->palette.button().color().darker(105);
- QColor highlightedGradientStartColor = option->palette.button().color().lighter(101);
- QColor highlightedGradientStopColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 85);
- QColor highlightedBaseGradientStartColor = option->palette.base().color();
- QColor highlightedBaseGradientStopColor = mergedColors(option->palette.base().color().darker(105), option->palette.highlight().color(), 70);
- QColor highlightedDarkInnerBorderColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 35);
- QColor highlightedLightInnerBorderColor = mergedColors(option->palette.button().color(), option->palette.highlight().color(), 58);
QColor alphaCornerColor;
if (widget) {
// ### backgroundrole/foregroundrole should be part of the style option
@@ -1107,13 +1111,7 @@ void QPlastiqueStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
} else {
alphaCornerColor = mergedColors(option->palette.background().color(), borderColor);
}
- QColor alphaInnerColor = mergedColors(highlightedLightInnerBorderColor, gradientStartColor);
- QColor alphaInnerColorNoHover = mergedColors(borderColor, gradientStartColor);
QColor alphaTextColor = mergedColors(option->palette.background().color(), option->palette.text().color());
- QColor alphaLightTextColor = mergedColors(option->palette.background().color().lighter(250), option->palette.text().color().lighter(250));
- QColor lightShadow = option->palette.button().color().lighter(105);
- QColor shadowGradientStartColor = option->palette.button().color().darker(115);
- QColor shadow = shadowGradientStartColor;
switch (element) {
case PE_IndicatorButtonDropDown:
@@ -2057,7 +2055,6 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op
bool reverse = (tab->direction == Qt::RightToLeft);
int lowerTop = selected ? 0 : 3; // to make the selected tab bigger than the rest
- QRect adjustedRect;
bool atEnd = (tab->position == QStyleOptionTab::End) || onlyTab;
bool atBeginning = ((tab->position == QStyleOptionTab::Beginning) || onlyTab)
&& !leftCornerWidget;
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 515b6c7..43fa4b9 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -3190,7 +3190,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
subRule2.drawRule(p, r);
}
- handleSubRule.drawRule(p, grooveSubRule.boxRect(hr, Margin));
+ handleSubRule.drawRule(p, handleSubRule.boxRect(hr, Margin));
}
if (slider->subControls & SC_SliderTickmarks) {
diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp
index 0314c6f..579dd0b 100644
--- a/src/gui/styles/qwindowsstyle.cpp
+++ b/src/gui/styles/qwindowsstyle.cpp
@@ -1388,8 +1388,9 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
QRect r = opt->rect;
int size = qMin(r.height(), r.width());
QPixmap pixmap;
- QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-") + QLatin1String(metaObject()->className()), opt, QSize(size, size))
- + QLatin1Char('-') + QString::number(pe);
+ QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-")
+ % QLatin1String(metaObject()->className()), opt, QSize(size, size))
+ % HexString<uint>(pe);
if (!QPixmapCache::find(pixmapName, pixmap)) {
int border = size/5;
int sqsize = 2*(size/2);
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 489b70b..943df7f 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -49,12 +49,12 @@
#include <private/qt_s60_p.h>
#include "qendian.h"
#include <private/qcore_symbian_p.h>
-#if defined(QT_NO_FREETYPE)
+#ifdef QT_NO_FREETYPE
#include <openfont.h>
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
#include <graphics/openfontrasterizer.h> // COpenFontRasterizer has moved to a new header file
#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
-#endif
+#endif // QT_NO_FREETYPE
QT_BEGIN_NAMESPACE
@@ -91,7 +91,7 @@ QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameF
return result;
}
-#if defined(QT_NO_FREETYPE)
+#ifdef QT_NO_FREETYPE
class QSymbianFontDatabaseExtrasImplementation : public QSymbianFontDatabaseExtras
{
public:
@@ -100,16 +100,41 @@ public:
const QSymbianTypeFaceExtras *extras(const QString &typeface, bool bold, bool italic) const;
+#ifndef Q_SYMBIAN_HAS_FONTTABLE_API
+ struct CFontFromFontStoreReleaser {
+ static inline void cleanup(CFont *font)
+ {
+ if (!font)
+ return;
+ const QSymbianFontDatabaseExtrasImplementation *dbExtras =
+ static_cast<const QSymbianFontDatabaseExtrasImplementation*>(privateDb()->symbianExtras);
+ dbExtras->m_store->ReleaseFont(font);
+ }
+ };
+#endif // !Q_SYMBIAN_HAS_FONTTABLE_API
+
+ struct CFontFromScreenDeviceReleaser {
+ static inline void cleanup(CFont *font)
+ {
+ if (!font)
+ return;
+ QS60Data::screenDevice()->ReleaseFont(font);
+ }
+ };
+
private:
+#ifndef Q_SYMBIAN_HAS_FONTTABLE_API
RHeap* m_heap;
CFontStore *m_store;
COpenFontRasterizer *m_rasterizer;
mutable QList<const QSymbianTypeFaceExtras *> m_extras;
+#endif // !Q_SYMBIAN_HAS_FONTTABLE_API
mutable QHash<QString, const QSymbianTypeFaceExtras *> m_extrasHash;
};
QSymbianFontDatabaseExtrasImplementation::QSymbianFontDatabaseExtrasImplementation()
{
+#ifndef Q_SYMBIAN_HAS_FONTTABLE_API
QStringList filters;
filters.append(QLatin1String("*.ttf"));
filters.append(QLatin1String("*.ccc"));
@@ -131,10 +156,14 @@ QSymbianFontDatabaseExtrasImplementation::QSymbianFontDatabaseExtrasImplementati
TPtrC fontFilePtr(qt_QString2TPtrC(fontFile));
QT_TRAP_THROWING(m_store->AddFileL(fontFilePtr));
}
+#endif // !Q_SYMBIAN_HAS_FONTTABLE_API
}
QSymbianFontDatabaseExtrasImplementation::~QSymbianFontDatabaseExtrasImplementation()
{
+#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
+ qDeleteAll(m_extrasHash);
+#else // Q_SYMBIAN_HAS_FONTTABLE_API
typedef QList<const QSymbianTypeFaceExtras *>::iterator iterator;
for (iterator p = m_extras.begin(); p != m_extras.end(); ++p) {
m_store->ReleaseFont((*p)->fontOwner());
@@ -143,6 +172,7 @@ QSymbianFontDatabaseExtrasImplementation::~QSymbianFontDatabaseExtrasImplementat
delete m_store;
m_heap->Close();
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API
}
#ifndef FNTSTORE_H_INLINES_SUPPORT_FMM
@@ -167,26 +197,37 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c
{
const QString searchKey = typeface + QString::number(int(bold)) + QString::number(int(italic));
if (!m_extrasHash.contains(searchKey)) {
- CFont* font = NULL;
TFontSpec searchSpec(qt_QString2TPtrC(typeface), 1);
if (bold)
searchSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
if (italic)
searchSpec.iFontStyle.SetPosture(EPostureItalic);
+
+ CFont* font = NULL;
+#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
+ const TInt err = QS60Data::screenDevice()->GetNearestFontToDesignHeightInPixels(font, searchSpec);
+ Q_ASSERT(err == KErrNone && font);
+ QScopedPointer<CFont, CFontFromScreenDeviceReleaser> sFont(font);
+ QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font);
+ sFont.take();
+ m_extrasHash.insert(searchKey, extras);
+#else // Q_SYMBIAN_HAS_FONTTABLE_API
const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, searchSpec);
Q_ASSERT(err == KErrNone && font);
const CBitmapFont *bitmapFont = static_cast<CBitmapFont*>(font);
COpenFont *openFont =
#ifdef FNTSTORE_H_INLINES_SUPPORT_FMM
- bitmapFont->openFont();
-#else
+ bitmapFont->OpenFont();
+#else // FNTSTORE_H_INLINES_SUPPORT_FMM
OpenFontFromBitmapFont(bitmapFont);
#endif // FNTSTORE_H_INLINES_SUPPORT_FMM
const TOpenFontFaceAttrib* const attrib = openFont->FaceAttrib();
const QString foundKey =
QString((const QChar*)attrib->FullName().Ptr(), attrib->FullName().Length());
if (!m_extrasHash.contains(foundKey)) {
+ QScopedPointer<CFont, CFontFromFontStoreReleaser> sFont(font);
QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font, openFont);
+ sFont.take();
m_extras.append(extras);
m_extrasHash.insert(searchKey, extras);
m_extrasHash.insert(foundKey, extras);
@@ -194,10 +235,11 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c
m_store->ReleaseFont(font);
m_extrasHash.insert(searchKey, m_extrasHash.value(foundKey));
}
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API
}
return m_extrasHash.value(searchKey);
}
-#else
+#else // QT_NO_FREETYPE
class QFontEngineFTS60 : public QFontEngineFT
{
public:
@@ -209,7 +251,7 @@ QFontEngineFTS60::QFontEngineFTS60(const QFontDef &fd)
{
default_hint_style = HintFull;
}
-#endif // defined(QT_NO_FREETYPE)
+#endif // QT_NO_FREETYPE
/*
QFontEngineS60::pixelsToPoints, QFontEngineS60::pointsToPixels, QFontEngineMultiS60::QFontEngineMultiS60
@@ -261,12 +303,12 @@ static void initializeDb()
if(!db || db->count)
return;
-#if defined(QT_NO_FREETYPE)
+#ifdef QT_NO_FREETYPE
if (!db->symbianExtras)
db->symbianExtras = new QSymbianFontDatabaseExtrasImplementation;
QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
-
+
const int numTypeFaces = QS60Data::screenDevice()->NumTypefaces();
const QSymbianFontDatabaseExtrasImplementation *dbExtras =
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(db->symbianExtras);
@@ -278,6 +320,7 @@ static void initializeDb()
TFontSpec fontSpec(typefaceSupport.iTypeface.iName, 11);
if (QS60Data::screenDevice()->GetNearestFontInPixels(font, fontSpec) != KErrNone)
continue;
+ QScopedPointer<CFont, QSymbianFontDatabaseExtrasImplementation::CFontFromScreenDeviceReleaser> sFont(font);
if (font->TypeUid() == KCFbsFontUid) {
TOpenFontFaceAttrib faceAttrib;
const CFbsFont *cfbsFont = static_cast<const CFbsFont *>(font);
@@ -318,14 +361,13 @@ static void initializeDb()
fontAdded = true;
}
- QS60Data::screenDevice()->ReleaseFont(font);
}
Q_ASSERT(fontAdded);
- lock.relock();
+ lock.relock();
-#else // defined(QT_NO_FREETYPE)
+#else // QT_NO_FREETYPE
QDir dir(QDesktopServices::storageLocation(QDesktopServices::FontsLocation));
dir.setNameFilters(QStringList() << QLatin1String("*.ttf")
<< QLatin1String("*.ttc") << QLatin1String("*.pfa")
@@ -334,7 +376,7 @@ static void initializeDb()
const QByteArray file = QFile::encodeName(dir.absoluteFilePath(dir[i]));
db->addTTFile(file);
}
-#endif // defined(QT_NO_FREETYPE)
+#endif // QT_NO_FREETYPE
}
static inline void load(const QString &family = QString(), int script = -1)
@@ -416,13 +458,13 @@ QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFo
const QString fontFamily = desc.family->name;
QFontDef request = req;
request.family = fontFamily;
-#if defined(QT_NO_FREETYPE)
+#ifdef QT_NO_FREETYPE
const QSymbianFontDatabaseExtrasImplementation *dbExtras =
static_cast<const QSymbianFontDatabaseExtrasImplementation*>(db->symbianExtras);
const QSymbianTypeFaceExtras *typeFaceExtras =
dbExtras->extras(fontFamily, request.weight > QFont::Normal, request.style != QFont::StyleNormal);
fe = new QFontEngineS60(request, typeFaceExtras);
-#else
+#else // QT_NO_FREETYPE
QFontEngine::FaceId faceId;
const QtFontFamily * const reqQtFontFamily = db->family(fontFamily);
faceId.filename = reqQtFontFamily->fontFilename;
@@ -433,7 +475,7 @@ QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFo
fe = fte;
else
delete fte;
-#endif
+#endif // QT_NO_FREETYPE
Q_ASSERT(fe);
if (script == QUnicodeTables::Common
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 93f02ff..925b3bf 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -50,21 +50,73 @@
#include <e32std.h>
#include <eikenv.h>
#include <gdi.h>
+#if defined(Q_SYMBIAN_HAS_FONTTABLE_API) || defined(Q_SYMBIAN_HAS_GLYPHOUTLINE_API)
+#include <graphics/gdi/gdiplatapi.h>
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API || Q_SYMBIAN_HAS_GLYPHOUTLINE_API
QT_BEGIN_NAMESPACE
-QSymbianTypeFaceExtras::QSymbianTypeFaceExtras(CFont* fontOwner, COpenFont *font)
- : m_font(font)
- , m_cmap(0)
+#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
+QSymbianTypeFaceExtras::QSymbianTypeFaceExtras(CFont* cFont, COpenFont *openFont)
+ : m_cFont(cFont)
, m_symbolCMap(false)
- , m_fontOwner(fontOwner)
+{
+ Q_UNUSED(openFont)
+}
+
+QSymbianTypeFaceExtras::~QSymbianTypeFaceExtras()
+{
+ QS60Data::screenDevice()->ReleaseFont(m_cFont);
+}
+
+QByteArray QSymbianTypeFaceExtras::getSfntTable(uint tag) const
+{
+ RFontTable fontTable;
+ if (fontTable.Open(*m_cFont, tag) != KErrNone)
+ return QByteArray();
+ const QByteArray byteArray(reinterpret_cast<const char *>
+ (fontTable.TableContent()),fontTable.TableLength());
+ fontTable.Close();
+ return byteArray;
+}
+
+bool QSymbianTypeFaceExtras::getSfntTableData(uint tag, uchar *buffer, uint *length) const
+{
+ RFontTable fontTable;
+ if (fontTable.Open(*m_cFont, tag) != KErrNone)
+ return false;
+
+ bool result = true;
+ const TInt tableByteLength = fontTable.TableLength();
+
+ if (*length > 0 && *length < tableByteLength) {
+ result = false; // Caller did not allocate enough memory
+ } else {
+ *length = tableByteLength;
+ if (buffer)
+ qMemCopy(buffer, fontTable.TableContent(), tableByteLength);
+ }
+
+ fontTable.Close();
+ return result;
+}
+
+#else // Q_SYMBIAN_HAS_FONTTABLE_API
+QSymbianTypeFaceExtras::QSymbianTypeFaceExtras(CFont* cFont, COpenFont *openFont)
+ : m_cFont(cFont)
+ , m_symbolCMap(false)
+ , m_openFont(openFont)
{
TAny *trueTypeExtension = NULL;
- m_font->ExtendedInterface(KUidOpenFontTrueTypeExtension, trueTypeExtension);
+ m_openFont->ExtendedInterface(KUidOpenFontTrueTypeExtension, trueTypeExtension);
m_trueTypeExtension = static_cast<MOpenFontTrueTypeExtension*>(trueTypeExtension);
Q_ASSERT(m_trueTypeExtension);
}
+QSymbianTypeFaceExtras::~QSymbianTypeFaceExtras()
+{
+}
+
QByteArray QSymbianTypeFaceExtras::getSfntTable(uint tag) const
{
Q_ASSERT(m_trueTypeExtension->HasTrueTypeTable(tag));
@@ -100,23 +152,25 @@ bool QSymbianTypeFaceExtras::getSfntTableData(uint tag, uchar *buffer, uint *len
m_trueTypeExtension->ReleaseTrueTypeTable(table);
return result;
}
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API
-const unsigned char *QSymbianTypeFaceExtras::cmap() const
+const uchar *QSymbianTypeFaceExtras::cmap() const
{
- if (!m_cmap) {
- m_cmapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p'));
+ if (m_cmapTable.isNull()) {
+ const QByteArray cmapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p'));
int size = 0;
- m_cmap = QFontEngineS60::getCMap(reinterpret_cast<const uchar *>(m_cmapTable.constData()), m_cmapTable.size(), &m_symbolCMap, &size);
+ const uchar *cmap = QFontEngine::getCMap(reinterpret_cast<const uchar *>
+ (cmapTable.constData()), cmapTable.size(), &m_symbolCMap, &size);
+ m_cmapTable = QByteArray(reinterpret_cast<const char *>(cmap), size);
}
- return m_cmap;
+ return reinterpret_cast<const uchar *>(m_cmapTable.constData());
}
CFont *QSymbianTypeFaceExtras::fontOwner() const
{
- return m_fontOwner;
+ return m_cFont;
}
-
// duplicated from qfontengine_xyz.cpp
static inline unsigned int getChar(const QChar *str, int &i, const int len)
{
@@ -225,6 +279,35 @@ void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla
}
}
+#ifdef Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+static bool parseGlyphPathData(const char *dataStr, const char *dataEnd, QPainterPath &path,
+ qreal fontPixelSize, const QPointF &offset, bool hinted);
+#endif //Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+
+void QFontEngineS60::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions,
+ int nglyphs, QPainterPath *path,
+ QTextItem::RenderFlags flags)
+{
+#ifdef Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+ Q_UNUSED(flags)
+ RGlyphOutlineIterator iterator;
+ const TInt error = iterator.Open(*m_activeFont, glyphs, nglyphs);
+ if (KErrNone != error)
+ return;
+ const qreal fontSizeInPixels = qreal(m_activeFont->HeightInPixels());
+ int count = 0;
+ do {
+ const TUint8* outlineUint8 = iterator.Outline();
+ const char* const outlineChar = reinterpret_cast<const char*>(outlineUint8);
+ const char* const outlineEnd = outlineChar + iterator.OutlineLength();
+ parseGlyphPathData(outlineChar, outlineEnd, *path, fontSizeInPixels,
+ positions[count++].toPointF(), false);
+ } while(KErrNone == iterator.Next() && count <= nglyphs);
+#else // Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+ QFontEngine::addGlyphsToPath(glyphs, positions, nglyphs, path, flags);
+#endif //Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+}
+
QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph)
{
TOpenFontCharMetrics metrics;
@@ -356,4 +439,69 @@ void QFontEngineS60::getCharacterData(glyph_t glyph, TOpenFontCharMetrics& metri
}
}
+#ifdef Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+static inline void skipSpacesAndComma(const char* &str, const char* const strEnd)
+{
+ while (str <= strEnd && (*str == ' ' || *str == ','))
+ ++str;
+}
+
+static bool parseGlyphPathData(const char *svgPath, const char *svgPathEnd, QPainterPath &path,
+ qreal fontPixelSize, const QPointF &offset, bool hinted)
+{
+ Q_UNUSED(hinted)
+ QPointF p1, p2, firstSubPathPoint;
+ qreal *elementValues[] =
+ {&p1.rx(), &p1.ry(), &p2.rx(), &p2.ry()};
+ const int unitsPerEm = 2048; // See: http://en.wikipedia.org/wiki/Em_%28typography%29
+ const qreal resizeFactor = fontPixelSize / unitsPerEm;
+
+ while (svgPath < svgPathEnd) {
+ skipSpacesAndComma(svgPath, svgPathEnd);
+ const char pathElem = *svgPath++;
+ skipSpacesAndComma(svgPath, svgPathEnd);
+
+ if (pathElem != 'Z') {
+ char *endStr = 0;
+ int elementValuesCount = 0;
+ for (int i = 0; i < 4; ++i) { // 4 = size of elementValues[]
+ qreal coordinateValue = strtod(svgPath, &endStr);
+ if (svgPath == endStr)
+ break;
+ if (i % 2) // Flip vertically
+ coordinateValue = -coordinateValue;
+ *elementValues[i] = coordinateValue * resizeFactor;
+ elementValuesCount++;
+ svgPath = endStr;
+ skipSpacesAndComma(svgPath, svgPathEnd);
+ }
+ p1 += offset;
+ if (elementValuesCount == 2)
+ p2 = firstSubPathPoint;
+ else
+ p2 += offset;
+ }
+
+ switch (pathElem) {
+ case 'M':
+ firstSubPathPoint = p1;
+ path.moveTo(p1);
+ break;
+ case 'Z':
+ path.closeSubpath();
+ break;
+ case 'L':
+ path.lineTo(p1);
+ break;
+ case 'Q':
+ path.quadTo(p1, p2);
+ break;
+ default:
+ return false;
+ }
+ }
+ return true;
+}
+#endif // Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+
QT_END_NAMESPACE
diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h
index 6883730..beeb4cc 100644
--- a/src/gui/text/qfontengine_s60_p.h
+++ b/src/gui/text/qfontengine_s60_p.h
@@ -58,6 +58,14 @@
#include "qsize.h"
#include <openfont.h>
+#ifdef SYMBIAN_GDI_GLYPHDATA
+#define Q_SYMBIAN_HAS_FONTTABLE_API
+#endif
+
+#ifdef Q_SYMBIAN_HAS_FONTTABLE_API
+#define Q_SYMBIAN_HAS_GLYPHOUTLINE_API
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API
+
class CFont;
QT_BEGIN_NAMESPACE
@@ -66,20 +74,22 @@ QT_BEGIN_NAMESPACE
class QSymbianTypeFaceExtras
{
public:
- QSymbianTypeFaceExtras(CFont* fontOwner, COpenFont *font);
+ QSymbianTypeFaceExtras(CFont* cFont, COpenFont *openFont = 0);
+ ~QSymbianTypeFaceExtras();
QByteArray getSfntTable(uint tag) const;
bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
- const unsigned char *cmap() const;
+ const uchar *cmap() const;
CFont *fontOwner() const;
private:
- COpenFont *m_font;
- mutable MOpenFontTrueTypeExtension *m_trueTypeExtension;
- mutable const unsigned char *m_cmap;
+ CFont* m_cFont;
mutable bool m_symbolCMap;
mutable QByteArray m_cmapTable;
- CFont* m_fontOwner;
+#ifndef Q_SYMBIAN_HAS_FONTTABLE_API
+ COpenFont *m_openFont;
+ mutable MOpenFontTrueTypeExtension *m_trueTypeExtension;
+#endif // Q_SYMBIAN_HAS_FONTTABLE_API
};
class QFontEngineS60 : public QFontEngine
@@ -91,6 +101,9 @@ public:
bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const;
+ void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
+ QPainterPath *path, QTextItem::RenderFlags flags);
+
QImage alphaMapForGlyph(glyph_t glyph);
glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 5163c94..d02e841 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -526,6 +526,14 @@ int QFontMetrics::rightBearing(QChar ch) const
*/
int QFontMetrics::width(const QString &text, int len) const
{
+ return width(text, len, 0);
+}
+
+/*!
+ \internal
+*/
+int QFontMetrics::width(const QString &text, int len, int flags) const
+{
int pos = text.indexOf(QLatin1Char('\x9c'));
if (pos != -1) {
len = (len < 0) ? pos : qMin(pos, len);
@@ -535,6 +543,23 @@ int QFontMetrics::width(const QString &text, int len) const
if (len == 0)
return 0;
+ if (flags & Qt::TextBypassShaping) {
+ // Skip harfbuzz complex shaping, only use advances
+ int numGlyphs = len;
+ QVarLengthGlyphLayoutArray glyphs(numGlyphs);
+ QFontEngine *engine = d->engineForScript(QUnicodeTables::Common);
+ if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, 0)) {
+ glyphs.resize(numGlyphs);
+ if (!engine->stringToCMap(text.data(), len, &glyphs, &numGlyphs, 0))
+ Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice");
+ }
+
+ QFixed width;
+ for (int i = 0; i < numGlyphs; ++i)
+ width += glyphs.advances_x[i];
+ return qRound(width);
+ }
+
QStackTextEngine layout(text, d.data());
layout.ignoreBidi = true;
return qRound(layout.width(0, len));
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index dca4b93..2518b54 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -89,6 +89,7 @@ public:
int leftBearing(QChar) const;
int rightBearing(QChar) const;
int width(const QString &, int len = -1) const;
+ int width(const QString &, int len, int flags) const;
int width(QChar) const;
int charWidth(const QString &str, int pos) const;
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 84c1d96..10870aa 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -115,10 +115,12 @@ QT_BEGIN_NAMESPACE
Qt::RichText.
If it's the first time the static text is drawn, or if the static text, or the painter's font
- or matrix have been altered since the last time it was drawn, the text's layout has to be
- recalculated. This will impose an overhead on the QPainter::drawStaticText() call where the
- relayout occurs. To avoid this overhead in the paint event, you can call prepare() ahead of
- time to ensure that the layout is calculated.
+ has been altered since the last time it was drawn, the text's layout has to be
+ recalculated. On some paint engines, changing the matrix of the painter will also cause the
+ layout to be recalculated. In particular, this will happen for any engine except for the
+ OpenGL2 paint engine. Recalculating the layout will impose an overhead on the
+ QPainter::drawStaticText() call where it occurs. To avoid this overhead in the paint event, you
+ can call prepare() ahead of time to ensure that the layout is calculated.
\sa QPainter::drawText(), QPainter::drawStaticText(), QTextLayout, QTextDocument
*/
@@ -188,8 +190,9 @@ void QStaticText::detach()
When drawStaticText() is called, the layout of the QStaticText will be recalculated if any part
of the QStaticText object has changed since the last time it was drawn. It will also be
- recalculated if the painter's font or matrix are not the same as when the QStaticText was last
- drawn.
+ recalculated if the painter's font is not the same as when the QStaticText was last drawn, or,
+ on any other paint engine than the OpenGL2 engine, if the painter's matrix has been altered
+ since the static text was last drawn.
To avoid the overhead of creating the layout the first time you draw the QStaticText after
making changes, you can use the prepare() function and pass in the \a matrix and \a font you
@@ -364,14 +367,16 @@ QSizeF QStaticText::size() const
QStaticTextPrivate::QStaticTextPrivate()
: textWidth(-1.0), items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0),
- needsRelayout(true), useBackendOptimizations(false), textFormat(Qt::AutoText)
+ needsRelayout(true), useBackendOptimizations(false), textFormat(Qt::AutoText),
+ untransformedCoordinates(false)
{
}
QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other)
: text(other.text), font(other.font), textWidth(other.textWidth), matrix(other.matrix),
items(0), itemCount(0), glyphPool(0), positionPool(0), charPool(0), needsRelayout(true),
- useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat)
+ useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat),
+ untransformedCoordinates(other.untransformedCoordinates)
{
}
@@ -396,8 +401,9 @@ namespace {
class DrawTextItemRecorder: public QPaintEngine
{
public:
- DrawTextItemRecorder(bool useBackendOptimizations, int numChars)
- : m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations)
+ DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations, int numChars)
+ : m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations),
+ m_untransformedCoordinates(untransformedCoordinates)
{
}
@@ -423,7 +429,7 @@ namespace {
if (m_dirtyPen)
currentItem.color = state->pen().color();
- QTransform matrix = state->transform();
+ QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform();
matrix.translate(position.x(), position.y());
QVarLengthArray<glyph_t> glyphs;
@@ -486,14 +492,17 @@ namespace {
bool m_dirtyPen;
bool m_useBackendOptimizations;
+ bool m_untransformedCoordinates;
};
class DrawTextItemDevice: public QPaintDevice
{
public:
- DrawTextItemDevice(bool useBackendOptimizations, int numChars)
+ DrawTextItemDevice(bool untransformedCoordinates, bool useBackendOptimizations,
+ int numChars)
{
- m_paintEngine = new DrawTextItemRecorder(useBackendOptimizations, numChars);
+ m_paintEngine = new DrawTextItemRecorder(untransformedCoordinates,
+ useBackendOptimizations, numChars);
}
~DrawTextItemDevice()
@@ -629,7 +638,7 @@ void QStaticTextPrivate::init()
position = QPointF(0, 0);
- DrawTextItemDevice device(useBackendOptimizations, text.size());
+ DrawTextItemDevice device(untransformedCoordinates, useBackendOptimizations, text.size());
{
QPainter painter(&device);
painter.setFont(font);
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 2ab5579..1a96291 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -148,9 +148,10 @@ public:
QFixedPoint *positionPool; // 4 bytes per text
QChar *charPool; // 4 bytes per text
- unsigned char needsRelayout : 1;
- unsigned char useBackendOptimizations : 1; // 1 byte per text
- unsigned char textFormat : 2;
+ unsigned char needsRelayout : 1; // 1 byte per text
+ unsigned char useBackendOptimizations : 1;
+ unsigned char textFormat : 2;
+ unsigned char untransformedCoordinates : 1;
// ================
// 167 bytes per text
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index c91df3c..d6ac3aa 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -64,7 +64,7 @@ enum {
QTextCursorPrivate::QTextCursorPrivate(QTextDocumentPrivate *p)
: priv(p), x(0), position(0), anchor(0), adjusted_anchor(0),
- currentCharFormat(-1), visualNavigation(false)
+ currentCharFormat(-1), visualNavigation(false), keepPositionOnInsert(false)
{
priv->addCursor(this);
}
@@ -79,6 +79,7 @@ QTextCursorPrivate::QTextCursorPrivate(const QTextCursorPrivate &rhs)
x = rhs.x;
currentCharFormat = rhs.currentCharFormat;
visualNavigation = rhs.visualNavigation;
+ keepPositionOnInsert = rhs.keepPositionOnInsert;
priv->addCursor(this);
}
@@ -95,7 +96,7 @@ QTextCursorPrivate::AdjustResult QTextCursorPrivate::adjustPosition(int position
if (position < positionOfChange
|| (position == positionOfChange
&& (op == QTextUndoCommand::KeepCursor
- || anchor < position)
+ || keepPositionOnInsert)
)
) {
result = CursorUnchanged;
@@ -1276,6 +1277,80 @@ void QTextCursor::setVisualNavigation(bool b)
d->visualNavigation = b;
}
+
+/*!
+ \since 4.7
+
+ Sets the visual x position for vertical cursor movements.
+
+ The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept
+ unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a
+ visually straight line with proportional fonts, and to gently "jump" over short lines.
+
+ A value of -1 indicates no predefined x position. It will then be set automatically the next time the
+ cursor moves up or down.
+
+ \sa verticalMovementX()
+ */
+void QTextCursor::setVerticalMovementX(int x)
+{
+ if (d)
+ d->x = x;
+}
+
+/*! \since 4.7
+
+ Returns the visual x position for vertical cursor movements.
+
+ A value of -1 indicates no predefined x position. It will then be set automatically the next time the
+ cursor moves up or down.
+
+ \sa setVerticalMovementX()
+ */
+int QTextCursor::verticalMovementX() const
+{
+ return d ? d->x : -1;
+}
+
+/*!
+ \since 4.7
+
+ Returns whether the cursor should keep its current position when text gets inserted at the position of the
+ cursor.
+
+ The default is false;
+
+ \sa setKeepPositionOnInsert()
+ */
+bool QTextCursor::keepPositionOnInsert() const
+{
+ return d ? d->keepPositionOnInsert : false;
+}
+
+/*!
+ \since 4.7
+
+ Defines whether the cursor should keep its current position when text gets inserted at the current position of the
+ cursor.
+
+ If \b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
+ If \b is false, the cursor moves along with the inserted text.
+
+ The default is false.
+
+ Note that a cursor always moves when text is inserted before the current position of the cursor, and it
+ always keeps its position when text is inserted after the current position of the cursor.
+
+ \sa keepPositionOnInsert()
+ */
+void QTextCursor::setKeepPositionOnInsert(bool b)
+{
+ if (d)
+ d->keepPositionOnInsert = b;
+}
+
+
+
/*!
Inserts \a text at the current position, using the current
character format.
@@ -1408,16 +1483,16 @@ void QTextCursor::deletePreviousChar()
{
if (!d || !d->priv)
return;
-
+
if (d->position != d->anchor) {
removeSelectedText();
return;
}
-
+
if (d->anchor < 1 || !d->canDelete(d->anchor-1))
return;
d->anchor--;
-
+
QTextDocumentPrivate::FragmentIterator fragIt = d->priv->find(d->anchor);
const QTextFragmentData * const frag = fragIt.value();
int fpos = fragIt.position();
@@ -1429,7 +1504,7 @@ void QTextCursor::deletePreviousChar()
if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00)
--d->anchor;
}
-
+
d->adjusted_anchor = d->anchor;
d->remove();
d->setX();
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index 3e968a3..251cb33 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -132,6 +132,12 @@ public:
bool visualNavigation() const;
void setVisualNavigation(bool b);
+ void setVerticalMovementX(int x);
+ int verticalMovementX() const;
+
+ void setKeepPositionOnInsert(bool b);
+ bool keepPositionOnInsert() const;
+
void deleteChar();
void deletePreviousChar();
diff --git a/src/gui/text/qtextcursor_p.h b/src/gui/text/qtextcursor_p.h
index 1bdfa78..4e36b95 100644
--- a/src/gui/text/qtextcursor_p.h
+++ b/src/gui/text/qtextcursor_p.h
@@ -112,7 +112,8 @@ public:
int anchor;
int adjusted_anchor;
int currentCharFormat;
- bool visualNavigation;
+ uint visualNavigation : 1;
+ uint keepPositionOnInsert : 1;
};
QT_END_NAMESPACE
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index f12bf0b..eeb66ce 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -79,7 +79,7 @@ Q_GUI_EXPORT extern int qt_defaultDpi();
// ################ should probably add frameFormatChange notification!
-struct QLayoutStruct;
+struct QTextLayoutStruct;
class QTextFrameData : public QTextFrameLayoutData
{
@@ -109,7 +109,7 @@ public:
QFixed minimumWidth;
QFixed maximumWidth;
- QLayoutStruct *currentLayoutStruct;
+ QTextLayoutStruct *currentLayoutStruct;
bool sizeDirty;
bool layoutDirty;
@@ -123,8 +123,8 @@ QTextFrameData::QTextFrameData()
{
}
-struct QLayoutStruct {
- QLayoutStruct() : maximumWidth(QFIXED_MAX), fullLayout(false)
+struct QTextLayoutStruct {
+ QTextLayoutStruct() : maximumWidth(QFIXED_MAX), fullLayout(false)
{}
QTextFrame *frame;
QFixed x_left;
@@ -477,9 +477,9 @@ public:
HitPoint hitTest(QTextTable *table, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
HitPoint hitTest(QTextBlock bl, const QFixedPoint &point, int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const;
- QLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,
- int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY,
- bool withPageBreaks);
+ QTextLayoutStruct layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,
+ int layoutFrom, int layoutTo, QTextTableData *tableData, QFixed absoluteTableY,
+ bool withPageBreaks);
void setCellPosition(QTextTable *t, const QTextTableCell &cell, const QPointF &pos);
QRectF layoutTable(QTextTable *t, int layoutFrom, int layoutTo, QFixed parentY);
@@ -490,13 +490,13 @@ public:
QRectF layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed frameWidth, QFixed frameHeight, QFixed parentY = 0);
void layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat,
- QLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat);
- void layoutFlow(QTextFrame::Iterator it, QLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, QFixed width = 0);
- void pageBreakInsideTable(QTextTable *table, QLayoutStruct *layoutStruct);
+ QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat);
+ void layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, QFixed width = 0);
+ void pageBreakInsideTable(QTextTable *table, QTextLayoutStruct *layoutStruct);
- void floatMargins(const QFixed &y, const QLayoutStruct *layoutStruct, QFixed *left, QFixed *right) const;
- QFixed findY(QFixed yFrom, const QLayoutStruct *layoutStruct, QFixed requiredWidth) const;
+ void floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct, QFixed *left, QFixed *right) const;
+ QFixed findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const;
QVector<QCheckPoint> checkPoints;
@@ -1487,12 +1487,12 @@ static QFixed firstChildPos(const QTextFrame *f)
return flowPosition(f->begin());
}
-QLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,
- int layoutFrom, int layoutTo, QTextTableData *td,
- QFixed absoluteTableY, bool withPageBreaks)
+QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QTextTableCell &cell, QFixed width,
+ int layoutFrom, int layoutTo, QTextTableData *td,
+ QFixed absoluteTableY, bool withPageBreaks)
{
LDEBUG << "layoutCell";
- QLayoutStruct layoutStruct;
+ QTextLayoutStruct layoutStruct;
layoutStruct.frame = t;
layoutStruct.minimumWidth = 0;
layoutStruct.maximumWidth = QFIXED_MAX;
@@ -1641,9 +1641,9 @@ recalc_minmax_widths:
// to figure out the min and the max width lay out the cell at
// maximum width. otherwise the maxwidth calculation sometimes
// returns wrong values
- QLayoutStruct layoutStruct = layoutCell(table, cell, QFIXED_MAX, layoutFrom,
- layoutTo, td, absoluteTableY,
- /*withPageBreaks =*/false);
+ QTextLayoutStruct layoutStruct = layoutCell(table, cell, QFIXED_MAX, layoutFrom,
+ layoutTo, td, absoluteTableY,
+ /*withPageBreaks =*/false);
// distribute the minimum width over all columns the cell spans
QFixed widthToDistribute = layoutStruct.minimumWidth + widthPadding;
@@ -1868,10 +1868,10 @@ relayout:
++rowCellCount;
const QFixed width = td->cellWidth(c, cspan) - widthPadding;
- QLayoutStruct layoutStruct = layoutCell(table, cell, width,
- layoutFrom, layoutTo,
- td, absoluteTableY,
- /*withPageBreaks =*/true);
+ QTextLayoutStruct layoutStruct = layoutCell(table, cell, width,
+ layoutFrom, layoutTo,
+ td, absoluteTableY,
+ /*withPageBreaks =*/true);
const QFixed height = layoutStruct.y + bottomPadding + topPadding;
@@ -1976,7 +1976,7 @@ void QTextDocumentLayoutPrivate::positionFloat(QTextFrame *frame, QTextLine *cur
QTextFrameData *pd = data(parent);
Q_ASSERT(pd && pd->currentLayoutStruct);
- QLayoutStruct *layoutStruct = pd->currentLayoutStruct;
+ QTextLayoutStruct *layoutStruct = pd->currentLayoutStruct;
if (!pd->floats.contains(frame))
pd->floats.append(frame);
@@ -2116,7 +2116,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
// function.
fd->contentsWidth = newContentsWidth;
- QLayoutStruct layoutStruct;
+ QTextLayoutStruct layoutStruct;
layoutStruct.frame = f;
layoutStruct.x_left = fd->leftMargin + fd->border + fd->padding;
layoutStruct.x_right = layoutStruct.x_left + newContentsWidth;
@@ -2179,7 +2179,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
return layoutStruct.updateRect;
}
-void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QLayoutStruct *layoutStruct,
+void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct,
int layoutFrom, int layoutTo, QFixed width)
{
LDEBUG << "layoutFlow from=" << layoutFrom << "to=" << layoutTo;
@@ -2509,7 +2509,7 @@ void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QLayoutStru
}
void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosition, const QTextBlockFormat &blockFormat,
- QLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat)
+ QTextLayoutStruct *layoutStruct, int layoutFrom, int layoutTo, const QTextBlockFormat *previousBlockFormat)
{
Q_Q(QTextDocumentLayout);
@@ -2718,7 +2718,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
}
}
-void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QLayoutStruct *layoutStruct,
+void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct,
QFixed *left, QFixed *right) const
{
// qDebug() << "floatMargins y=" << y;
@@ -2740,7 +2740,7 @@ void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QLayoutStru
// qDebug() << "floatMargins: left="<<*left<<"right="<<*right<<"y="<<y;
}
-QFixed QTextDocumentLayoutPrivate::findY(QFixed yFrom, const QLayoutStruct *layoutStruct, QFixed requiredWidth) const
+QFixed QTextDocumentLayoutPrivate::findY(QFixed yFrom, const QTextLayoutStruct *layoutStruct, QFixed requiredWidth) const
{
QFixed right, left;
requiredWidth = qMin(requiredWidth, layoutStruct->x_right - layoutStruct->x_left);
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index dc099fc..b25795e 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -885,7 +885,7 @@ void QTextEngine::shapeText(int item) const
QFixed letterSpacing = font.d->letterSpacing;
QFixed wordSpacing = font.d->wordSpacing;
- if (letterSpacingIsAbsolute)
+ if (letterSpacingIsAbsolute && letterSpacing.value())
letterSpacing *= font.d->dpi / qt_defaultDpiY();
if (letterSpacing != 0) {
@@ -2653,6 +2653,12 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
flags |= QTextItem::StrikeOut;
}
+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe)
+ : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline),
+ num_chars(0), chars(0), logClusters(0), f(font), fontEngine(fe), glyphs(g)
+{
+}
+
QTextItemInt QTextItemInt::midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const
{
QTextItemInt ti = *this;
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index d92148f..00b1392 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -311,6 +311,7 @@ public:
logClusters(0), f(0), fontEngine(0)
{}
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
+ QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe);
/// copy the structure items, adjusting the glyphs arrays to the right subarrays.
/// the width of the returned QTextItemInt is not adjusted, for speed reasons
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 412c909..f3aabc1 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -89,9 +89,9 @@ static QFixed alignLine(QTextEngine *eng, const QScriptLine &line)
if (align & Qt::AlignJustify && eng->option.textDirection() == Qt::RightToLeft)
align = Qt::AlignRight;
if (align & Qt::AlignRight)
- x = line.width - (line.textWidth + leadingSpaceWidth(eng, line));
+ x = line.width - (line.textAdvance + leadingSpaceWidth(eng, line));
else if (align & Qt::AlignHCenter)
- x = (line.width - line.textWidth)/2;
+ x = (line.width - line.textAdvance)/2;
}
return x;
}
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 8cffebd..30ce23b 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -295,8 +295,10 @@ void QAbstractScrollAreaPrivate::init()
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren();
#ifndef Q_WS_MAC
+#ifndef QT_NO_GESTURES
viewport->grabGesture(Qt::PanGesture);
#endif
+#endif
}
#ifdef Q_WS_WIN
@@ -546,8 +548,10 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->setFocusProxy(this);
d->viewport->installEventFilter(d->viewportFilter.data());
#ifndef Q_WS_MAC
+#ifndef QT_NO_GESTURES
d->viewport->grabGesture(Qt::PanGesture);
#endif
+#endif
d->layoutChildren();
if (isVisible())
d->viewport->show();
@@ -960,6 +964,7 @@ bool QAbstractScrollArea::event(QEvent *e)
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
return false;
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
{
QGestureEvent *ge = static_cast<QGestureEvent *>(e);
@@ -980,6 +985,7 @@ bool QAbstractScrollArea::event(QEvent *e)
}
return false;
}
+#endif // QT_NO_GESTURES
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
case QEvent::ApplicationLayoutDirectionChange:
@@ -1036,9 +1042,11 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e)
#endif
return QFrame::event(e);
case QEvent::LayoutRequest:
+#ifndef QT_NO_GESTURES
case QEvent::Gesture:
case QEvent::GestureOverride:
return event(e);
+#endif
default:
break;
}
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index 2734fba..21c2635 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -1476,6 +1476,7 @@ bool QPlainTextEdit::event(QEvent *e)
d->sendControlEvent(e);
}
#endif
+#ifndef QT_NO_GESTURES
else if (e->type() == QEvent::Gesture) {
QGestureEvent *ge = static_cast<QGestureEvent *>(e);
QPanGesture *g = static_cast<QPanGesture *>(ge->gesture(Qt::PanGesture));
@@ -1499,6 +1500,7 @@ bool QPlainTextEdit::event(QEvent *e)
}
return true;
}
+#endif // QT_NO_GESTURES
return QAbstractScrollArea::event(e);
}
diff --git a/src/gui/widgets/qprogressbar.h b/src/gui/widgets/qprogressbar.h
index b461a21..58bc8b2 100644
--- a/src/gui/widgets/qprogressbar.h
+++ b/src/gui/widgets/qprogressbar.h
@@ -93,9 +93,11 @@ public:
Qt::Orientation orientation() const;
void setInvertedAppearance(bool invert);
- bool invertedAppearance();
+ bool invertedAppearance(); //### Qt5 make const
+ bool invertedAppearance() const { return const_cast<QProgressBar *>(this)->invertedAppearance(); }
void setTextDirection(QProgressBar::Direction textDirection);
- QProgressBar::Direction textDirection();
+ QProgressBar::Direction textDirection(); //### Qt5 make const
+ QProgressBar::Direction textDirection() const { return const_cast<QProgressBar *>(this)->textDirection(); }
void setFormat(const QString &format);
QString format() const;
diff --git a/src/gui/widgets/qstackedwidget.cpp b/src/gui/widgets/qstackedwidget.cpp
index 6c4061c..57b43b5 100644
--- a/src/gui/widgets/qstackedwidget.cpp
+++ b/src/gui/widgets/qstackedwidget.cpp
@@ -228,11 +228,11 @@ int QStackedWidget::insertWidget(int index, QWidget *widget)
}
/*!
- Removes the given \a widget from the QStackedWidget.
+ Removes \a widget from the QStackedWidget. i.e., \a widget is \e
+ not deleted but simply removed from the stacked layout, causing it
+ to be hidden.
- \bold{Note:} The ownership of \a widget remains the same.
- The widget is \e not deleted, but simply removed from the widget's
- stacked layout, causing it to be hidden.
+ \bold{Note:} Ownership of \a widget reverts to the application.
\sa addWidget(), insertWidget(), currentWidget()
*/
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
index 11f2392..1fc23ca 100644
--- a/src/imports/gestures/plugin.cpp
+++ b/src/imports/gestures/plugin.cpp
@@ -53,7 +53,9 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures"));
+#ifndef QT_NO_GESTURES
qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
+#endif
}
};
@@ -62,4 +64,3 @@ QT_END_NAMESPACE
#include "plugin.moc"
Q_EXPORT_PLUGIN2(qmlgesturesplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
-
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 1b0aeeb..22be2f1 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -55,6 +55,8 @@
#include <private/qobject_p.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QDeclarativeGestureAreaPrivate : public QDeclarativeItemPrivate
@@ -267,3 +269,5 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
}
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h
index 0195511..ff89166 100644
--- a/src/imports/gestures/qdeclarativegesturearea_p.h
+++ b/src/imports/gestures/qdeclarativegesturearea_p.h
@@ -50,6 +50,8 @@
#include <QtCore/qstring.h>
#include <QtGui/qgesture.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -97,4 +99,6 @@ QML_DECLARE_TYPE(QDeclarativeGestureArea)
QT_END_HEADER
+#endif // QT_NO_GESTURES
+
#endif
diff --git a/src/imports/webkit/qdeclarativewebview.cpp b/src/imports/webkit/qdeclarativewebview.cpp
index 050e2b7..9e5647f 100644
--- a/src/imports/webkit/qdeclarativewebview.cpp
+++ b/src/imports/webkit/qdeclarativewebview.cpp
@@ -711,7 +711,7 @@ bool QDeclarativeWebView::sceneEvent(QEvent *event)
return QDeclarativeItem::sceneEvent(event);
}
-
+#ifndef QT_NO_ACTION
/*!
\qmlproperty action WebView::back
This property holds the action for causing the previous URL in the history to be displayed.
@@ -747,6 +747,7 @@ QAction *QDeclarativeWebView::stopAction() const
{
return page()->action(QWebPage::Stop);
}
+#endif // QT_NO_ACTION
/*!
\qmlproperty real WebView::title
diff --git a/src/imports/webkit/qdeclarativewebview_p.h b/src/imports/webkit/qdeclarativewebview_p.h
index 87bd938..042237e 100644
--- a/src/imports/webkit/qdeclarativewebview_p.h
+++ b/src/imports/webkit/qdeclarativewebview_p.h
@@ -108,10 +108,12 @@ class QDeclarativeWebView : public QDeclarativeItem
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+#ifndef QT_NO_ACTION
Q_PROPERTY(QAction* reload READ reloadAction CONSTANT)
Q_PROPERTY(QAction* back READ backAction CONSTANT)
Q_PROPERTY(QAction* forward READ forwardAction CONSTANT)
Q_PROPERTY(QAction* stop READ stopAction CONSTANT)
+#endif
Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT)
@@ -154,10 +156,12 @@ public:
qreal progress() const;
QString statusText() const;
+#ifndef QT_NO_ACTION
QAction *reloadAction() const;
QAction *backAction() const;
QAction *forwardAction() const;
QAction *stopAction() const;
+#endif
QWebPage *page() const;
void setPage(QWebPage *page);
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index f7ada8c..80b74c7 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -464,6 +464,15 @@ QNetworkAccessManager::~QNetworkAccessManager()
#ifndef QT_NO_NETWORKPROXY
delete d_func()->proxyFactory;
#endif
+
+ // Delete the QNetworkReply children first.
+ // Else a QAbstractNetworkCache might get deleted in ~QObject
+ // before a QNetworkReply that accesses the QAbstractNetworkCache
+ // object in its destructor.
+ qDeleteAll(findChildren<QNetworkReply *>());
+ // The other children will be deleted in this ~QObject
+ // FIXME instead of this "hack" make the QNetworkReplyImpl
+ // properly watch the cache deletion, e.g. via a QWeakPointer.
}
#ifndef QT_NO_NETWORKPROXY
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 865d338..d1bdd57 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -991,6 +991,8 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
}
QString normalizedDomain = QUrl::fromAce(QUrl::toAce(QString::fromUtf8(rawDomain)));
+ if (normalizedDomain.isEmpty() && !rawDomain.isEmpty())
+ return result;
cookie.setDomain(maybeLeadingDot + normalizedDomain);
} else if (field.first == "max-age") {
bool ok = false;
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 471927a..5d4274f 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -483,8 +483,10 @@ void QNetworkConfigurationManagerPrivate::pollEngines()
QMutexLocker locker(&mutex);
for (int i = 0; i < sessionEngines.count(); ++i) {
- if ((forcedPolling && sessionEngines.at(i)->requiresPolling()) ||
- sessionEngines.at(i)->configurationsInUse()) {
+ if (!sessionEngines.at(i)->requiresPolling())
+ continue;
+
+ if (forcedPolling || sessionEngines.at(i)->configurationsInUse()) {
pollingEngines.insert(i);
QMetaObject::invokeMethod(sessionEngines.at(i), "requestUpdate");
}
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index fd647e2..31c5ed1 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -259,13 +259,28 @@ QByteArray QSslCertificate::version() const
/*!
Returns the certificate's serial number string in decimal format.
+ In case the serial number cannot be converted to decimal format
+ (i.e. if it is bigger than 4294967295, which means it does not fit into 4 bytes),
+ its hexadecimal version is returned.
*/
QByteArray QSslCertificate::serialNumber() const
{
- if (d->serialNumberString.isEmpty() && d->x509)
- d->serialNumberString =
- QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->serialNumber)));
-
+ if (d->serialNumberString.isEmpty() && d->x509) {
+ ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
+ // if we cannot convert to a long, just output the hexadecimal number
+ if (serialNumber->length > 4) {
+ QByteArray hexString;
+ hexString.reserve(serialNumber->length * 3);
+ for (int a = 0; a < serialNumber->length; ++a) {
+ hexString += QByteArray::number(serialNumber->data[a], 16).rightJustified(2, '0');
+ hexString += ':';
+ }
+ hexString.chop(1);
+ d->serialNumberString = hexString;
+ } else {
+ d->serialNumberString = QByteArray::number(qlonglong(q_ASN1_INTEGER_get(serialNumber)));
+ }
+ }
return d->serialNumberString;
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 5758b25..ee49a3d 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1333,8 +1333,16 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
QFontEngineGlyphCache::Type glyphType = textItem->fontEngine->glyphFormat >= 0
? QFontEngineGlyphCache::Type(textItem->fontEngine->glyphFormat)
: d->glyphCacheType;
+ if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
+ if (d->device->alphaRequested() || state()->matrix.type() > QTransform::TxTranslate
+ || (state()->composition_mode != QPainter::CompositionMode_Source
+ && state()->composition_mode != QPainter::CompositionMode_SourceOver))
+ {
+ glyphType = QFontEngineGlyphCache::Raster_A8;
+ }
+ }
- d->drawCachedGlyphs(glyphType, textItem, true);
+ d->drawCachedGlyphs(glyphType, textItem);
}
bool QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src)
@@ -1408,7 +1416,7 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
staticTextItem.numGlyphs = glyphs.size();
staticTextItem.glyphPositions = positions.data();
- d->drawCachedGlyphs(glyphType, &staticTextItem, false);
+ d->drawCachedGlyphs(glyphType, &staticTextItem);
}
return;
}
@@ -1439,21 +1447,16 @@ namespace {
// #define QT_OPENGL_DRAWCACHEDGLYPHS_INDEX_ARRAY_VBO
void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType,
- QStaticTextItem *staticTextItem,
- bool includeMatrixInCache)
+ QStaticTextItem *staticTextItem)
{
Q_Q(QGL2PaintEngineEx);
QOpenGL2PaintEngineState *s = q->state();
QGLTextureGlyphCache *cache =
- (QGLTextureGlyphCache *) staticTextItem->fontEngine->glyphCache(ctx, glyphType,
- includeMatrixInCache
- ? s->matrix
- : QTransform());
+ (QGLTextureGlyphCache *) staticTextItem->fontEngine->glyphCache(ctx, glyphType, QTransform());
if (!cache || cache->cacheType() != glyphType) {
- cache = new QGLTextureGlyphCache(ctx, glyphType,
- includeMatrixInCache ? s->matrix : QTransform());
+ cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform());
staticTextItem->fontEngine->setGlyphCache(ctx, cache);
}
@@ -1561,13 +1564,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
QBrush pensBrush = q->state()->pen.brush();
setBrush(pensBrush);
- // When painting a QStaticTextItem, the glyph positions are already in device coordinates,
- // therefore we temporarily set an identity matrix on the painter for the draw call to
- // avoid transforming the positions twice.
- QTransform old = s->matrix;
- if (includeMatrixInCache)
- s->matrix = QTransform();
-
if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
// Subpixel antialiasing without gamma correction
@@ -1664,9 +1660,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
#else
glDrawElements(GL_TRIANGLE_STRIP, 6 * staticTextItem->numGlyphs, GL_UNSIGNED_SHORT, elementIndices.data());
#endif
-
- if (includeMatrixInCache)
- s->matrix = old;
}
void QGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 0a046dc..59b90d8 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -202,8 +202,7 @@ public:
void drawTexture(const QGLRect& dest, const QGLRect& src, const QSize &textureSize, bool opaque, bool pattern = false);
void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
QPainter::PixmapFragmentHints hints);
- void drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType, QStaticTextItem *staticTextItem,
- bool includeMatrixInCache);
+ void drawCachedGlyphs(QFontEngineGlyphCache::Type glyphType, QStaticTextItem *staticTextItem);
// Calls glVertexAttributePointer if the pointer has changed
inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer);
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 410cf21..5371c5e 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -276,6 +276,11 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
}
}
+int QGLTextureGlyphCache::glyphMargin() const
+{
+ return 1;
+}
+
int QGLTextureGlyphCache::glyphPadding() const
{
return 1;
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 6bcd655..84e9021 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -72,6 +72,7 @@ public:
virtual void createTextureData(int width, int height);
virtual void resizeTextureData(int width, int height);
virtual void fillTexture(const Coord &c, glyph_t glyph);
+ virtual int glyphMargin() const;
virtual int glyphPadding() const;
inline GLuint texture() const { return m_texture; }
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index c8502c2..5c5d3d1 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1256,6 +1256,8 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
QGLFormat::OpenGL_Version_2_1 |
QGLFormat::OpenGL_Version_3_0;
switch (versionString[2].toAscii()) {
+ case '3':
+ versionFlags |= QGLFormat::OpenGL_Version_3_3;
case '2':
versionFlags |= QGLFormat::OpenGL_Version_3_2;
case '1':
@@ -1264,9 +1266,23 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
break;
default:
versionFlags |= QGLFormat::OpenGL_Version_3_1 |
- QGLFormat::OpenGL_Version_3_2;
+ QGLFormat::OpenGL_Version_3_2 |
+ QGLFormat::OpenGL_Version_3_3;
break;
}
+ } else if (versionString.startsWith(QLatin1String("4."))) {
+ versionFlags |= QGLFormat::OpenGL_Version_1_1 |
+ QGLFormat::OpenGL_Version_1_2 |
+ QGLFormat::OpenGL_Version_1_3 |
+ QGLFormat::OpenGL_Version_1_4 |
+ QGLFormat::OpenGL_Version_1_5 |
+ QGLFormat::OpenGL_Version_2_0 |
+ QGLFormat::OpenGL_Version_2_1 |
+ QGLFormat::OpenGL_Version_3_0 |
+ QGLFormat::OpenGL_Version_3_1 |
+ QGLFormat::OpenGL_Version_3_2 |
+ QGLFormat::OpenGL_Version_3_3 |
+ QGLFormat::OpenGL_Version_4_0;
} else {
versionFlags |= QGLFormat::OpenGL_Version_1_1 |
QGLFormat::OpenGL_Version_1_2 |
@@ -1277,7 +1293,9 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co
QGLFormat::OpenGL_Version_2_1 |
QGLFormat::OpenGL_Version_3_0 |
QGLFormat::OpenGL_Version_3_1 |
- QGLFormat::OpenGL_Version_3_2;
+ QGLFormat::OpenGL_Version_3_2 |
+ QGLFormat::OpenGL_Version_3_3 |
+ QGLFormat::OpenGL_Version_4_0;
}
}
return versionFlags;
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index f297009..f0b36f7 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -266,7 +266,9 @@ public:
OpenGL_ES_Version_2_0 = 0x00000800,
OpenGL_Version_3_0 = 0x00001000,
OpenGL_Version_3_1 = 0x00002000,
- OpenGL_Version_3_2 = 0x00004000
+ OpenGL_Version_3_2 = 0x00004000,
+ OpenGL_Version_3_3 = 0x00008000,
+ OpenGL_Version_4_0 = 0x00010000
};
Q_DECLARE_FLAGS(OpenGLVersionFlags, OpenGLVersionFlag)
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index d203646..9491f14 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1773,6 +1773,9 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmap *pixmap, cons
glXBindTexImageEXT(x11Info.display(), (GLXPixmap)pixmapData->gl_surface, GLX_FRONT_LEFT_EXT, 0);
glBindTexture(GL_TEXTURE_2D, textureId);
+ GLuint filtering = (options & QGLContext::LinearFilteringBindOption) ? GL_LINEAR : GL_NEAREST;
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
if (!((hasAlpha && RGBAConfigInverted) || (!hasAlpha && RGBConfigInverted)))
options &= ~QGLContext::InvertedYBindOption;
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 890b029..deffc20 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -1024,6 +1024,36 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const
}
/*!
+ \fn bool QGLFramebufferObject::bindDefault()
+ \internal
+
+ Switches rendering back to the default, windowing system provided
+ framebuffer.
+ Returns true upon success, false otherwise.
+
+ \sa bind(), release()
+*/
+bool QGLFramebufferObject::bindDefault()
+{
+ QGLContext *ctx = const_cast<QGLContext *>(QGLContext::currentContext());
+
+ if (ctx) {
+ bool ext_detected = (QGLExtensions::glExtensions() & QGLExtensions::FramebufferObject);
+ if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(ctx)))
+ return false;
+
+ ctx->d_ptr->current_fbo = ctx->d_ptr->default_fbo;
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->default_fbo);
+#ifdef QT_DEBUG
+ } else {
+ qWarning("QGLFramebufferObject::bindDefault() called without current context.");
+#endif
+ }
+
+ return ctx != 0;
+}
+
+/*!
\fn bool QGLFramebufferObject::hasOpenGLFramebufferObjects()
Returns true if the OpenGL \c{GL_EXT_framebuffer_object} extension
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index 306b6ff..6ff6645 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -108,6 +108,8 @@ public:
QPaintEngine *paintEngine() const;
GLuint handle() const;
+ static bool bindDefault();
+
static bool hasOpenGLFramebufferObjects();
void drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget = GL_TEXTURE_2D);
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 76a605a..4b22d5e 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -1622,11 +1622,48 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
QRectF rect(points[0], points[1], points[2] - points[0],
points[5] - points[1]);
clip(rect.toRect(), op);
- } else {
- // The best we can do is clip to the bounding rectangle
- // of all control points.
- clip(path.controlPointRect().toRect(), op);
+ return;
+ }
+
+ // Try converting the path into a QRegion that tightly follows
+ // the outline of the path we want to clip with.
+ QRegion region(path.convertToPainterPath().toFillPolygon(QTransform()).toPolygon());
+ switch (op) {
+ case Qt::NoClip:
+ {
+ region = defaultClipRegion();
+ }
+ break;
+
+ case Qt::ReplaceClip:
+ {
+ region = d->transform.map(region);
+ }
+ break;
+
+ case Qt::IntersectClip:
+ {
+ region = s->clipRegion.intersect(d->transform.map(region));
+ }
+ break;
+
+ case Qt::UniteClip:
+ {
+ region = s->clipRegion.unite(d->transform.map(region));
+ }
+ break;
}
+ if (region.numRects() <= d->maxScissorRects) {
+ // We haven't reached the maximum scissor count yet, so we can
+ // still make use of this region.
+ s->clipRegion = region;
+ updateScissor();
+ return;
+ }
+
+ // The best we can do is clip to the bounding rectangle
+ // of all control points.
+ clip(path.controlPointRect().toRect(), op);
}
void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 8c26cf0..ab1ba28 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -389,9 +389,9 @@ void SymbianEngine::updateConfigurationsL()
QNetworkConfigurationPrivatePointer ptr(cpPriv);
accessPointConfigurations.insert(ident, ptr);
- locker.unlock();
+ mutex.unlock();
emit configurationAdded(ptr);
- locker.relock();
+ mutex.lock();
} else {
delete cpPriv;
}
diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri
index 1a6f4a2..4e15102 100644
--- a/src/plugins/s60/s60pluginbase.pri
+++ b/src/plugins/s60/s60pluginbase.pri
@@ -8,11 +8,16 @@ QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/s60
MMP_RULES += NOEXPORTLIBRARY
-defBlock = \
- "$${LITERAL_HASH}ifdef WINSCW" \
- "DEFFILE ../bwins/qts60plugin.def" \
- "$${LITERAL_HASH}else" \
- "DEFFILE ../eabi/qts60plugin.def" \
- "$${LITERAL_HASH}endif"
+symbian-abld|symbian-sbsv2 {
+ defBlock = \
+ "$${LITERAL_HASH}ifdef WINSCW" \
+ "DEFFILE ../bwins/qts60plugin.def" \
+ "$${LITERAL_HASH}else" \
+ "DEFFILE ../eabi/qts60plugin.def" \
+ "$${LITERAL_HASH}endif"
+} else {
+ CONFIG *= def_files
+ DEF_FILE = ../eabi/qts60pluginu.def
+}
MMP_RULES += defBlock \ No newline at end of file
diff --git a/src/qbase.pri b/src/qbase.pri
index 9c4732e..d2137d0 100644
--- a/src/qbase.pri
+++ b/src/qbase.pri
@@ -1,4 +1,4 @@
-isEmpty(TARGET):error(You must set TARGET before include()'ing $${_FILE_})
+isEmpty(TARGET):error("You must set TARGET before include()'ing $${_FILE_}")
INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat
!isEmpty(RCC_DIR): INCLUDEPATH += $$RCC_DIR
isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index ec019e2..f43f344 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -74,6 +74,21 @@ data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resou
// iconengines stubs
data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+// qml import plugins
+file=ABI_DIR\BUILD_DIR\qmlwebkitplugin.dll SHARED_LIB_DIR\qmlwebkitplugin.dll
+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\org\webkit\qmlwebkitplugin.qtplugin resource\qt\imports\org\webkit\qmlwebkitplugin.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=\epoc32\data\z\resource\qt\imports\org\webkit\qmldir resource\qt\imports\org\webkit\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
// QtMultimedia audio backend
data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio\qaudio.qtplugin
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 90c362b..d3d9eed 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -11,21 +11,24 @@ symbian: {
isEmpty(QT_LIBINFIX) {
TARGET.UID3 = 0x2001E61C
-
- # sqlite3 is expected to be already found on phone if infixed configuration is built.
- BLD_INF_RULES.prj_exports += \
- "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
- "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
- symbian-abld|symbian-sbsv2 {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
- } else {
- sqlitedeployment = \
- "; Deploy sqlite onto phone that does not have it already" \
- "@\"$${PWD}/sqlite3.sis\", (0x2002af5f)"
+
+ # Sqlite3 is expected to be already found on phone if infixed configuration is built.
+ # It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll.
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ BLD_INF_RULES.prj_exports += \
+ "sqlite3.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis" \
+ "sqlite3_selfsigned.sis $${EPOCROOT}epoc32/data/qt/sis/sqlite3_selfsigned.sis"
+ symbian-abld|symbian-sbsv2 {
+ sqlitedeployment = \
+ "; Deploy sqlite onto phone that does not have it already" \
+ "@\"$${EPOCROOT}epoc32/data/qt/sis/sqlite3.sis\", (0x2002af5f)"
+ } else {
+ sqlitedeployment = \
+ "; Deploy sqlite onto phone that does not have it already" \
+ "@\"$${PWD}/sqlite3.sis\", (0x2002af5f)"
+ }
+ qtlibraries.pkg_postrules += sqlitedeployment
}
- qtlibraries.pkg_postrules += sqlitedeployment
} else {
# Always use experimental UID for infixed configuration to avoid UID clash
TARGET.UID3 = 0xE001E61C
@@ -81,12 +84,16 @@ symbian: {
qtlibraries.pkg_prerules = vendorinfo
qtlibraries.pkg_prerules += "; Dependencies of Qt libraries"
- qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
- contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
- }
- contains(CONFIG, stl) {
- qtlibraries.pkg_prerules += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
+
+ # It is expected that Symbian^3 and newer phones will have sufficiently new OpenC already installed
+ contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
+ qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}"
+ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
+ qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}"
+ }
+ contains(CONFIG, stl) {
+ qtlibraries.pkg_prerules += "(0x2000F866), 1, 0, 0, {\"Standard C++ Library Common\"}"
+ }
}
qtlibraries.pkg_prerules += "(0x2002af5f), 0, 5, 0, {\"sqlite3\"}"
@@ -143,12 +150,39 @@ symbian: {
contains(QT_CONFIG, declarative): {
qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtDeclarative$${QT_LIBINFIX}.dll
+
+ folderlistmodelImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/folderlistmodel/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll
+ gesturesImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/gestures/qmlgesturesplugin$${QT_LIBINFIX}.dll
+ particlesImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/particles/qmlparticlesplugin$${QT_LIBINFIX}.dll
+
+ folderlistmodelImport.sources += $$QT_SOURCE_TREE/src/imports/folderlistmodel/qmldir
+ gesturesImport.sources += $$QT_SOURCE_TREE/src/imports/gestures/qmldir
+ particlesImport.sources += $$QT_SOURCE_TREE/src/imports/particles/qmldir
+
+ folderlistmodelImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/folderlistmodel
+ gesturesImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/gestures
+ particlesImport.path = $$QT_IMPORTS_BASE_DIR/Qt/labs/particles
+
+ DEPLOYMENT += folderlistmodelImport gesturesImport particlesImport
+
+ contains(QT_CONFIG, webkit): {
+ webkitImport.sources = $$QT_BUILD_TREE/imports/org/webkit/qmlwebkitplugin$${QT_LIBINFIX}.dll
+ webkitImport.sources += $$QT_SOURCE_TREE/src/imports/webkit/qmldir
+ webkitImport.path = $$QT_IMPORTS_BASE_DIR/org/webkit
+ DEPLOYMENT += webkitImport
+ }
}
graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
contains(QT_CONFIG, openvg) {
qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenVG$${QT_LIBINFIX}.dll
graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qvggraphicssystem$${QT_LIBINFIX}.dll
+ # OpenVG requires Symbian^3 or later
+ pkg_platform_dependencies -= \
+ "[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+ "[0x102032BE],0,0,0,{\"S60ProductID\"}" \
+ "[0x102752AE],0,0,0,{\"S60ProductID\"}" \
+ "[0x1028315F],0,0,0,{\"S60ProductID\"}"
}
contains(QT_CONFIG, multimedia){
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 6fd1725..9a35ac5 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -259,14 +259,14 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode
static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0)
{
- return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ')
+ return QString(qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ')
+ qWarnODBCHandle(SQL_HANDLE_DBC, odbc->dpDbc()) + QLatin1Char(' ')
+ qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)).simplified();
}
static QString qODBCWarn(const QODBCDriverPrivate* odbc, int *nativeCode = 0)
{
- return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
+ return QString(qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')
+ qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode)).simplified();
}
diff --git a/src/svg/qgraphicssvgitem.cpp b/src/svg/qgraphicssvgitem.cpp
index 69ff7a3..e035e1d 100644
--- a/src/svg/qgraphicssvgitem.cpp
+++ b/src/svg/qgraphicssvgitem.cpp
@@ -124,8 +124,10 @@ public:
\snippet doc/src/snippets/code/src_svg_qgraphicssvgitem.cpp 0
- Size of the item can be set via the setSize() method or via
- direct manipulation of the items transformation matrix.
+ Size of the item can be set via the \l{QRectF::setSize()}
+ {setSize()} method of the \l{QGraphicsSvgItem::boundingRect()}
+ {bounding rectangle} or via direct manipulation of the items
+ transformation matrix.
By default the SVG rendering is cached using QGraphicsItem::DeviceCoordinateCache
mode to speedup the display of items. Caching can be disabled by passing