summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/libconninet/Makefile.am49
-rw-r--r--src/3rdparty/libconninet/debian/changelog14
-rw-r--r--src/3rdparty/libconninet/src/Makefile.am36
-rw-r--r--src/3rdparty/libconninet/src/dbusdispatcher.cpp2
-rw-r--r--src/3rdparty/libconninet/src/maemo_icd.cpp63
-rw-r--r--src/3rdparty/libconninet/tests/Makefile.am39
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp1
-rw-r--r--src/corelib/codecs/qtextcodec_symbian.cpp6
-rw-r--r--src/corelib/concurrent/qtconcurrentrun.cpp2
-rw-r--r--src/corelib/io/qprocess_symbian.cpp47
-rw-r--r--src/corelib/tools/qhash.h5
-rw-r--r--src/corelib/tools/qlinkedlist.h5
-rw-r--r--src/corelib/tools/qlist.h5
-rw-r--r--src/corelib/tools/qmap.h5
-rw-r--r--src/corelib/tools/qshareddata.h20
-rw-r--r--src/corelib/tools/qvector.h5
-rw-r--r--src/declarative/debugger/qdeclarativedebug.cpp6
-rw-r--r--src/declarative/debugger/qdeclarativedebug_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp26
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp48
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp108
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp119
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p.h8
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners_p_p.h5
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp22
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp51
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h3
-rw-r--r--src/declarative/qml/parser/qdeclarativejslexer.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp11
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp17
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp34
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug.cpp45
-rw-r--r--src/declarative/qml/qdeclarativeenginedebug_p.h11
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp2
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp1
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp87
-rw-r--r--src/declarative/qml/qmetaobjectbuilder.cpp2
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp184
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h18
-rw-r--r--src/declarative/util/qdeclarativebehavior.cpp1
-rw-r--r--src/declarative/util/qdeclarativebind.cpp1
-rw-r--r--src/declarative/util/qdeclarativeconnections.cpp1
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp2
-rw-r--r--src/declarative/util/qdeclarativefontloader_p.h1
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp8
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent.cpp16
-rw-r--r--src/declarative/util/qdeclarativelistmodelworkeragent_p.h4
-rw-r--r--src/declarative/util/qdeclarativepackage.cpp1
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp120
-rw-r--r--src/declarative/util/qdeclarativesmoothedanimation.cpp1
-rw-r--r--src/declarative/util/qdeclarativespringanimation.cpp1
-rw-r--r--src/declarative/util/qdeclarativestate.cpp1
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp5
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp3
-rw-r--r--src/declarative/util/qdeclarativesystempalette.cpp1
-rw-r--r--src/declarative/util/qdeclarativetimer.cpp1
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp1
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp2
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm25
-rw-r--r--src/gui/egl/qegl_x11.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp8
-rw-r--r--src/gui/kernel/qaction_p.h8
-rw-r--r--src/gui/kernel/qapplication.cpp24
-rw-r--r--src/gui/kernel/qapplication_s60.cpp76
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp3
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac.mm5
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac_p.h1
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm12
-rw-r--r--src/gui/kernel/qgesturemanager.cpp7
-rw-r--r--src/gui/kernel/qt_s60_p.h1
-rw-r--r--src/gui/kernel/qwidget.cpp74
-rw-r--r--src/gui/kernel/qwidget_mac.mm18
-rw-r--r--src/gui/kernel/qwidget_p.h17
-rw-r--r--src/gui/kernel/qwidget_s60.cpp34
-rw-r--r--src/gui/painting/painting.pri1
-rw-r--r--src/gui/painting/qbackingstore.cpp9
-rw-r--r--src/gui/painting/qdrawhelper.cpp11
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp253
-rw-r--r--src/gui/painting/qgrayraster.c80
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp24
-rw-r--r--src/gui/painting/qpainter.cpp7
-rw-r--r--src/gui/painting/qwindowsurface_qws.cpp6
-rw-r--r--src/gui/text/qtextcontrol.cpp8
-rw-r--r--src/gui/text/qtextobject.cpp4
-rw-r--r--src/gui/util/qcompleter.cpp2
-rw-r--r--src/gui/widgets/qcocoamenu_mac.mm12
-rw-r--r--src/gui/widgets/qcocoamenu_mac_p.h1
-rw-r--r--src/gui/widgets/qdatetimeedit.h2
-rw-r--r--src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp1
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp2
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp4
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp1
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp7
-rw-r--r--src/network/bearer/qnetworkconfiguration.h10
-rw-r--r--src/network/bearer/qnetworksession.h4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp16
-rw-r--r--src/opengl/gl2paintengineex/qtriangulator.cpp8
-rw-r--r--src/opengl/opengl.pro30
-rw-r--r--src/opengl/qgl.cpp90
-rw-r--r--src/opengl/qgl_egl.cpp2
-rw-r--r--src/opengl/qgl_p.h12
-rw-r--r--src/opengl/qgl_symbian.cpp362
-rw-r--r--src/opengl/qpixmapdata_gl.cpp6
-rw-r--r--src/openvg/qpixmapdata_vg.cpp53
-rw-r--r--src/openvg/qpixmapdata_vg_p.h8
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp4
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp21
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp95
-rw-r--r--src/plugins/bearer/icd/qicdengine.h2
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp13
-rw-r--r--src/plugins/graphicssystems/opengl/opengl.pro2
-rw-r--r--src/s60installs/bwins/QtDeclarativeu.def1
-rw-r--r--src/s60installs/bwins/QtGuiu.def4
-rw-r--r--src/s60installs/eabi/QtDeclarativeu.def1
-rw-r--r--src/s60installs/eabi/QtGuiu.def1
-rw-r--r--src/s60installs/eabi/QtNetworku.def2
-rw-r--r--src/s60installs/qt.iby3
-rw-r--r--src/s60installs/s60installs.pro5
-rw-r--r--src/tools/moc/generator.cpp48
-rw-r--r--src/tools/moc/moc.cpp58
-rw-r--r--src/tools/moc/moc.h1
149 files changed, 2074 insertions, 926 deletions
diff --git a/src/3rdparty/libconninet/Makefile.am b/src/3rdparty/libconninet/Makefile.am
deleted file mode 100644
index 250637a..0000000
--- a/src/3rdparty/libconninet/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-SUBDIRS = src tests
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = conninet.pc
-
-MAINTAINERCLEANFILES = \
- Makefile.in config.h.in configure \
- install-sh ltmain.sh missing mkinstalldirs \
- config.log config.status config.guess config.sub \
- build-stamp compile depcomp acinclude.m4 aclocal.m4 \
- debian/files \
- debian/libconninet0.postinst.debhelper \
- debian/libconninet0.postrm.debhelper \
- debian/libconninet0.substvars
-
-EXTRA_DIST = \
- debian/changelog \
- debian/compat \
- debian/control \
- debian/copyright \
- debian/libconninet0-dev.dirs \
- debian/libconninet0-dev.files \
- debian/libconninet0.dirs \
- debian/libconninet0.files \
- debian/rules
-
-# get rid of debian build dirs
-maintainer-clean-local:
- -rm -rf debian/build debian/tmp \
- debian/libconninet0 \
- debian/libconninet0-dev \
- debian/libconninet0-dbg
-
-if DOXYGEN_DOCS_ENABLED
- DOXYGEN_LINE = $(DOXYGEN) doxygen.cfg
-else
- DOXYGEN_LINE =
-endif
-
-.PHONY : doc
-
-doc:
- $(DOXYGEN_LINE)
-
-deb: dist
- -mkdir $(top_builddir)/debian-build
- cd $(top_builddir)/debian-build && tar zxf ../$(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
- cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot -sa -D
- -rm -rf $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION)
diff --git a/src/3rdparty/libconninet/debian/changelog b/src/3rdparty/libconninet/debian/changelog
index 436d318..4063317 100644
--- a/src/3rdparty/libconninet/debian/changelog
+++ b/src/3rdparty/libconninet/debian/changelog
@@ -1,9 +1,17 @@
-libconninet (0.41+0m6) unstable; urgency=low
+libconninet (0.42+0m6) unstable; urgency=low
* This entry has been added by BIFH queue processor
- version has been changed to 0.41+0m6
+ version has been changed to 0.42+0m6
- -- Qing Jin <ext-qing.1.jin@nokia.com> Thu, 15 Jul 2010 15:56:38 +0300
+ -- Qing Jin <ext-qing.1.jin@nokia.com> Thu, 22 Jul 2010 14:04:58 +0300
+
+libconninet (0.42) unstable; urgency=low
+
+ * Fixes: NB#180536 - Uploads to online services are not working.
+ This is a regression caused by fix to bug 175098, the timeout was never
+ expiring when waiting reply from icd.
+
+ -- Jukka Rissanen <jukka.rissanen@nokia.com> Mon, 19 Jul 2010 12:23:30 +0300
libconninet (0.41) unstable; urgency=low
diff --git a/src/3rdparty/libconninet/src/Makefile.am b/src/3rdparty/libconninet/src/Makefile.am
deleted file mode 100644
index be7a1e5..0000000
--- a/src/3rdparty/libconninet/src/Makefile.am
+++ /dev/null
@@ -1,36 +0,0 @@
-DEFS = -DDBUS_API_SUBJECT_TO_CHANGE -DGCONF_DISABLE_DEPRECATED
-INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @GCONF_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTDBUS_CFLAGS@ @QGCONF_CFLAGS@ @CONNSETTINGS_CFLAGS@
-LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @GCONF_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTNETWORK_CFLAGS@ @QGCONF_LIBS@ @CONNSETTINGS_LIBS@
-
-AM_CFLAGS = $(CONCFLAGS)
-
-lib_LTLIBRARIES = libconninet.la
-libconninet_la_SOURCES = \
- maemo_icd.cpp \
- dbusdispatcher.cpp \
- iapconf.cpp \
- iapmonitor.cpp \
- proxyconf.cpp
-
-#libconninet_la_LDFLAGS = -version-info 0:0:0
-
-conninetincludedir = $(includedir)/conninet
-conninetinclude_HEADERS = \
- maemo_icd.h \
- dbusdispatcher.h \
- iapconf.h \
- iapmonitor.h \
- proxyconf.h
-
-nodist_libconninet_la_SOURCES = \
- moc_maemo_icd.cpp \
- moc_dbusdispatcher.cpp
-
-MAINTAINERCLEANFILES = Makefile.in
-
-# This rule lets GNU make create any moc_*.cpp from the equivalent *.h
-moc_%.cpp: %.h
- moc $< -o $@
-
-# This line ensures that generated moc files are deleted when we make clean.
-CLEANFILES = *_moc.cpp *.loT
diff --git a/src/3rdparty/libconninet/src/dbusdispatcher.cpp b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
index f5b830a..7581982 100644
--- a/src/3rdparty/libconninet/src/dbusdispatcher.cpp
+++ b/src/3rdparty/libconninet/src/dbusdispatcher.cpp
@@ -31,7 +31,7 @@
namespace Maemo {
/*!
- \class Maemo::DBusDispatcher
+ \class DBusDispatcher
\brief DBusDispatcher is a class, which is able to send DBUS method call
messages and receive unicast signals from DBUS object.
diff --git a/src/3rdparty/libconninet/src/maemo_icd.cpp b/src/3rdparty/libconninet/src/maemo_icd.cpp
index bc84fbc..026241c 100644
--- a/src/3rdparty/libconninet/src/maemo_icd.cpp
+++ b/src/3rdparty/libconninet/src/maemo_icd.cpp
@@ -30,9 +30,30 @@
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
namespace Maemo {
+#undef PRINT_DEBUGINFO
+#ifdef PRINT_DEBUGINFO
+ static FILE *fdebug = NULL;
+#define PDEBUG(fmt, args...) \
+ do { \
+ struct timeval tv; \
+ gettimeofday(&tv, 0); \
+ fprintf(fdebug, "DEBUG[%d]:%ld.%ld:%s:%s():%d: " fmt, \
+ getpid(), \
+ tv.tv_sec, tv.tv_usec, \
+ __FILE__, __FUNCTION__, __LINE__, args); \
+ fflush(fdebug); \
+ } while(0)
+#else
+#define PDEBUG(fmt...)
+#endif
+
+
/* Reference counting singleton class that creates a single connection
* to icd so that icd reference counting works as expected. This is
* needed because DBusDispatcher uses private dbus connections
@@ -239,6 +260,13 @@ public:
icd = myfriend;
timeout = dbus_timeout;
+
+#ifdef PRINT_DEBUGINFO
+ if (!fdebug) {
+ fdebug = fopen("/tmp/maemoicd.log", "a+");
+ }
+ PDEBUG("created %s\n", "IcdPrivate");
+#endif
}
void clearState()
@@ -672,6 +700,8 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results)
uint signals_left, total_signals;
IcdStateResult result;
+ PDEBUG("%s\n", "non blocking state");
+
clearState();
reply = mDBus->call(ICD_DBUS_API_STATE_REQ);
if (reply.type() != QVariant::List)
@@ -719,6 +749,7 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results)
}
timer.stop();
+ PDEBUG("total_signals=%d\n", total_signals);
return total_signals;
}
@@ -731,11 +762,14 @@ uint IcdPrivate::state_non_blocking(QList<IcdStateResult>& state_results)
*/
uint IcdPrivate::state(QList<IcdStateResult>& state_results)
{
- QTimer timer;
QVariant reply;
QVariantList vl;
uint signals_left, total_signals;
IcdStateResult result;
+ time_t started;
+ int timeout_secs = timeout / 1000;
+
+ PDEBUG("%s\n", "state_results");
clearState();
reply = mDBus->call(ICD_DBUS_API_STATE_REQ);
@@ -749,17 +783,16 @@ uint IcdPrivate::state(QList<IcdStateResult>& state_results)
if (!signals_left)
return 0;
- timer.setSingleShot(true);
- timer.start(timeout);
+ started = time(0);
state_results.clear();
mError.clear();
while (signals_left) {
mInterface.clear();
- while (timer.isActive() && mInterface.isEmpty()) {
+ while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) {
mDBus->synchronousDispatch(1000);
}
- if (!timer.isActive()) {
+ if (time(0)>(started+timeout_secs)) {
total_signals = 0;
break;
}
@@ -782,8 +815,8 @@ uint IcdPrivate::state(QList<IcdStateResult>& state_results)
break;
}
}
- timer.stop();
+ PDEBUG("total_signals=%d\n", total_signals);
return total_signals;
}
@@ -956,11 +989,14 @@ static void get_addrinfo_all_result(QList<QVariant>& args,
*/
uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results)
{
- QTimer timer;
QVariant reply;
QVariantList vl;
uint signals_left, total_signals;
IcdAddressInfoResult result;
+ time_t started;
+ int timeout_secs = timeout / 1000;
+
+ PDEBUG("%s\n", "addr_results");
clearState();
reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ);
@@ -976,16 +1012,15 @@ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results)
if (!signals_left)
return 0;
- timer.setSingleShot(true);
- timer.start(timeout);
+ started = time(0);
addr_results.clear();
while (signals_left) {
mInterface.clear();
- while (timer.isActive() && mInterface.isEmpty()) {
+ while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) {
mDBus->synchronousDispatch(1000);
}
- if (!timer.isActive()) {
+ if (time(0)>(started+timeout_secs)) {
total_signals = 0;
break;
}
@@ -1003,7 +1038,8 @@ uint IcdPrivate::addrinfo(QList<IcdAddressInfoResult>& addr_results)
break;
}
}
- timer.stop();
+
+ PDEBUG("total_signals=%d\n", total_signals);
return total_signals;
}
@@ -1015,6 +1051,8 @@ uint IcdPrivate::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results
uint signals_left, total_signals;
IcdAddressInfoResult result;
+ PDEBUG("%s\n", "non blocking addrinfo");
+
clearState();
reply = mDBus->call(ICD_DBUS_API_ADDRINFO_REQ);
if (reply.type() != QVariant::List)
@@ -1057,6 +1095,7 @@ uint IcdPrivate::addrinfo_non_blocking(QList<IcdAddressInfoResult>& addr_results
}
}
timer.stop();
+ PDEBUG("total_signals=%d\n", total_signals);
return total_signals;
}
diff --git a/src/3rdparty/libconninet/tests/Makefile.am b/src/3rdparty/libconninet/tests/Makefile.am
deleted file mode 100644
index f6f41ea..0000000
--- a/src/3rdparty/libconninet/tests/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-DEFS = -DDBUS_API_SUBJECT_TO_CHANGE
-INCLUDES = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @CONNSETTINGS_CFLAGS@ @OSSO_IC_CFLAGS@ @ICD_DEV_CFLAGS@ \
- @QTCORE_CFLAGS@ @QTDBUS_CFLAGS@ @QTCORE_CFLAGS@ @QTNETWORK_CFLAGS@ @QTTEST_CFLAGS@ \
- -I$(top_srcdir) \
- -I$(top_srcdir)/src
-
-LIBS = @GLIB_LIBS@ @DBUS_LIBS@ @CONNSETTINGS_LIBS@ @OSSO_IC_LIBS@ @ICD_DEV_LIBS@ \
- @QTCORE_LIBS@ @QTDBUS_LIBS@ @QTCORE_LIBS@ @QTNETWORK_LIBS@ @QTTEST_LIBS@ \
- $(top_builddir)/src/libconninet.la
-
-AM_CFLAGS = $(CONCFLAGS)
-AM_LDFLAGS = -static
-
-bin_PROGRAMS = test_dbusdispatcher test_iapconf test_maemo_icd test_iapmonitor test_proxyconf
-
-test_dbusdispatcher_SOURCES = ut_dbusdispatcher.cpp
-ut_dbusdispatcher.o: ut_dbusdispatcher.moc
-
-test_iapconf_SOURCES = ut_iapconf.cpp
-ut_iapconf.o: ut_iapconf.moc
-
-test_maemo_icd_SOURCES = ut_maemo_icd.cpp
-ut_maemo_icd.o: ut_maemo_icd.moc
-
-test_iapmonitor_SOURCES = ut_iapmonitor.cpp
-ut_iapmonitor.o: ut_iapmonitor.moc
-
-test_proxyconf_SOURCES = ut_proxyconf.cpp
-ut_proxyconf.o: ut_proxyconf.moc
-
-
-MAINTAINERCLEANFILES = Makefile.in
-
-# This rule lets GNU make create any *.moc from the equivalent *.cpp
-%.moc: %.cpp
- moc $< -o $@
-
-# This line ensures that generated moc files are deleted when we make clean.
-CLEANFILES = *.moc
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index 9dcba60..c1ca23d 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -139,6 +139,7 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
/*!
\qmlclass WebView QDeclarativeWebView
+ \ingroup qml-view-elements
\since 4.7
\brief The WebView item allows you to add web content to a canvas.
\inherits Item
diff --git a/src/corelib/codecs/qtextcodec_symbian.cpp b/src/corelib/codecs/qtextcodec_symbian.cpp
index e4db9d7..20e0cfc 100644
--- a/src/corelib/codecs/qtextcodec_symbian.cpp
+++ b/src/corelib/codecs/qtextcodec_symbian.cpp
@@ -53,8 +53,10 @@ struct QSymbianCodecInitData {
const char *aliases;
};
-/* This table contains the known Symbian codecs aliases. It is ordered by charsetId.
- It is required as symbian does not provide have aliases.
+/* This table contains the known Symbian codecs aliases.
+ It is required because symbian does not provide aliases for codecs.
+ It is also faster to have a name here than asking the system.
+ It is ordered by charsetId to allow binary search lookup
*/
static const QSymbianCodecInitData codecsData[] = {
{ /*268439485*/ KCharacterSetIdentifierShiftJis, 17, "Shift_JIS\0MS_Kanji\0csShiftJIS\0MS_KANJI\0SJIS\0" },
diff --git a/src/corelib/concurrent/qtconcurrentrun.cpp b/src/corelib/concurrent/qtconcurrentrun.cpp
index 5a9c755..e80a204 100644
--- a/src/corelib/concurrent/qtconcurrentrun.cpp
+++ b/src/corelib/concurrent/qtconcurrentrun.cpp
@@ -99,7 +99,7 @@
functions; passing by pointer is useful for calling non-const member
functions that modify the instance.
- For example, calling QString::split() (a const member function) in a
+ For example, calling QByteArray::split() (a const member function) in a
separate thread is done like this:
\snippet doc/src/snippets/code/src_corelib_concurrent_qtconcurrentrun.cpp 4
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index af657b2..003e781 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -375,10 +375,9 @@ QProcessActive::QProcessActive()
// Nothing to do
}
-// Called from ProcessManagerThread
+// Called from main thread
QProcessActive::~QProcessActive()
{
- Cancel();
process = NULL;
pproc = NULL;
}
@@ -482,10 +481,9 @@ QProcessManagerMediator::QProcessManagerMediator()
// Nothing to do
}
-// Called from ProcessManagerThread
+// Called from main thread
QProcessManagerMediator::~QProcessManagerMediator()
{
- Cancel();
processManagerThread.Close();
currentCommand = ENoCommand;
currentObserver = NULL;
@@ -648,25 +646,36 @@ QProcessManager::QProcessManager()
QProcessManager::~QProcessManager()
{
QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager()");
- // Cancel death listening for all child processes
- if (mediator) {
- QMap<int, QProcessActive *>::Iterator it = children.begin();
- while (it != children.end()) {
- // Remove all monitors
- QProcessActive *active = it.value();
- mediator->remove(active);
-
- QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process");
- ++it;
+
+ // Check if manager thread is still alive. If this destructor is ran as part of global
+ // static cleanup, manager thread will most likely be terminated by kernel at this point,
+ // so trying to delete QProcessActives and QProcessMediators will panic as they
+ // will still be active. They can also no longer be canceled as the thread is already gone.
+ // In case manager thread has already died, we simply do nothing and let the deletion of
+ // the main heap at process exit take care of stray objects.
+
+ if (managerThread.Handle() && managerThread.ExitType() == EExitPending) {
+ // Cancel death listening for all child processes
+ if (mediator) {
+ QMap<int, QProcessActive *>::Iterator it = children.begin();
+ while (it != children.end()) {
+ // Remove all monitors
+ QProcessActive *active = it.value();
+ mediator->remove(active);
+
+ QPROCESS_DEBUG_PRINT("QProcessManager::~QProcessManager() removed listening for a process");
+ ++it;
+ }
+
+ // Terminate process manager thread.
+ mediator->terminate();
+ delete mediator;
}
- // Terminate process manager thread.
- mediator->terminate();
- delete mediator;
+ qDeleteAll(children.values());
+ children.clear();
}
- qDeleteAll(children.values());
- children.clear();
managerThread.Close();
managerMutex.Close();
}
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 360f99d..14ed514 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -586,10 +586,11 @@ template <class Key, class T>
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
{
if (d != other.d) {
- other.d->ref.ref();
+ QHashData *o = other.d;
+ o->ref.ref();
if (!d->ref.deref())
freeData(d);
- d = other.d;
+ d = o;
if (!d->sharable)
detach_helper();
}
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index d145fe3..9b3efa3 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -312,10 +312,11 @@ template <typename T>
QLinkedList<T> &QLinkedList<T>::operator=(const QLinkedList<T> &l)
{
if (d != l.d) {
- l.d->ref.ref();
+ QLinkedListData *o = l.d;
+ o->ref.ref();
if (!d->ref.deref())
free(d);
- d = l.d;
+ d = o;
if (!d->sharable)
detach_helper();
}
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 99c9795..1282bca 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -424,10 +424,11 @@ template <typename T>
Q_INLINE_TEMPLATE QList<T> &QList<T>::operator=(const QList<T> &l)
{
if (d != l.d) {
- l.d->ref.ref();
+ QListData::Data *o = l.d;
+ o->ref.ref();
if (!d->ref.deref())
free(d);
- d = l.d;
+ d = o;
if (!d->sharable)
detach_helper();
}
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 2d11613..08f5a35 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -424,10 +424,11 @@ template <class Key, class T>
Q_INLINE_TEMPLATE QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
{
if (d != other.d) {
- other.d->ref.ref();
+ QMapData* o = other.d;
+ o->ref.ref();
if (!d->ref.deref())
freeData(d);
- d = other.d;
+ d = o;
if (!d->sharable)
detach_helper();
}
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 80ba7b7..1ae2fa9 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -95,9 +95,10 @@ public:
if (o.d != d) {
if (o.d)
o.d->ref.ref();
- if (d && !d->ref.deref())
- delete d;
+ T *old = d;
d = o.d;
+ if (old && !old->ref.deref())
+ delete old;
}
return *this;
}
@@ -105,9 +106,10 @@ public:
if (o != d) {
if (o)
o->ref.ref();
- if (d && !d->ref.deref())
- delete d;
+ T *old = d;
d = o;
+ if (old && !old->ref.deref())
+ delete old;
}
return *this;
}
@@ -172,9 +174,10 @@ public:
if (o.d != d) {
if (o.d)
o.d->ref.ref();
- if (d && !d->ref.deref())
- delete d;
+ T *old = d;
d = o.d;
+ if (old && !old->ref.deref())
+ delete old;
}
return *this;
}
@@ -182,9 +185,10 @@ public:
if (o != d) {
if (o)
o->ref.ref();
- if (d && !d->ref.deref())
- delete d;
+ T *old = d;
d = o;
+ if (old && !old->ref.deref())
+ delete old;
}
return *this;
}
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 5613c12..2f0ad42 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -377,10 +377,11 @@ inline void QVector<T>::replace(int i, const T &t)
template <typename T>
QVector<T> &QVector<T>::operator=(const QVector<T> &v)
{
- v.d->ref.ref();
+ QVectorData *o = v.d;
+ o->ref.ref();
if (!d->ref.deref())
free(p);
- d = v.d;
+ d = o;
if (!d->sharable)
detach_helper();
return *this;
diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativedebug.cpp
index 19d8ab3..bf07080 100644
--- a/src/declarative/debugger/qdeclarativedebug.cpp
+++ b/src/declarative/debugger/qdeclarativedebug.cpp
@@ -340,6 +340,8 @@ void QDeclarativeEngineDebugPrivate::message(const QByteArray &data)
if (!watch)
return;
emit watch->valueChanged(name, value);
+ } else if (type == "OBJECT_CREATED") {
+ emit q_func()->newObjects();
}
}
@@ -507,7 +509,7 @@ QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObject(const QDeclar
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
- << false;
+ << false << true;
d->client->sendMessage(message);
} else {
query->m_state = QDeclarativeDebugQuery::Error;
@@ -530,7 +532,7 @@ QDeclarativeDebugObjectQuery *QDeclarativeEngineDebug::queryObjectRecursive(cons
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
- << true;
+ << true << true;
d->client->sendMessage(message);
} else {
query->m_state = QDeclarativeDebugQuery::Error;
diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativedebug_p.h
index 2e79c5d..f0fc488 100644
--- a/src/declarative/debugger/qdeclarativedebug_p.h
+++ b/src/declarative/debugger/qdeclarativedebug_p.h
@@ -99,6 +99,9 @@ public:
bool resetBindingForObject(int objectDebugId, const QString &propertyName);
bool setMethodBody(int objectDebugId, const QString &methodName, const QString &methodBody);
+Q_SIGNALS:
+ void newObjects();
+
private:
Q_DECLARE_PRIVATE(QDeclarativeEngineDebug)
};
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index d8527d3..e0a2149 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -62,7 +62,8 @@ QT_BEGIN_NAMESPACE
\qmlclass AnimatedImage QDeclarativeAnimatedImage
\inherits Image
\since 4.7
-
+ \ingroup basic-visual-elements
+
The AnimatedImage element provides for playing animations stored as images containing a series of frames,
such as GIF files.
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index 4881248..e0c7fc2 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -56,6 +56,7 @@ QT_BEGIN_NAMESPACE
\brief The BorderImage element provides an image that can be used as a border.
\inherits Item
\since 4.7
+ \ingroup qm-basic-visual-elements
A BorderImage breaks an image into 9 sections, as shown below:
diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp
index 81ec6e1..0a35a3f 100644
--- a/src/declarative/graphicsitems/qdeclarativeevents.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp
@@ -45,6 +45,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass KeyEvent QDeclarativeKeyEvent
\since 4.7
+ \ingroup qml-event-elements
+
\brief The KeyEvent object provides information about a key event.
For example, the following changes the Item's state property when the Enter
@@ -115,6 +117,8 @@ Item {
/*!
\qmlclass MouseEvent QDeclarativeMouseEvent
\since 4.7
+ \ingroup qml-event-elements
+
\brief The MouseEvent object provides information about a mouse event.
The position of the mouse can be found via the x and y properties.
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 61b4dcd..1e862cc 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
static const int FlickThreshold = 20;
// Really slow flicks can be annoying.
-static const int minimumFlickVelocity = 200;
+static const int MinimumFlickVelocity = 75;
QDeclarativeFlickableVisibleArea::QDeclarativeFlickableVisibleArea(QDeclarativeFlickable *parent)
: QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
@@ -345,6 +345,8 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd()
/*!
\qmlclass Flickable QDeclarativeFlickable
\since 4.7
+ \ingroup qml-basic-interaction-elements
+
\brief The Flickable item provides a surface that can be "flicked".
\inherits Item
@@ -777,23 +779,15 @@ void QDeclarativeFlickablePrivate::handleMouseReleaseEvent(QGraphicsSceneMouseEv
}
vTime = timeline.time();
- if (qAbs(vData.velocity) > 10 && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold) {
- qreal velocity = vData.velocity;
- if (qAbs(velocity) < minimumFlickVelocity) // Minimum velocity to avoid annoyingly slow flicks.
- velocity = velocity < 0 ? -minimumFlickVelocity : minimumFlickVelocity;
- flickY(velocity);
- } else {
+ if (qAbs(vData.velocity) > MinimumFlickVelocity && qAbs(event->pos().y() - pressPos.y()) > FlickThreshold)
+ flickY(vData.velocity);
+ else
fixupY();
- }
- if (qAbs(hData.velocity) > 10 && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold) {
- qreal velocity = hData.velocity;
- if (qAbs(velocity) < minimumFlickVelocity) // Minimum velocity to avoid annoyingly slow flicks.
- velocity = velocity < 0 ? -minimumFlickVelocity : minimumFlickVelocity;
- flickX(velocity);
- } else {
+ if (qAbs(hData.velocity) > MinimumFlickVelocity && qAbs(event->pos().x() - pressPos.x()) > FlickThreshold)
+ flickX(hData.velocity);
+ else
fixupX();
- }
lastPosTime.invalidate();
@@ -1027,7 +1021,7 @@ void QDeclarativeFlickable::cancelFlick()
void QDeclarativeFlickablePrivate::data_append(QDeclarativeListProperty<QObject> *prop, QObject *o)
{
- QDeclarativeItem *i = qobject_cast<QDeclarativeItem *>(o);
+ QGraphicsObject *i = qobject_cast<QGraphicsObject *>(o);
if (i)
i->setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem);
else
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index b266273..6ce0fa6 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -70,6 +70,8 @@ public:
/*!
\qmlclass Flipable QDeclarativeFlipable
\since 4.7
+ \ingroup qml-basic-interaction-elements
+
\brief The Flipable item provides a surface that can be flipped.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
index bd60e25..5c7959a 100644
--- a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
@@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass FocusPanel QDeclarativeFocusPanel
\since 4.7
+ \ingroup qml-basic-interaction-elements
+
\brief The FocusPanel item explicitly creates a focus panel.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
index e8e6fa2..4498275 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
@@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass FocusScope QDeclarativeFocusScope
\since 4.7
+ \ingroup qml-basic-interaction-elements
+
\brief The FocusScope object explicitly creates a focus scope.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 68a4c64..d67e69a 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -1056,6 +1056,8 @@ void QDeclarativeGridViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
/*!
\qmlclass GridView QDeclarativeGridView
\since 4.7
+ \ingroup qml-view-elements
+
\inherits Flickable
\brief The GridView item provides a grid view of items provided by a model.
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 37736cc..1cc5f81 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -51,6 +51,8 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Image QDeclarativeImage
\since 4.7
+ \ingroup qml-vasic-visual-elements
+
\brief The Image element allows you to add bitmaps to a scene.
\inherits Item
@@ -329,7 +331,7 @@ qreal QDeclarativeImage::paintedHeight() const
Unlike the \l {Item::}{width} and \l {Item::}{height} properties, which scale
the painting of the image, this property sets the actual number of pixels
stored for the loaded image so that large images do not use more
- memory than necessary. For example, this ensures the image is memory is no
+ memory than necessary. For example, this ensures the image in memory is no
larger than 1024x1024 pixels, regardless of the Image's \l {Item::}{width} and
\l {Item::}{height} values:
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index ba40443..d6b935b 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -147,10 +147,15 @@ void QDeclarativeImageBase::load()
setImplicitWidth(0);
setImplicitHeight(0);
emit statusChanged(d->status);
+ d->sourcesize.setWidth(0);
+ d->sourcesize.setHeight(0);
+ emit sourceSizeChanged();
pixmapChange();
update();
} else {
+
d->status = Loading;
+ emit statusChanged(d->status);
d->pix.load(qmlEngine(this), d->url, d->sourcesize, d->async);
@@ -169,53 +174,34 @@ void QDeclarativeImageBase::load()
d->pix.connectDownloadProgress(this, thisRequestProgress);
} else {
- QSize impsize = d->pix.implicitSize();
- setImplicitWidth(impsize.width());
- setImplicitHeight(impsize.height());
-
- if (d->pix.isReady()) {
- d->status = Ready;
-
- if (!d->sourcesize.isValid())
- emit sourceSizeChanged();
-
- } else {
- d->status = Error;
- qmlInfo(this) << d->pix.error();
- }
- d->progress = 1.0;
- emit statusChanged(d->status);
- emit progressChanged(d->progress);
- pixmapChange();
- update();
+ requestFinished();
}
-
}
-
- emit statusChanged(d->status);
}
void QDeclarativeImageBase::requestFinished()
{
Q_D(QDeclarativeImageBase);
- QSize impsize = d->pix.implicitSize();
-
if (d->pix.isError()) {
d->status = Error;
qmlInfo(this) << d->pix.error();
+ } else {
+ d->status = Ready;
}
+ emit statusChanged(d->status);
- setImplicitWidth(impsize.width());
- setImplicitHeight(impsize.height());
+ setImplicitWidth(d->pix.width());
+ setImplicitHeight(d->pix.height());
- if (d->status == Loading)
- d->status = Ready;
d->progress = 1.0;
- emit statusChanged(d->status);
- emit progressChanged(1.0);
- if (!d->sourcesize.isValid())
+ emit progressChanged(d->progress);
+
+ if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) {
+ d->sourcesize.setWidth(d->pix.width());
+ d->sourcesize.setHeight(d->pix.height());
emit sourceSizeChanged();
+ }
pixmapChange();
update();
}
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index cc7c673..0f16a79 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Transform QGraphicsTransform
+ \ingroup qml-transform-elements
\since 4.7
\brief The Transform elements provide a way of building advanced transformations on Items.
@@ -90,6 +91,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Translate QDeclarativeTranslate
+ \ingroup qml-transform-elements
\since 4.7
\brief The Translate object provides a way to move an Item without changing its x or y properties.
@@ -131,6 +133,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Scale QGraphicsScale
+ \ingroup qml-transform-elements
\since 4.7
\brief The Scale element provides a way to scale an Item.
@@ -172,6 +175,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Rotation QGraphicsRotation
+ \ingroup qml-transform-elements
\since 4.7
\brief The Rotation object provides a way to rotate an Item.
@@ -419,6 +423,7 @@ void QDeclarativeItemKeyFilter::componentComplete()
/*!
\qmlclass KeyNavigation QDeclarativeKeyNavigationAttached
+ \ingroup qml-basic-interaction-elements
\since 4.7
\brief The KeyNavigation attached property supports key navigation by arrow keys.
@@ -725,6 +730,7 @@ void QDeclarativeKeyNavigationAttached::keyReleased(QKeyEvent *event, bool post)
/*!
\qmlclass Keys QDeclarativeKeysAttached
+ \ingroup qml-basic-interaction-elements
\since 4.7
\brief The Keys attached property provides key handling to Items.
@@ -1310,6 +1316,7 @@ QDeclarativeKeysAttached *QDeclarativeKeysAttached::qmlAttachedProperties(QObjec
/*!
\qmlclass Item QDeclarativeItem
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The Item is the most basic of all visual items in QML.
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
index 38d5f59..8509473 100644
--- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
@@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass LayoutItem QDeclarativeLayoutItem
+ \ingroup qml-utility-elements
\since 4.7
\brief The LayoutItem element allows declarative UI elements to be placed inside Qt's Graphics View layouts.
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index e1dd1c0..2e2e08c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -983,7 +983,7 @@ void QDeclarativeListViewPrivate::updateSections()
void QDeclarativeListViewPrivate::updateCurrentSection()
{
if (!sectionCriteria || visibleItems.isEmpty()) {
- currentSection = QString();
+ currentSection.clear();
return;
}
int index = 0;
@@ -1357,6 +1357,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m
/*!
\qmlclass ListView QDeclarativeListView
+ \ingroup qml-view-elements
\since 4.7
\inherits Flickable
\brief The ListView item provides a list view of items provided by a model.
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index d28181e..2fde4c8 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -108,59 +108,83 @@ void QDeclarativeLoaderPrivate::initResize()
/*!
\qmlclass Loader QDeclarativeLoader
+ \ingroup qml-utility-elements
\since 4.7
\inherits Item
\brief The Loader item allows dynamically loading an Item-based
subtree from a URL or Component.
- The Loader element instantiates an item from a component. The component to
- be instantiated may be specified directly by the \l sourceComponent
- property, or loaded from a URL via the \l source property.
+ Loader is used to dynamically load visual QML components. It can load a
+ QML file (using the \l source property) or a \l Component object (using
+ the \l sourceComponent property). It is useful for delaying the creation
+ of a component until it is required: for example, when a component should
+ be created on demand, or when a component should not be created
+ unnecessarily for performance reasons.
- Loader can be used to delay the creation of a component until it
- is required. For example, this loads "Page1.qml" as a component
- into the Loader element, when the \l MouseArea is clicked:
+ Here is a Loader that loads "Page1.qml" as a component when the
+ \l MouseArea is clicked:
- \code
- import Qt 4.7
+ \snippet doc/src/snippets/declarative/loader/simple.qml 0
- Item {
- width: 200; height: 200
+ The loaded item can be accessed using the \l item property.
- MouseArea {
- anchors.fill: parent
- onClicked: pageLoader.source = "Page1.qml"
- }
+ Loader is like any other visual item and must be positioned and sized
+ accordingly to become visible. Once the component is loaded, the Loader
+ is automatically resized to the size of the component.
- Loader { id: pageLoader }
- }
- \endcode
+ If the \l source or \l sourceComponent changes, any previously instantiated
+ items are destroyed. Setting \l source to an empty string or setting
+ \l sourceComponent to \c undefined destroys the currently loaded item,
+ freeing resources and leaving the Loader empty.
+
+
+ \section2 Receiving signals from loaded items
- Note that Loader is like any other graphical Item and needs to be positioned
- and sized accordingly to become visible. When a component is loaded, the
- Loader is automatically resized to the size of the component.
+ Any signals emitted from the loaded item can be received using the
+ \l Connections element. For example, the following \c application.qml
+ loads \c MyItem.qml, and is able to receive the \c message signal from
+ the loaded item through a \l Connections object:
- If the Loader source is changed, any previous items instantiated
- 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:
+ \table
+ \row
+ \o application.qml
+ \o MyItem.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/connections.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/MyItem.qml 0
+ \endtable
- \code
- pageLoader.source = ""
- \endcode
+ Alternatively, since \c MyItem.qml is loaded within the scope of the
+ Loader, it could also directly call any function defined in the Loader or
+ its parent \l Item.
- or
- \code
- pageLoader.sourceComponent = undefined
- \endcode
+ \section2 Focus and key events
- unloads "Page1.qml" and frees resources consumed by it.
+ Loader is a focus scope. Its \l {Item::}{focus} property must be set to
+ \c true for any of its children to get the \e {active focus}. (See
+ \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page}
+ for more details.) Any key events received in the loaded item should likely
+ also be \l {KeyEvent::}{accepted} so they are not propagated to the Loader.
- Note that Loader is a focus scope. Its \c focus property must be set to \c true for any of its children
- to get the \e {active focus} (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details).
+ For example, the following \c application.qml loads \c KeyReader.qml when
+ the \l MouseArea is clicked. Notice the \l {Item::}{focus} property is
+ set to \c true for the Loader as well as the \l Item in the dynamically
+ loaded object:
+
+ \table
+ \row
+ \o application.qml
+ \o KeyReader.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/focus.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/KeyReader.qml 0
+ \endtable
+
+ Once \c KeyReader.qml is loaded, it accepts key events and sets
+ \c event.accepted to \c true so that the event is not propagated to the
+ parent \l Rectangle.
\sa {dynamic-object-creation}{Dynamic Object Creation}
*/
@@ -197,8 +221,13 @@ QDeclarativeLoader::~QDeclarativeLoader()
/*!
\qmlproperty url Loader::source
- This property holds the URL of the QML component to
- instantiate.
+ This property holds the URL of the QML component to instantiate.
+
+ Note the QML component must be an \l Item-based component. Loader cannot
+ load non-visual components.
+
+ To unload the currently loaded item, set this property to an empty string,
+ or set \l sourceComponent to \c undefined.
\sa sourceComponent, status, progress
*/
@@ -257,7 +286,8 @@ void QDeclarativeLoader::setSource(const QUrl &url)
}
\endqml
- Note this value must hold a \l Component object; it cannot be a \l Item.
+ To unload the currently loaded item, set this property to an empty string,
+ or set \l sourceComponent to \c undefined.
\sa source, progress
*/
@@ -476,7 +506,7 @@ void QDeclarativeLoaderPrivate::_q_updateSize(bool loaderGeometryChanged)
/*!
\qmlproperty Item Loader::item
- This property holds the top-level item created from source.
+ This property holds the top-level item that is currently loaded.
*/
QGraphicsObject *QDeclarativeLoader::item() const
{
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index dcdb9f6..2823888 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -180,6 +180,7 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
/*!
\qmlclass MouseArea QDeclarativeMouseArea
+ \ingroup qml-basic-interaction-elements
\since 4.7
\brief The MouseArea item enables simple mouse handling.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index c48011d3..0c069ce 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass PathElement QDeclarativePathElement
+ \ingroup qml-view-elements
\since 4.7
\brief PathElement is the base path type.
@@ -67,6 +68,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Path QDeclarativePath
+ \ingroup qml-view-elements
\since 4.7
\brief A Path object defines a path for use by \l PathView.
@@ -497,6 +499,7 @@ void QDeclarativeCurve::setY(qreal y)
/*!
\qmlclass PathAttribute QDeclarativePathAttribute
+ \ingroup qml-view-elements
\since 4.7
\brief The PathAttribute allows setting an attribute at a given position in a Path.
@@ -587,6 +590,7 @@ void QDeclarativePathAttribute::setValue(qreal value)
/*!
\qmlclass PathLine QDeclarativePathLine
+ \ingroup qml-view-elements
\since 4.7
\brief The PathLine defines a straight line.
@@ -627,6 +631,7 @@ void QDeclarativePathLine::addToPath(QPainterPath &path)
/*!
\qmlclass PathQuad QDeclarativePathQuad
+ \ingroup qml-view-elements
\since 4.7
\brief The PathQuad defines a quadratic Bezier curve with a control point.
@@ -713,6 +718,7 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path)
/*!
\qmlclass PathCubic QDeclarativePathCubic
+ \ingroup qml-view-elements
\since 4.7
\brief The PathCubic defines a cubic Bezier curve with two control points.
@@ -828,6 +834,7 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path)
/*!
\qmlclass PathPercent QDeclarativePathPercent
+ \ingroup qml-view-elements
\since 4.7
\brief The PathPercent manipulates the way a path is interpreted.
@@ -886,6 +893,7 @@ void QDeclarativePathPercent::setValue(qreal value)
{
if (_value != value) {
_value = value;
+ emit valueChanged();
emit changed();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h
index 5ab5cfd..21e1b24 100644
--- a/src/declarative/graphicsitems/qdeclarativepath_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepath_p.h
@@ -190,13 +190,16 @@ private:
class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement
{
Q_OBJECT
- Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed)
+ Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged)
public:
QDeclarativePathPercent(QObject *parent=0) : QDeclarativePathElement(parent) {}
qreal value() const;
void setValue(qreal value);
+signals:
+ void valueChanged();
+
private:
qreal _value;
};
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index 380c6ad..4b97505 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -326,6 +326,7 @@ void QDeclarativePathViewPrivate::regenerate()
/*!
\qmlclass PathView QDeclarativePathView
+ \ingroup qml-view-elements
\since 4.7
\brief The PathView element lays out model-provided items on a path.
\inherits Item
@@ -479,7 +480,8 @@ void QDeclarativePathView::setModel(const QVariant &model)
connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset()));
connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*)));
}
- d->offset = qmlMod(d->offset, qreal(d->model->count()));
+ if (d->model->count())
+ d->offset = qmlMod(d->offset, qreal(d->model->count()));
if (d->offset < 0)
d->offset = d->model->count() + d->offset;
d->regenerate();
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 179f13d..4ceb5d9 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -61,16 +61,37 @@ static const QDeclarativeItemPrivate::ChangeTypes watchedChanges
| QDeclarativeItemPrivate::Opacity
| QDeclarativeItemPrivate::Destroyed;
-void QDeclarativeBasePositionerPrivate::watchChanges(QDeclarativeItem *other)
+void QDeclarativeBasePositionerPrivate::watchChanges(QGraphicsObject *other)
{
- QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
- otherPrivate->addItemChangeListener(this, watchedChanges);
+ if (QGraphicsItemPrivate::get(other)->isDeclarativeItem) {
+ QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
+ otherPrivate->addItemChangeListener(this, watchedChanges);
+ } else {
+ Q_Q(QDeclarativeBasePositioner);
+ QObject::connect(other, SIGNAL(widthChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(heightChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(opacityChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::connect(other, SIGNAL(visibleChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ }
}
-void QDeclarativeBasePositionerPrivate::unwatchChanges(QDeclarativeItem* other)
+void QDeclarativeBasePositionerPrivate::unwatchChanges(QGraphicsObject* other)
{
- QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
- otherPrivate->removeItemChangeListener(this, watchedChanges);
+ if (QGraphicsItemPrivate::get(other)->isDeclarativeItem) {
+ QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
+ otherPrivate->removeItemChangeListener(this, watchedChanges);
+ } else {
+ Q_Q(QDeclarativeBasePositioner);
+ QObject::disconnect(other, SIGNAL(widthChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(heightChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(opacityChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ QObject::disconnect(other, SIGNAL(visibleChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
+ }
+}
+
+void QDeclarativeBasePositioner::graphicsWidgetGeometryChanged()
+{
+ prePositioning();
}
/*!
@@ -174,16 +195,16 @@ QVariant QDeclarativeBasePositioner::itemChange(GraphicsItemChange change,
Q_D(QDeclarativeBasePositioner);
if (change == ItemChildAddedChange){
QGraphicsItem* item = value.value<QGraphicsItem*>();
- QDeclarativeItem* child = 0;
+ QGraphicsObject* child = 0;
if(item)
- child = qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
+ child = item->toGraphicsObject();
if (child)
prePositioning();
} else if (change == ItemChildRemovedChange) {
QGraphicsItem* item = value.value<QGraphicsItem*>();
- QDeclarativeItem* child = 0;
+ QGraphicsObject* child = 0;
if(item)
- child = qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
+ child = item->toGraphicsObject();
if (child) {
QDeclarativeBasePositioner::PositionedItem posItem(child);
int idx = positionedItems.find(posItem);
@@ -194,7 +215,6 @@ QVariant QDeclarativeBasePositioner::itemChange(GraphicsItemChange change,
prePositioning();
}
}
-
return QDeclarativeItem::itemChange(change, value);
}
@@ -216,10 +236,10 @@ void QDeclarativeBasePositioner::prePositioning()
QPODVector<PositionedItem,8> oldItems;
positionedItems.copyAndClear(oldItems);
for (int ii = 0; ii < children.count(); ++ii) {
- QDeclarativeItem *child = qobject_cast<QDeclarativeItem *>(children.at(ii));
+ QGraphicsObject *child = children.at(ii)->toGraphicsObject();
if (!child)
continue;
- QDeclarativeItemPrivate *childPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(child));
+ QGraphicsItemPrivate *childPrivate = static_cast<QGraphicsItemPrivate*>(QGraphicsItemPrivate::get(child));
PositionedItem *item = 0;
PositionedItem posItem(child);
int wIdx = oldItems.find(posItem);
@@ -302,14 +322,15 @@ void QDeclarativeBasePositioner::finishApplyTransitions()
d->moveActions.clear();
}
-static inline bool isInvisible(QDeclarativeItem *child)
+static inline bool isInvisible(QGraphicsObject *child)
{
- QDeclarativeItemPrivate *childPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(child));
- return child->opacity() == 0.0 || childPrivate->explicitlyHidden || !child->width() || !child->height();
+ QGraphicsItemPrivate *childPrivate = static_cast<QGraphicsItemPrivate*>(QGraphicsItemPrivate::get(child));
+ return child->opacity() == 0.0 || childPrivate->explicitlyHidden || !childPrivate->width() || !childPrivate->height();
}
/*!
\qmlclass Column QDeclarativeColumn
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Column item arranges its children vertically.
\inherits Item
@@ -440,9 +461,9 @@ void QDeclarativeColumn::doPositioning(QSizeF *contentSize)
if(child.item->y() != voffset)
positionY(voffset, child);
- contentSize->setWidth(qMax(contentSize->width(), child.item->width()));
+ contentSize->setWidth(qMax(contentSize->width(), QGraphicsItemPrivate::get(child.item)->width()));
- voffset += child.item->height();
+ voffset += QGraphicsItemPrivate::get(child.item)->height();
voffset += spacing();
}
@@ -454,8 +475,8 @@ void QDeclarativeColumn::reportConflictingAnchors()
QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item) {
- QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
if (anchors) {
QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
if (usedAnchors & QDeclarativeAnchors::TopAnchor ||
@@ -475,6 +496,7 @@ void QDeclarativeColumn::reportConflictingAnchors()
/*!
\qmlclass Row QDeclarativeRow
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Row item arranges its children horizontally.
\inherits Item
@@ -579,9 +601,9 @@ void QDeclarativeRow::doPositioning(QSizeF *contentSize)
if(child.item->x() != hoffset)
positionX(hoffset, child);
- contentSize->setHeight(qMax(contentSize->height(), child.item->height()));
+ contentSize->setHeight(qMax(contentSize->height(), QGraphicsItemPrivate::get(child.item)->height()));
- hoffset += child.item->width();
+ hoffset += QGraphicsItemPrivate::get(child.item)->width();
hoffset += spacing();
}
@@ -593,8 +615,8 @@ void QDeclarativeRow::reportConflictingAnchors()
QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item) {
- QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
if (anchors) {
QDeclarativeAnchors::Anchors usedAnchors = anchors->usedAnchors();
if (usedAnchors & QDeclarativeAnchors::LeftAnchor ||
@@ -613,6 +635,7 @@ void QDeclarativeRow::reportConflictingAnchors()
/*!
\qmlclass Grid QDeclarativeGrid
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Grid item positions its children in a grid.
\inherits Item
@@ -814,10 +837,11 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
const PositionedItem &child = positionedItems.at(childIndex++);
if (!child.item || isInvisible(child.item))
continue;
- if (child.item->width() > maxColWidth[j])
- maxColWidth[j] = child.item->width();
- if (child.item->height() > maxRowHeight[i])
- maxRowHeight[i] = child.item->height();
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
+ if (childPrivate->width() > maxColWidth[j])
+ maxColWidth[j] = childPrivate->width();
+ if (childPrivate->height() > maxRowHeight[i])
+ maxRowHeight[i] = childPrivate->height();
}
}
} else {
@@ -833,10 +857,11 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
const PositionedItem &child = positionedItems.at(childIndex++);
if (!child.item || isInvisible(child.item))
continue;
- if (child.item->width() > maxColWidth[j])
- maxColWidth[j] = child.item->width();
- if (child.item->height() > maxRowHeight[i])
- maxRowHeight[i] = child.item->height();
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
+ if (childPrivate->width() > maxColWidth[j])
+ maxColWidth[j] = childPrivate->width();
+ if (childPrivate->height() > maxRowHeight[i])
+ maxRowHeight[i] = childPrivate->height();
}
}
}
@@ -855,7 +880,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
}
if (m_flow == LeftToRight) {
- contentSize->setWidth(qMax(contentSize->width(), xoffset + child.item->width()));
+ contentSize->setWidth(qMax(contentSize->width(), xoffset + QGraphicsItemPrivate::get(child.item)->width()));
contentSize->setHeight(yoffset + maxRowHeight[curRow]);
xoffset+=maxColWidth[curCol]+spacing();
@@ -869,7 +894,7 @@ void QDeclarativeGrid::doPositioning(QSizeF *contentSize)
break;
}
} else {
- contentSize->setHeight(qMax(contentSize->height(), yoffset + child.item->height()));
+ contentSize->setHeight(qMax(contentSize->height(), yoffset + QGraphicsItemPrivate::get(child.item)->height()));
contentSize->setWidth(xoffset + maxColWidth[curCol]);
yoffset+=maxRowHeight[curRow]+spacing();
@@ -891,8 +916,8 @@ void QDeclarativeGrid::reportConflictingAnchors()
QDeclarativeBasePositionerPrivate *d = static_cast<QDeclarativeBasePositionerPrivate*>(QDeclarativeBasePositionerPrivate::get(this));
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item) {
- QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
d->anchorConflict = true;
break;
@@ -905,6 +930,7 @@ void QDeclarativeGrid::reportConflictingAnchors()
/*!
\qmlclass Flow QDeclarativeFlow
+ \ingroup qml-positioning-elements
\since 4.7
\brief The Flow item arranges its children side by side, wrapping as necessary.
\inherits Item
@@ -1026,14 +1052,15 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
if (!child.item || isInvisible(child.item))
continue;
+ QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child.item);
if (d->flow == LeftToRight) {
- if (widthValid() && hoffset && hoffset + child.item->width() > width()) {
+ if (widthValid() && hoffset && hoffset + childPrivate->width() > width()) {
hoffset = 0;
voffset += linemax + spacing();
linemax = 0;
}
} else {
- if (heightValid() && voffset && voffset + child.item->height() > height()) {
+ if (heightValid() && voffset && voffset + childPrivate->height() > height()) {
voffset = 0;
hoffset += linemax + spacing();
linemax = 0;
@@ -1045,17 +1072,17 @@ void QDeclarativeFlow::doPositioning(QSizeF *contentSize)
positionY(voffset, child);
}
- contentSize->setWidth(qMax(contentSize->width(), hoffset + child.item->width()));
- contentSize->setHeight(qMax(contentSize->height(), voffset + child.item->height()));
+ contentSize->setWidth(qMax(contentSize->width(), hoffset + childPrivate->width()));
+ contentSize->setHeight(qMax(contentSize->height(), voffset + childPrivate->height()));
if (d->flow == LeftToRight) {
- hoffset += child.item->width();
+ hoffset += childPrivate->width();
hoffset += spacing();
- linemax = qMax(linemax, qCeil(child.item->height()));
+ linemax = qMax(linemax, qCeil(childPrivate->height()));
} else {
- voffset += child.item->height();
+ voffset += childPrivate->height();
voffset += spacing();
- linemax = qMax(linemax, qCeil(child.item->width()));
+ linemax = qMax(linemax, qCeil(childPrivate->width()));
}
}
}
@@ -1065,8 +1092,8 @@ void QDeclarativeFlow::reportConflictingAnchors()
Q_D(QDeclarativeFlow);
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
- if (child.item) {
- QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(child.item)->_anchors;
+ if (child.item && QGraphicsItemPrivate::get(child.item)->isDeclarativeItem) {
+ QDeclarativeAnchors *anchors = QDeclarativeItemPrivate::get(static_cast<QDeclarativeItem *>(child.item))->_anchors;
if (anchors && (anchors->usedAnchors() || anchors->fill() || anchors->centerIn())) {
d->anchorConflict = true;
break;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
index c03e518..f9ecc0a 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p.h
@@ -91,14 +91,16 @@ Q_SIGNALS:
protected Q_SLOTS:
void prePositioning();
+ void graphicsWidgetGeometryChanged();
protected:
virtual void doPositioning(QSizeF *contentSize)=0;
virtual void reportConflictingAnchors()=0;
- struct PositionedItem {
- PositionedItem(QDeclarativeItem *i) : item(i), isNew(false), isVisible(true) {}
+ class PositionedItem {
+ public :
+ PositionedItem(QGraphicsObject *i) : item(i), isNew(false), isVisible(true) {}
bool operator==(const PositionedItem &other) const { return other.item == item; }
- QDeclarativeItem *item;
+ QGraphicsObject *item;
bool isNew;
bool isVisible;
};
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
index 822079b..35946e9 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepositioners_p_p.h
@@ -94,8 +94,8 @@ public:
QDeclarativeTransitionManager addTransitionManager;
QDeclarativeTransitionManager moveTransitionManager;
- void watchChanges(QDeclarativeItem *other);
- void unwatchChanges(QDeclarativeItem* other);
+ void watchChanges(QGraphicsObject *other);
+ void unwatchChanges(QGraphicsObject* other);
bool queuedPositioning : 1;
bool doingPositioning : 1;
bool anchorConflict : 1;
@@ -123,6 +123,7 @@ public:
if (newGeometry.size() != oldGeometry.size())
q->prePositioning();
}
+
virtual void itemVisibilityChanged(QDeclarativeItem *)
{
schedulePositioning();
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index c49be46..5990c2d 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -84,6 +84,7 @@ void QDeclarativePen::setWidth(int w)
/*!
\qmlclass GradientStop QDeclarativeGradientStop
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The GradientStop item defines the color at a position in a Gradient
@@ -105,6 +106,7 @@ void QDeclarativeGradientStop::updateGradient()
/*!
\qmlclass Gradient QDeclarativeGradient
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The Gradient item defines a gradient fill.
@@ -152,6 +154,7 @@ void QDeclarativeGradient::doUpdate()
/*!
\qmlclass Rectangle QDeclarativeRectangle
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The Rectangle item allows you to add rectangles to a scene.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 68e7e9a..4a951a2 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -62,6 +62,7 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
/*!
\qmlclass Repeater QDeclarativeRepeater
+ \ingroup qml-utility-elements
\since 4.7
\inherits Item
@@ -245,8 +246,8 @@ void QDeclarativeRepeater::setModel(const QVariant &model)
connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*)));
*/
regenerate();
- emit countChanged();
}
+ emit countChanged();
}
/*!
@@ -377,6 +378,7 @@ void QDeclarativeRepeater::itemsInserted(int index, int count)
d->deletables.insert(modelIndex, item);
}
}
+ emit countChanged();
}
void QDeclarativeRepeater::itemsRemoved(int index, int count)
@@ -391,6 +393,7 @@ void QDeclarativeRepeater::itemsRemoved(int index, int count)
else
break;
}
+ emit countChanged();
}
void QDeclarativeRepeater::itemsMoved(int from, int to, int count)
@@ -420,6 +423,7 @@ void QDeclarativeRepeater::modelReset()
if (!isComponentComplete())
return;
regenerate();
+ emit countChanged();
}
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index ab2be9c..e5ad743 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -162,7 +162,8 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
/*!
\qmlclass Text QDeclarativeText
- \since 4.7
+ \ingroup qml-basic-visual-elements
+ \since 4.7
\brief The Text item allows you to add formatted text to a scene.
\inherits Item
@@ -1046,10 +1047,10 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
QAbstractTextDocumentLayout::PaintContext context;
+ QTextOption oldOption(doc->defaultTextOption());
if (drawStyle) {
context.palette.setColor(QPalette::Text, styleColor);
- // ### Do we really want this?
- QTextOption colorOption;
+ QTextOption colorOption(doc->defaultTextOption());
colorOption.setFlags(QTextOption::SuppressColors);
doc->setDefaultTextOption(colorOption);
} else {
@@ -1057,7 +1058,7 @@ QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle)
}
doc->documentLayout()->draw(&p, context);
if (drawStyle)
- doc->setDefaultTextOption(QTextOption());
+ doc->setDefaultTextOption(oldOption);
return img;
}
@@ -1217,7 +1218,7 @@ void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (!d->richText || !d->doc || d->doc->documentLayout()->anchorAt(event->pos()).isEmpty()) {
event->setAccepted(false);
- d->activeLink = QString();
+ d->activeLink.clear();
} else {
d->activeLink = d->doc->documentLayout()->anchorAt(event->pos());
}
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index 8117676..b8e8726 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass TextEdit QDeclarativeTextEdit
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The TextEdit item displays multiple lines of editable formatted text.
\inherits Item
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 90f5a70..b4f36f4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass TextInput QDeclarativeTextInput
+ \ingroup qml-basic-visual-elements
\since 4.7
\brief The TextInput item displays an editable line of text.
\inherits Item
@@ -276,8 +277,10 @@ void QDeclarativeTextInput::setSelectionColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::Highlight, d->selectionColor);
d->control->setPalette(p);
- clearCache();
- update();
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
emit selectionColorChanged(color);
}
@@ -302,8 +305,10 @@ void QDeclarativeTextInput::setSelectedTextColor(const QColor &color)
QPalette p = d->control->palette();
p.setColor(QPalette::HighlightedText, d->selectedTextColor);
d->control->setPalette(p);
- clearCache();
- update();
+ if (d->control->hasSelectedText()) {
+ clearCache();
+ update();
+ }
emit selectedTextColorChanged(color);
}
@@ -561,6 +566,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
/*!
\qmlclass IntValidator QIntValidator
+ \ingroup qml-basic-visual-elements
This element provides a validator for integer values.
*/
@@ -579,6 +585,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
/*!
\qmlclass DoubleValidator QDoubleValidator
+ \ingroup qml-basic-visual-elements
This element provides a validator for non-integer numbers.
*/
@@ -617,6 +624,7 @@ void QDeclarativeTextInput::setAutoScroll(bool b)
/*!
\qmlclass RegExpValidator QRegExpValidator
+ \ingroup qml-basic-visual-elements
This element provides a validator, which counts as valid any string which
matches a specified regular expression.
@@ -1229,8 +1237,12 @@ void QDeclarativeTextInput::setPasswordCharacter(const QString &str)
Q_D(QDeclarativeTextInput);
if(str.length() < 1)
return;
- emit passwordCharacterChanged();
d->control->setPasswordCharacter(str.constData()[0]);
+ EchoMode echoMode_ = echoMode();
+ if (echoMode_ == Password || echoMode_ == PasswordEchoOnEdit) {
+ updateSize();
+ }
+ emit passwordCharacterChanged();
}
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index a489b5a..65b14cf 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -128,6 +128,7 @@ public:
/*!
\qmlclass VisualItemModel QDeclarativeVisualItemModel
+ \ingroup qml-working-with-data
\since 4.7
\brief The VisualItemModel allows items to be provided to a view.
@@ -237,20 +238,6 @@ QString QDeclarativeVisualItemModel::stringValue(int index, const QString &name)
return QDeclarativeEngine::contextForObject(d->children.at(index).item)->contextProperty(name).toString();
}
-QVariant QDeclarativeVisualItemModel::evaluate(int index, const QString &expression, QObject *objectContext)
-{
- Q_D(QDeclarativeVisualItemModel);
- if (index < 0 || index >= d->children.count())
- return QVariant();
- QDeclarativeContext *ccontext = qmlContext(this);
- QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
- ctxt->setContextObject(d->children.at(index).item);
- QDeclarativeExpression e(ctxt, objectContext, expression);
- QVariant value = e.evaluate();
- delete ctxt;
- return value;
-}
-
int QDeclarativeVisualItemModel::indexOf(QDeclarativeItem *item, QObject *) const
{
Q_D(const QDeclarativeVisualItemModel);
@@ -644,6 +631,7 @@ QDeclarativeVisualDataModelData *QDeclarativeVisualDataModelPrivate::data(QObjec
/*!
\qmlclass VisualDataModel QDeclarativeVisualDataModel
+ \ingroup qml-working-with-data
\brief The VisualDataModel encapsulates a model and delegate
A VisualDataModel encapsulates a model and the delegate that will
@@ -726,6 +714,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)),
this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)));
QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
+ d->m_abstractItemModel = 0;
} else if (d->m_visualItemModel) {
QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)),
this, SIGNAL(itemsInserted(int,int)));
@@ -977,7 +966,7 @@ QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(Q
Q_ASSERT(p->declarativeData);
QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
if (d->ownContext && d->context)
- d->context->clearExpressions();
+ d->context->clearContext();
if (inPackage) {
emit destroyingPackage(qobject_cast<QDeclarativePackage*>(obj));
@@ -1165,38 +1154,6 @@ QString QDeclarativeVisualDataModel::stringValue(int index, const QString &name)
return val;
}
-QVariant QDeclarativeVisualDataModel::evaluate(int index, const QString &expression, QObject *objectContext)
-{
- Q_D(QDeclarativeVisualDataModel);
- if (d->m_visualItemModel)
- return d->m_visualItemModel->evaluate(index, expression, objectContext);
-
- if ((!d->m_listModelInterface && !d->m_abstractItemModel) || !d->m_delegate)
- return QVariant();
-
- QVariant value;
- QObject *nobj = d->m_cache.item(index);
- if (nobj) {
- QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(nobj);
- if (item) {
- QDeclarativeExpression e(qmlContext(item), objectContext, expression);
- value = e.evaluate();
- }
- } else {
- QDeclarativeContext *ccontext = d->m_context;
- if (!ccontext) ccontext = qmlContext(this);
- QDeclarativeContext *ctxt = new QDeclarativeContext(ccontext);
- QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
- ctxt->setContextObject(data);
- QDeclarativeExpression e(ctxt, objectContext, expression);
- value = e.evaluate();
- delete data;
- delete ctxt;
- }
-
- return value;
-}
-
int QDeclarativeVisualDataModel::indexOf(QDeclarativeItem *item, QObject *) const
{
QVariant val = QDeclarativeEngine::contextForObject(item)->contextProperty(QLatin1String("index"));
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
index d5c0de2..50d2c53 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -79,7 +79,6 @@ public:
virtual ReleaseFlags release(QDeclarativeItem *item) = 0;
virtual bool completePending() const = 0;
virtual void completeItem() = 0;
- virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext) = 0;
virtual QString stringValue(int, const QString &) { return QString(); }
virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const = 0;
@@ -122,7 +121,6 @@ public:
virtual bool completePending() const;
virtual void completeItem();
virtual QString stringValue(int index, const QString &role);
- virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext);
virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const;
@@ -177,7 +175,6 @@ public:
bool completePending() const;
void completeItem();
virtual QString stringValue(int index, const QString &role);
- QVariant evaluate(int index, const QString &expression, QObject *objectContext);
int indexOf(QDeclarativeItem *item, QObject *objectContext) const;
diff --git a/src/declarative/qml/parser/qdeclarativejslexer.cpp b/src/declarative/qml/parser/qdeclarativejslexer.cpp
index 65a6af2..cd08658 100644
--- a/src/declarative/qml/parser/qdeclarativejslexer.cpp
+++ b/src/declarative/qml/parser/qdeclarativejslexer.cpp
@@ -120,7 +120,7 @@ Lexer::~Lexer()
void Lexer::setCode(const QString &c, int lineno)
{
- errmsg = QString();
+ errmsg.clear();
yylineno = lineno;
yycolumn = 1;
restrKeyword = false;
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 5f4a063..d2d1f19 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -54,6 +54,7 @@
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativescriptparser_p.h"
#include "private/qdeclarativedebugtrace_p.h"
+#include "private/qdeclarativeenginedebug_p.h"
#include <QStack>
#include <QStringList>
@@ -104,6 +105,7 @@ class QByteArray;
/*!
\qmlclass Component QDeclarativeComponent
+ \ingroup qml-utility-elements
\since 4.7
\brief The Component element encapsulates a QML component definition.
@@ -599,7 +601,7 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
property, or else the object will not be visible.
Dynamically created instances can be deleted with the \c destroy() method.
- See \l {Dynamic Object Management} for more information.
+ See \l {Dynamic Object Management in QML} for more information.
*/
/*!
@@ -764,8 +766,11 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons
QObject *rv = begin(ctxt, ep, cc, start, count, &state, bindings);
- if (rv && !context->isInternal && ep->isDebugging)
- context->asQDeclarativeContextPrivate()->instances.append(rv);
+ if (ep->isDebugging && rv) {
+ if (!context->isInternal)
+ context->asQDeclarativeContextPrivate()->instances.append(rv);
+ QDeclarativeEngineDebugServer::instance()->objectCreated(engine, rv);
+ }
return rv;
}
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index 26b2a9b..2e77534 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -544,7 +544,7 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
}
- foreach (QDeclarativeScriptParser::Import imp, unit->data.imports()) {
+ foreach (const QDeclarativeScriptParser::Import &imp, unit->data.imports()) {
QDeclarativeDirComponents qmldircomponentsnetwork;
if (imp.type == QDeclarativeScriptParser::Import::Script)
continue;
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index a58dc6c..a3b16d9 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -533,8 +533,21 @@ void QDeclarativeContextData::invalidate()
parent = 0;
}
-void QDeclarativeContextData::clearExpressions()
+void QDeclarativeContextData::clearContext()
{
+ if (engine) {
+ while (componentAttached) {
+ QDeclarativeComponentAttached *a = componentAttached;
+ componentAttached = a->next;
+ if (componentAttached) componentAttached->prev = &componentAttached;
+
+ a->next = 0;
+ a->prev = 0;
+
+ emit a->destruction();
+ }
+ }
+
QDeclarativeAbstractExpression *expression = expressions;
while (expression) {
QDeclarativeAbstractExpression *nextExpression = expression->m_nextExpression;
@@ -555,7 +568,7 @@ void QDeclarativeContextData::destroy()
if (engine) invalidate();
- clearExpressions();
+ clearContext();
while (contextObjects) {
QDeclarativeData *co = contextObjects;
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index c5a039a..6c14feb 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -113,7 +113,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeContextData
public:
QDeclarativeContextData();
QDeclarativeContextData(QDeclarativeContext *);
- void clearExpressions();
+ void clearContext();
void destroy();
void invalidate();
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 3fe89a5..4d244c5 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -114,6 +114,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass QtObject QObject
+ \ingroup qml-utility-elements
\since 4.7
\brief The QtObject element is the most basic element in QML.
@@ -185,6 +186,7 @@ void QDeclarativeEnginePrivate::defineModule()
/*!
\qmlclass QML:Qt QDeclarativeEnginePrivate
+ \ingroup qml-utility-elements
\brief The QML global Qt object provides useful enums and functions from Qt.
\keyword QmlGlobalQtObject
@@ -241,7 +243,7 @@ The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDat
\section1 Dynamic Object Creation
The following functions on the global object allow you to dynamically create QML
-items from files or strings. See \l{Dynamic Object Management} for an overview
+items from files or strings. See \l{Dynamic Object Management in QML} for an overview
of their use.
\list
@@ -436,8 +438,6 @@ void QDeclarativeEnginePrivate::clear(SimpleList<QDeclarativeParserStatus> &pss)
pss.clear();
}
-Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
-
void QDeclarativePrivate::qdeclarativeelement_destructor(QObject *o)
{
QObjectPrivate *p = QObjectPrivate::get(o);
@@ -479,9 +479,8 @@ void QDeclarativeEnginePrivate::init()
if (QCoreApplication::instance()->thread() == q->thread() &&
QDeclarativeEngineDebugServer::isDebuggingEnabled()) {
- qmlEngineDebugServer();
isDebugging = true;
- QDeclarativeEngineDebugServer::addEngine(q);
+ QDeclarativeEngineDebugServer::instance()->addEngine(q);
}
}
@@ -545,11 +544,11 @@ QDeclarativeEngine::~QDeclarativeEngine()
{
Q_D(QDeclarativeEngine);
if (d->isDebugging)
- QDeclarativeEngineDebugServer::remEngine(this);
+ QDeclarativeEngineDebugServer::instance()->remEngine(this);
}
/*! \fn void QDeclarativeEngine::quit()
- This signal is emitted when the QDeclarativeEngine quits.
+ This signal is emitted when the QML loaded by the engine would like to quit.
*/
/*! \fn void QDeclarativeEngine::warnings(const QList<QDeclarativeError> &warnings)
@@ -672,7 +671,7 @@ void QDeclarativeEngine::addImageProvider(const QString &providerId, QDeclarativ
{
Q_D(QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
- d->imageProviders.insert(providerId, provider);
+ d->imageProviders.insert(providerId, QSharedPointer<QDeclarativeImageProvider>(provider));
}
/*!
@@ -682,7 +681,7 @@ QDeclarativeImageProvider *QDeclarativeEngine::imageProvider(const QString &prov
{
Q_D(const QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
- return d->imageProviders.value(providerId);
+ return d->imageProviders.value(providerId).data();
}
/*!
@@ -696,13 +695,14 @@ void QDeclarativeEngine::removeImageProvider(const QString &providerId)
{
Q_D(QDeclarativeEngine);
QMutexLocker locker(&d->mutex);
- delete d->imageProviders.take(providerId);
+ d->imageProviders.take(providerId);
}
QDeclarativeImageProvider::ImageType QDeclarativeEnginePrivate::getImageProviderType(const QUrl &url)
{
QMutexLocker locker(&mutex);
- QDeclarativeImageProvider *provider = imageProviders.value(url.host());
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
if (provider)
return provider->imageType();
return static_cast<QDeclarativeImageProvider::ImageType>(-1);
@@ -712,7 +712,8 @@ QImage QDeclarativeEnginePrivate::getImageFromProvider(const QUrl &url, QSize *s
{
QMutexLocker locker(&mutex);
QImage image;
- QDeclarativeImageProvider *provider = imageProviders.value(url.host());
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
if (provider)
image = provider->requestImage(url.path().mid(1), size, req_size);
return image;
@@ -722,7 +723,8 @@ QPixmap QDeclarativeEnginePrivate::getPixmapFromProvider(const QUrl &url, QSize
{
QMutexLocker locker(&mutex);
QPixmap pixmap;
- QDeclarativeImageProvider *provider = imageProviders.value(url.host());
+ QSharedPointer<QDeclarativeImageProvider> provider = imageProviders.value(url.host());
+ locker.unlock();
if (provider)
pixmap = provider->requestPixmap(url.path().mid(1), size, req_size);
return pixmap;
@@ -1119,7 +1121,7 @@ For example:
\snippet doc/src/snippets/declarative/createComponent-simple.qml 0
-See \l {Dynamic Object Management} for more information on using this function.
+See \l {Dynamic Object Management in QML} for more information on using this function.
To create a QML object from an arbitrary string of QML (instead of a file),
use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}.
@@ -1171,7 +1173,7 @@ Note that this function returns immediately, and therefore may not work if
the \a qml string loads new components (that is, external QML files that have not yet been loaded).
If this is the case, consider using \l{QML:Qt::createComponent()}{Qt.createComponent()} instead.
-See \l {Dynamic Object Management} for more information on using this function.
+See \l {Dynamic Object Management in QML} for more information on using this function.
*/
QScriptValue QDeclarativeEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngine *engine)
@@ -2074,7 +2076,7 @@ void QDeclarativeEnginePrivate::registerCompositeType(QDeclarativeCompiledData *
QByteArray name = data->root->className();
QByteArray ptr = name + '*';
- QByteArray lst = "QDeclarativeListProperty<" + name + ">";
+ QByteArray lst = "QDeclarativeListProperty<" + name + '>';
int ptr_type = QMetaType::registerType(ptr.constData(), voidptr_destructor,
voidptr_constructor);
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 3b5dd5a..db2db35 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -232,7 +232,7 @@ public:
mutable QNetworkAccessManager *networkAccessManager;
mutable QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory;
- QHash<QString,QDeclarativeImageProvider*> imageProviders;
+ QHash<QString,QSharedPointer<QDeclarativeImageProvider> > imageProviders;
QDeclarativeImageProvider::ImageType getImageProviderType(const QUrl &url);
QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp
index 1837366..ed28185 100644
--- a/src/declarative/qml/qdeclarativeenginedebug.cpp
+++ b/src/declarative/qml/qdeclarativeenginedebug.cpp
@@ -58,7 +58,13 @@
QT_BEGIN_NAMESPACE
-QList<QDeclarativeEngine *> QDeclarativeEngineDebugServer::m_engines;
+Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer);
+
+QDeclarativeEngineDebugServer *QDeclarativeEngineDebugServer::instance()
+{
+ return qmlEngineDebugServer();
+}
+
QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent)
: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
m_watch(new QDeclarativeWatcher(this))
@@ -182,7 +188,7 @@ QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) con
}
void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
- QObject *object, bool recur)
+ QObject *object, bool recur, bool dumpProperties)
{
message << objectData(object);
@@ -209,6 +215,8 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
continue;
QDeclarativeBoundSignal *signal = QDeclarativeBoundSignal::cast(child);
if (signal) {
+ if (!dumpProperties)
+ continue;
QDeclarativeObjectProperty prop;
prop.type = QDeclarativeObjectProperty::SignalProperty;
prop.hasNotifySignal = false;
@@ -229,12 +237,17 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message,
fakeProperties << prop;
} else {
if (recur)
- buildObjectDump(message, child, recur);
+ buildObjectDump(message, child, recur, dumpProperties);
else
message << objectData(child);
}
}
+ if (!dumpProperties) {
+ message << 0;
+ return;
+ }
+
message << (object->metaObject()->propertyCount() + fakeProperties.count());
for (int ii = 0; ii < object->metaObject()->propertyCount(); ++ii)
@@ -257,8 +270,7 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDecla
QDeclarativeContextData *child = p->childContexts;
while (child) {
- if (!child->isInternal)
- ++count;
+ ++count;
child = child->nextChild;
}
@@ -266,8 +278,7 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDecla
child = p->childContexts;
while (child) {
- if (!child->isInternal)
- buildObjectList(message, child->asQDeclarativeContext());
+ buildObjectList(message, child->asQDeclarativeContext());
child = child->nextChild;
}
@@ -372,8 +383,9 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
int queryId;
int objectId;
bool recurse;
+ bool dumpProperties = true;
- ds >> queryId >> objectId >> recurse;
+ ds >> queryId >> objectId >> recurse >> dumpProperties;
QObject *object = QDeclarativeDebugService::objectForId(objectId);
@@ -382,7 +394,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message)
rs << QByteArray("FETCH_OBJECT_R") << queryId;
if (object)
- buildObjectDump(rs, object, recurse);
+ buildObjectDump(rs, object, recurse, dumpProperties);
sendMessage(reply);
} else if (type == "WATCH_OBJECT") {
@@ -592,4 +604,19 @@ void QDeclarativeEngineDebugServer::remEngine(QDeclarativeEngine *engine)
m_engines.removeAll(engine);
}
+void QDeclarativeEngineDebugServer::objectCreated(QDeclarativeEngine *engine, QObject *object)
+{
+ Q_ASSERT(engine);
+ Q_ASSERT(m_engines.contains(engine));
+
+ int engineId = QDeclarativeDebugService::idForObject(engine);
+ int objectId = QDeclarativeDebugService::idForObject(object);
+
+ QByteArray reply;
+ QDataStream rs(&reply, QIODevice::WriteOnly);
+
+ rs << QByteArray("OBJECT_CREATED") << engineId << objectId;
+ sendMessage(reply);
+}
+
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/qml/qdeclarativeenginedebug_p.h
index ea35b40..613f1fe 100644
--- a/src/declarative/qml/qdeclarativeenginedebug_p.h
+++ b/src/declarative/qml/qdeclarativeenginedebug_p.h
@@ -92,8 +92,11 @@ public:
bool hasNotifySignal;
};
- static void addEngine(QDeclarativeEngine *);
- static void remEngine(QDeclarativeEngine *);
+ void addEngine(QDeclarativeEngine *);
+ void remEngine(QDeclarativeEngine *);
+ void objectCreated(QDeclarativeEngine *, QObject *);
+
+ static QDeclarativeEngineDebugServer *instance();
protected:
virtual void messageReceived(const QByteArray &);
@@ -103,7 +106,7 @@ private Q_SLOTS:
private:
void buildObjectList(QDataStream &, QDeclarativeContext *);
- void buildObjectDump(QDataStream &, QObject *, bool);
+ void buildObjectDump(QDataStream &, QObject *, bool, bool);
QDeclarativeObjectData objectData(QObject *);
QDeclarativeObjectProperty propertyData(QObject *, int);
QVariant valueContents(const QVariant &defaultValue) const;
@@ -111,7 +114,7 @@ private:
void resetBinding(int objectId, const QString &propertyName);
void setMethodBody(int objectId, const QString &method, const QString &body);
- static QList<QDeclarativeEngine *> m_engines;
+ QList<QDeclarativeEngine *> m_engines;
QDeclarativeWatcher *m_watch;
};
Q_DECLARATIVE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectData &);
diff --git a/src/declarative/qml/qdeclarativeimageprovider.cpp b/src/declarative/qml/qdeclarativeimageprovider.cpp
index ea68327..ef31be7 100644
--- a/src/declarative/qml/qdeclarativeimageprovider.cpp
+++ b/src/declarative/qml/qdeclarativeimageprovider.cpp
@@ -161,7 +161,9 @@ QDeclarativeImageProvider::QDeclarativeImageProvider(ImageType type)
}
/*!
- \internal
+ Destroys the QDeclarativeImageProvider
+
+ \note The destructor of your derived class need to be thread safe.
*/
QDeclarativeImageProvider::~QDeclarativeImageProvider()
{
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 8d81b34..5c21ebc 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -338,7 +338,7 @@ QString QDeclarativeImportsPrivate::resolvedUri(const QString &dir_arg, QDeclara
qSort(paths.begin(), paths.end(), greaterThan); // Ensure subdirs preceed their parents.
QString stableRelativePath = dir;
- foreach( QString path, paths) {
+ foreach(const QString &path, paths) {
if (dir.startsWith(path)) {
stableRelativePath = dir.mid(path.length()+1);
break;
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index 0657f49..0b3b35f 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -543,7 +543,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
QString typemodifier;
if(node->typeModifier)
typemodifier = node->typeModifier->asString();
- if (typemodifier == QString()) {
+ if (typemodifier.isEmpty()) {
type = Object::DynamicProperty::Custom;
} else if(typemodifier == QLatin1String("list")) {
type = Object::DynamicProperty::CustomList;
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index a42f131..509ca6b 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -514,6 +514,7 @@ void QDeclarativeWorkerScriptEngine::run()
/*!
\qmlclass WorkerScript QDeclarativeWorkerScript
+ \ingroup qml-utility-elements
\brief The WorkerScript element enables the use of threads in QML.
Use WorkerScript to run operations in a new thread.
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index eb37dd8..301ea1d 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -967,8 +967,9 @@ public:
QScriptValue send(QScriptValue *me, const QByteArray &);
QScriptValue abort(QScriptValue *me);
- QString responseBody() const;
+ QString responseBody();
const QByteArray & rawResponseBody() const;
+ bool receivedXml() const;
private slots:
void downloadProgress(qint64);
void error(QNetworkReply::NetworkError);
@@ -991,6 +992,15 @@ private:
HeadersList m_headersList;
void fillHeadersList();
+ bool m_gotXml;
+ QByteArray m_mime;
+ QByteArray m_charset;
+ QTextCodec *m_textCodec;
+#ifndef QT_NO_TEXTCODEC
+ QTextCodec* findTextCodec() const;
+#endif
+ void readEncoding();
+
QScriptValue m_me; // Set to the data object while a send() is ongoing (to access the callback)
QScriptValue dispatchCallback(QScriptValue *me);
@@ -1008,7 +1018,7 @@ private:
QDeclarativeXMLHttpRequest::QDeclarativeXMLHttpRequest(QNetworkAccessManager *manager)
: m_state(Unsent), m_errorFlag(false), m_sendFlag(false),
- m_redirectCount(0), m_network(0), m_nam(manager)
+ m_redirectCount(0), m_gotXml(false), m_textCodec(0), m_network(0), m_nam(manager)
{
}
@@ -1278,6 +1288,7 @@ void QDeclarativeXMLHttpRequest::finished()
if (cbv.isError()) printError(cbv);
}
m_responseEntityBody.append(m_network->readAll());
+ readEncoding();
if (xhrDump()) {
qWarning().nospace() << "XMLHttpRequest: RESPONSE " << qPrintable(m_url.toString());
@@ -1303,15 +1314,72 @@ void QDeclarativeXMLHttpRequest::finished()
}
-QString QDeclarativeXMLHttpRequest::responseBody() const
+void QDeclarativeXMLHttpRequest::readEncoding()
+{
+ foreach (const HeaderPair &header, m_headersList) {
+ if (header.first == "content-type") {
+ int separatorIdx = header.second.indexOf(';');
+ if (separatorIdx == -1) {
+ m_mime == header.second;
+ } else {
+ m_mime = header.second.mid(0, separatorIdx);
+ int charsetIdx = header.second.indexOf("charset=");
+ if (charsetIdx != -1) {
+ charsetIdx += 8;
+ separatorIdx = header.second.indexOf(';', charsetIdx);
+ m_charset = header.second.mid(charsetIdx, separatorIdx >= 0 ? separatorIdx : header.second.length());
+ }
+ }
+ break;
+ }
+ }
+
+ if (m_mime.isEmpty() || m_mime == "text/xml" || m_mime == "application/xml" || m_mime.endsWith("+xml"))
+ m_gotXml = true;
+}
+
+bool QDeclarativeXMLHttpRequest::receivedXml() const
+{
+ return m_gotXml;
+}
+
+
+#ifndef QT_NO_TEXTCODEC
+QTextCodec* QDeclarativeXMLHttpRequest::findTextCodec() const
+{
+ QTextCodec *codec = 0;
+
+ if (!m_charset.isEmpty())
+ codec = QTextCodec::codecForName(m_charset);
+
+ if (!codec && m_gotXml) {
+ QXmlStreamReader reader(m_responseEntityBody);
+ reader.readNext();
+ codec = QTextCodec::codecForName(reader.documentEncoding().toString().toUtf8());
+ }
+
+ if (!codec && m_mime == "text/html")
+ codec = QTextCodec::codecForHtml(m_responseEntityBody, 0);
+
+ if (!codec)
+ codec = QTextCodec::codecForUtfText(m_responseEntityBody, 0);
+
+ if (!codec)
+ codec = QTextCodec::codecForName("UTF-8");
+ return codec;
+}
+#endif
+
+
+QString QDeclarativeXMLHttpRequest::responseBody()
{
- QXmlStreamReader reader(m_responseEntityBody);
- reader.readNext();
#ifndef QT_NO_TEXTCODEC
- QTextCodec *codec = QTextCodec::codecForName(reader.documentEncoding().toUtf8());
- if (codec)
- return codec->toUnicode(m_responseEntityBody);
+ if (!m_textCodec)
+ m_textCodec = findTextCodec();
+ if (m_textCodec)
+ return m_textCodec->toUnicode(m_responseEntityBody);
#endif
+
return QString::fromUtf8(m_responseEntityBody);
}
@@ -1572,7 +1640,8 @@ static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScri
if (!request)
THROW_REFERENCE("Not an XMLHttpRequest object");
- if (request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
+ if (!request->receivedXml() ||
+ request->readyState() != QDeclarativeXMLHttpRequest::Loading &&
request->readyState() != QDeclarativeXMLHttpRequest::Done)
return engine->nullValue();
else
diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp
index 6e4d7b8..0954248 100644
--- a/src/declarative/qml/qmetaobjectbuilder.cpp
+++ b/src/declarative/qml/qmetaobjectbuilder.cpp
@@ -1142,7 +1142,7 @@ static QByteArray buildParameterNames
if (!parameterNames.isEmpty()) {
QByteArray names;
bool first = true;
- foreach (QByteArray name, parameterNames) {
+ foreach (const QByteArray &name, parameterNames) {
if (first)
first = false;
else
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index a747706..4e9e8d5 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -74,6 +74,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Animation QDeclarativeAbstractAnimation
+ \ingroup qml-animation-transition
\since 4.7
\brief The Animation element is the base of all QML animations.
@@ -554,6 +555,7 @@ void QDeclarativeAbstractAnimation::timelineComplete()
/*!
\qmlclass PauseAnimation QDeclarativePauseAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The PauseAnimation element provides a pause for an animation.
@@ -630,6 +632,7 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
/*!
\qmlclass ColorAnimation QDeclarativeColorAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits PropertyAnimation
\brief The ColorAnimation element animates changes in color values.
@@ -691,9 +694,12 @@ QDeclarativeColorAnimation::~QDeclarativeColorAnimation()
}
\endqml
- If this value is not set and the ColorAnimation is defined within
- a \l Transition, it defaults to the value defined in the starting
- state of the \l Transition.
+ If the ColorAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation}
*/
QColor QDeclarativeColorAnimation::from() const
{
@@ -711,9 +717,12 @@ void QDeclarativeColorAnimation::setFrom(const QColor &f)
This property holds the color value at which the animation should end.
- If this value is not set and the ColorAnimation is defined within
- a \l Transition or \l Behavior, it defaults to the value defined in the end
- state of the \l Transition or \l Behavior.
+ If the ColorAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation}
*/
QColor QDeclarativeColorAnimation::to() const
{
@@ -730,6 +739,7 @@ void QDeclarativeColorAnimation::setTo(const QColor &t)
/*!
\qmlclass ScriptAction QDeclarativeScriptAction
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The ScriptAction element allows scripts to be run during an animation.
@@ -878,33 +888,50 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
/*!
\qmlclass PropertyAction QDeclarativePropertyAction
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The PropertyAction element allows immediate property changes during animation.
- PropertyAction is used to specify an immediate property change
- during an animation. The property change is not animated.
+ PropertyAction is used to specify an immediate property change during an
+ animation. The property change is not animated.
- For example, to explicitly set \c {theImage.smooth = true} during a \l Transition:
- \code
- transitions: Transition {
- ...
- PropertyAction { target: theImage; property: "smooth"; value: true }
- ...
- }
- \endcode
+ It is useful for setting non-animated property values during an animation.
- Or, to set \c theWebView.url to the value set for the destination state:
- \code
+ For example, here is a SequentialAnimation that sets the image's
+ \l {Image::}{smooth} property to \c true, animates the width of the image,
+ then sets \l {Image::}{smooth} back to \c false:
+
+ \snippet doc/src/snippets/declarative/propertyaction.qml standalone
+
+ PropertyAction is also useful for setting the exact point at which a property
+ change should occur during a \l Transition. For example, if PropertyChanges
+ was used in a \l State to rotate an item around a particular
+ \l {Item::}{transformOrigin}, it might be implemented like this:
+
+ \snippet doc/src/snippets/declarative/propertyaction.qml transition
+
+ However, with this code, the \c transformOrigin is not set until \e after
+ the animation, as a \l State is taken to define the values at the \e end of
+ a transition. The animation would rotate at the default \c transformOrigin,
+ then jump to \c Item.BottomRight. To fix this, insert a PropertyChanges
+ before the RotationAnimation begins:
+
+ \qml
transitions: Transition {
- ...
- PropertyAction { target: theWebView; property: "url" }
- ...
+ SequentialAnimation {
+ PropertyAction { target: rect; property: "transformOrigin" }
+ RotationAnimation { ... }
+ }
}
- \endcode
-
+ \endqml
+
+ This immediately sets the \c transformOrigin property to the value defined
+ in the end state of the \l Transition (i.e. the value defined in the
+ PropertyChanges object) so that the rotation animation begins with the
+ correct transform origin.
- \sa QtDeclarative
+ \sa {QML Animation}, QtDeclarative
*/
/*!
\internal
@@ -1009,7 +1036,11 @@ QDeclarativeListProperty<QObject> QDeclarativePropertyAction::exclude()
/*!
\qmlproperty any PropertyAction::value
This property holds the value to be set on the property.
- If not set, then the value defined for the end state of the transition.
+
+ If the PropertyAction is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
*/
QVariant QDeclarativePropertyAction::value() const
{
@@ -1129,6 +1160,7 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
/*!
\qmlclass NumberAnimation QDeclarativeNumberAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits PropertyAnimation
\brief The NumberAnimation element animates changes in qreal-type values.
@@ -1184,7 +1216,7 @@ void QDeclarativeNumberAnimation::init()
/*!
\qmlproperty real NumberAnimation::from
- This property holds the starting number value.
+ This property holds the starting value for the animation.
For example, the following animation is not applied until the \c x value
has reached 100:
@@ -1199,9 +1231,12 @@ void QDeclarativeNumberAnimation::init()
}
\endqml
- If this value is not set and the NumberAnimation is defined within
- a \l Transition, it defaults to the value defined in the start
- state of the \l Transition.
+ If the NumberAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation}
*/
qreal QDeclarativeNumberAnimation::from() const
@@ -1217,11 +1252,14 @@ void QDeclarativeNumberAnimation::setFrom(qreal f)
/*!
\qmlproperty real NumberAnimation::to
- This property holds the ending number value.
+ This property holds the end value for the animation.
- If this value is not set and the NumberAnimation is defined within
- a \l Transition or \l Behavior, it defaults to the value defined in the end
- state of the \l Transition or \l Behavior.
+ If the NumberAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation}
*/
qreal QDeclarativeNumberAnimation::to() const
{
@@ -1238,6 +1276,7 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
/*!
\qmlclass Vector3dAnimation QDeclarativeVector3dAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits PropertyAnimation
\brief The Vector3dAnimation element animates changes in QVector3d values.
@@ -1273,10 +1312,14 @@ QDeclarativeVector3dAnimation::~QDeclarativeVector3dAnimation()
/*!
\qmlproperty real Vector3dAnimation::from
- This property holds the starting value.
+ This property holds the starting value for the animation.
+
+ If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
- If this value is not set, it defaults to the value defined in the start
- state of the \l Transition.
+ \sa {QML Animation}
*/
QVector3D QDeclarativeVector3dAnimation::from() const
{
@@ -1291,10 +1334,14 @@ void QDeclarativeVector3dAnimation::setFrom(QVector3D f)
/*!
\qmlproperty real Vector3dAnimation::to
- This property holds the ending value.
+ This property holds the end value for the animation.
- If this value is not set, it defaults to the value defined in the end
- state of the \l Transition or \l Behavior.
+ If the Vector3dAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation}
*/
QVector3D QDeclarativeVector3dAnimation::to() const
{
@@ -1311,6 +1358,7 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
/*!
\qmlclass RotationAnimation QDeclarativeRotationAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits PropertyAnimation
\brief The RotationAnimation element animates changes in rotation values.
@@ -1335,6 +1383,12 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
your own properties via \l {PropertyAnimation::properties}{properties} or
\l {PropertyAnimation::property}{property}.
+ Also, note the \l Rectangle will be rotated around its default
+ \l {Item::}{transformOrigin} (which is \c Item.Center). To use a different
+ transform origin, set the origin in the PropertyChanges object and apply
+ the change at the start of the animation using PropertyAction. See the
+ PropertyAction documentation for more details.
+
Like any other animation element, a RotationAnimation can be applied in a
number of ways, including transitions, behaviors and property value
sources. The \l {QML Animation} documentation shows a variety of methods
@@ -1400,7 +1454,7 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
/*!
\qmlproperty real RotationAnimation::from
- This property holds the starting number value.
+ This property holds the starting value for the animation.
For example, the following animation is not applied until the \c angle value
has reached 100:
@@ -1415,8 +1469,12 @@ QDeclarativeRotationAnimation::~QDeclarativeRotationAnimation()
}
\endqml
- If this value is not set, it defaults to the value defined in the start
- state of the \l Transition.
+ If the RotationAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation}
*/
qreal QDeclarativeRotationAnimation::from() const
{
@@ -1431,10 +1489,14 @@ void QDeclarativeRotationAnimation::setFrom(qreal f)
/*!
\qmlproperty real RotationAnimation::to
- This property holds the ending value.
+ This property holds the end value for the animation..
+
+ If the RotationAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
- If this value is not set, it defaults to the value defined in the end
- state of the \l Transition or \l Behavior.
+ \sa {QML Animation}
*/
qreal QDeclarativeRotationAnimation::to() const
{
@@ -1540,6 +1602,7 @@ QDeclarativeListProperty<QDeclarativeAbstractAnimation> QDeclarativeAnimationGro
/*!
\qmlclass SequentialAnimation QDeclarativeSequentialAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The SequentialAnimation element allows animations to be run sequentially.
@@ -1613,6 +1676,7 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
/*!
\qmlclass ParallelAnimation QDeclarativeParallelAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The ParallelAnimation element allows animations to be run in parallel.
@@ -1731,6 +1795,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int
/*!
\qmlclass PropertyAnimation QDeclarativePropertyAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The PropertyAnimation element animates changes in property values.
@@ -1843,8 +1908,14 @@ void QDeclarativePropertyAnimation::setDuration(int duration)
/*!
\qmlproperty real PropertyAnimation::from
- This property holds the starting value.
- If not set, then the value defined in the start state of the transition.
+ This property holds the starting value for the animation.
+
+ If the PropertyAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the starting state of the
+ \l Transition, or the current value of the property at the moment the
+ \l Behavior is triggered.
+
+ \sa {QML Animation}
*/
QVariant QDeclarativePropertyAnimation::from() const
{
@@ -1864,8 +1935,14 @@ void QDeclarativePropertyAnimation::setFrom(const QVariant &f)
/*!
\qmlproperty real PropertyAnimation::to
- This property holds the ending value.
- If not set, then the value defined in the end state of the transition or \l Behavior.
+ This property holds the end value for the animation.
+
+ If the PropertyAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
+
+ \sa {QML Animation}
*/
QVariant QDeclarativePropertyAnimation::to() const
{
@@ -2392,12 +2469,15 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
d->actions = &data->actions;
} else {
delete data;
+ d->va->setFromSourcedValue(0); //clear previous data
+ d->va->setAnimValue(0, QAbstractAnimation::DeleteWhenStopped); //clear previous data
d->actions = 0;
}
}
/*!
\qmlclass ParentAnimation QDeclarativeParentAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The ParentAnimation element animates changes in parent values.
@@ -2488,7 +2568,10 @@ void QDeclarativeParentAnimation::setTarget(QDeclarativeItem *target)
\qmlproperty Item ParentAnimation::newParent
The new parent to animate to.
- If not set, then the parent defined in the end state of the transition.
+ If the ParentAnimation is defined within a \l Transition or \l Behavior,
+ this value defaults to the value defined in the end state of the
+ \l Transition, or the value of the property change that triggered the
+ \l Behavior.
*/
QDeclarativeItem *QDeclarativeParentAnimation::newParent() const
{
@@ -2757,6 +2840,7 @@ QAbstractAnimation *QDeclarativeParentAnimation::qtAnimation()
/*!
\qmlclass AnchorAnimation QDeclarativeAnchorAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits Animation
\brief The AnchorAnimation element animates changes in anchor values.
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index a1bb64f..8cb17e4 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -74,7 +74,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeAbstractAnimation : public QObject, publi
Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged)
- Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopsChanged)
+ Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopCountChanged)
Q_CLASSINFO("DefaultMethod", "start()")
public:
@@ -301,8 +301,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeColorAnimation : public QDeclarativeProperty
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(QColor from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(QColor to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(QColor from READ from WRITE setFrom)
+ Q_PROPERTY(QColor to READ to WRITE setTo)
public:
QDeclarativeColorAnimation(QObject *parent=0);
@@ -320,8 +320,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeNumberAnimation : public QDeclarativePropert
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
public:
QDeclarativeNumberAnimation(QObject *parent=0);
@@ -345,8 +345,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeVector3dAnimation : public QDeclarativePrope
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(QVector3D from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(QVector3D to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(QVector3D from READ from WRITE setFrom)
+ Q_PROPERTY(QVector3D to READ to WRITE setTo)
public:
QDeclarativeVector3dAnimation(QObject *parent=0);
@@ -366,8 +366,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeRotationAnimation : public QDeclarativePrope
Q_DECLARE_PRIVATE(QDeclarativeRotationAnimation)
Q_ENUMS(RotationDirection)
- Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
public:
diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp
index 1e7f81a..f1b6f9a 100644
--- a/src/declarative/util/qdeclarativebehavior.cpp
+++ b/src/declarative/util/qdeclarativebehavior.cpp
@@ -72,6 +72,7 @@ public:
/*!
\qmlclass Behavior QDeclarativeBehavior
+ \ingroup qml-animation-transition
\since 4.7
\brief The Behavior element allows you to specify a default animation for a property change.
diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp
index 5fab631..86d08f5 100644
--- a/src/declarative/util/qdeclarativebind.cpp
+++ b/src/declarative/util/qdeclarativebind.cpp
@@ -72,6 +72,7 @@ public:
/*!
\qmlclass Binding QDeclarativeBind
+ \ingroup qml-working-with-data
\since 4.7
\brief The Binding element allows arbitrary property bindings to be created.
diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp
index b364821..293928e 100644
--- a/src/declarative/util/qdeclarativeconnections.cpp
+++ b/src/declarative/util/qdeclarativeconnections.cpp
@@ -71,6 +71,7 @@ public:
/*!
\qmlclass Connections QDeclarativeConnections
+ \ingroup qml-utility-elements
\since 4.7
\brief A Connections element describes generalized connections to signals.
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 83bdb17..1755855 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -78,6 +78,7 @@ public:
/*!
\qmlclass FontLoader QDeclarativeFontLoader
+ \ingroup qml-utility-elements
\since 4.7
\brief The FontLoader element allows fonts to be loaded by name or URL.
@@ -129,6 +130,7 @@ void QDeclarativeFontLoader::setSource(const QUrl &url)
d->status = Loading;
emit statusChanged();
+ emit sourceChanged();
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(d->url);
if (!lf.isEmpty()) {
diff --git a/src/declarative/util/qdeclarativefontloader_p.h b/src/declarative/util/qdeclarativefontloader_p.h
index 6947547..0344d99 100644
--- a/src/declarative/util/qdeclarativefontloader_p.h
+++ b/src/declarative/util/qdeclarativefontloader_p.h
@@ -82,6 +82,7 @@ private Q_SLOTS:
void replyFinished();
Q_SIGNALS:
+ void sourceChanged();
void nameChanged();
void statusChanged();
};
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 3a6a5b0..d84de26 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -68,6 +68,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
/*!
\qmlclass ListModel QDeclarativeListModel
+ \ingroup qml-working-with-data
\since 4.7
\brief The ListModel element defines a free-form list data source.
@@ -129,7 +130,7 @@ QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListM
\snippet examples/declarative/threading/threadedlistmodel/dataloader.js 0
- The application's \tt Timer object periodically sends a message to the
+working-with-data
worker script by calling \l WorkerScript::sendMessage(). When this message
is received, \l {WorkerScript::onMessage}{WorkerScript.onMessage()} is invoked in
\tt dataloader.js, which appends the current time to the list model.
@@ -569,7 +570,7 @@ bool QDeclarativeListModelParser::compileProperty(const QDeclarativeCustomParser
QList<QDeclarativeCustomParserProperty> props = node.properties();
for(int jj = 0; jj < props.count(); ++jj) {
const QDeclarativeCustomParserProperty &nodeProp = props.at(jj);
- if (nodeProp.name() == "") {
+ if (nodeProp.name().isEmpty()) {
error(nodeProp, QDeclarativeListModel::tr("ListElement: cannot contain nested elements"));
return false;
}
@@ -657,7 +658,7 @@ QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomPa
for(int ii = 0; ii < customProps.count(); ++ii) {
const QDeclarativeCustomParserProperty &prop = customProps.at(ii);
- if(prop.name() != "") { // isn't default property
+ if(!prop.name().isEmpty()) { // isn't default property
error(prop, QDeclarativeListModel::tr("ListModel: undefined property '%1'").arg(QString::fromUtf8(prop.name())));
return QByteArray();
}
@@ -769,6 +770,7 @@ bool QDeclarativeListModelParser::definesEmptyList(const QString &s)
/*!
\qmlclass ListElement
+ \ingroup qml-working-with-data
\since 4.7
\brief The ListElement element defines a data item in a ListModel.
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
index 534c923..498de6d 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp
@@ -187,12 +187,17 @@ void QDeclarativeListModelWorkerAgent::sync()
s->data = data;
s->list = m_copy;
data.changes.clear();
+
+ mutex.lock();
QCoreApplication::postEvent(this, s);
+ syncDone.wait(&mutex);
+ mutex.unlock();
}
bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
{
if (e->type() == QEvent::User) {
+ QMutexLocker locker(&mutex);
Sync *s = static_cast<Sync *>(e);
const QList<Change> &changes = s->data.changes;
@@ -202,13 +207,18 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
FlatListModel *orig = m_orig->m_flat;
FlatListModel *copy = s->list->m_flat;
- if (!orig || !copy)
+ if (!orig || !copy) {
+ syncDone.wakeAll();
return QObject::event(e);
-
+ }
+
orig->m_roles = copy->m_roles;
orig->m_strings = copy->m_strings;
orig->m_values = copy->m_values;
+ syncDone.wakeAll();
+ locker.unlock();
+
for (int ii = 0; ii < changes.count(); ++ii) {
const Change &change = changes.at(ii);
switch (change.type) {
@@ -229,6 +239,8 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e)
if (cc)
emit m_orig->countChanged();
+ } else {
+ syncDone.wakeAll();
}
}
diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
index 1622144..01da374 100644
--- a/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
+++ b/src/declarative/util/qdeclarativelistmodelworkeragent_p.h
@@ -57,6 +57,8 @@
#include <QtScript/qscriptvalue.h>
#include <QtGui/qevent.h>
+#include <QMutex>
+#include <QWaitCondition>
QT_BEGIN_HEADER
@@ -142,6 +144,8 @@ private:
QAtomicInt m_ref;
QDeclarativeListModel *m_orig;
QDeclarativeListModel *m_copy;
+ QMutex mutex;
+ QWaitCondition syncDone;
};
QT_END_NAMESPACE
diff --git a/src/declarative/util/qdeclarativepackage.cpp b/src/declarative/util/qdeclarativepackage.cpp
index 1a4f2a7..a5ec9b3 100644
--- a/src/declarative/util/qdeclarativepackage.cpp
+++ b/src/declarative/util/qdeclarativepackage.cpp
@@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Package QDeclarativePackage
+ \ingroup qml-working-with-data
\brief Package provides a collection of named items.
The Package class is used in conjunction with
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index 12c6353..c28ada3 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -61,51 +61,34 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass PropertyChanges QDeclarativePropertyChanges
+ \ingroup qml-state-elements
\since 4.7
\brief The PropertyChanges element describes new property bindings or values for a state.
- PropertyChanges provides a state change that modifies the properties of an item.
+ PropertyChanges is used to define the property values or bindings in a
+ \l State. This enables an item's property values to be changed when it
+ \l {QML States}{changes between states}.
- Here is a property change that modifies the text and color of a \l Text element
- when it is clicked:
+ To create a PropertyChanges object, specify the \l target item whose
+ properties are to be modified, and define the new property values or
+ bindings. For example:
- \qml
- Text {
- id: myText
- width: 100; height: 100
- text: "Hello"
- color: "blue"
-
- states: State {
- name: "myState"
-
- PropertyChanges {
- target: myText
- text: "Goodbye"
- color: "red"
- }
- }
-
- MouseArea { anchors.fill: parent; onClicked: myText.state = 'myState' }
- }
- \endqml
-
- By default, PropertyChanges will establish new bindings where appropriate.
- For example, the following creates a new binding for myItem's \c height property.
-
- \qml
- PropertyChanges {
- target: myItem
- height: parent.height
- }
- \endqml
-
- If you don't want a binding to be established (and instead just want to assign
- the value of the binding at the time the state is entered),
- you should set the PropertyChange's \l{PropertyChanges::explicit}{explicit}
+ \snippet doc/src/snippets/declarative/propertychanges.qml import
+ \codeline
+ \snippet doc/src/snippets/declarative/propertychanges.qml 0
+
+ When the mouse is pressed, the \l Rectangle changes to the \e resized
+ state. In this state, the PropertyChanges object sets the rectangle's
+ color to blue and the \c height value to that of \c container.height.
+
+ Note this automatically binds \c rect.height to \c container.height
+ in the \e resized state. If a property binding should not be
+ established, and the height should just be set to the value of
+ \c container.height at the time of the state change, set the \l explicit
property to \c true.
-
- State-specific script for signal handlers can also be specified:
+
+ A PropertyChanges object can also override the default signal handler
+ for an object to implement a signal handler specific to the new state:
\qml
PropertyChanges {
@@ -114,36 +97,31 @@ QT_BEGIN_NAMESPACE
}
\endqml
- You can reset a property in a state change by assigning \c undefined. In the following
- example we reset \c theText's width when we enter state1. This will give the text its
- natural width (which is the whole string on one line).
+ \note PropertyChanges can be used to change anchor margins, but not other anchor
+ values; use AnchorChanges for this instead. Similarly, to change an \l Item's
+ \l {Item::}{parent} value, use ParentChanges instead.
- \qml
- import Qt 4.7
-
- Rectangle {
- width: 640
- height: 480
- Text {
- id: theText
- width: 50
- wrapMode: Text.WordWrap
- text: "a text string that is longer than 50 pixels"
- }
- states: State {
- name: "state1"
- PropertyChanges {
- target: theText
- width: undefined
- }
- }
- }
- \endqml
+ \section2 Resetting property values
- Anchor margins should be changed with PropertyChanges, but other anchor changes or changes to
- an Item's parent should be done using the associated change elements
- (ParentChange and AnchorChanges, respectively).
+ The \c undefined value can be used to reset the property value for a state.
+ In the following example, when \c theText changes to the \e widerText
+ state, its \c width property is reset, giving the text its natural width
+ and displaying the whole string on a single line.
+
+ \snippet doc/src/snippets/declarative/propertychanges.qml reset
+
+
+ \section2 Immediate property changes in transitions
+
+ When \l Transitions are used to animate state changes, they animate
+ properties from their values in the current state to those defined in the
+ new state (as defined by PropertyChanges objects). However,
+ it is sometimes desirable to set a property value \e immediately during a
+ \l Transition, without animation; in these cases, the PropertyAction
+ element can be used to force an immediate property change.
+
+ See the PropertyAction documentation for more details.
\sa {declarative/animation/states}{states example}, {qmlstate}{States}, QtDeclarative
*/
@@ -396,12 +374,12 @@ void QDeclarativePropertyChanges::setObject(QObject *o)
/*!
\qmlproperty bool PropertyChanges::restoreEntryValues
-
- Whether or not the previous values should be restored when
- leaving the state. By default, restoreEntryValues is true.
- By setting restoreEntryValues to false, you can create a temporary state
- that has permanent effects on property values.
+ This property holds whether the previous values should be restored when
+ leaving the state.
+
+ The default value is \c true. Setting this value to \c false creates a
+ temporary state that has permanent effects on property values.
*/
bool QDeclarativePropertyChanges::restoreEntryValues() const
{
diff --git a/src/declarative/util/qdeclarativesmoothedanimation.cpp b/src/declarative/util/qdeclarativesmoothedanimation.cpp
index 30e1491..b2f02e6 100644
--- a/src/declarative/util/qdeclarativesmoothedanimation.cpp
+++ b/src/declarative/util/qdeclarativesmoothedanimation.cpp
@@ -249,6 +249,7 @@ void QSmoothedAnimation::init()
/*!
\qmlclass SmoothedAnimation QDeclarativeSmoothedAnimation
+ \ingroup qml-animation-transition
\since 4.7
\inherits NumberAnimation
\brief The SmoothedAnimation element allows a property to smoothly track a value.
diff --git a/src/declarative/util/qdeclarativespringanimation.cpp b/src/declarative/util/qdeclarativespringanimation.cpp
index 6f4ac51..fce4097 100644
--- a/src/declarative/util/qdeclarativespringanimation.cpp
+++ b/src/declarative/util/qdeclarativespringanimation.cpp
@@ -228,6 +228,7 @@ void QDeclarativeSpringAnimationPrivate::updateMode()
/*!
\qmlclass SpringAnimation QDeclarativeSpringAnimation
+ \ingroup qml-animation-transition
\inherits Animation
\since 4.7
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 028bacb..6e17cf2 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -133,6 +133,7 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje
/*!
\qmlclass State QDeclarativeState
+ \ingroup qml-state-elements
\since 4.7
\brief The State element defines configurations of objects and properties.
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp
index 1c1e964..6d9563e 100644
--- a/src/declarative/util/qdeclarativestategroup.cpp
+++ b/src/declarative/util/qdeclarativestategroup.cpp
@@ -88,6 +88,7 @@ public:
/*!
\qmlclass StateGroup QDeclarativeStateGroup
+ \ingroup qml-state-elements
\since 4.7
\brief The StateGroup element provides state support for non-Item elements.
@@ -271,7 +272,7 @@ void QDeclarativeStateGroup::componentComplete()
return;
} else if (!d->currentState.isEmpty()) {
QString cs = d->currentState;
- d->currentState = QString();
+ d->currentState.clear();
d->setCurrentStateInternal(cs, true);
}
}
@@ -313,7 +314,7 @@ bool QDeclarativeStateGroupPrivate::updateAutoState()
}
}
if (revert) {
- bool rv = currentState != QString();
+ bool rv = !currentState.isEmpty();
q->setState(QString());
return rv;
} else {
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 2291c16..6e6f0cb 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -161,6 +161,7 @@ void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, Q
/*!
\preliminary
\qmlclass ParentChange QDeclarativeParentChange
+ \ingroup qml-state-elements
\brief The ParentChange element allows you to reparent an Item in a state change.
ParentChange reparents an item while preserving its visual appearance (position, size,
@@ -589,6 +590,7 @@ public:
/*!
\qmlclass StateChangeScript QDeclarativeStateChangeScript
+ \ingroup qml-state-elements
\brief The StateChangeScript element allows you to run a script in a state.
A StateChangeScript is run upon entering a state. You can optionally use
@@ -693,6 +695,7 @@ QString QDeclarativeStateChangeScript::typeName() const
/*!
\qmlclass AnchorChanges QDeclarativeAnchorChanges
+ \ingroup qml-state-elements
\brief The AnchorChanges element allows you to change the anchors of an item in a state.
The AnchorChanges element is used to modify the anchors of an item in a \l State.
diff --git a/src/declarative/util/qdeclarativesystempalette.cpp b/src/declarative/util/qdeclarativesystempalette.cpp
index c334859..7b80736 100644
--- a/src/declarative/util/qdeclarativesystempalette.cpp
+++ b/src/declarative/util/qdeclarativesystempalette.cpp
@@ -58,6 +58,7 @@ public:
/*!
\qmlclass SystemPalette QDeclarativeSystemPalette
+ \ingroup qml-utility-elements
\since 4.7
\brief The SystemPalette element provides access to the Qt palettes.
diff --git a/src/declarative/util/qdeclarativetimer.cpp b/src/declarative/util/qdeclarativetimer.cpp
index 838a8f3..56320e6 100644
--- a/src/declarative/util/qdeclarativetimer.cpp
+++ b/src/declarative/util/qdeclarativetimer.cpp
@@ -70,6 +70,7 @@ public:
/*!
\qmlclass Timer QDeclarativeTimer
+ \ingroup qml-utility-elements
\since 4.7
\brief The Timer item triggers a handler at a specified interval.
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index aa1426c..21d7ded 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmlclass Transition QDeclarativeTransition
+ \ingroup qml-animation-transition
\since 4.7
\brief The Transition element defines animated transitions that occur on state changes.
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index ece3d3a..cef78af 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -72,6 +72,7 @@ typedef QPair<int, int> QDeclarativeXmlListRange;
/*!
\qmlclass XmlRole QDeclarativeXmlListModelRole
+ \ingroup qml-working-with-data
\since 4.7
\brief The XmlRole element allows you to specify a role for an XmlListModel.
@@ -505,6 +506,7 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
/*!
\qmlclass XmlListModel QDeclarativeXmlListModel
+ \ingroup qml-working-with-data
\since 4.7
\brief The XmlListModel element is used to specify a model using XPath expressions.
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 64fc0ee..87850a7 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -119,6 +119,7 @@ QT_USE_NAMESPACE
- (QString)removeExtensions:(const QString &)filter;
- (void)createTextField;
- (void)createPopUpButton:(const QString &)selectedFilter hideDetails:(BOOL)hideDetails;
+- (QStringList)findStrippedFilterWithVisualFilterName:(QString)name;
- (void)createAccessory;
@end
@@ -127,8 +128,6 @@ QT_USE_NAMESPACE
- (id)initWithAcceptMode:(QT_PREPEND_NAMESPACE(QFileDialog::AcceptMode))acceptMode
title:(const QString &)title
- nameFilters:(const QStringList &)nameFilters
- selectedNameFilter:(const QString &)selectedNameFilter
hideNameFilterDetails:(bool)hideNameFilterDetails
qDirFilter:(QT_PREPEND_NAMESPACE(QDir::Filters))qDirFilter
fileOptions:(QT_PREPEND_NAMESPACE(QFileDialog::Options))fileOptions
@@ -158,8 +157,10 @@ QT_USE_NAMESPACE
mPriv = priv;
mLastFilterCheckPath = new QString;
mQDirFilterEntryList = new QStringList;
- mNameFilterDropDownList = new QStringList(nameFilters);
- mSelectedNameFilter = new QStringList(qt_clean_filter_list(selectedNameFilter));
+ mNameFilterDropDownList = new QStringList(priv->nameFilters);
+ QString selectedVisualNameFilter = priv->qFileDialogUi->fileTypeCombo->currentText();
+ mSelectedNameFilter = new QStringList([self findStrippedFilterWithVisualFilterName:selectedVisualNameFilter]);
+
QFileInfo sel(selectFile);
if (sel.isDir()){
mCurrentDir = [qt_mac_QStringToNSString(sel.absoluteFilePath()) retain];
@@ -168,8 +169,9 @@ QT_USE_NAMESPACE
mCurrentDir = [qt_mac_QStringToNSString(sel.absolutePath()) retain];
mCurrentSelection = new QString(sel.absoluteFilePath());
}
+
[mSavePanel setTitle:qt_mac_QStringToNSString(title)];
- [self createPopUpButton:selectedNameFilter hideDetails:hideNameFilterDetails];
+ [self createPopUpButton:selectedVisualNameFilter hideDetails:hideNameFilterDetails];
[self createTextField];
[self createAccessory];
[mSavePanel setAccessoryView:mNameFilterDropDownList->size() > 1 ? mAccessoryView : nil];
@@ -350,7 +352,7 @@ QT_USE_NAMESPACE
// This mDelegate function is called when the _name_ filter changes.
Q_UNUSED(sender);
QString selection = mNameFilterDropDownList->value([mPopUpButton indexOfSelectedItem]);
- *mSelectedNameFilter = QT_PREPEND_NAMESPACE(qt_clean_filter_list)(selection);
+ *mSelectedNameFilter = [self findStrippedFilterWithVisualFilterName:selection];
[mSavePanel validateVisibleColumns];
[self updateProperties];
if (mPriv)
@@ -499,6 +501,15 @@ QT_USE_NAMESPACE
}
}
+- (QStringList) findStrippedFilterWithVisualFilterName:(QString)name
+{
+ for (int i=0; i<mNameFilterDropDownList->size(); ++i) {
+ if (mNameFilterDropDownList->at(i).startsWith(name))
+ return qt_clean_filter_list(mNameFilterDropDownList->at(i));
+ }
+ return QStringList();
+}
+
- (void)createAccessory
{
NSRect accessoryRect = { { 0.0, 0.0 }, { 450.0, 33.0 } };
@@ -1039,8 +1050,6 @@ void QFileDialogPrivate::createNSOpenSavePanelDelegate()
QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) alloc]
initWithAcceptMode:acceptMode
title:q->windowTitle()
- nameFilters:q->nameFilters()
- selectedNameFilter:q->selectedNameFilter()
hideNameFilterDetails:q->testOption(QFileDialog::HideNameFilterDetails)
qDirFilter:model->filter()
fileOptions:opts
diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index fea6e8d..15cc109 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -165,7 +165,7 @@ VisualID QEgl::getCompatibleVisualId(EGLConfig config)
if (chosenVisualInfo) {
// Skip size checks if implementation supports non-matching visual
// and config (http://bugreports.qt.nokia.com/browse/QTBUG-9444).
- if (QEgl::hasExtension("EGL_NV_post_convert_replication"))
+ if (QEgl::hasExtension("EGL_NV_post_convert_rounding"))
return visualId;
int visualRedSize = countBits(chosenVisualInfo->red_mask);
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 6d1bb44..995426f 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5126,7 +5126,9 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool
q->update(itemBoundingRect.translated(item->d_ptr->sceneTransform.dx(),
item->d_ptr->sceneTransform.dy()));
} else {
- q->update(item->d_ptr->sceneTransform.mapRect(itemBoundingRect));
+ QRectF rect = item->d_ptr->sceneTransform.mapRect(itemBoundingRect);
+ if (!rect.isEmpty())
+ q->update(rect);
}
} else {
QRectF dirtyRect;
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 32560be..d568c40 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2596,9 +2596,11 @@ void QGraphicsView::updateScene(const QList<QRectF> &rects)
// Convert scene rects to viewport rects.
foreach (const QRectF &rect, rects) {
- QRect xrect = transform.mapRect(rect).toRect();
+ QRect xrect = transform.mapRect(rect).toAlignedRect();
if (!(d->optimizationFlags & DontAdjustForAntialiasing))
xrect.adjust(-2, -2, 2, 2);
+ else
+ xrect.adjust(-1, -1, 1, 1);
if (!viewportRect.intersects(xrect))
continue;
dirtyViewportRects << xrect;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 051aa45..d5db431 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -830,15 +830,17 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers
return false;
QFileInfo info(fileName);
- 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);
+ // Note: If no extension is provided, we try to match the
+ // file against known plugin extensions
+ if (!info.completeSuffix().isEmpty() && !info.exists())
+ return false;
+
if (QPixmapCache::find(key, *this))
return true;
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 214c31f..12add05 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2271,9 +2271,11 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
} else {
d->selectionModel->setCurrentIndex(newCurrent, command);
d->pressedPosition = visualRect(newCurrent).center() + d->offset();
- // We copy the same behaviour as for mousePressEvent().
- QRect rect(d->pressedPosition - d->offset(), QSize(1, 1));
- setSelection(rect, command);
+ if (newCurrent.isValid()) {
+ // We copy the same behaviour as for mousePressEvent().
+ QRect rect(d->pressedPosition - d->offset(), QSize(1, 1));
+ setSelection(rect, command);
+ }
}
event->accept();
return;
diff --git a/src/gui/kernel/qaction_p.h b/src/gui/kernel/qaction_p.h
index 899b01b..5764318 100644
--- a/src/gui/kernel/qaction_p.h
+++ b/src/gui/kernel/qaction_p.h
@@ -112,12 +112,12 @@ public:
//for soft keys management
uint forceEnabledInSoftkeys : 1;
uint menuActionSoftkeys : 1;
-
- QAction::MenuRole menuRole : 3;
- QAction::SoftKeyRole softKeyRole : 2;
- QAction::Priority priority : 14;
int iconVisibleInMenu : 3; // Only has values -1, 0, and 1
+ QAction::MenuRole menuRole;
+ QAction::SoftKeyRole softKeyRole;
+ QAction::Priority priority;
+
QList<QWidget *> widgets;
#ifndef QT_NO_GRAPHICSVIEW
QList<QGraphicsWidget *> graphicsWidgets;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 028e3aa..d9c3b6a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1053,6 +1053,18 @@ QApplication::~QApplication()
QApplicationPrivate::is_app_closing = true;
QApplicationPrivate::is_app_running = false;
+ // delete all widgets
+ if (QWidgetPrivate::allWidgets) {
+ QWidgetSet *mySet = QWidgetPrivate::allWidgets;
+ QWidgetPrivate::allWidgets = 0;
+ for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) {
+ register QWidget *w = *it;
+ if (!w->parent()) // window
+ w->destroy(true, true);
+ }
+ delete mySet;
+ }
+
delete qt_desktopWidget;
qt_desktopWidget = 0;
@@ -1073,18 +1085,6 @@ QApplication::~QApplication()
delete QWidgetPrivate::mapper;
QWidgetPrivate::mapper = 0;
- // delete all widgets
- if (QWidgetPrivate::allWidgets) {
- QWidgetSet *mySet = QWidgetPrivate::allWidgets;
- QWidgetPrivate::allWidgets = 0;
- for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) {
- register QWidget *w = *it;
- if (!w->parent()) // window
- w->destroy(true, true);
- }
- delete mySet;
- }
-
delete QApplicationPrivate::app_pal;
QApplicationPrivate::app_pal = 0;
delete QApplicationPrivate::sys_pal;
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 4ed00f8..5c1f29e 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -135,6 +135,38 @@ void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, boo
}
#endif
+void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
+{
+ if (QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control)) {
+ QWidget *const widget = QWidgetPrivate::mapper->value(control);
+ QWidget *const window = widget->window();
+ if (QTLWExtra *topData = qt_widget_private(window)->maybeTopData()) {
+ QWidgetBackingStoreTracker &backingStore = topData->backingStore;
+ if (visible) {
+ if (backingStore.data()) {
+ backingStore.registerWidget(widget);
+ } else {
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+ S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer);
+#endif
+ backingStore.create(window);
+ backingStore.registerWidget(widget);
+ qt_widget_private(widget)->invalidateBuffer(widget->rect());
+ widget->repaint();
+ }
+ } else {
+#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
+ S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer);
+#endif
+ backingStore.unregisterWidget(widget);
+ // In order to ensure that any resources used by the window surface
+ // are immediately freed, we flush the WSERV command buffer.
+ S60->wsSession().Flush();
+ }
+ }
+ }
+}
+
bool qt_nograb() // application no-grab option
{
#if defined(QT_DEBUG)
@@ -1075,17 +1107,19 @@ void QSymbianControl::Draw(const TRect& controlRect) const
CFbsBitmap *bitmap = s60Surface->symbianBitmap();
CWindowGc &gc = SystemGc();
- switch(qwidget->d_func()->extraData()->nativePaintMode) {
+ QWExtra::NativePaintMode nativePaintMode = qwidget->d_func()->extraData()->nativePaintMode;
+ if(qwidget->d_func()->paintOnScreen())
+ nativePaintMode = QWExtra::Disable;
+
+ switch(nativePaintMode) {
case QWExtra::Disable:
// Do nothing
break;
-
case QWExtra::Blit:
if (qwidget->d_func()->isOpaque)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
break;
-
case QWExtra::ZeroFill:
if (Window().DisplayMode() == EColor16MA
|| Window().DisplayMode() == Q_SYMBIAN_ECOLOR16MAP) {
@@ -1098,7 +1132,6 @@ void QSymbianControl::Draw(const TRect& controlRect) const
gc.Clear(controlRect);
};
break;
-
default:
Q_ASSERT(false);
}
@@ -1475,6 +1508,8 @@ void qt_init(QApplicationPrivate * /* priv */, int)
S60->avkonComponentsSupportTransparency = (value==1) ? true : false;
}
}
+ delete repository;
+ repository = 0;
#endif
#ifdef QT_KEYPAD_NAVIGATION
@@ -1920,35 +1955,10 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
if (callSymbianEventFilters(symbianEvent))
return 1;
const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
- QWidget *w = QWidgetPrivate::mapper->value(control);
- QWidget *const window = w->window();
- if (!window->d_func()->maybeTopData())
- break;
- QRefCountedWidgetBackingStore &backingStore = window->d_func()->maybeTopData()->backingStore;
- if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer);
-#endif
- // 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) {
- if (backingStore.data()) {
- // Increment backing store reference count
- backingStore.ref();
- } else {
-#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
- S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer);
-#endif
- // Create backing store with an initial reference count of 1
- backingStore.create(window);
- backingStore.ref();
- w->d_func()->invalidateBuffer(w->rect());
- w->repaint();
- }
- }
+ if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible)
+ S60->controlVisibilityChanged(control, false);
+ else if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
+ S60->controlVisibilityChanged(control, true);
return 1;
}
break;
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp
index 9fcc718..4b75f0a 100644
--- a/src/gui/kernel/qclipboard_x11.cpp
+++ b/src/gui/kernel/qclipboard_x11.cpp
@@ -456,7 +456,8 @@ QClipboard::QClipboard(QObject *parent)
XCheckIfEvent(X11->display, &ev, &qt_init_timestamp_scanner, (XPointer)&data);
if (data.timestamp == CurrentTime) {
setupOwner();
- int dummy = 0;
+ // We need this value just for completeness, we don't use it.
+ long dummy = 0;
Window ownerId = owner->internalWinId();
XChangeProperty(X11->display, ownerId,
ATOM(CLIP_TEMPORARY), XA_INTEGER, 32,
diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm
index 8d65aa1..8d38f45 100644
--- a/src/gui/kernel/qcocoamenuloader_mac.mm
+++ b/src/gui/kernel/qcocoamenuloader_mac.mm
@@ -255,5 +255,10 @@ QT_USE_NAMESPACE
qApp->quit();
}
}
+
+ - (void)orderFrontCharacterPalette:(id)sender
+ {
+ [NSApp orderFrontCharacterPalette:sender];
+ }
@end
#endif // QT_MAC_USE_COCOA
diff --git a/src/gui/kernel/qcocoamenuloader_mac_p.h b/src/gui/kernel/qcocoamenuloader_mac_p.h
index a75ad0a..edacfa5 100644
--- a/src/gui/kernel/qcocoamenuloader_mac_p.h
+++ b/src/gui/kernel/qcocoamenuloader_mac_p.h
@@ -88,6 +88,7 @@
- (IBAction)hide:(id)sender;
- (IBAction)qtDispatcherToQAction:(id)sender;
- (void)qtUpdateMenubar;
+- (void)orderFrontCharacterPalette:(id)sender;
@end
#endif // QT_MAC_USE_COCOA
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index e26fbde..89f01d8 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -785,7 +785,7 @@ void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions()
// the stacking order of the windows while doing so, we put
// up a block that is used in QCocoaWindow and QCocoaPanel:
int stackSize = cocoaModalSessionStack.size();
- for (int i=stackSize-1; i>=0; --i) {
+ for (int i=0; i<stackSize; ++i) {
QCocoaModalSessionInfo &info = cocoaModalSessionStack[i];
if (info.session) {
[NSApp endModalSession:info.session];
@@ -822,12 +822,12 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession()
QBoolBlocker block1(blockSendPostedEvents, true);
info.nswindow = window;
[(NSWindow*) info.nswindow retain];
- // When creating a modal session cocoa will rearrange the windows.
- // In order to avoid windows to be put behind another we need to
- // keep the window level.
- int level = [window level];
+ int levelBeforeEnterModal = [window level];
info.session = [NSApp beginModalSessionForWindow:window];
- [window setLevel:level];
+ // Make sure we don't stack the window lower that it was before
+ // entering modal, in case it e.g. had the stays-on-top flag set:
+ if (levelBeforeEnterModal > [window level])
+ [window setLevel:levelBeforeEnterModal];
}
currentModalSessionCached = info.session;
}
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index fe9dd8a..e768a21 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -129,7 +129,12 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
{
QList<QGestureRecognizer *> list = m_recognizers.values(type);
- m_recognizers.remove(type);
+ while (QGestureRecognizer *recognizer = m_recognizers.take(type)) {
+ if (!m_obsoleteGestures.contains(recognizer)) {
+ // inserting even an empty QSet will cause the recognizer to be deleted on destruction of the manager
+ m_obsoleteGestures.insert(recognizer, QSet<QGesture *>());
+ }
+ }
foreach (QGesture *g, m_gestureToRecognizer.keys()) {
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
if (list.contains(recognizer)) {
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index a18ea07..ad6a99a 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -164,6 +164,7 @@ public:
static inline CEikButtonGroupContainer* buttonGroupContainer();
static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible);
#endif
+ static void controlVisibilityChanged(CCoeControl *control, bool visible);
#ifdef Q_OS_SYMBIAN
TTrapHandler *s60InstalledTrapHandler;
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 22123a0..0baecce 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -162,47 +162,76 @@ static inline bool hasBackingStoreSupport()
extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp
extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp
+/*!
+ \internal
+ \class QWidgetBackingStoreTracker
+ \brief Class which allows tracking of which widgets are using a given backing store
+
+ QWidgetBackingStoreTracker is a thin wrapper around a QWidgetBackingStore pointer,
+ which maintains a list of the QWidgets which are currently using the backing
+ store. This list is modified via the registerWidget and unregisterWidget functions.
+ */
-QRefCountedWidgetBackingStore::QRefCountedWidgetBackingStore()
+QWidgetBackingStoreTracker::QWidgetBackingStoreTracker()
: m_ptr(0)
- , m_count(0)
{
}
-QRefCountedWidgetBackingStore::~QRefCountedWidgetBackingStore()
+QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker()
{
delete m_ptr;
}
-void QRefCountedWidgetBackingStore::create(QWidget *widget)
+/*!
+ \internal
+ Destroy the contained QWidgetBackingStore, if not null, and clear the list of
+ widgets using the backing store, then create a new QWidgetBackingStore, providing
+ the QWidget.
+ */
+void QWidgetBackingStoreTracker::create(QWidget *widget)
{
destroy();
m_ptr = new QWidgetBackingStore(widget);
- m_count = 0;
}
-void QRefCountedWidgetBackingStore::destroy()
+/*!
+ \internal
+ Destroy the contained QWidgetBackingStore, if not null, and clear the list of
+ widgets using the backing store.
+ */
+void QWidgetBackingStoreTracker::destroy()
{
delete m_ptr;
m_ptr = 0;
- m_count = 0;
+ m_widgets.clear();
}
-void QRefCountedWidgetBackingStore::ref()
+/*!
+ \internal
+ Add the widget to the list of widgets currently using the backing store.
+ If the widget was already in the list, this function is a no-op.
+ */
+void QWidgetBackingStoreTracker::registerWidget(QWidget *w)
{
Q_ASSERT(m_ptr);
- ++m_count;
+ Q_ASSERT(w->internalWinId());
+ Q_ASSERT(qt_widget_private(w)->maybeBackingStore() == m_ptr);
+ m_widgets.insert(w);
}
-void QRefCountedWidgetBackingStore::deref()
+/*!
+ \internal
+ Remove the widget from the list of widgets currently using the backing store.
+ If the widget was in the list, and removing it causes the list to be empty,
+ the backing store is deleted.
+ If the widget was not in the list, this function is a no-op.
+ */
+void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)
{
- if (m_count) {
- Q_ASSERT(m_ptr);
- if (0 == --m_count) {
- delete m_ptr;
- m_ptr = 0;
- }
+ if (m_widgets.remove(w) && m_widgets.isEmpty()) {
+ delete m_ptr;
+ m_ptr = 0;
}
}
@@ -1245,7 +1274,16 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
q->setAttribute(Qt::WA_WState_Hidden);
//give potential windows a bigger "pre-initial" size; create_sys() will give them a new size later
+#ifdef Q_OS_SYMBIAN
+ if (isGLWidget) {
+ // Don't waste GPU mem for unnecessary large egl surface
+ data.crect = QRect(0,0,2,2);
+ } else {
+ data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,360,640);
+ }
+#else
data.crect = parentWidget ? QRect(0,0,100,30) : QRect(0,0,640,480);
+#endif
focus_next = focus_prev = q;
@@ -9934,7 +9972,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
desktopWidget = parent;
bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget;
-#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN)
if (newParent && parent && !desktopWidget) {
if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings))
parent->d_func()->enforceNativeChildren();
@@ -10588,7 +10626,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
}
case Qt::WA_PaintOnScreen:
d->updateIsOpaque();
-#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC)
+#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN)
// Recreate the widget if it's already created as an alien widget and
// WA_PaintOnScreen is enabled. Paint on screen widgets must have win id.
// So must their children.
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index c499d93..ef7e1d3 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2796,10 +2796,14 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
if (QWidget *parent = q->parentWidget()) {
if (parent->testAttribute(Qt::WA_WState_Created)) {
- if (set)
- [qt_mac_window_for(parent) addChildWindow:qt_mac_window_for(q) ordered:NSWindowAbove];
- else
+ if (set) {
+ if (parent->isVisible()) {
+ NSWindow *childwin = qt_mac_window_for(q);
+ [qt_mac_window_for(parent) addChildWindow:childwin ordered:NSWindowAbove];
+ }
+ } else {
[qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)];
+ }
}
}
@@ -2807,10 +2811,12 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
- if (set)
- [qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove];
- else
+ if (set) {
+ NSWindow *childwin = qt_mac_window_for(child);
+ [qt_mac_window_for(q) addChildWindow:childwin ordered:NSWindowAbove];
+ } else {
[qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)];
+ }
}
}
}
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 9118919..c943bd8 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -110,17 +110,18 @@ class QWidgetItemV2;
class QStyle;
-class Q_AUTOTEST_EXPORT QRefCountedWidgetBackingStore
+class Q_AUTOTEST_EXPORT QWidgetBackingStoreTracker
{
+
public:
- QRefCountedWidgetBackingStore();
- ~QRefCountedWidgetBackingStore();
+ QWidgetBackingStoreTracker();
+ ~QWidgetBackingStoreTracker();
void create(QWidget *tlw);
void destroy();
- void ref();
- void deref();
+ void registerWidget(QWidget *w);
+ void unregisterWidget(QWidget *w);
inline QWidgetBackingStore* data()
{
@@ -143,11 +144,11 @@ public:
}
private:
- Q_DISABLE_COPY(QRefCountedWidgetBackingStore)
+ Q_DISABLE_COPY(QWidgetBackingStoreTracker)
private:
QWidgetBackingStore* m_ptr;
- int m_count;
+ QSet<QWidget *> m_widgets;
};
struct QTLWExtra {
@@ -156,7 +157,7 @@ struct QTLWExtra {
// Regular pointers (keep them together to avoid gaps on 64 bits architectures).
QIcon *icon; // widget icon
QPixmap *iconPixmap;
- QRefCountedWidgetBackingStore backingStore;
+ QWidgetBackingStoreTracker backingStore;
QWindowSurface *windowSurface;
QPainter *sharedPainter;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 5075803..222d707 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -486,14 +486,13 @@ void QWidgetPrivate::show_sys()
activateSymbianWindow();
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
+ const bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
#ifdef Q_WS_S60
// Lazily initialize the S60 screen furniture when the first window is shown.
- if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
+ if (q->isWindow() && !QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
&& !S60->buttonGroupContainer() && !S60->statusPane()) {
- bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
-
if (!q->testAttribute(Qt::WA_DontShowOnScreen)) {
// Create the status pane and CBA here
@@ -508,23 +507,24 @@ void QWidgetPrivate::show_sys()
// Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
S60->statusPane()->SetObserver(desktopControl);
-
- // Hide the status pane if fullscreen OR
- // Fill client area if maximized OR
- // Put window below status pane unless the window has an explicit position.
- if (isFullscreen) {
+ if (isFullscreen)
S60->statusPane()->MakeVisible(false);
- } else if (q->windowState() & Qt::WindowMaximized) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- id->SetExtent(r.iTl, r.Size());
- } else if (!q->testAttribute(Qt::WA_Moved)) {
- id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
- }
}
}
}
#endif
+ // Fill client area if maximized OR
+ // Put window below status pane unless the window has an explicit position.
+ if (!isFullscreen) {
+ if (q->windowState() & Qt::WindowMaximized) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ id->SetExtent(r.iTl, r.Size());
+ } else if (!q->testAttribute(Qt::WA_Moved)) {
+ id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
+ }
+ }
+
id->MakeVisible(true);
if(q->isWindow())
@@ -688,6 +688,12 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
QSymbianControl *old_winid = static_cast<QSymbianControl *>(wasCreated ? data.winid : 0);
if ((q->windowType() == Qt::Desktop))
old_winid = 0;
+
+ // old_winid may not have received a 'not visible' visibility
+ // changed event before being destroyed; make sure that it is
+ // removed from the backing store's list of visible windows.
+ S60->controlVisibilityChanged(old_winid, false);
+
setWinId(0);
// hide and reparent our own window away. Otherwise we might get
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index dfa4a48..793d380 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -212,6 +212,7 @@ if(mmx|3dnow|sse|sse2|iwmmxt) {
SSE3DNOW_SOURCES += painting/qdrawhelper_sse3dnow.cpp
SSE_SOURCES += painting/qdrawhelper_sse.cpp
SSE2_SOURCES += painting/qdrawhelper_sse2.cpp
+ SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp
IWMMXT_SOURCES += painting/qdrawhelper_iwmmxt.cpp
}
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 83751ed..ac9b994 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -352,7 +352,7 @@ void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QWindowS
// Always flush repainted areas.
dirtyOnScreen += toClean;
-#ifdef Q_WS_QWS
+#if defined(Q_WS_QWS) && !defined(Q_BACKINGSTORE_SUBSURFACES)
toClean.translate(tlwOffset);
#endif
@@ -1294,7 +1294,12 @@ void QWidgetBackingStore::sync()
#ifdef Q_BACKINGSTORE_SUBSURFACES
QWindowSurface *subSurface = w->windowSurface();
BeginPaintInfo beginPaintInfo;
- beginPaint(toBePainted, w, subSurface, &beginPaintInfo, false);
+
+ QPoint off = w->mapTo(tlw, QPoint());
+ toBePainted.translate(off);
+ beginPaint(toBePainted, w, subSurface, &beginPaintInfo, true);
+ toBePainted.translate(-off);
+
if (beginPaintInfo.nothingToPaint)
continue;
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 054f96f..d6beb72 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -7958,6 +7958,17 @@ void qInitDrawhelperAsm()
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_sse2;
qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_sse2;
+
+#if defined(QT_HAVE_SSSE3)
+ if (features & SSSE3) {
+ extern void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha);
+ qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
+ qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
+ }
+#endif // QT_HAVE_SSSE3
} else
#endif
{
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
new file mode 100644
index 0000000..9c02009
--- /dev/null
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -0,0 +1,253 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifdef QT_HAVE_SSSE3
+
+#include <private/qsimd_p.h>
+#include <private/qdrawhelper_x86_p.h>
+#include <private/qdrawingprimitive_sse2_p.h>
+
+QT_BEGIN_NAMESPACE
+
+inline static void blend_pixel(quint32 &dst, const quint32 src)
+{
+ if (src >= 0xff000000)
+ dst = src;
+ else if (src != 0)
+ dst = src + BYTE_MUL(dst, qAlpha(~src));
+}
+
+
+/* The instruction palignr uses direct arguments, so we have to generate the code fo the different
+ shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow.
+ */
+#define BLENDING_LOOP(palignrOffset, length)\
+ for (; x < length-3; x += 4) { \
+ const __m128i srcVectorLastLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes + 4]);\
+ const __m128i srcVector = _mm_alignr_epi8(srcVectorLastLoaded, srcVectorPrevLoaded, palignrOffset); \
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
+ _mm_store_si128((__m128i *)&dst[x], srcVector); \
+ } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
+ __m128i alphaChannel = _mm_shuffle_epi8(srcVector, alphaShuffleMask); \
+ alphaChannel = _mm_sub_epi16(one, alphaChannel); \
+ const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
+ __m128i destMultipliedByOneMinusAlpha; \
+ BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
+ _mm_store_si128((__m128i *)&dst[x], result); \
+ } \
+ srcVectorPrevLoaded = srcVectorLastLoaded;\
+ }
+
+
+#define BLEND_SOURCE_OVER_ARGB32_FIRST_ROW_SSSE3(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
+ int x = 0; \
+\
+ /* First, get dst aligned. */ \
+ const int offsetToAlignOn16Bytes = (4 - ((reinterpret_cast<quintptr>(dst) >> 2) & 0x3)) & 0x3;\
+ const int prologLength = qMin(length, offsetToAlignOn16Bytes);\
+\
+ for (; x < prologLength; ++x) {\
+ blend_pixel(dst[x], src[x]); \
+ } \
+\
+ const int minusOffsetToAlignSrcOn16Bytes = (reinterpret_cast<quintptr>(&(src[x])) >> 2) & 0x3;\
+\
+ if (!minusOffsetToAlignSrcOn16Bytes) {\
+ /* src is aligned, usual algorithm but with aligned operations.\
+ See the SSE2 version for more documentation on the algorithm itself. */\
+ const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
+ for (; x < length-3; x += 4) { \
+ const __m128i srcVector = _mm_load_si128((__m128i *)&src[x]); \
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
+ _mm_store_si128((__m128i *)&dst[x], srcVector); \
+ } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
+ __m128i alphaChannel = _mm_shuffle_epi8(srcVector, alphaShuffleMask); \
+ alphaChannel = _mm_sub_epi16(one, alphaChannel); \
+ const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
+ __m128i destMultipliedByOneMinusAlpha; \
+ BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
+ _mm_store_si128((__m128i *)&dst[x], result); \
+ } \
+ } /* end for() */\
+ } else if ((length - x) >= 8) {\
+ /* We are at the first line, so "x - minusOffsetToAlignSrcOn16Bytes" could go before src, and\
+ generate an invalid access. */\
+\
+ /* We use two vectors to extract the src: prevLoaded for the first pixels, lastLoaded for the current pixels. */\
+ __m128i srcVectorPrevLoaded;\
+ if (minusOffsetToAlignSrcOn16Bytes > prologLength) {\
+ /* We go forward 4 pixels to avoid reading before src. */\
+ for (; x < prologLength + 4; ++x)\
+ blend_pixel(dst[x], src[x]); \
+ }\
+ srcVectorPrevLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes]);\
+ const int palignrOffset = minusOffsetToAlignSrcOn16Bytes << 2;\
+\
+ const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
+ switch (palignrOffset) {\
+ case 4:\
+ BLENDING_LOOP(4, length)\
+ break;\
+ case 8:\
+ BLENDING_LOOP(8, length)\
+ break;\
+ case 12:\
+ BLENDING_LOOP(12, length)\
+ break;\
+ }\
+ }\
+ for (; x < length; ++x) \
+ blend_pixel(dst[x], src[x]); \
+}
+
+// Basically blend src over dst with the const alpha defined as constAlphaVector.
+// nullVector, half, one, colorMask are constant accross the whole image/texture, and should be defined as:
+//const __m128i nullVector = _mm_set1_epi32(0);
+//const __m128i half = _mm_set1_epi16(0x80);
+//const __m128i one = _mm_set1_epi16(0xff);
+//const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+//const __m128i alphaMask = _mm_set1_epi32(0xff000000);
+//
+// The computation being done is:
+// result = s + d * (1-alpha)
+// with shortcuts if fully opaque or fully transparent.
+#define BLEND_SOURCE_OVER_ARGB32_MAIN_SSSE3(dst, src, length, nullVector, half, one, colorMask, alphaMask) { \
+ int x = 0; \
+\
+ /* First, get dst aligned. */ \
+ ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \
+ blend_pixel(dst[x], src[x]); \
+ } \
+\
+ const int minusOffsetToAlignSrcOn16Bytes = (reinterpret_cast<quintptr>(&(src[x])) >> 2) & 0x3;\
+\
+ if (!minusOffsetToAlignSrcOn16Bytes) {\
+ /* src is aligned, usual algorithm but with aligned operations.\
+ See the SSE2 version for more documentation on the algorithm itself. */\
+ const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
+ for (; x < length-3; x += 4) { \
+ const __m128i srcVector = _mm_load_si128((__m128i *)&src[x]); \
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
+ if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) { \
+ _mm_store_si128((__m128i *)&dst[x], srcVector); \
+ } else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) != 0xffff) { \
+ __m128i alphaChannel = _mm_shuffle_epi8(srcVector, alphaShuffleMask); \
+ alphaChannel = _mm_sub_epi16(one, alphaChannel); \
+ const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]); \
+ __m128i destMultipliedByOneMinusAlpha; \
+ BYTE_MUL_SSE2(destMultipliedByOneMinusAlpha, dstVector, alphaChannel, colorMask, half); \
+ const __m128i result = _mm_add_epi8(srcVector, destMultipliedByOneMinusAlpha); \
+ _mm_store_si128((__m128i *)&dst[x], result); \
+ } \
+ } /* end for() */\
+ } else if ((length - x) >= 8) {\
+ /* We use two vectors to extract the src: prevLoaded for the first pixels, lastLoaded for the current pixels. */\
+ __m128i srcVectorPrevLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes]);\
+ const int palignrOffset = minusOffsetToAlignSrcOn16Bytes << 2;\
+\
+ const __m128i alphaShuffleMask = _mm_set_epi8(0xff,15,0xff,15,0xff,11,0xff,11,0xff,7,0xff,7,0xff,3,0xff,3);\
+ switch (palignrOffset) {\
+ case 4:\
+ BLENDING_LOOP(4, length)\
+ break;\
+ case 8:\
+ BLENDING_LOOP(8, length)\
+ break;\
+ case 12:\
+ BLENDING_LOOP(12, length)\
+ break;\
+ }\
+ }\
+ for (; x < length; ++x) \
+ blend_pixel(dst[x], src[x]); \
+}
+
+void qt_blend_argb32_on_argb32_ssse3(uchar *destPixels, int dbpl,
+ const uchar *srcPixels, int sbpl,
+ int w, int h,
+ int const_alpha)
+{
+ const quint32 *src = (const quint32 *) srcPixels;
+ quint32 *dst = (quint32 *) destPixels;
+ if (const_alpha == 256) {
+ const __m128i alphaMask = _mm_set1_epi32(0xff000000);
+ const __m128i nullVector = _mm_setzero_si128();
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+
+ // We have to unrol the first row in order to deal with the load on unaligned data
+ // prior to the src pointer.
+ BLEND_SOURCE_OVER_ARGB32_FIRST_ROW_SSSE3(dst, src, w, nullVector, half, one, colorMask, alphaMask);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+
+ for (int y = 1; y < h; ++y) {
+ BLEND_SOURCE_OVER_ARGB32_MAIN_SSSE3(dst, src, w, nullVector, half, one, colorMask, alphaMask);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ } else if (const_alpha != 0) {
+ // dest = (s + d * sia) * ca + d * cia
+ // = s * ca + d * (sia * ca + cia)
+ // = s * ca + d * (1 - sa*ca)
+ const_alpha = (const_alpha * 255) >> 8;
+ const __m128i nullVector = _mm_setzero_si128();
+ const __m128i half = _mm_set1_epi16(0x80);
+ const __m128i one = _mm_set1_epi16(0xff);
+ const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
+ const __m128i constAlphaVector = _mm_set1_epi16(const_alpha);
+ for (int y = 0; y < h; ++y) {
+ BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_SSE2(dst, src, w, nullVector, half, one, colorMask, constAlphaVector)
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_HAVE_SSSE3
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 5e7c67a..94039fb 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -956,53 +956,49 @@
const QT_FT_Vector* control2,
const QT_FT_Vector* to )
{
- TPos dx, dy, da, db;
int top, level;
int* levels;
QT_FT_Vector* arc;
+ int mid_x = ( DOWNSCALE( ras.x ) + to->x +
+ 3 * (control1->x + control2->x ) ) / 8;
+ int mid_y = ( DOWNSCALE( ras.y ) + to->y +
+ 3 * (control1->y + control2->y ) ) / 8;
+ TPos dx = DOWNSCALE( ras.x ) + to->x - ( mid_x << 1 );
+ TPos dy = DOWNSCALE( ras.y ) + to->y - ( mid_y << 1 );
- dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 );
if ( dx < 0 )
dx = -dx;
- dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 );
if ( dy < 0 )
dy = -dy;
if ( dx < dy )
dx = dy;
- da = dx;
-
- dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x );
- if ( dx < 0 )
- dx = -dx;
- dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->x + control2->y );
- if ( dy < 0 )
- dy = -dy;
- if ( dx < dy )
- dx = dy;
- db = dx;
level = 1;
- da = da / ras.cubic_level;
- db = db / ras.conic_level;
- while ( da > 0 || db > 0 )
+ dx /= ras.cubic_level;
+ while ( dx > 0 )
{
- da >>= 2;
- db >>= 3;
+ dx >>= 2;
level++;
}
if ( level <= 1 )
{
- TPos to_x, to_y, mid_x, mid_y;
+ TPos to_x, to_y;
to_x = UPSCALE( to->x );
to_y = UPSCALE( to->y );
+
+ /* Recalculation of midpoint is needed only if */
+ /* UPSCALE and DOWNSCALE have any effect. */
+
+#if ( PIXEL_BITS != 6 )
mid_x = ( ras.x + to_x +
3 * UPSCALE( control1->x + control2->x ) ) / 8;
mid_y = ( ras.y + to_y +
3 * UPSCALE( control1->y + control2->y ) ) / 8;
+#endif
gray_render_line( RAS_VAR_ mid_x, mid_y );
gray_render_line( RAS_VAR_ to_x, to_y );
@@ -1359,10 +1355,6 @@
/* <Input> */
/* outline :: A pointer to the source target. */
/* */
- /* func_interface :: A table of `emitters', i.e,. function pointers */
- /* called during decomposition to indicate path */
- /* operations. */
- /* */
/* user :: A typeless pointer which is passed to each */
/* emitter during the decomposition. It can be */
/* used to store the state during the */
@@ -1373,15 +1365,10 @@
/* */
static
int QT_FT_Outline_Decompose( const QT_FT_Outline* outline,
- const QT_FT_Outline_Funcs* func_interface,
void* user )
{
#undef SCALED
-#if 0
-#define SCALED( x ) ( ( (x) << shift ) - delta )
-#else
#define SCALED( x ) (x)
-#endif
QT_FT_Vector v_last;
QT_FT_Vector v_control;
@@ -1396,12 +1383,6 @@
int error;
char tag; /* current point's state */
-#if 0
- int shift = func_interface->shift;
- TPos delta = func_interface->delta;
-#endif
-
-
first = 0;
for ( n = 0; n < outline->n_contours; n++ )
@@ -1455,7 +1436,7 @@
tags--;
}
- error = func_interface->move_to( &v_start, user );
+ error = gray_move_to( &v_start, user );
if ( error )
goto Exit;
@@ -1475,7 +1456,7 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
- error = func_interface->line_to( &vec, user );
+ error = gray_line_to( &vec, user );
if ( error )
goto Exit;
continue;
@@ -1502,7 +1483,7 @@
if ( tag == QT_FT_CURVE_TAG_ON )
{
- error = func_interface->conic_to( &v_control, &vec,
+ error = gray_conic_to( &v_control, &vec,
user );
if ( error )
goto Exit;
@@ -1515,7 +1496,7 @@
v_middle.x = ( v_control.x + vec.x ) / 2;
v_middle.y = ( v_control.y + vec.y ) / 2;
- error = func_interface->conic_to( &v_control, &v_middle,
+ error = gray_conic_to( &v_control, &v_middle,
user );
if ( error )
goto Exit;
@@ -1524,7 +1505,7 @@
goto Do_Conic;
}
- error = func_interface->conic_to( &v_control, &v_start,
+ error = gray_conic_to( &v_control, &v_start,
user );
goto Close;
}
@@ -1555,20 +1536,20 @@
vec.x = SCALED( point->x );
vec.y = SCALED( point->y );
- error = func_interface->cubic_to( &vec1, &vec2, &vec, user );
+ error = gray_cubic_to( &vec1, &vec2, &vec, user );
if ( error )
goto Exit;
continue;
}
- error = func_interface->cubic_to( &vec1, &vec2, &v_start, user );
+ error = gray_cubic_to( &vec1, &vec2, &v_start, user );
goto Close;
}
}
}
/* close the contour with a line segment */
- error = func_interface->line_to( &v_start, user );
+ error = gray_line_to( &v_start, user );
Close:
if ( error )
@@ -1596,22 +1577,11 @@
static int
gray_convert_glyph_inner( RAS_ARG )
{
- static
- const QT_FT_Outline_Funcs func_interface =
- {
- (QT_FT_Outline_MoveTo_Func) gray_move_to,
- (QT_FT_Outline_LineTo_Func) gray_line_to,
- (QT_FT_Outline_ConicTo_Func)gray_conic_to,
- (QT_FT_Outline_CubicTo_Func)gray_cubic_to,
- 0,
- 0
- };
-
volatile int error = 0;
if ( qt_ft_setjmp( ras.jump_buffer ) == 0 )
{
- error = QT_FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
+ error = QT_FT_Outline_Decompose( &ras.outline, &ras );
gray_record_cell( RAS_VAR );
}
else
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index e521e01..fecf25f 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -696,10 +696,11 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount)
linef = d->matrix.map(QLineF(lines[i]));
}
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
- int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
- int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
- int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
+ int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
+
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -729,10 +730,11 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount)
for (int i = 0; i < lineCount; ++i) {
QLineF linef = d->matrix.map(lines[i]);
if (clipLine(&linef, d->polygonClipper.boundingRect())) {
- int x1 = qFloor(linef.x1() + aliasedCoordinateDelta);
- int y1 = qFloor(linef.y1() + aliasedCoordinateDelta);
- int x2 = qFloor(linef.x2() + aliasedCoordinateDelta);
- int y2 = qFloor(linef.y2() + aliasedCoordinateDelta);
+ int x1 = qRound(linef.x1() + aliasedCoordinateDelta);
+ int y1 = qRound(linef.y1() + aliasedCoordinateDelta);
+ int x2 = qRound(linef.x2() + aliasedCoordinateDelta);
+ int y2 = qRound(linef.y2() + aliasedCoordinateDelta);
+
XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2);
}
}
@@ -1688,8 +1690,8 @@ void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int
if (clippedCount > 0) {
QVarLengthArray<XPoint> xpoints(clippedCount);
for (int i = 0; i < clippedCount; ++i) {
- xpoints[i].x = qFloor(clippedPoints[i].x + aliasedCoordinateDelta);
- xpoints[i].y = qFloor(clippedPoints[i].y + aliasedCoordinateDelta);
+ xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta);
+ xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta);
}
uint numberPoints = qMin(clippedCount, xlibMaxLinePoints);
XPoint *pts = xpoints.data();
@@ -1914,6 +1916,8 @@ void QX11PaintEngine::drawPixmap(const QRectF &r, const QPixmap &px, const QRect
int sh = qRound(sr.height());
QPixmap pixmap = qt_toX11Pixmap(px);
+ if(pixmap.isNull())
+ return;
if ((d->xinfo && d->xinfo->screen() != pixmap.x11Info().screen())
|| (pixmap.x11Info().screen() != DefaultScreen(X11->display))) {
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 314f349..1f1bb29 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5986,10 +5986,13 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
return;
}
- if (d->extended->type() == QPaintEngine::OpenGL2 && !staticText_d->untransformedCoordinates) {
+ bool paintEngineSupportsTransformations = d->extended->type() == QPaintEngine::OpenGL2
+ || d->extended->type() == QPaintEngine::OpenVG;
+
+ if (paintEngineSupportsTransformations && !staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = true;
staticText_d->needsRelayout = true;
- } else if (d->extended->type() != QPaintEngine::OpenGL2 && staticText_d->untransformedCoordinates) {
+ } else if (!paintEngineSupportsTransformations && staticText_d->untransformedCoordinates) {
staticText_d->untransformedCoordinates = false;
staticText_d->needsRelayout = true;
}
diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp
index a816ed2..170668b 100644
--- a/src/gui/painting/qwindowsurface_qws.cpp
+++ b/src/gui/painting/qwindowsurface_qws.cpp
@@ -882,7 +882,11 @@ void QWSMemorySurface::beginPaint(const QRegion &rgn)
const QVector<QRect> rects = rgn.rects();
const QColor blank = Qt::transparent;
for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) {
- p.fillRect(*it, blank);
+ QRect r = *it;
+#ifdef Q_BACKINGSTORE_SUBSURFACES
+ r.translate(painterOffset());
+#endif
+ p.fillRect(r, blank);
}
}
QWSWindowSurface::beginPaint(rgn);
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 32b1df9..441a8c8 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1101,14 +1101,6 @@ void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *conte
}
}
break;
- case QEvent::LayoutDirectionChange: {
- if (contextWidget) {
- QTextOption opt = document()->defaultTextOption();
- opt.setTextDirection(contextWidget->layoutDirection());
- document()->setDefaultTextOption(opt);
- }
- }
- // FALL THROUGH
default:
break;
}
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index e366f77..12a8924 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1156,6 +1156,10 @@ Qt::LayoutDirection QTextBlock::textDirection() const
if (dir != Qt::LayoutDirectionAuto)
return dir;
+ dir = p->defaultTextOption.textDirection();
+ if (dir != Qt::LayoutDirectionAuto)
+ return dir;
+
const QString buffer = p->buffer();
const int pos = position();
diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp
index 04d6de9..e718212 100644
--- a/src/gui/util/qcompleter.cpp
+++ b/src/gui/util/qcompleter.cpp
@@ -921,10 +921,12 @@ void QCompleterPrivate::showPopup(const QRect& rect)
void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path)
{
Q_Q(QCompleter);
+#ifndef QT_NO_LINEEDIT
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(widget);
//the path given by QFileSystemModel does not end with /
if (lineEdit && !lineEdit->text().isEmpty() && !q->completionPrefix().isEmpty() && q->completionPrefix() != path + QLatin1Char('/'))
q->complete();
+#endif
}
/*!
diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm
index ce85919..15fae23 100644
--- a/src/gui/widgets/qcocoamenu_mac.mm
+++ b/src/gui/widgets/qcocoamenu_mac.mm
@@ -188,6 +188,18 @@ QT_USE_NAMESPACE
return NO;
}
+- (NSInteger)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector
+{
+ NSInteger index = [super indexOfItemWithTarget:anObject andAction:actionSelector];
+ static SEL selForOFCP = NSSelectorFromString(@"orderFrontCharacterPalette:");
+ if (index == -1 && selForOFCP == actionSelector) {
+ // Check if the 'orderFrontCharacterPalette' SEL exists for QCocoaMenuLoader object
+ QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)];
+ return [super indexOfItemWithTarget:loader andAction:actionSelector];
+ }
+ return index;
+}
+
@end
QT_BEGIN_NAMESPACE
diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h
index d6ac8c5..1a42642 100644
--- a/src/gui/widgets/qcocoamenu_mac_p.h
+++ b/src/gui/widgets/qcocoamenu_mac_p.h
@@ -76,6 +76,7 @@ QT_FORWARD_DECLARE_CLASS(QAction)
}
- (id)initWithQMenu:(QMenu*)menu;
- (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action;
+- (NSInteger)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector;
@end
#endif
diff --git a/src/gui/widgets/qdatetimeedit.h b/src/gui/widgets/qdatetimeedit.h
index 81bbdb9..d2f315a 100644
--- a/src/gui/widgets/qdatetimeedit.h
+++ b/src/gui/widgets/qdatetimeedit.h
@@ -206,7 +206,6 @@ private:
class Q_GUI_EXPORT QTimeEdit : public QDateTimeEdit
{
Q_OBJECT
- Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged USER true)
public:
QTimeEdit(QWidget *parent = 0);
QTimeEdit(const QTime &time, QWidget *parent = 0);
@@ -215,7 +214,6 @@ public:
class Q_GUI_EXPORT QDateEdit : public QDateTimeEdit
{
Q_OBJECT
- Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true)
public:
QDateEdit(QWidget *parent = 0);
QDateEdit(const QDate &date, QWidget *parent = 0);
diff --git a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
index 2f4d1df..6c38911 100644
--- a/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp
@@ -94,6 +94,7 @@ public:
/*!
\qmlclass FolderListModel QDeclarativeFolderListModel
+ \ingroup qml-working-with-data
\brief The FolderListModel provides a model of the contents of a folder in a filesystem.
FolderListModel provides access to the local filesystem. The \e folder property
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index ed936d5..500c6bf 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -79,6 +79,8 @@ public:
/*!
\qmlclass GestureArea QDeclarativeGestureArea
+ \ingroup qml-basic-interaction-elements
+
\brief The GestureArea item enables simple gesture handling.
\inherits Item
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index b842109..5cd9c0c 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -154,6 +154,7 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
/*!
\qmlclass ParticleMotionLinear QDeclarativeParticleMotionLinear
+ \ingroup qml-particle-elements
\since 4.7
\brief The ParticleMotionLinear object moves particles linearly.
@@ -180,6 +181,7 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
/*!
\qmlclass ParticleMotionGravity QDeclarativeParticleMotionGravity
+ \ingroup qml-particle-elements
\since 4.7
\brief The ParticleMotionGravity object moves particles towards a point.
@@ -271,6 +273,7 @@ void QDeclarativeParticleMotionGravity::advance(QDeclarativeParticle &p, int int
/*!
\qmlclass ParticleMotionWander QDeclarativeParticleMotionWander
+ \ingroup qml-particle-elements
\since 4.7
\brief The ParticleMotionWander object moves particles in a somewhat random fashion.
@@ -634,6 +637,7 @@ void QDeclarativeParticlesPrivate::updateOpacity(QDeclarativeParticle &p, int ag
/*!
\qmlclass Particles QDeclarativeParticles
+ \ingroup qml-particle-elements
\since 4.7
\brief The Particles object generates and moves particles.
\inherits Item
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index c4f7c00..dd174bf 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -63,6 +63,7 @@ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
: pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true)
{
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
+ qRegisterMetaType<QNetworkConfigurationPrivatePointer>("QNetworkConfigurationPrivatePointer");
moveToThread(QCoreApplicationPrivate::mainThread());
updateConfigurations();
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index 60851ac..3190a30 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -406,13 +406,6 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const
This function is deprecated. It is equivalent to calling bearerTypeName(), however
bearerType() should be used in preference.
*/
-QString QNetworkConfiguration::bearerName() const
-{
- // This function cannot be inline as it would break Qt Mobility.
- // Qt Mobility uses the Qt header as well and since the Mobility Bearer library
- // does not provide bearerTypeName() we cannot use an inline function.
- return bearerTypeName();
-}
/*!
Returns the type of bearer used by this network configuration.
diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h
index 18b92a9..593dbbe 100644
--- a/src/network/bearer/qnetworkconfiguration.h
+++ b/src/network/bearer/qnetworkconfiguration.h
@@ -103,6 +103,7 @@ public:
Q_DECLARE_FLAGS(StateFlags, StateFlag)
+#ifndef QT_MOBILITY_BEARER
enum BearerType {
BearerUnknown,
BearerEthernet,
@@ -114,17 +115,22 @@ public:
BearerBluetooth,
BearerWiMAX
};
+#endif
StateFlags state() const;
Type type() const;
Purpose purpose() const;
- // Required to maintain source compatibility with Qt Mobility.
+#ifndef QT_MOBILITY_BEARER
#ifdef QT_DEPRECATED
- QT_DEPRECATED QString bearerName() const;
+ // Required to maintain source compatibility with Qt Mobility.
+ QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); }
#endif
BearerType bearerType() const;
QString bearerTypeName() const;
+#else
+ QString bearerName() const;
+#endif
QString identifier() const;
bool isRoamingAvailable() const;
diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h
index e7fffac..0b40147 100644
--- a/src/network/bearer/qnetworksession.h
+++ b/src/network/bearer/qnetworksession.h
@@ -89,11 +89,7 @@ public:
OperationNotSupportedError,
InvalidConfigurationError
};
-#ifndef QT_MOBILITY_BEARER
- QNetworkSession(const QNetworkConfiguration& connConfig, QObject* parent =0);
-#else
explicit QNetworkSession(const QNetworkConfiguration& connConfig, QObject* parent =0);
-#endif
virtual ~QNetworkSession();
bool isOpen() const;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index c2338be..6e56553 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -90,7 +90,10 @@
QT_BEGIN_NAMESPACE
-//#define QT_GL_NO_SCISSOR_TEST
+#if defined(Q_OS_SYMBIAN)
+#define QT_GL_NO_SCISSOR_TEST
+#endif
+
#if defined(Q_WS_WIN)
extern Q_GUI_EXPORT bool qt_cleartype_enabled;
#endif
@@ -374,12 +377,12 @@ void QGL2PaintEngineExPrivate::updateMatrix()
dx = ceilf(dx - 0.5f);
dy = ceilf(dy - 0.5f);
}
-
+#ifndef Q_OS_SYMBIAN
if (addOffset) {
dx += 0.49f;
dy += 0.49f;
}
-
+#endif
pmvMatrix[0][0] = (wfactor * transform.m11()) - transform.m13();
pmvMatrix[1][0] = (wfactor * transform.m21()) - transform.m23();
pmvMatrix[2][0] = (wfactor * dx) - transform.m33();
@@ -686,7 +689,12 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
// ### Remove before release...
- static bool do_vectorpath_cache = qgetenv("QT_OPENGL_NO_PATH_CACHE").isEmpty();
+#ifdef Q_OS_SYMBIAN
+ // ### There are some unresolved issues in Symbian vector path caching.
+ static bool do_vectorpath_cache = false;
+#else
+ static bool do_vectorpath_cache = true;
+#endif
// Check to see if there's any hints
if (path.shape() == QVectorPath::RectangleHint) {
diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp
index df7cbc2..f14b0a4 100644
--- a/src/opengl/gl2paintengineex/qtriangulator.cpp
+++ b/src/opengl/gl2paintengineex/qtriangulator.cpp
@@ -65,7 +65,11 @@ QT_BEGIN_NAMESPACE
// Quick sort.
template <class T, class LessThan>
+#ifdef Q_CC_RVCT // RVCT 2.2 doesn't see recursive _static_ template function
+void sort(T *array, int count, LessThan lessThan)
+#else
static void sort(T *array, int count, LessThan lessThan)
+#endif
{
// If the number of elements fall below some threshold, use insertion sort.
const int INSERTION_SORT_LIMIT = 7; // About 7 is fastest on my computer...
@@ -122,7 +126,11 @@ sort_loop_end:
// Quick sort.
template <class T>
+#ifdef Q_CC_RVCT
+void sort(T *array, int count) // RVCT 2.2 doesn't see recursive _static_ template function
+#else
static void sort(T *array, int count)
+#endif
{
// If the number of elements fall below some threshold, use insertion sort.
const int INSERTION_SORT_LIMIT = 25; // About 25 is fastest on my computer...
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 81b964a..c7ca4bc 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -11,30 +11,30 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore QtGui
include(../qbase.pri)
-!win32:!embedded:!mac:CONFIG += x11
+!win32:!embedded:!mac:!symbian:CONFIG += x11
contains(QT_CONFIG, opengl):CONFIG += opengl
contains(QT_CONFIG, opengles1):CONFIG += opengles1
contains(QT_CONFIG, opengles2):CONFIG += opengles2
contains(QT_CONFIG, egl):CONFIG += egl
HEADERS += qgl.h \
- qgl_p.h \
- qglcolormap.h \
+ qgl_p.h \
+ qglcolormap.h \
qglfunctions.h \
- qglpixelbuffer.h \
+ qglpixelbuffer.h \
qglpixelbuffer_p.h \
- qglframebufferobject.h \
+ qglframebufferobject.h \
qglframebufferobject_p.h \
qglextensions_p.h \
qglpaintdevice_p.h \
qglbuffer.h \
-SOURCES += qgl.cpp \
- qglcolormap.cpp \
+SOURCES += qgl.cpp \
+ qglcolormap.cpp \
qglfunctions.cpp \
- qglpixelbuffer.cpp \
- qglframebufferobject.cpp \
+ qglpixelbuffer.cpp \
+ qglframebufferobject.cpp \
qglextensions.cpp \
qglpaintdevice.cpp \
qglbuffer.cpp \
@@ -121,7 +121,7 @@ mac {
win32:!wince*: {
DEFINES += QT_NO_EGL
SOURCES += qgl_win.cpp \
- qglpixelbuffer_win.cpp
+ qglpixelbuffer_win.cpp
}
wince*: {
SOURCES += qgl_wince.cpp \
@@ -149,4 +149,14 @@ embedded {
}
}
+symbian {
+ SOURCES += qgl_symbian.cpp \
+ qglpixelbuffer_egl.cpp \
+ qgl_egl.cpp
+
+ HEADERS += qgl_egl_p.h
+
+ symbian:TARGET.UID3 = 0x2002131A
+}
+
INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 71d42a5..aac6db4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -98,7 +98,7 @@
QT_BEGIN_NAMESPACE
-#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs;
#endif
@@ -1691,6 +1691,10 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
workaround_needsFullClearOnEveryFrame = false;
workaround_brokenFBOReadBack = false;
workaroundsCached = false;
+
+ workaround_brokenTextureFromPixmap = false;
+ workaround_brokenTextureFromPixmap_init = false;
+
for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
vertexAttributeArraysEnabledState[i] = false;
}
@@ -2260,7 +2264,7 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
}
}
-#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
QGLExtensionFuncs& QGLContextPrivate::extensionFuncs(const QGLContext *)
{
return qt_extensionFuncs;
@@ -2283,11 +2287,19 @@ QImage QGLContextPrivate::convertToGLFormat(const QImage &image, bool force_prem
QGLTexture *QGLContextPrivate::bindTexture(const QImage &image, GLenum target, GLint format,
QGLContext::BindOptions options)
{
+ Q_Q(QGLContext);
+
const qint64 key = image.cacheKey();
QGLTexture *texture = textureCacheLookup(key, target);
if (texture) {
- glBindTexture(target, texture->id);
- return texture;
+ if (image.paintingActive()) {
+ // A QPainter is active on the image - take the safe route and replace the texture.
+ q->deleteTexture(texture->id);
+ texture = 0;
+ } else {
+ glBindTexture(target, texture->id);
+ return texture;
+ }
}
if (!texture)
@@ -2553,14 +2565,19 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
}
#else
Q_UNUSED(pd);
- Q_UNUSED(q);
#endif
const qint64 key = pixmap.cacheKey();
QGLTexture *texture = textureCacheLookup(key, target);
if (texture) {
- glBindTexture(target, texture->id);
- return texture;
+ if (pixmap.paintingActive()) {
+ // A QPainter is active on the pixmap - take the safe route and replace the texture.
+ q->deleteTexture(texture->id);
+ texture = 0;
+ } else {
+ glBindTexture(target, texture->id);
+ return texture;
+ }
}
#if defined(Q_WS_X11)
@@ -2571,11 +2588,27 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
&& target == GL_TEXTURE_2D
&& QApplication::instance()->thread() == QThread::currentThread())
{
- texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options);
- if (texture) {
- texture->options |= QGLContext::MemoryManagedBindOption;
- texture->boundPixmap = pd;
- boundPixmaps.insert(pd, QPixmap(pixmap));
+ if (!workaround_brokenTextureFromPixmap_init) {
+ workaround_brokenTextureFromPixmap_init = true;
+
+ const QByteArray versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
+ const int pos = versionString.indexOf("NVIDIA ");
+
+ if (pos >= 0) {
+ const QByteArray nvidiaVersionString = versionString.mid(pos + strlen("NVIDIA "));
+
+ if (nvidiaVersionString.startsWith("195") || nvidiaVersionString.startsWith("256"))
+ workaround_brokenTextureFromPixmap = true;
+ }
+ }
+
+ if (!workaround_brokenTextureFromPixmap) {
+ texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options);
+ if (texture) {
+ texture->options |= QGLContext::MemoryManagedBindOption;
+ texture->boundPixmap = pd;
+ boundPixmaps.insert(pd, QPixmap(pixmap));
+ }
}
}
#endif
@@ -4156,6 +4189,34 @@ bool QGLWidget::event(QEvent *e)
d->glcx->d_ptr->clearDrawable();
# endif
}
+#elif defined(Q_OS_SYMBIAN)
+ // prevents errors on some systems, where we get a flush to a
+ // hidden widget
+ if (e->type() == QEvent::Hide) {
+ makeCurrent();
+ glFinish();
+ doneCurrent();
+ } else if (e->type() == QEvent::ParentChange) {
+ // if we've reparented a window that has the current context
+ // bound, we need to rebind that context to the new window id
+ if (d->glcx == QGLContext::currentContext())
+ makeCurrent();
+
+ if (testAttribute(Qt::WA_TranslucentBackground))
+ setContext(new QGLContext(d->glcx->requestedFormat(), this));
+ }
+
+ // A re-parent is likely to destroy the Symbian window and re-create it. It is important
+ // that we free the EGL surface _before_ the winID changes - otherwise we can leak.
+ if (e->type() == QEvent::ParentAboutToChange)
+ d->glcx->d_func()->destroyEglSurfaceForDevice();
+
+ if ((e->type() == QEvent::ParentChange) || (e->type() == QEvent::WindowStateChange)) {
+ // The window may have been re-created during re-parent or state change - if so, the EGL
+ // surface will need to be re-created.
+ d->recreateEglSurface();
+ }
+
#endif
return QWidget::event(e);
@@ -4363,6 +4424,11 @@ void QGLWidget::glDraw()
Q_D(QGLWidget);
if (!isValid())
return;
+#ifdef Q_OS_SYMBIAN
+ // Crashes on Symbian if trying to render to invisible surfaces
+ if (!isVisible() && d->glcx->device()->devType() == QInternal::Widget)
+ return;
+#endif
makeCurrent();
#ifndef QT_OPENGL_ES
if (d->glcx->deviceIsPixmap())
diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index a154325..ebd1169 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -230,7 +230,7 @@ void QGLContext::swapBuffers() const
void QGLContextPrivate::destroyEglSurfaceForDevice()
{
if (eglSurface != EGL_NO_SURFACE) {
-#ifdef Q_WS_X11
+#if defined(Q_WS_X11) || defined(Q_OS_SYMBIAN)
// Make sure we don't call eglDestroySurface on a surface which
// was created for a different winId. This applies only to QGLWidget
// paint device, so make sure this is the one we're operating on
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 5044795..f86a848 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -167,6 +167,9 @@ public:
#if defined(Q_WS_X11) && !defined(QT_NO_EGL)
, eglSurfaceWindowId(0)
#endif
+#if defined(Q_OS_SYMBIAN)
+ , eglSurfaceWindowId(0)
+#endif
{
isGLWidget = 1;
}
@@ -208,6 +211,10 @@ public:
#elif defined(Q_WS_QWS)
QWSGLWindowSurface *wsurf;
#endif
+#ifdef Q_OS_SYMBIAN
+ void recreateEglSurface();
+ WId eglSurfaceWindowId;
+#endif
};
class QGLContextGroupResourceBase;
@@ -394,6 +401,9 @@ public:
uint workaround_brokenFBOReadBack : 1;
uint workaroundsCached : 1;
+ uint workaround_brokenTextureFromPixmap : 1;
+ uint workaround_brokenTextureFromPixmap_init : 1;
+
QPaintDevice *paintDevice;
QColor transpColor;
QGLContext *q_ptr;
@@ -416,7 +426,7 @@ public:
static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *ctx) { return ctx->d_ptr->group->extensionFuncs(); }
#endif
-#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
static Q_OPENGL_EXPORT QGLExtensionFuncs qt_extensionFuncs;
static Q_OPENGL_EXPORT QGLExtensionFuncs& extensionFuncs(const QGLContext *);
#endif
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
new file mode 100644
index 0000000..73fe4c9
--- /dev/null
+++ b/src/opengl/qgl_symbian.cpp
@@ -0,0 +1,362 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtOpenGL module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qgl.h"
+#include <coemain.h>
+#include <coecntrl.h>
+#include <w32std.h>
+#include <private/qpixmap_s60_p.h>
+#include <private/qimagepixmapcleanuphooks_p.h>
+#include <private/qgl_p.h>
+#include <private/qpaintengine_opengl_p.h>
+#include <private/qwidget_p.h> // to access QWExtra
+#include "qgl_egl_p.h"
+#include "qcolormap.h"
+#include <QDebug>
+
+QT_BEGIN_NAMESPACE
+
+// Turn off "direct to window" rendering if EGL cannot support it.
+#if !defined(EGL_RENDER_BUFFER) || !defined(EGL_SINGLE_BUFFER)
+#if defined(QGL_DIRECT_TO_WINDOW)
+#undef QGL_DIRECT_TO_WINDOW
+#endif
+#endif
+
+// Determine if preserved window contents should be used.
+#if !defined(EGL_SWAP_BEHAVIOR) || !defined(EGL_BUFFER_PRESERVED)
+#if !defined(QGL_NO_PRESERVED_SWAP)
+#define QGL_NO_PRESERVED_SWAP 1
+#endif
+#endif
+
+/*
+ QGLTemporaryContext implementation
+*/
+
+
+class QGLTemporaryContextPrivate
+{
+public:
+ bool initialized;
+ RWindow *window;
+ EGLContext context;
+ EGLSurface surface;
+ EGLDisplay display;
+};
+
+QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
+ : d(new QGLTemporaryContextPrivate)
+{
+ d->initialized = false;
+ d->window = 0;
+ d->context = 0;
+ d->surface = 0;
+
+ d->display = d->display = QEgl::display();
+
+ EGLConfig config;
+ int numConfigs = 0;
+ EGLint attribs[] = {
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+#ifdef QT_OPENGL_ES_2
+ EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+#endif
+ EGL_NONE
+ };
+
+ eglChooseConfig(d->display, attribs, &config, 1, &numConfigs);
+ if (!numConfigs) {
+ qWarning("QGLTemporaryContext: No EGL configurations available.");
+ return;
+ }
+
+ d->window = new RWindow(CCoeEnv::Static()->WsSession());
+ d->window->Construct(CCoeEnv::Static()->RootWin(),(uint)this);
+
+ d->surface = eglCreateWindowSurface(d->display, config, (EGLNativeWindowType) d->window, NULL);
+
+ if (d->surface == EGL_NO_SURFACE) {
+ qWarning("QGLTemporaryContext: Error creating EGL surface.");
+ delete d->window;
+ d->window = 0;
+ return;
+ }
+
+ EGLint contextAttribs[] = {
+#ifdef QT_OPENGL_ES_2
+ EGL_CONTEXT_CLIENT_VERSION, 2,
+#endif
+ EGL_NONE
+ };
+ d->context = eglCreateContext(d->display, config, 0, contextAttribs);
+ if (d->context != EGL_NO_CONTEXT
+ && eglMakeCurrent(d->display, d->surface, d->surface, d->context))
+ {
+ d->initialized = true;
+ } else {
+ qWarning("QGLTemporaryContext: Error creating EGL context.");
+ d->window = 0;
+ return;
+ }
+}
+
+QGLTemporaryContext::~QGLTemporaryContext()
+{
+ if (d->initialized) {
+ eglMakeCurrent(d->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglDestroyContext(d->display, d->context);
+ eglDestroySurface(d->display, d->surface);
+ delete d->window;
+ }
+}
+
+bool QGLFormat::hasOpenGLOverlays()
+{
+ return false;
+}
+
+// Chooses the EGL config and creates the EGL context
+bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as in qgl_x11egl.cpp
+{
+ Q_D(QGLContext);
+
+ if (!device())
+ return false;
+
+ int devType = device()->devType();
+
+ if ((devType != QInternal::Widget) && (devType != QInternal::Pbuffer)) {
+ qWarning("WARNING: Creating a QGLContext not supported on device type %d", devType);
+ return false;
+ }
+
+ // Get the display and initialize it.
+ if (d->eglContext == 0) {
+ d->eglContext = new QEglContext();
+ d->ownsEglContext = true;
+ d->eglContext->setApi(QEgl::OpenGL);
+
+ // If the device is a widget with WA_TranslucentBackground set, make sure the glFormat
+ // has the alpha channel option set:
+ if (devType == QInternal::Widget) {
+ QWidget* widget = static_cast<QWidget*>(device());
+ if (widget->testAttribute(Qt::WA_TranslucentBackground))
+ d->glFormat.setAlpha(true);
+ }
+
+ // Construct the configuration we need for this surface.
+ QEglProperties configProps;
+ configProps.setDeviceType(devType);
+ configProps.setPaintDeviceFormat(device());
+ configProps.setRenderableType(QEgl::OpenGL);
+ configProps.setValue(EGL_SURFACE_TYPE, EGL_WINDOW_BIT|EGL_SWAP_BEHAVIOR_PRESERVED_BIT);
+
+ qt_eglproperties_set_glformat(configProps, d->glFormat);
+
+ if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) {
+ delete d->eglContext;
+ d->eglContext = 0;
+ return false;
+ }
+
+ // Create a new context for the configuration.
+ QEglContext* eglSharedContext = shareContext ? shareContext->d_func()->eglContext : 0;
+ if (!d->eglContext->createContext(eglSharedContext)) {
+ delete d->eglContext;
+ d->eglContext = 0;
+ return false;
+ }
+ d->sharing = d->eglContext->isSharing();
+ if (d->sharing && shareContext)
+ const_cast<QGLContext *>(shareContext)->d_func()->sharing = true;
+ }
+
+ // Inform the higher layers about the actual format properties
+ qt_glformat_from_eglconfig(d->glFormat, d->eglContext->config());
+
+ // Do don't create the EGLSurface for everything.
+ // QWidget - yes, create the EGLSurface and store it in QGLContextPrivate::eglSurface
+ // QGLWidget - yes, create the EGLSurface and store it in QGLContextPrivate::eglSurface
+ // QGLPixelBuffer - no, it creates the surface itself and stores it in QGLPixelBufferPrivate::pbuf
+
+ if (devType == QInternal::Widget) {
+ if (d->eglSurface != EGL_NO_SURFACE)
+ eglDestroySurface(d->eglContext->display(), d->eglSurface);
+
+ d->eglSurface = QEgl::createSurface(device(), d->eglContext->config());
+
+#if !defined(QGL_NO_PRESERVED_SWAP)
+ eglGetError(); // Clear error state first.
+ eglSurfaceAttrib(QEgl::display(), d->eglSurface,
+ EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
+ if (eglGetError() != EGL_SUCCESS) {
+ qWarning("QGLContext: could not enable preserved swap");
+ }
+#endif
+
+ setWindowCreated(true);
+ }
+
+ return true;
+}
+
+void QGLWidget::resizeEvent(QResizeEvent *)
+{
+ Q_D(QGLWidget);
+ if (!isValid())
+ return;
+
+ if (QGLContext::currentContext())
+ doneCurrent();
+
+ // Symbian needs to recreate the surface on resize.
+ d->recreateEglSurface();
+
+ makeCurrent();
+ if (!d->glcx->initialized())
+ glInit();
+ resizeGL(width(), height());
+ //handle overlay
+}
+
+const QGLContext* QGLWidget::overlayContext() const
+{
+ return 0;
+}
+
+void QGLWidget::makeOverlayCurrent()
+{
+ //handle overlay
+}
+
+void QGLWidget::updateOverlayGL()
+{
+ //handle overlay
+}
+
+void QGLWidget::setContext(QGLContext *context, const QGLContext* shareContext, bool deleteOldContext)
+{
+ Q_D(QGLWidget);
+ if (context == 0) {
+ qWarning("QGLWidget::setContext: Cannot set null context");
+ return;
+ }
+ if (!context->deviceIsPixmap() && context->device() != this) {
+ qWarning("QGLWidget::setContext: Context must refer to this widget");
+ return;
+ }
+
+ if (d->glcx)
+ d->glcx->doneCurrent();
+ QGLContext* oldcx = d->glcx;
+ d->glcx = context;
+
+ bool createFailed = false;
+ if (!d->glcx->isValid()) {
+ // Create the QGLContext here, which in turn chooses the EGL config
+ // and creates the EGL context:
+ if (!d->glcx->create(shareContext ? shareContext : oldcx))
+ createFailed = true;
+ }
+ if (createFailed) {
+ if (deleteOldContext)
+ delete oldcx;
+ return;
+ }
+
+ d->eglSurfaceWindowId = winId(); // Remember the window id we created the surface for
+}
+
+void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget* shareWidget)
+{
+ Q_Q(QGLWidget);
+
+ initContext(context, shareWidget);
+
+ if(q->isValid() && glcx->format().hasOverlay()) {
+ //no overlay
+ qWarning("QtOpenGL ES doesn't currently support overlays");
+ }
+}
+
+void QGLWidgetPrivate::cleanupColormaps()
+{
+}
+
+const QGLColormap & QGLWidget::colormap() const
+{
+ return d_func()->cmap;
+}
+
+void QGLWidget::setColormap(const QGLColormap &)
+{
+}
+
+void QGLWidgetPrivate::recreateEglSurface()
+{
+ Q_Q(QGLWidget);
+
+ WId currentId = q->winId();
+
+ if (glcx->d_func()->eglSurface != EGL_NO_SURFACE) {
+ eglDestroySurface(glcx->d_func()->eglContext->display(),
+ glcx->d_func()->eglSurface);
+ }
+
+ glcx->d_func()->eglSurface = QEgl::createSurface(glcx->device(),
+ glcx->d_func()->eglContext->config());
+
+#if !defined(QGL_NO_PRESERVED_SWAP)
+ eglGetError(); // Clear error state first.
+ eglSurfaceAttrib(QEgl::display(), glcx->d_func()->eglSurface,
+ EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
+ if (eglGetError() != EGL_SUCCESS) {
+ qWarning("QGLContext: could not enable preserved swap");
+ }
+#endif
+
+ eglSurfaceWindowId = currentId;
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 653e805..1efd398 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -367,7 +367,7 @@ void QGLPixmapData::ensureCreated() const
}
void QGLPixmapData::fromImage(const QImage &image,
- Qt::ImageConversionFlags /*flags*/)
+ Qt::ImageConversionFlags flags)
{
if (image.size() == QSize(w, h))
setSerialNumber(++qt_gl_pixmap_serial);
@@ -381,7 +381,9 @@ void QGLPixmapData::fromImage(const QImage &image,
if (qApp->desktop()->depth() == 16)
format = QImage::Format_RGB16;
- if (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())
+ if (image.hasAlphaChannel()
+ && ((flags & Qt::NoOpaqueDetection)
+ || const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels()))
format = QImage::Format_ARGB32_Premultiplied;;
m_source = image.convertToFormat(format);
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index cb413d0..e8ec333 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -47,6 +47,9 @@
#endif
#include "qvg_p.h"
#include "qvgimagepool_p.h"
+#include <QBuffer>
+#include <QImageReader>
+#include <QtGui/private/qimage_p.h>
QT_BEGIN_NAMESPACE
@@ -152,11 +155,59 @@ void QVGPixmapData::resize(int wid, int ht)
void QVGPixmapData::fromImage
(const QImage &image, Qt::ImageConversionFlags flags)
{
+ QImage img = image;
+ createPixmapForImage(img, flags, false);
+}
+
+void QVGPixmapData::fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags)
+{
+ QImage image = imageReader->read();
+ if (image.isNull())
+ return;
+
+ createPixmapForImage(image, flags, true);
+}
+
+bool QVGPixmapData::fromFile(const QString &filename, const char *format,
+ Qt::ImageConversionFlags flags)
+{
+ QImage image = QImageReader(filename, format).read();
+ if (image.isNull())
+ return false;
+
+ createPixmapForImage(image, flags, true);
+
+ return !isNull();
+}
+
+bool QVGPixmapData::fromData(const uchar *buffer, uint len, const char *format,
+ Qt::ImageConversionFlags flags)
+{
+ QByteArray a = QByteArray::fromRawData(reinterpret_cast<const char *>(buffer), len);
+ QBuffer b(&a);
+ b.open(QIODevice::ReadOnly);
+ QImage image = QImageReader(&b, format).read();
+ if (image.isNull())
+ return false;
+
+ createPixmapForImage(image, flags, true);
+
+ return !isNull();
+}
+
+void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace)
+{
if (image.size() == QSize(w, h))
setSerialNumber(++qt_vg_pixmap_serial);
else
resize(image.width(), image.height());
- source = image.convertToFormat(sourceFormat(), flags);
+
+ if (inPlace && image.data_ptr()->convertInPlace(sourceFormat(), flags))
+ source = image;
+ else
+ source = image.convertToFormat(sourceFormat());
+
recreate = true;
}
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index c21b48f..114d545 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -64,6 +64,7 @@ QT_BEGIN_NAMESPACE
class QEglContext;
class QVGImagePool;
+class QImageReader;
#if !defined(QT_NO_EGL)
class QVGPixmapData;
@@ -87,6 +88,12 @@ public:
void resize(int width, int height);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
+ void fromImageReader(QImageReader *imageReader,
+ Qt::ImageConversionFlags flags);
+ bool fromFile(const QString &filename, const char *format,
+ Qt::ImageConversionFlags flags);
+ bool fromData(const uchar *buffer, uint len, const char *format,
+ Qt::ImageConversionFlags flags);
void fill(const QColor &color);
bool hasAlphaChannel() const;
@@ -126,6 +133,7 @@ public:
protected:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
+ void createPixmapForImage(QImage &image, Qt::ImageConversionFlags flags, bool inPlace);
#if defined(Q_OS_SYMBIAN)
void cleanup();
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 6d8f7f2..bbe8ab1 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -5,7 +5,7 @@ contains(QT_CONFIG, dbus) {
SUBDIRS += icd
} else {
SUBDIRS += generic
- !mac:SUBDIRS += connman networkmanager
+ linux*:SUBDIRS += connman networkmanager
}
}
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 3b5ae86..341f7cd 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -328,7 +328,6 @@ QString QConnmanEngine::getServiceForNetwork(const QString &netPath)
void QConnmanEngine::propertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
{
Q_UNUSED(path);
-// qDebug() << __FUNCTION__ << path << item << value.variant();
QMutexLocker locker(&mutex);
if(item == "Services") {
@@ -380,12 +379,10 @@ void QConnmanEngine::servicePropertyChangedContext(const QString &path,const QSt
void QConnmanEngine::networkPropertyChangedContext(const QString &path,const QString &item, const QDBusVariant &value)
{
QMutexLocker locker(&mutex);
-// qDebug() << __FUNCTION__ << path << item << value.variant();
}
void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const QString &item,const QDBusVariant &value)
{
-// qDebug() << __FUNCTION__ << devpath << item << value.variant();
QMutexLocker locker(&mutex);
if(item == "Networks") {
@@ -429,7 +426,6 @@ void QConnmanEngine::devicePropertyChangedContext(const QString &devpath,const Q
void QConnmanEngine::technologyPropertyChangedContext(const QString & path, const QString &item, const QDBusVariant &value)
{
-// qDebug() << __FUNCTION__ << path << item << value.variant();
if(item == "Devices") {
QDBusArgument arg = qvariant_cast<QDBusArgument>(value.variant());
QStringList list = qdbus_cast<QStringList>(arg);
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 0ffada9..3fc0bae 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -481,9 +481,7 @@ QVariant QConnmanProfileInterface::getProperty(const QString &property)
QVariantMap map = getProperties();
if (map.contains(property)) {
var = map.value(property);
- } else {
- qDebug() <<__FUNCTION__<< "Could not find" << property;
- }
+ }
return var;
}
@@ -522,8 +520,6 @@ QConnmanServiceInterface::~QConnmanServiceInterface()
void QConnmanServiceInterface::connectNotify(const char *signal)
{
-// qWarning() << __FUNCTION__ << signal << this->path();
-
if (QLatin1String(signal) == SIGNAL(propertyChanged(QString,QDBusVariant))) {
dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
@@ -569,9 +565,7 @@ QVariant QConnmanServiceInterface::getProperty(const QString &property)
QVariantMap map = getProperties();
if (map.contains(property)) {
var = map.value(property);
- } else {
-// qDebug() <<__FUNCTION__<< "Could not find" << property;
- }
+ }
return var;
}
@@ -1051,15 +1045,7 @@ QVariantMap QConnmanDeviceInterface::getProperties()
bool QConnmanDeviceInterface::setProperty(const QString &name, const QDBusVariant &value)
{
-
-// QList<QVariant> args;
- qWarning() << __FUNCTION__ << name << value.variant();
-// args << QVariant::fromValue(name);
-// args << QVariant::fromValue(value);
-
QDBusMessage reply = this->call(QLatin1String("SetProperty"),name, QVariant::fromValue(value));
-qWarning() << reply.errorMessage();
-
return true;
}
@@ -1148,7 +1134,6 @@ bool QConnmanDeviceInterface::setEnabled(bool powered)
<< QVariant::fromValue(QDBusVariant(powered));
QDBusMessage reply = this->callWithArgumentList(QDBus::AutoDetect,QLatin1String("SetProperty"),args);
- qWarning() << reply.errorMessage() << reply.errorName();
return true;
}
@@ -1164,8 +1149,6 @@ QConnmanDBusHelper::~QConnmanDBusHelper()
void QConnmanDBusHelper::propertyChanged(const QString &item, const QDBusVariant &var)
{
QDBusMessage msg = this->message();
-// qWarning() << sender();
- // qWarning() << msg.interface() << msg.path() << item << var.variant() <<"\n";
Q_EMIT propertyChangedContext(msg.path() ,item, var);
}
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
index 0900329..3264f15 100644
--- a/src/plugins/bearer/icd/qicdengine.cpp
+++ b/src/plugins/bearer/icd/qicdengine.cpp
@@ -275,6 +275,8 @@ void QIcdEngine::initialize()
userChoiceConfigurations.insert(cpPriv->id, ptr);
doRequestUpdate();
+
+ getIcdInitialState();
}
static inline QString network_attrs_to_security(uint network_attrs)
@@ -623,7 +625,11 @@ void QIcdEngine::doRequestUpdate(QList<Maemo::IcdScanResult> scanned)
changed = true;
}
- if (ptr->state != QNetworkConfiguration::Discovered) {
+ /* If this config is the current active one, we do not set it
+ * to discovered.
+ */
+ if ((ptr->state != QNetworkConfiguration::Discovered) &&
+ (ptr->state != QNetworkConfiguration::Active)) {
ptr->state = QNetworkConfiguration::Discovered;
changed = true;
}
@@ -786,10 +792,48 @@ void QIcdEngine::startListeningStateSignalsForAllConnections()
ICD_DBUS_API_INTERFACE,
ICD_DBUS_API_STATE_SIG,
this, SLOT(connectionStateSignalsSlot(QDBusMessage)));
+}
+
+void QIcdEngine::getIcdInitialState()
+{
+ /* Instead of requesting ICD status asynchronously, we ask it synchronously.
+ * It ensures that we always get right icd status BEFORE initialize() ends.
+ * If not, initialize() might end before we got icd status and
+ * QNetworkConfigurationManager::updateConfigurations()
+ * call from user might also end before receiving icd status.
+ * In such case, we come up to a bug:
+ * QNetworkConfigurationManagerPrivate::isOnline() will be false even
+ * if we are connected.
+ */
+ Maemo::Icd icd;
+ QList<Maemo::IcdStateResult> state_results;
+ QNetworkConfigurationPrivatePointer ptr;
- // Calling ICD_DBUS_API_STATE_REQ makes sure that initial state will be updated immediately
- m_gettingInitialConnectionState = true;
- m_dbusInterface->call(ICD_DBUS_API_STATE_REQ);
+ if (icd.state(state_results) && !state_results.isEmpty()) {
+
+ if (!(state_results.first().params.network_attrs == 0 &&
+ state_results.first().params.network_id.isEmpty())) {
+
+ switch (state_results.first().state) {
+ case ICD_STATE_CONNECTED:
+ m_onlineIapId = state_results.first().params.network_id;
+
+ ptr = accessPointConfigurations.value(m_onlineIapId);
+ if (ptr) {
+ QMutexLocker configLocker(&ptr->mutex);
+ ptr->state = QNetworkConfiguration::Active;
+ configLocker.unlock();
+
+ mutex.unlock();
+ emit configurationChanged(ptr);
+ mutex.lock();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
}
void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
@@ -814,12 +858,12 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
ptr->type = QNetworkConfiguration::InternetAccessPoint;
if (ptr->state != QNetworkConfiguration::Active) {
ptr->state = QNetworkConfiguration::Active;
- if (!m_gettingInitialConnectionState) {
- configLocker.unlock();
- locker.unlock();
- emit configurationChanged(ptr);
- locker.relock();
- }
+
+ configLocker.unlock();
+ locker.unlock();
+ emit configurationChanged(ptr);
+ locker.relock();
+
m_onlineIapId = iapid;
}
} else {
@@ -840,22 +884,21 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
ptr->type = QNetworkConfiguration::InternetAccessPoint;
if (ptr->state == QNetworkConfiguration::Active) {
ptr->state = QNetworkConfiguration::Discovered;
- if (!m_gettingInitialConnectionState) {
- configLocker.unlock();
- locker.unlock();
- emit configurationChanged(ptr);
- locker.relock();
- // Note: If ICD switches used IAP from one to another:
- // 1) new IAP is reported to be online first
- // 2) old IAP is reported to be offline then
- // => Device can be reported to be offline only
- // if last known online IAP is reported to be disconnected
- if (iapid == m_onlineIapId) {
- // It's known that there is only one global ICD connection
- // => Because ICD state was reported to be DISCONNECTED, Device is offline
- m_onlineIapId.clear();
- }
+ configLocker.unlock();
+ locker.unlock();
+ emit configurationChanged(ptr);
+ locker.relock();
+
+ // Note: If ICD switches used IAP from one to another:
+ // 1) new IAP is reported to be online first
+ // 2) old IAP is reported to be offline then
+ // => Device can be reported to be offline only
+ // if last known online IAP is reported to be disconnected
+ if (iapid == m_onlineIapId) {
+ // It's known that there is only one global ICD connection
+ // => Because ICD state was reported to be DISCONNECTED, Device is offline
+ m_onlineIapId.clear();
}
}
} else {
@@ -876,8 +919,6 @@ void QIcdEngine::connectionStateSignalsSlot(QDBusMessage msg)
locker.unlock();
emit iapStateChanged(iapid, icd_connection_state);
locker.relock();
-
- m_gettingInitialConnectionState = false;
}
void QIcdEngine::requestUpdate()
diff --git a/src/plugins/bearer/icd/qicdengine.h b/src/plugins/bearer/icd/qicdengine.h
index a768d84..0d5ba27 100644
--- a/src/plugins/bearer/icd/qicdengine.h
+++ b/src/plugins/bearer/icd/qicdengine.h
@@ -152,6 +152,7 @@ private:
void startListeningStateSignalsForAllConnections();
void doRequestUpdate(QList<Maemo::IcdScanResult> scanned = QList<Maemo::IcdScanResult>());
void cancelAsyncConfigurationUpdate();
+ void getIcdInitialState();
private:
IapMonitor *iapMonitor;
@@ -162,7 +163,6 @@ private:
QList<Maemo::IcdScanResult> m_scanResult;
bool firstUpdate;
- bool m_gettingInitialConnectionState;
bool m_scanGoingOn;
};
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 2583b28..3170bf6 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -339,8 +339,6 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
isOpen = false;
opened = false;
- connect(&manager, SIGNAL(updateCompleted()), this, SLOT(networkConfigurationsChanged()));
-
connect(engine, SIGNAL(iapStateChanged(const QString&, uint)),
this, SLOT(iapStateChanged(const QString&, uint)));
@@ -460,14 +458,15 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
else
ptr->name = ptr->id;
+ const QString identifier = ptr->id;
+
+ configLocker.unlock();
+
// Add the new active configuration to manager or update the old config
- if (!engine->hasIdentifier(ptr->id)) {
- configLocker.unlock();
+ if (!engine->hasIdentifier(identifier))
engine->addSessionConfiguration(ptr);
- } else {
- configLocker.unlock();
+ else
engine->changedSessionConfiguration(ptr);
- }
}
break;
diff --git a/src/plugins/graphicssystems/opengl/opengl.pro b/src/plugins/graphicssystems/opengl/opengl.pro
index 7d6fe3f..47e15c5 100644
--- a/src/plugins/graphicssystems/opengl/opengl.pro
+++ b/src/plugins/graphicssystems/opengl/opengl.pro
@@ -9,3 +9,5 @@ SOURCES = main.cpp
target.path += $$[QT_INSTALL_PLUGINS]/graphicssystems
INSTALLS += target
+
+symbian: TARGET.UID3 = 0x2002131B
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 480d9ff..bc6d0aa 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -1684,4 +1684,5 @@ EXPORTS
?rootContext@QDeclarativeView@@QBEPAVQDeclarativeContext@@XZ @ 1683 NONAME ; class QDeclarativeContext * QDeclarativeView::rootContext(void) const
?rootContext@QDeclarativeEngine@@QBEPAVQDeclarativeContext@@XZ @ 1684 NONAME ; class QDeclarativeContext * QDeclarativeEngine::rootContext(void) const
?qmlregister@QDeclarativePrivate@@YAHW4RegistrationType@1@PAX@Z @ 1685 NONAME ; int QDeclarativePrivate::qmlregister(enum QDeclarativePrivate::RegistrationType, void *)
+ ?hasValue@QDeclarativeOpenMetaObject@@QBE_NH@Z @ 1686 NONAME ; bool QDeclarativeOpenMetaObject::hasValue(int) const
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 90c0878..21a2122 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -4148,7 +4148,7 @@ EXPORTS
?ensureSceneTransformRecursive@QGraphicsItemPrivate@@QAEXPAPAVQGraphicsItem@@@Z @ 4147 NONAME ; void QGraphicsItemPrivate::ensureSceneTransformRecursive(class QGraphicsItem * *)
?ensureSequentialSiblingIndex@QGraphicsItemPrivate@@QAEXXZ @ 4148 NONAME ; void QGraphicsItemPrivate::ensureSequentialSiblingIndex(void)
?ensureSortedChildren@QGraphicsItemPrivate@@QAEXXZ @ 4149 NONAME ; void QGraphicsItemPrivate::ensureSortedChildren(void)
- ?ensureSpace@QTextEngine@@QBEXH@Z @ 4150 NONAME ; void QTextEngine::ensureSpace(int) const
+ ?ensureSpace@QTextEngine@@QBEXH@Z @ 4150 NONAME ABSENT ; void QTextEngine::ensureSpace(int) const
?ensureVisible@QGraphicsItem@@QAEXABVQRectF@@HH@Z @ 4151 NONAME ; void QGraphicsItem::ensureVisible(class QRectF const &, int, int)
?ensureVisible@QGraphicsItem@@QAEXMMMMHH@Z @ 4152 NONAME ; void QGraphicsItem::ensureVisible(float, float, float, float, int, int)
?ensureVisible@QGraphicsView@@QAEXABVQRectF@@HH@Z @ 4153 NONAME ; void QGraphicsView::ensureVisible(class QRectF const &, int, int)
@@ -12886,4 +12886,6 @@ EXPORTS
?zScaleChanged@QGraphicsScale@@IAEXXZ @ 12885 NONAME ; void QGraphicsScale::zScaleChanged(void)
?xScaleChanged@QGraphicsScale@@IAEXXZ @ 12886 NONAME ; void QGraphicsScale::xScaleChanged(void)
?yScaleChanged@QGraphicsScale@@IAEXXZ @ 12887 NONAME ; void QGraphicsScale::yScaleChanged(void)
+ ?_q_aboutToQuit@QApplicationPrivate@@QAEXXZ @ 12888 NONAME ; void QApplicationPrivate::_q_aboutToQuit(void)
+ ?ensureSpace@QTextEngine@@QBE_NH@Z @ 12889 NONAME ; bool QTextEngine::ensureSpace(int) const
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index 9a3cefa..723f2ae 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -1714,4 +1714,5 @@ EXPORTS
_ZNK16QDeclarativeView6engineEv @ 1713 NONAME
_ZNK18QDeclarativeEngine11rootContextEv @ 1714 NONAME
_ZN19QDeclarativePrivate11qmlregisterENS_16RegistrationTypeEPv @ 1715 NONAME
+ _ZNK26QDeclarativeOpenMetaObject8hasValueEi @ 1716 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index d8e86bf..c4ad848 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12091,4 +12091,5 @@ EXPORTS
_ZN14QGraphicsScale13xScaleChangedEv @ 12090 NONAME
_ZN14QGraphicsScale13yScaleChangedEv @ 12091 NONAME
_ZN14QGraphicsScale13zScaleChangedEv @ 12092 NONAME
+ _ZN19QApplicationPrivate14_q_aboutToQuitEv @ 12093 NONAME
diff --git a/src/s60installs/eabi/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def
index 2442ee8..6b34a19 100644
--- a/src/s60installs/eabi/QtNetworku.def
+++ b/src/s60installs/eabi/QtNetworku.def
@@ -1131,7 +1131,7 @@ EXPORTS
_ZNK21QNetworkAccessManager13configurationEv @ 1130 NONAME
_ZNK21QNetworkAccessManager17networkAccessibleEv @ 1131 NONAME
_ZNK21QNetworkAccessManager19activeConfigurationEv @ 1132 NONAME
- _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME
+ _ZNK21QNetworkConfiguration10bearerNameEv @ 1133 NONAME ABSENT
_ZNK21QNetworkConfiguration10identifierEv @ 1134 NONAME
_ZNK21QNetworkConfiguration18isRoamingAvailableEv @ 1135 NONAME
_ZNK21QNetworkConfiguration4nameEv @ 1136 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index 935bdc5..b6cdce9 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -20,6 +20,7 @@ file=ABI_DIR\BUILD_DIR\phonon.dll SHARED_LIB_DIR\phonon.dll
file=ABI_DIR\BUILD_DIR\QtMultimedia.dll SHARED_LIB_DIR\QtMultimedia.dll
file=ABI_DIR\BUILD_DIR\QtXmlPatterns.dll SHARED_LIB_DIR\QtXmlPatterns.dll
file=ABI_DIR\BUILD_DIR\QtDeclarative.dll SHARED_LIB_DIR\QtDeclarative.dll
+file=ABI_DIR\BUILD_DIR\QtOpenGL.dll SHARED_LIB_DIR\QtOpenGL.dll
// imageformats
file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll
@@ -50,6 +51,7 @@ file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll
// graphicssystems
file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll
+file=ABI_DIR\BUILD_DIR\qglgraphicssystem.dll SHARED_LIB_DIR\qglgraphicssystem.dll
// S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM,
// so don't bother including those plugins
@@ -95,6 +97,7 @@ data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio
// graphicssystems
data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin
// Stub sis file
data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 8a8167b..9e1d582 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -189,6 +189,11 @@ symbian: {
"[0x1028315F],0,0,0,{\"S60ProductID\"}"
}
+ contains(QT_CONFIG, opengl) {
+ qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenGL$${QT_LIBINFIX}.dll
+ graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qglgraphicssystem$${QT_LIBINFIX}.dll
+ }
+
contains(QT_CONFIG, multimedia){
qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMultimedia$${QT_LIBINFIX}.dll
}
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 9a982d0..c3bbba1 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -483,54 +483,6 @@ void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype
void Generator::generateProperties()
{
//
- // specify get function, for compatibiliy we accept functions
- // returning pointers, or const char * for QByteArray.
- //
- for (int i = 0; i < cdef->propertyList.count(); ++i) {
- PropertyDef &p = cdef->propertyList[i];
- if (p.read.isEmpty())
- continue;
- for (int j = 0; j < cdef->publicList.count(); ++j) {
- const FunctionDef &f = cdef->publicList.at(j);
- if (f.name != p.read)
- continue;
- if (!f.isConst) // get functions must be const
- continue;
- if (f.arguments.size()) // and must not take any arguments
- continue;
- PropertyDef::Specification spec = PropertyDef::ValueSpec;
- QByteArray tmp = f.normalizedType;
- if (p.type == "QByteArray" && tmp == "const char *")
- tmp = "QByteArray";
- if (tmp.left(6) == "const ")
- tmp = tmp.mid(6);
- if (p.type != tmp && tmp.endsWith('*')) {
- tmp.chop(1);
- spec = PropertyDef::PointerSpec;
- } else if (f.type.name.endsWith('&')) { // raw type, not normalized type
- spec = PropertyDef::ReferenceSpec;
- }
- if (p.type != tmp)
- continue;
- p.gspec = spec;
- break;
- }
- if(!p.notify.isEmpty()) {
- int notifyId = -1;
- for (int j = 0; j < cdef->signalList.count(); ++j) {
- const FunctionDef &f = cdef->signalList.at(j);
- if(f.name != p.notify) {
- continue;
- } else {
- notifyId = j /* Signal indexes start from 0 */;
- break;
- }
- }
- p.notifyId = notifyId;
- }
- }
-
- //
// Create meta data
//
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index ac49d65..2c24165 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -727,6 +727,7 @@ void Moc::parse()
error("Class declarations lacks Q_OBJECT macro.");
checkSuperClasses(&def);
+ checkProperties(&def);
classList += def;
knownQObjectClasses.insert(def.classname);
@@ -1312,5 +1313,62 @@ void Moc::checkSuperClasses(ClassDef *def)
}
}
+void Moc::checkProperties(ClassDef *cdef)
+{
+ //
+ // specify get function, for compatibiliy we accept functions
+ // returning pointers, or const char * for QByteArray.
+ //
+ for (int i = 0; i < cdef->propertyList.count(); ++i) {
+ PropertyDef &p = cdef->propertyList[i];
+ if (p.read.isEmpty())
+ continue;
+ for (int j = 0; j < cdef->publicList.count(); ++j) {
+ const FunctionDef &f = cdef->publicList.at(j);
+ if (f.name != p.read)
+ continue;
+ if (!f.isConst) // get functions must be const
+ continue;
+ if (f.arguments.size()) // and must not take any arguments
+ continue;
+ PropertyDef::Specification spec = PropertyDef::ValueSpec;
+ QByteArray tmp = f.normalizedType;
+ if (p.type == "QByteArray" && tmp == "const char *")
+ tmp = "QByteArray";
+ if (tmp.left(6) == "const ")
+ tmp = tmp.mid(6);
+ if (p.type != tmp && tmp.endsWith('*')) {
+ tmp.chop(1);
+ spec = PropertyDef::PointerSpec;
+ } else if (f.type.name.endsWith('&')) { // raw type, not normalized type
+ spec = PropertyDef::ReferenceSpec;
+ }
+ if (p.type != tmp)
+ continue;
+ p.gspec = spec;
+ break;
+ }
+ if(!p.notify.isEmpty()) {
+ int notifyId = -1;
+ for (int j = 0; j < cdef->signalList.count(); ++j) {
+ const FunctionDef &f = cdef->signalList.at(j);
+ if(f.name != p.notify) {
+ continue;
+ } else {
+ notifyId = j /* Signal indexes start from 0 */;
+ break;
+ }
+ }
+ p.notifyId = notifyId;
+ if (notifyId == -1) {
+ QByteArray msg = "NOTIFY signal '" + p.notify + "' of property '" + p.name
+ + "' does not exist in class " + cdef->classname + ".";
+ error(msg.constData());
+ }
+ }
+ }
+}
+
+
QT_END_NAMESPACE
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 9f349b5..5e47d9a 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -238,6 +238,7 @@ public:
bool testFunctionAttribute(Token tok, FunctionDef *def);
void checkSuperClasses(ClassDef *def);
+ void checkProperties(ClassDef* cdef);
};
inline QByteArray noRef(const QByteArray &type)