summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/syncqt6
-rw-r--r--config.tests/mac/crc/main.cpp4
-rwxr-xr-xconfigure2
-rw-r--r--projects.pro2
-rw-r--r--src/corelib/codecs/qtextcodec.h2
-rw-r--r--src/corelib/io/qfsfileengine.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp3
-rw-r--r--src/corelib/kernel/qcore_unix.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp13
-rw-r--r--src/dbus/qdbusargument_p.h2
-rw-r--r--src/dbus/qdbusconnection_p.h2
-rw-r--r--src/dbus/qdbusconnectioninterface.cpp2
-rw-r--r--src/dbus/qdbuserror.cpp2
-rw-r--r--src/dbus/qdbusintegrator_p.h2
-rw-r--r--src/dbus/qdbusinterface.cpp2
-rw-r--r--src/dbus/qdbusinterface_p.h4
-rw-r--r--src/dbus/qdbusinternalfilters.cpp2
-rw-r--r--src/dbus/qdbusmessage.cpp2
-rw-r--r--src/dbus/qdbusmetatype.cpp2
-rw-r--r--src/dbus/qdbusutil.cpp2
-rw-r--r--src/dbus/qdbusxmlparser_p.h2
-rw-r--r--src/gui/dialogs/dialogs.pri18
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp24
-rw-r--r--src/gui/kernel/qapplication.cpp10
-rw-r--r--src/gui/kernel/qwidget_mac.mm112
-rw-r--r--src/gui/styles/qgtkstyle.cpp16
-rw-r--r--src/gui/styles/qgtkstyle_p.cpp2
-rw-r--r--src/gui/styles/qgtkstyle_p.h2
-rw-r--r--src/gui/util/qsystemtrayicon.cpp3
-rw-r--r--src/gui/util/qsystemtrayicon_mac.mm28
-rw-r--r--src/network/access/qnetworkrequest.cpp3
-rw-r--r--src/qt_install.pri6
-rw-r--r--src/s60installs/eabi/QtGuiu.def41
-rw-r--r--src/s60installs/eabi/QtOpenVGu.def8
-rw-r--r--src/script/api/qscriptengine.cpp7
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp17
-rw-r--r--src/sql/kernel/qsqlcachedresult.cpp5
-rw-r--r--tests/auto/auto.pro6
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp2
-rw-r--r--tests/auto/qprocessenvironment/qprocessenvironment.pro5
-rw-r--r--tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp265
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp10
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp1
-rw-r--r--tests/auto/qtouchevent/tst_qtouchevent.cpp250
-rw-r--r--tests/benchmarks/qscriptengine/tst_qscriptengine.cpp21
-rw-r--r--tests/manual/qwidget_zorder/main.cpp118
-rw-r--r--tests/manual/qwidget_zorder/qwidget_zorder.pro6
47 files changed, 941 insertions, 110 deletions
diff --git a/bin/syncqt b/bin/syncqt
index a14a82d..629e124 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -666,6 +666,7 @@ foreach (@modules_to_sync) {
#information used after the syncing
my $pri_install_classes = "";
my $pri_install_files = "";
+ my $pri_install_pfiles = "";
my $libcapitals = $lib;
$libcapitals =~ y/a-z/A-Z/;
@@ -834,6 +835,10 @@ foreach (@modules_to_sync) {
$pri_install_files.= "$pri_install_iheader ";;
}
}
+ else {
+ my $pri_install_iheader = fixPaths($iheader, $current_dir);
+ $pri_install_pfiles.= "$pri_install_iheader ";;
+ }
}
print "header created for $iheader ($header_copies)\n" if($header_copies > 0);
}
@@ -878,6 +883,7 @@ foreach (@modules_to_sync) {
my $headers_pri_contents = "";
$headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n";
$headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
+ $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
my $headers_pri_file = "$out_basedir/include/$lib/headers.pri";
if(-e "$headers_pri_file") {
open HEADERS_PRI_FILE, "<$headers_pri_file";
diff --git a/config.tests/mac/crc/main.cpp b/config.tests/mac/crc/main.cpp
index 894f88b..700a4cd 100644
--- a/config.tests/mac/crc/main.cpp
+++ b/config.tests/mac/crc/main.cpp
@@ -71,7 +71,7 @@ private:
for(int iCodes = 0; iCodes <= 0xFF; iCodes++) {
ulTable[iCodes] = Reflect(iCodes, 8) << 24;
for(int iPos = 0; iPos < 8; iPos++) {
- ulTable[iCodes] = (ulTable[iCodes] << 1)
+ ulTable[iCodes] = ((ulTable[iCodes] << 1) & 0xffffffff)
^ ((ulTable[iCodes] & (1 << 31)) ? ulPolynomial : 0);
}
@@ -84,7 +84,7 @@ private:
// Swap bit 0 for bit 7, bit 1 For bit 6, etc....
for(int iPos = 1; iPos < (cChar + 1); iPos++) {
if(ulReflect & 1) {
- ulValue |= (1 << (cChar - iPos));
+ ulValue |= (1ul << (cChar - iPos));
}
ulReflect >>= 1;
}
diff --git a/configure b/configure
index f186944..40a73f8 100755
--- a/configure
+++ b/configure
@@ -131,7 +131,7 @@ compilerSupportsFlag()
cat >conftest.cpp <<EOF
int main() { return 0; }
EOF
- "$TEST_COMPILER" "$@" -o /dev/null conftest.cpp
+ "$TEST_COMPILER" "$@" -o conftest.o conftest.cpp
ret=$?
rm -f conftest.cpp conftest.o
return $ret
diff --git a/projects.pro b/projects.pro
index 497acd0..d405a5b 100644
--- a/projects.pro
+++ b/projects.pro
@@ -48,7 +48,7 @@ for(PROJECT, $$list($$lower($$unique(QT_BUILD_PARTS)))) {
contains(QT_BUILD_PARTS, tools) {
include(translations/translations.pri) # ts targets
} else {
- SUBDIRS += tools/linguist/lrelease
+ !wince*:!symbian:SUBDIRS += tools/linguist/lrelease
}
SUBDIRS += translations # qm build step
} else:isEqual(PROJECT, qmake) {
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index f831700..6170272 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -161,7 +161,7 @@ public:
QByteArray fromUnicode(const QString& str);
QByteArray fromUnicode(const QChar *uc, int len);
#ifdef QT3_SUPPORT
- QByteArray fromUnicode(const QString& uc, int& lenInOut);
+ QT3_SUPPORT QByteArray fromUnicode(const QString& uc, int& lenInOut);
#endif
bool hasFailure() const;
private:
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 37b0ea1..e4c4e3f 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -144,7 +144,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
return path;
#endif
// Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here.
-#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_LINIX) || defined(Q_OS_SYMBIAN)
char *ret = realpath(path.toLocal8Bit().constData(), (char*)0);
if (ret) {
QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret));
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 37161bc..c78af3c 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -275,7 +275,7 @@ QProcessEnvironment &QProcessEnvironment::operator=(const QProcessEnvironment &o
*/
bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
{
- return d->hash == other.d->hash;
+ return d == other.d || (d && other.d && d->hash == other.d->hash);
}
/*!
@@ -334,6 +334,7 @@ bool QProcessEnvironment::contains(const QString &name) const
*/
void QProcessEnvironment::insert(const QString &name, const QString &value)
{
+ // d detaches from null
d->hash.insert(prepareName(name), prepareValue(value));
}
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 5885591..d0dc7be 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -129,7 +129,7 @@ static inline bool time_update(struct timeval *tv, const struct timeval &start,
// clock source is monotonic, so we can recalculate how much timeout is left
struct timeval now = qt_gettime();
*tv = timeout + start - now;
- return true;
+ return tv->tv_sec >= 0;
}
int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
@@ -154,7 +154,8 @@ int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept,
// recalculate the timeout
if (!time_update(&timeout, start, *orig_timeout)) {
- // clock reset, fake timeout error
+ // timeout during update
+ // or clock reset, fake timeout error
return 0;
}
}
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index c6eef5e..c305341 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -509,7 +509,11 @@ LRESULT CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
}
}
}
+#ifdef Q_OS_WINCE
+ return 0;
+#else
return CallNextHookEx(0, code, wp, lp);
+#endif
}
static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatcher)
@@ -636,11 +640,13 @@ void QEventDispatcherWin32::createInternalHwnd()
return;
d->internalHwnd = qt_create_internal_window(this);
+#ifndef Q_OS_WINCE
// setup GetMessage hook needed to drive our posted events
d->getMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC) qt_GetMessageHook, NULL, GetCurrentThreadId());
if (!d->getMessageHook) {
qFatal("Qt: INTERNALL ERROR: failed to install GetMessage hook");
}
+#endif
// register all socket notifiers
QList<int> sockets = (d->sn_read.keys().toSet()
@@ -731,6 +737,11 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
if (haveMessage) {
+#ifdef Q_OS_WINCE
+ // WinCE doesn't support hooks at all, so we have to call this by hand :(
+ (void) qt_GetMessageHook(0, PM_REMOVE, (LPARAM) &msg);
+#endif
+
if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) {
if (seenWM_QT_SENDPOSTEDEVENTS) {
needWM_QT_SENDPOSTEDEVENTS = true;
@@ -1065,9 +1076,11 @@ void QEventDispatcherWin32::closingDown()
d->timerVec.clear();
d->timerDict.clear();
+#ifndef Q_OS_WINCE
if (d->getMessageHook)
UnhookWindowsHookEx(d->getMessageHook);
d->getMessageHook = 0;
+#endif
}
bool QEventDispatcherWin32::event(QEvent *e)
diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h
index 47c5e62..17302b4 100644
--- a/src/dbus/qdbusargument_p.h
+++ b/src/dbus/qdbusargument_p.h
@@ -54,7 +54,7 @@
//
#include <qdbusargument.h>
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index b65e101..d6f7598 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -67,7 +67,7 @@
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qvector.h>
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include <qdbusmessage.h>
diff --git a/src/dbus/qdbusconnectioninterface.cpp b/src/dbus/qdbusconnectioninterface.cpp
index 0f9a67f..ec61859 100644
--- a/src/dbus/qdbusconnectioninterface.cpp
+++ b/src/dbus/qdbusconnectioninterface.cpp
@@ -49,7 +49,7 @@
#include <QtCore/QVariant>
#include <QtCore/QDebug>
-#include <qdbus_symbols_p.h> // for the DBUS_* constants
+#include "qdbus_symbols_p.h" // for the DBUS_* constants
QT_BEGIN_NAMESPACE
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp
index 5c2fa2b..a48b878 100644
--- a/src/dbus/qdbuserror.cpp
+++ b/src/dbus/qdbuserror.cpp
@@ -44,7 +44,7 @@
#include <qdebug.h>
#include <qvarlengtharray.h>
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include "qdbusmessage.h"
#include "qdbusmessage_p.h"
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index 5b18aca..85c6cb2 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -54,7 +54,7 @@
#ifndef QDBUSINTEGRATOR_P_H
#define QDBUSINTEGRATOR_P_H
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include "qcoreevent.h"
#include "qeventloop.h"
diff --git a/src/dbus/qdbusinterface.cpp b/src/dbus/qdbusinterface.cpp
index d0a693f..c05e6a9 100644
--- a/src/dbus/qdbusinterface.cpp
+++ b/src/dbus/qdbusinterface.cpp
@@ -41,7 +41,7 @@
#include "qdbusinterface.h"
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include <QtCore/qpointer.h>
#include <QtCore/qstringlist.h>
diff --git a/src/dbus/qdbusinterface_p.h b/src/dbus/qdbusinterface_p.h
index 3d11af1..a601608 100644
--- a/src/dbus/qdbusinterface_p.h
+++ b/src/dbus/qdbusinterface_p.h
@@ -54,8 +54,8 @@
#ifndef QDBUSINTERFACEPRIVATE_H
#define QDBUSINTERFACEPRIVATE_H
-#include <qdbusabstractinterface_p.h>
-#include <qdbusmetaobject_p.h>
+#include "qdbusabstractinterface_p.h"
+#include "qdbusmetaobject_p.h"
#include <qdbusinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp
index acd04d3..37110c5 100644
--- a/src/dbus/qdbusinternalfilters.cpp
+++ b/src/dbus/qdbusinternalfilters.cpp
@@ -41,7 +41,7 @@
#include "qdbusconnection_p.h"
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qstringlist.h>
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp
index 4f1950b..a37ba1f 100644
--- a/src/dbus/qdbusmessage.cpp
+++ b/src/dbus/qdbusmessage.cpp
@@ -44,7 +44,7 @@
#include <qdebug.h>
#include <qstringlist.h>
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include "qdbusargument_p.h"
#include "qdbuserror.h"
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 237aea3..afa3bbf 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -42,7 +42,7 @@
#include "qdbusmetatype.h"
#include <string.h>
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include <qbytearray.h>
#include <qglobal.h>
diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp
index bf5a739..01b1dbd 100644
--- a/src/dbus/qdbusutil.cpp
+++ b/src/dbus/qdbusutil.cpp
@@ -41,7 +41,7 @@
#include "qdbusutil_p.h"
-#include <qdbus_symbols_p.h>
+#include "qdbus_symbols_p.h"
#include <QtCore/qstringlist.h>
diff --git a/src/dbus/qdbusxmlparser_p.h b/src/dbus/qdbusxmlparser_p.h
index 3dbae1b..1a0523b 100644
--- a/src/dbus/qdbusxmlparser_p.h
+++ b/src/dbus/qdbusxmlparser_p.h
@@ -56,7 +56,7 @@
#include <QtCore/qmap.h>
#include <QtXml/qdom.h>
#include <qdbusmacros.h>
-#include <qdbusintrospection_p.h>
+#include "qdbusintrospection_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri
index b9fad41..63f64a2 100644
--- a/src/gui/dialogs/dialogs.pri
+++ b/src/gui/dialogs/dialogs.pri
@@ -28,13 +28,27 @@ HEADERS += \
dialogs/qprintpreviewdialog.h
!embedded:mac {
- OBJECTIVE_SOURCES += dialogs/qcolordialog_mac.mm \
- dialogs/qfiledialog_mac.mm \
+ OBJECTIVE_SOURCES += dialogs/qfiledialog_mac.mm \
dialogs/qfontdialog_mac.mm \
dialogs/qnspanelproxy_mac.mm \
dialogs/qpagesetupdialog_mac.mm \
dialogs/qprintdialog_mac.mm
+
+# Compile qcolordialog_mac.mm with exception support, disregarding the -no-exceptions
+# configure option. (qcolordialog_mac needs to catch exceptions thrown by cocoa)
+ EXCEPTION_SOURCES = dialogs/qcolordialog_mac.mm
+ exceptions_compiler.commands = $$QMAKE_CXX -c
+ exceptions_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ exceptions_compiler.commands += -fexceptions
+ exceptions_compiler.dependency_type = TYPE_C
+ exceptions_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ exceptions_compiler.input = EXCEPTION_SOURCES
+ exceptions_compiler.variable_out = OBJECTS
+ exceptions_compiler.name = compiling[exceptopns] ${QMAKE_FILE_IN}
+ silent:exceptions_compiler.commands = @echo compiling[exceptopns] ${QMAKE_FILE_IN} && $$exceptions_compiler.commands
+ QMAKE_EXTRA_COMPILERS += exceptions_compiler
}
+
win32 {
HEADERS += dialogs/qwizard_win_p.h
SOURCES += dialogs/qdialogsbinarycompat_win.cpp \
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ff3c1bb..182a3f5 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -614,6 +614,19 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
if (item == lastActivePanel)
lastActivePanel = 0;
+ // Cancel active touches
+ {
+ QMap<int, QGraphicsItem *>::iterator it = itemForTouchPointId.begin();
+ while (it != itemForTouchPointId.end()) {
+ if (it.value() == item) {
+ sceneCurrentTouchPoints.remove(it.key());
+ it = itemForTouchPointId.erase(it);
+ } else {
+ ++it;
+ }
+ }
+ }
+
// Disable selectionChanged() for individual items
++selectionChanging;
int oldSelectedItemsSize = selectedItems.size();
@@ -5683,17 +5696,22 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve
touchEvent->setAccepted(acceptTouchEvents);
res = acceptTouchEvents && sendEvent(item, touchEvent);
eventAccepted = touchEvent->isAccepted();
- item->d_ptr->acceptedTouchBeginEvent = (res && eventAccepted);
+ if (itemForTouchPointId.value(touchEvent->touchPoints().first().id()) == 0) {
+ // item was deleted
+ item = 0;
+ } else {
+ item->d_ptr->acceptedTouchBeginEvent = (res && eventAccepted);
+ }
touchEvent->spont = false;
if (res && eventAccepted) {
// the first item to accept the TouchBegin gets an implicit grab.
for (int i = 0; i < touchEvent->touchPoints().count(); ++i) {
const QTouchEvent::TouchPoint &touchPoint = touchEvent->touchPoints().at(i);
- itemForTouchPointId[touchPoint.id()] = item;
+ itemForTouchPointId[touchPoint.id()] = item; // can be zero
}
break;
}
- if (item->isPanel())
+ if (item && item->isPanel())
break;
}
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 9f4cd0c..8c63968 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -4092,9 +4092,15 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
bool acceptTouchEvents = widget->testAttribute(Qt::WA_AcceptTouchEvents);
touchEvent->setWidget(widget);
touchEvent->setAccepted(acceptTouchEvents);
+ QWeakPointer<QWidget> p = widget;
res = acceptTouchEvents && d->notify_helper(widget, touchEvent);
eventAccepted = touchEvent->isAccepted();
- widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, res && eventAccepted);
+ if (p.isNull()) {
+ // widget was deleted
+ widget = 0;
+ } else {
+ widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, res && eventAccepted);
+ }
touchEvent->spont = false;
if (res && eventAccepted) {
// the first widget to accept the TouchBegin gets an implicit grab.
@@ -4103,7 +4109,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
d->widgetForTouchPointId[touchPoint.id()] = widget;
}
break;
- } else if (widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) {
+ } else if (p.isNull() || widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) {
break;
}
QPoint offset = widget->pos();
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1907cca..7dc4d85 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3654,6 +3654,16 @@ void QWidgetPrivate::setFocus_sys()
}
}
+NSComparisonResult compareViews2Raise(id view1, id view2, void *context)
+{
+ id topView = reinterpret_cast<id>(context);
+ if (view1 == topView)
+ return NSOrderedDescending;
+ if (view2 == topView)
+ return NSOrderedAscending;
+ return NSOrderedSame;
+}
+
void QWidgetPrivate::raise_sys()
{
Q_Q(QWidget);
@@ -3661,7 +3671,6 @@ void QWidgetPrivate::raise_sys()
return;
#if QT_MAC_USE_COCOA
- QMacCocoaAutoReleasePool pool;
if (isRealWindow()) {
// Calling orderFront shows the window on Cocoa too.
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) {
@@ -3673,16 +3682,9 @@ void QWidgetPrivate::raise_sys()
SetFrontProcessWithOptions(&psn, kSetFrontProcessFrontWindowOnly);
}
} else {
- // Cocoa doesn't really have an idea of Z-ordering, but you can
- // fake it by changing the order of it. But beware, removing an
- // NSView will also remove it as the first responder. So we re-set
- // the first responder just in case:
NSView *view = qt_mac_nativeview_for(q);
NSView *parentView = [view superview];
- NSResponder *firstResponder = [[view window] firstResponder];
- [view removeFromSuperview];
- [parentView addSubview:view];
- [[view window] makeFirstResponder:firstResponder];
+ [parentView sortSubviewsUsingFunction:compareViews2Raise context:reinterpret_cast<void *>(view)];
}
#else
if(q->isWindow()) {
@@ -3700,47 +3702,29 @@ void QWidgetPrivate::raise_sys()
#endif
}
+NSComparisonResult compareViews2Lower(id view1, id view2, void *context)
+{
+ id topView = reinterpret_cast<id>(context);
+ if (view1 == topView)
+ return NSOrderedAscending;
+ if (view2 == topView)
+ return NSOrderedDescending;
+ return NSOrderedSame;
+}
+
void QWidgetPrivate::lower_sys()
{
Q_Q(QWidget);
if((q->windowType() == Qt::Desktop))
return;
#ifdef QT_MAC_USE_COCOA
- QMacCocoaAutoReleasePool pool;
if (isRealWindow()) {
OSWindowRef window = qt_mac_window_for(q);
[window orderBack:window];
} else {
- // Cocoa doesn't really have an idea of Z-ordering, but you can
- // fake it by changing the order of it. In this case
- // we put the item at the beginning of the list, but that means
- // we must re-insert everything since we cannot modify the list directly.
- NSView *myview = qt_mac_nativeview_for(q);
- NSView *parentView = [myview superview];
- NSArray *tmpViews = [parentView subviews];
- NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]];
- [subviews addObjectsFromArray:tmpViews];
- NSResponder *firstResponder = [[myview window] firstResponder];
- // Implicit assumption that myViewIndex is included in subviews, that's why I'm not checking
- // myViewIndex.
- NSUInteger index = 0;
- NSUInteger myViewIndex = 0;
- bool foundMyView = false;
- for (NSView *subview in subviews) {
- [subview removeFromSuperview];
- if (subview == myview) {
- foundMyView = true;
- myViewIndex = index;
- }
- ++index;
- }
- [parentView addSubview:myview];
- if (foundMyView)
- [subviews removeObjectAtIndex:myViewIndex];
- for (NSView *subview in subviews)
- [parentView addSubview:subview];
- [subviews release];
- [[myview window] makeFirstResponder:firstResponder];
+ NSView *view = qt_mac_nativeview_for(q);
+ NSView *parentView = [view superview];
+ [parentView sortSubviewsUsingFunction:compareViews2Lower context:reinterpret_cast<void *>(view)];
}
#else
if(q->isWindow()) {
@@ -3753,6 +3737,16 @@ void QWidgetPrivate::lower_sys()
#endif
}
+NSComparisonResult compareViews2StackUnder(id view1, id view2, void *context)
+{
+ const QHash<NSView *, int> &viewOrder = *reinterpret_cast<QHash<NSView *, int> *>(context);
+ if (viewOrder[view1] < viewOrder[view2])
+ return NSOrderedAscending;
+ if (viewOrder[view1] > viewOrder[view2])
+ return NSOrderedDescending;
+ return NSOrderedSame;
+}
+
void QWidgetPrivate::stackUnder_sys(QWidget *w)
{
// stackUnder
@@ -3761,37 +3755,23 @@ void QWidgetPrivate::stackUnder_sys(QWidget *w)
return;
#ifdef QT_MAC_USE_COCOA
// Do the same trick as lower_sys() and put this widget before the widget passed in.
- QMacCocoaAutoReleasePool pool;
- NSView *myview = qt_mac_nativeview_for(q);
+ NSView *myView = qt_mac_nativeview_for(q);
NSView *wView = qt_mac_nativeview_for(w);
- NSView *parentView = [myview superview];
- NSArray *tmpViews = [parentView subviews];
- NSMutableArray *subviews = [[NSMutableArray alloc] initWithCapacity:[tmpViews count]];
- [subviews addObjectsFromArray:tmpViews];
- // Implicit assumption that myViewIndex and wViewIndex is included in subviews,
- // that's why I'm not checking myViewIndex.
- NSUInteger index = 0;
- NSUInteger myViewIndex = 0;
- NSUInteger wViewIndex = 0;
- for (NSView *subview in subviews) {
- [subview removeFromSuperview];
- if (subview == myview)
- myViewIndex = index;
- else if (subview == wView)
- wViewIndex = index;
- ++index;
- }
- index = 0;
+ QHash<NSView *, int> viewOrder;
+ NSView *parentView = [myView superview];
+ NSArray *subviews = [parentView subviews];
+ NSUInteger index = 1;
+ // make a hash of view->zorderindex and make sure z-value is always odd,
+ // so that when we modify the order we create a new (even) z-value which
+ // will not interfere with others.
for (NSView *subview in subviews) {
- if (index == myViewIndex)
- continue;
- if (index == wViewIndex)
- [parentView addSubview:myview];
- [parentView addSubview:subview];
+ viewOrder.insert(subview, index * 2);
++index;
}
- [subviews release];
+ viewOrder[myView] = viewOrder[wView] - 1;
+
+ [parentView sortSubviewsUsingFunction:compareViews2StackUnder context:reinterpret_cast<void *>(&viewOrder)];
#else
QWidget *p = q->parentWidget();
if(!p || p != w->parentWidget())
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index afa3325..e10bb41 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -3375,12 +3375,28 @@ QIcon QGtkStyle::standardIconImplementation(StandardPixmap standardIcon,
/*! \reimp */
QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
{
+ Q_D(const QGtkStyle);
+
QRect r = QCleanlooksStyle::subElementRect(element, option, widget);
switch (element) {
case SE_ProgressBarLabel:
case SE_ProgressBarContents:
case SE_ProgressBarGroove:
return option->rect;
+ case SE_PushButtonContents:
+ if (!d->gtk_check_version(2, 10, 0)) {
+ GtkWidget *gtkButton = d->gtkWidget(QLS("GtkButton"));
+ GtkBorder *border = 0;
+ d->gtk_widget_style_get(gtkButton, "inner-border", &border, NULL);
+ if (border) {
+ r = option->rect.adjusted(border->left, border->top, -border->right, -border->bottom);
+ d->gtk_border_free(border);
+ } else {
+ r = option->rect.adjusted(1, 1, -1, -1);
+ }
+ r = visualRect(option->direction, option->rect, r);
+ }
+ break;
default:
break;
}
diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
index 22dfc62..a644a5b 100644
--- a/src/gui/styles/qgtkstyle_p.cpp
+++ b/src/gui/styles/qgtkstyle_p.cpp
@@ -158,6 +158,7 @@ Ptr_gtk_window_get_type QGtkStylePrivate::gtk_window_get_type = 0;
Ptr_gtk_widget_get_type QGtkStylePrivate::gtk_widget_get_type = 0;
Ptr_gtk_rc_get_style_by_paths QGtkStylePrivate::gtk_rc_get_style_by_paths = 0;
Ptr_gtk_check_version QGtkStylePrivate::gtk_check_version = 0;
+Ptr_gtk_border_free QGtkStylePrivate::gtk_border_free = 0;
Ptr_pango_font_description_get_size QGtkStylePrivate::pango_font_description_get_size = 0;
Ptr_pango_font_description_get_weight QGtkStylePrivate::pango_font_description_get_weight = 0;
@@ -416,6 +417,7 @@ void QGtkStylePrivate::resolveGtk() const
gtk_widget_get_type =(Ptr_gtk_widget_get_type)libgtk.resolve("gtk_widget_get_type");
gtk_rc_get_style_by_paths =(Ptr_gtk_rc_get_style_by_paths)libgtk.resolve("gtk_rc_get_style_by_paths");
gtk_check_version =(Ptr_gtk_check_version)libgtk.resolve("gtk_check_version");
+ gtk_border_free =(Ptr_gtk_border_free)libgtk.resolve("gtk_border_free");
pango_font_description_get_size = (Ptr_pango_font_description_get_size)libgtk.resolve("pango_font_description_get_size");
pango_font_description_get_weight = (Ptr_pango_font_description_get_weight)libgtk.resolve("pango_font_description_get_weight");
pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h
index f6ab8a3..c27308f 100644
--- a/src/gui/styles/qgtkstyle_p.h
+++ b/src/gui/styles/qgtkstyle_p.h
@@ -176,6 +176,7 @@ typedef GtkWidget* (*Ptr_gtk_file_chooser_dialog_new)(const gchar *title,
typedef void (*Ptr_gtk_file_chooser_set_current_name) (GtkFileChooser *, const gchar *);
typedef gboolean (*Ptr_gtk_file_chooser_set_filename) (GtkFileChooser *chooser, const gchar *name);
typedef gint (*Ptr_gtk_dialog_run) (GtkDialog*);
+typedef void (*Ptr_gtk_border_free)(GtkBorder *);
typedef guchar* (*Ptr_gdk_pixbuf_get_pixels) (const GdkPixbuf *pixbuf);
typedef int (*Ptr_gdk_pixbuf_get_width) (const GdkPixbuf *pixbuf);
@@ -371,6 +372,7 @@ public:
static Ptr_gtk_widget_get_type gtk_widget_get_type;
static Ptr_gtk_rc_get_style_by_paths gtk_rc_get_style_by_paths;
static Ptr_gtk_check_version gtk_check_version;
+ static Ptr_gtk_border_free gtk_border_free;
static Ptr_pango_font_description_get_size pango_font_description_get_size;
static Ptr_pango_font_description_get_weight pango_font_description_get_weight;
diff --git a/src/gui/util/qsystemtrayicon.cpp b/src/gui/util/qsystemtrayicon.cpp
index c6ea00f..6f2b501 100644
--- a/src/gui/util/qsystemtrayicon.cpp
+++ b/src/gui/util/qsystemtrayicon.cpp
@@ -380,6 +380,9 @@ bool QSystemTrayIcon::supportsMessages()
On Windows, the \a millisecondsTimeoutHint is usually ignored by the system
when the application has focus.
+ On Mac OS X, the Growl notification system must be installed for this function to
+ display messages.
+
\sa show() supportsMessages()
*/
void QSystemTrayIcon::showMessage(const QString& title, const QString& msg,
diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm
index b74ca85..93295a7 100644
--- a/src/gui/util/qsystemtrayicon_mac.mm
+++ b/src/gui/util/qsystemtrayicon_mac.mm
@@ -314,8 +314,22 @@ QT_END_NAMESPACE
{
Q_UNUSED(notification);
down = NO;
+
+ if( ![self icon]->icon().isNull() ) {
+#ifndef QT_MAC_USE_COCOA
+ const short scale = GetMBarHeight()-4;
+#else
+ CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
+ const short scale = hgt - 4;
+#endif
+ NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale))));
+ [self setImage: nsimage];
+ [nsimage release];
+ }
+
if([self icon]->contextMenu())
[self icon]->contextMenu()->hide();
+
[self setNeedsDisplay:YES];
}
@@ -327,6 +341,20 @@ QT_END_NAMESPACE
[self icon]->contextMenu()->hide();
[self setNeedsDisplay:YES];
+#ifndef QT_MAC_USE_COCOA
+ const short scale = GetMBarHeight()-4;
+#else
+ CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
+ const short scale = hgt - 4;
+#endif
+
+ if( down && ![self icon]->icon().isNull() ) {
+ NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale), QIcon::Selected)));
+ [self setImage: nsaltimage];
+ [nsaltimage release];
+ }
+
+
if (down)
[parent triggerSelector:self];
else if ((clickCount%2))
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index c91c608..923f2e3 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -49,6 +49,9 @@
#include "QtCore/qdatetime.h"
#include <ctype.h>
+#ifndef QT_NO_DATESTRING
+# include <stdio.h>
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/qt_install.pri b/src/qt_install.pri
index ebeac8d..5b29942 100644
--- a/src/qt_install.pri
+++ b/src/qt_install.pri
@@ -30,6 +30,12 @@ qt_install_headers {
targ_headers.files = $$INSTALL_HEADERS
targ_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET
INSTALLS += targ_headers
+
+ contains(QT_CONFIG,private_tests) {
+ private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES
+ private_headers.path = $$[QT_INSTALL_HEADERS]/$$TARGET/private
+ INSTALLS += private_headers
+ }
}
embedded:equals(TARGET, QtGui) {
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 429ca79..bfad2e7 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -11741,4 +11741,45 @@ EXPORTS
_ZN11QVectorPathD2Ev @ 11740 NONAME
_ZNK11QVectorPath12addCacheDataEP14QPaintEngineExPvPFvS1_S2_E @ 11741 NONAME
_ZNK20QGraphicsItemPrivate20discardUpdateRequestEbbb @ 11742 NONAME
+ _ZN11QEglContext10extensionsEv @ 11743 NONAME
+ _ZN11QEglContext10getDisplayEP12QPaintDevice @ 11744 NONAME
+ _ZN11QEglContext10waitClientEv @ 11745 NONAME
+ _ZN11QEglContext10waitNativeEv @ 11746 NONAME
+ _ZN11QEglContext11doneCurrentEv @ 11747 NONAME
+ _ZN11QEglContext11errorStringEi @ 11748 NONAME
+ _ZN11QEglContext11makeCurrentEi @ 11749 NONAME
+ _ZN11QEglContext11openDisplayEP12QPaintDevice @ 11750 NONAME
+ _ZN11QEglContext11swapBuffersEi @ 11751 NONAME
+ _ZN11QEglContext12chooseConfigERK14QEglPropertiesN4QEgl16PixelFormatMatchE @ 11752 NONAME
+ _ZN11QEglContext12hasExtensionEPKc @ 11753 NONAME
+ _ZN11QEglContext13createContextEPS_PK14QEglProperties @ 11754 NONAME
+ _ZN11QEglContext13createSurfaceEP12QPaintDevicePK14QEglProperties @ 11755 NONAME
+ _ZN11QEglContext14currentContextEN4QEgl3APIE @ 11756 NONAME
+ _ZN11QEglContext14defaultDisplayEP12QPaintDevice @ 11757 NONAME
+ _ZN11QEglContext14destroySurfaceEi @ 11758 NONAME
+ _ZN11QEglContext14dumpAllConfigsEv @ 11759 NONAME
+ _ZN11QEglContext15lazyDoneCurrentEv @ 11760 NONAME
+ _ZN11QEglContext17setCurrentContextEN4QEgl3APIEPS_ @ 11761 NONAME
+ _ZN11QEglContext7destroyEv @ 11762 NONAME
+ _ZN11QEglContextC1Ev @ 11763 NONAME
+ _ZN11QEglContextC2Ev @ 11764 NONAME
+ _ZN11QEglContextD1Ev @ 11765 NONAME
+ _ZN11QEglContextD2Ev @ 11766 NONAME
+ _ZN14QEglProperties11removeValueEi @ 11767 NONAME
+ _ZN14QEglProperties14dumpAllConfigsEv @ 11768 NONAME
+ _ZN14QEglProperties14setPixelFormatEN6QImage6FormatE @ 11769 NONAME
+ _ZN14QEglProperties17setRenderableTypeEN4QEgl3APIE @ 11770 NONAME
+ _ZN14QEglProperties19reduceConfigurationEv @ 11771 NONAME
+ _ZN14QEglProperties20setPaintDeviceFormatEP12QPaintDevice @ 11772 NONAME
+ _ZN14QEglProperties8setValueEii @ 11773 NONAME
+ _ZN14QEglPropertiesC1Ei @ 11774 NONAME
+ _ZN14QEglPropertiesC1Ev @ 11775 NONAME
+ _ZN14QEglPropertiesC2Ei @ 11776 NONAME
+ _ZN14QEglPropertiesC2Ev @ 11777 NONAME
+ _ZNK11QEglContext12configAttribEiPi @ 11778 NONAME
+ _ZNK11QEglContext16configPropertiesEi @ 11779 NONAME
+ _ZNK11QEglContext7isValidEv @ 11780 NONAME
+ _ZNK11QEglContext9isCurrentEv @ 11781 NONAME
+ _ZNK14QEglProperties5valueEi @ 11782 NONAME
+ _ZNK14QEglProperties8toStringEv @ 11783 NONAME
diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def
index 8458983..7526632 100644
--- a/src/s60installs/eabi/QtOpenVGu.def
+++ b/src/s60installs/eabi/QtOpenVGu.def
@@ -1,8 +1,8 @@
EXPORTS
_Z16qPixmapToVGImageRK7QPixmap @ 1 NONAME
- _Z20qt_vg_create_contextP12QPaintDevice @ 2 NONAME
+ _Z20qt_vg_create_contextP12QPaintDevice @ 2 NONAME ABSENT
_Z20qt_vg_shared_surfacev @ 3 NONAME
- _Z21qt_vg_destroy_contextP11QEglContext @ 4 NONAME
+ _Z21qt_vg_destroy_contextP11QEglContext @ 4 NONAME ABSENT
_Z24qt_vg_image_to_vg_formatN6QImage6FormatE @ 5 NONAME
_Z25qt_vg_config_to_vg_formatP11QEglContext @ 6 NONAME
_Z25qt_vg_create_paint_enginev @ 7 NONAME
@@ -169,4 +169,8 @@ EXPORTS
_ZThn8_NK16QVGWindowSurface6metricEN12QPaintDevice17PaintDeviceMetricE @ 168 NONAME
_ZN14QVGPaintEngine10fillRegionERK7QRegionRK6QColorRK5QSize @ 169 NONAME
_ZN20QVGCompositionHelper10blitWindowEmRK5QSizeRK5QRectRK6QPointi @ 170 NONAME
+ _Z20qt_vg_create_contextP12QPaintDevicei @ 171 NONAME
+ _Z21qt_vg_destroy_contextP11QEglContexti @ 172 NONAME
+ _ZN13QVGPixmapData22destroyImageAndContextEv @ 173 NONAME
+ _ZN13QVGPixmapData9hibernateEv @ 174 NONAME
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index b6aa872..1879367 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -33,6 +33,7 @@
#include "qscriptvalue_p.h"
#include "qscriptvalueiterator.h"
#include "qscriptclass.h"
+#include "qscriptcontextinfo.h"
#include "qscriptprogram.h"
#include "qscriptprogram_p.h"
#include "qdebug.h"
@@ -698,9 +699,9 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS
return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): third argument (n) must be a number");
#ifndef QT_NO_QOBJECT
QString context;
-// ### implement context resolution
-// if (ctx->parentContext())
-// context = QFileInfo(ctx->parentContext()->fileName()).baseName();
+ QScriptContext *ctx = QScriptEnginePrivate::contextForFrame(exec);
+ if (ctx && ctx->parentContext())
+ context = QFileInfo(QScriptContextInfo(ctx->parentContext()).fileName()).baseName();
#endif
QString text(args.at(0).toString(exec));
#ifndef QT_NO_QOBJECT
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 8355de2..c62f15c 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -122,14 +122,14 @@ public:
sqlite3_stmt *stmt;
- uint skippedStatus: 1; // the status of the fetchNext() that's skipped
- uint skipRow: 1; // skip the next fetchNext()?
- uint utf8: 1;
+ bool skippedStatus; // the status of the fetchNext() that's skipped
+ bool skipRow; // skip the next fetchNext()?
QSqlRecord rInf;
+ QVector<QVariant> firstRow;
};
QSQLiteResultPrivate::QSQLiteResultPrivate(QSQLiteResult* res) : q(res), access(0),
- stmt(0), skippedStatus(false), skipRow(false), utf8(false)
+ stmt(0), skippedStatus(false), skipRow(false)
{
}
@@ -189,10 +189,17 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i
// already fetched
Q_ASSERT(!initialFetch);
skipRow = false;
+ for(int i=0;i<firstRow.count();i++)
+ values[i]=firstRow[i];
return skippedStatus;
}
skipRow = initialFetch;
+ if(initialFetch) {
+ firstRow.clear();
+ firstRow.resize(sqlite3_column_count(stmt));
+ }
+
if (!stmt) {
q->setLastError(QSqlError(QCoreApplication::translate("QSQLiteResult", "Unable to fetch row"),
QCoreApplication::translate("QSQLiteResult", "No query"), QSqlError::ConnectionError));
@@ -399,7 +406,7 @@ bool QSQLiteResult::exec()
"Parameter count mismatch"), QString(), QSqlError::StatementError));
return false;
}
- d->skippedStatus = d->fetchNext(cache(), 0, true);
+ d->skippedStatus = d->fetchNext(d->firstRow, 0, true);
if (lastError().isValid()) {
setSelect(false);
setActive(false);
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp
index b4a9241..2e4d19e 100644
--- a/src/sql/kernel/qsqlcachedresult.cpp
+++ b/src/sql/kernel/qsqlcachedresult.cpp
@@ -278,6 +278,11 @@ bool QSqlCachedResult::cacheNext()
if (d->atEnd)
return false;
+ if(isForwardOnly()) {
+ d->cache.clear();
+ d->cache.resize(d->colCount);
+ }
+
if (!gotoNext(d->cache, d->nextIndex())) {
d->revertLast();
d->atEnd = true;
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 92d29ae..4215e97 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -256,6 +256,7 @@ SUBDIRS += \
qprinter \
qprinterinfo \
qprocess \
+ qprocessenvironment \
qprogressbar \
qprogressdialog \
qpropertyanimation \
@@ -442,7 +443,6 @@ SUBDIRS += \
qsharedmemory \
qsidebar \
qsizegrip \
- qsoftkeymanager \
qsqldriver \
qsystemsemaphore \
qtconcurrentfilter \
@@ -477,6 +477,10 @@ embedded:!wince* {
SUBDIRS += qtextpiecetable
}
+symbian {
+ SUBDIRS += qsoftkeymanager
+}
+
# Enable the tests specific to QtXmlPatterns. If you add a test, remember to
# update runQtXmlPatternsTests.sh too. Remember that this file, auto.pro, is
# not respected by some test system, they just have a script which loop over
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index cd58fd6..1445f5b 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -513,9 +513,11 @@ void tst_QFileInfo::canonicalFilePath()
QFileInfo info("/tmp/../../../../../../../../../../../../../../../../../");
info.canonicalFilePath();
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
// This used to crash on Mac
QFileInfo dontCrash(QLatin1String("/"));
QCOMPARE(dontCrash.canonicalFilePath(), QLatin1String("/"));
+#endif
#ifndef Q_OS_WIN
// test symlinks
diff --git a/tests/auto/qprocessenvironment/qprocessenvironment.pro b/tests/auto/qprocessenvironment/qprocessenvironment.pro
new file mode 100644
index 0000000..398facc
--- /dev/null
+++ b/tests/auto/qprocessenvironment/qprocessenvironment.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+
+QT = core
+
+SOURCES += tst_qprocessenvironment.cpp
diff --git a/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
new file mode 100644
index 0000000..1cde33c
--- /dev/null
+++ b/tests/auto/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -0,0 +1,265 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite 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 <QtTest>
+#include <QObject>
+#include <QProcessEnvironment>
+
+// Note:
+// in cross-platform tests, ALWAYS use UPPERCASE variable names
+// That's because on Windows, the variables are uppercased
+
+class tst_QProcessEnvironment: public QObject
+{
+ Q_OBJECT
+private slots:
+ void operator_eq();
+ void clearAndIsEmpty();
+ void insert();
+ void emptyNull();
+ void toStringList();
+
+ void caseSensitivity();
+ void systemEnvironment();
+ void putenv();
+};
+
+void tst_QProcessEnvironment::operator_eq()
+{
+ QProcessEnvironment e1;
+ QVERIFY(e1 == e1);
+ e1.clear();
+ QVERIFY(e1 == e1);
+
+ e1 = QProcessEnvironment();
+ QProcessEnvironment e2;
+ QVERIFY(e1 == e2);
+
+ e1.clear();
+ QVERIFY(e1 != e2);
+
+ e2.clear();
+
+ QVERIFY(e1 == e2);
+}
+
+void tst_QProcessEnvironment::clearAndIsEmpty()
+{
+ QProcessEnvironment e;
+ e.insert("FOO", "bar");
+ QVERIFY(!e.isEmpty());
+ e.clear();
+ QVERIFY(e.isEmpty());
+}
+
+void tst_QProcessEnvironment::insert()
+{
+ QProcessEnvironment e;
+ e.insert("FOO", "bar");
+ QVERIFY(!e.isEmpty());
+ QVERIFY(e.contains("FOO"));
+ QCOMPARE(e.value("FOO"), QString("bar"));
+
+ e.remove("FOO");
+ QVERIFY(!e.contains("FOO"));
+ QVERIFY(e.value("FOO").isNull());
+
+ e.clear();
+ QVERIFY(!e.contains("FOO"));
+}
+
+void tst_QProcessEnvironment::emptyNull()
+{
+ QProcessEnvironment e;
+
+ e.insert("FOO", "");
+ QVERIFY(e.contains("FOO"));
+ QVERIFY(e.value("FOO").isEmpty());
+ QVERIFY(!e.value("FOO").isNull());
+
+ e.insert("FOO", QString());
+ QVERIFY(e.contains("FOO"));
+ QVERIFY(e.value("FOO").isEmpty());
+ // don't test if it's NULL, since we shall not make a guarantee
+
+ e.remove("FOO");
+ QVERIFY(!e.contains("FOO"));
+}
+
+void tst_QProcessEnvironment::toStringList()
+{
+ QProcessEnvironment e;
+ QVERIFY(e.isEmpty());
+ QVERIFY(e.toStringList().isEmpty());
+
+ e.insert("FOO", "bar");
+ QStringList result = e.toStringList();
+ QVERIFY(!result.isEmpty());
+ QCOMPARE(result.length(), 1);
+ QCOMPARE(result.at(0), QString("FOO=bar"));
+
+ e.clear();
+ e.insert("BAZ", "");
+ result = e.toStringList();
+ QCOMPARE(result.at(0), QString("BAZ="));
+
+ e.insert("FOO", "bar");
+ e.insert("A", "bc");
+ e.insert("HELLO", "World");
+ result = e.toStringList();
+ QCOMPARE(result.length(), 4);
+
+ // order is not specified, so use contains()
+ QVERIFY(result.contains("FOO=bar"));
+ QVERIFY(result.contains("BAZ="));
+ QVERIFY(result.contains("A=bc"));
+ QVERIFY(result.contains("HELLO=World"));
+}
+
+void tst_QProcessEnvironment::caseSensitivity()
+{
+ QProcessEnvironment e;
+ e.insert("foo", "bar");
+
+#ifdef Q_OS_WIN
+ // on Windows, it's uppercased
+ QVERIFY(e.contains("foo"));
+ QVERIFY(e.contains("FOO"));
+ QVERIFY(e.contains("FoO"));
+
+ QCOMPARE(e.value("foo"), QString("bar"));
+ QCOMPARE(e.value("FOO"), QString("bar"));
+ QCOMPARE(e.value("FoO"), QString("bar"));
+
+ QStringList list = e.toStringList();
+ QCOMPARE(list.at(0), QString("FOO=bar"));
+#else
+ // otherwise, it's case sensitive
+ QVERIFY(e.contains("foo"));
+ QVERIFY(!e.contains("FOO"));
+
+ e.insert("FOO", "baz");
+ QVERIFY(e.contains("FOO"));
+ QCOMPARE(e.value("FOO"), QString("baz"));
+ QCOMPARE(e.value("foo"), QString("bar"));
+
+ QStringList list = e.toStringList();
+ QVERIFY(list.contains("foo=bar"));
+ QVERIFY(list.contains("FOO=baz"));
+#endif
+}
+
+void tst_QProcessEnvironment::systemEnvironment()
+{
+ static const char envname[] = "THIS_ENVIRONMENT_VARIABLE_HOPEFULLY_DOESNT_EXIST";
+ QByteArray path = qgetenv("PATH");
+ QByteArray nonexistant = qgetenv(envname);
+ QProcessEnvironment system = QProcessEnvironment::systemEnvironment();
+
+ QVERIFY(nonexistant.isNull());
+
+#ifdef Q_WS_WINCE
+ // Windows CE has no environment
+ QVERIFY(path.isEmpty());
+ QVERIFY(!system.contains("PATH"));
+ QVERIFY(system.isEmpty());
+#else
+ // all other system have environments
+ if (path.isEmpty())
+ QFAIL("Could not find the PATH environment variable -- please correct the test environment");
+
+ QVERIFY(system.contains("PATH"));
+ QCOMPARE(system.value("PATH"), QString::fromLocal8Bit(path));
+
+ QVERIFY(!system.contains(envname));
+
+# ifdef Q_OS_WIN
+ // check case-insensitive too
+ QVERIFY(system.contains("path"));
+ QCOMPARE(system.value("path"), QString::fromLocal8Bit(path));
+
+ QVERIFY(!system.contains(QString(envname).toLower()));
+# endif
+#endif
+}
+
+void tst_QProcessEnvironment::putenv()
+{
+#ifdef Q_WS_WINCE
+ QSKIP("Windows CE has no environment", SkipAll);
+#else
+ static const char envname[] = "WE_RE_SETTING_THIS_ENVIRONMENT_VARIABLE";
+ static bool testRan = false;
+
+ if (testRan)
+ QFAIL("You cannot run this test more than once, since we modify the environment");
+ testRan = true;
+
+ QByteArray valBefore = qgetenv(envname);
+ if (!valBefore.isNull())
+ QFAIL("The environment variable we set in the environment is already set! -- please correct the test environment");
+ QProcessEnvironment eBefore = QProcessEnvironment::systemEnvironment();
+
+ qputenv(envname, "Hello, World");
+ QByteArray valAfter = qgetenv(envname);
+ if (valAfter != "Hello, World")
+ QSKIP("Could not test: qputenv did not do its job", SkipAll);
+
+ QProcessEnvironment eAfter = QProcessEnvironment::systemEnvironment();
+
+ QVERIFY(!eBefore.contains(envname));
+ QVERIFY(eAfter.contains(envname));
+ QCOMPARE(eAfter.value(envname), QString("Hello, World"));
+
+# ifdef Q_OS_WIN
+ // check case-insensitive too
+ QString lower = envname;
+ lower = lower.toLower();
+ QVERIFY(!eBefore.contains(lower));
+ QVERIFY(eAfter.contains(lower));
+ QCOMPARE(eAfter.value(lower), QString("Hello, World"));
+# endif
+#endif
+}
+
+QTEST_MAIN(tst_QProcessEnvironment)
+
+#include "tst_qprocessenvironment.moc"
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index ed9206c..0cb08f9 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -73,6 +73,7 @@ private slots:
void forwardDeclaration2();
void memoryManagement();
void downCast();
+ void functionCallDownCast();
void upCast();
void qobjectWeakManagement();
void noSharedPointerFromWeakQObject();
@@ -503,6 +504,15 @@ void tst_QSharedPointer::downCast()
QCOMPARE(DerivedData::derivedDestructorCounter, destructorCount + 1);
}
+void functionDataByValue(QSharedPointer<Data> p) { Q_UNUSED(p); };
+void functionDataByRef(const QSharedPointer<Data> &p) { Q_UNUSED(p); };
+void tst_QSharedPointer::functionCallDownCast()
+{
+ QSharedPointer<DerivedData> p(new DerivedData());
+ functionDataByValue(p);
+ functionDataByRef(p);
+}
+
void tst_QSharedPointer::upCast()
{
QSharedPointer<Data> baseptr = QSharedPointer<Data>(new DerivedData);
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index f840ca6..cb4e103 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -2493,7 +2493,6 @@ void tst_QSqlDatabase::oci_tables()
QString systemTableName("system."+qTableName("mypassword"));
QVERIFY_SQL(q, exec("CREATE TABLE "+systemTableName+"(name VARCHAR(20))"));
QVERIFY(!db.tables().contains(systemTableName.toUpper()));
- qDebug() << db.tables(QSql::SystemTables);
QVERIFY(db.tables(QSql::SystemTables).contains(systemTableName.toUpper()));
}
diff --git a/tests/auto/qtouchevent/tst_qtouchevent.cpp b/tests/auto/qtouchevent/tst_qtouchevent.cpp
index f95a5c6..da8721c 100644
--- a/tests/auto/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/qtouchevent/tst_qtouchevent.cpp
@@ -48,6 +48,7 @@ public:
QList<QTouchEvent::TouchPoint> touchBeginPoints, touchUpdatePoints, touchEndPoints;
bool seenTouchBegin, seenTouchUpdate, seenTouchEnd;
bool acceptTouchBegin, acceptTouchUpdate, acceptTouchEnd;
+ bool deleteInTouchBegin, deleteInTouchUpdate, deleteInTouchEnd;
tst_QTouchEventWidget()
: QWidget()
@@ -62,6 +63,7 @@ public:
touchEndPoints.clear();
seenTouchBegin = seenTouchUpdate = seenTouchEnd = false;
acceptTouchBegin = acceptTouchUpdate = acceptTouchEnd = true;
+ deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false;
}
bool event(QEvent *event)
@@ -74,6 +76,8 @@ public:
seenTouchBegin = !seenTouchBegin && !seenTouchUpdate && !seenTouchEnd;
touchBeginPoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchBegin);
+ if (deleteInTouchBegin)
+ delete this;
break;
case QEvent::TouchUpdate:
if (!seenTouchBegin) qWarning("TouchUpdate: have not seen TouchBegin");
@@ -81,6 +85,8 @@ public:
seenTouchUpdate = seenTouchBegin && !seenTouchEnd;
touchUpdatePoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchUpdate);
+ if (deleteInTouchUpdate)
+ delete this;
break;
case QEvent::TouchEnd:
if (!seenTouchBegin) qWarning("TouchEnd: have not seen TouchBegin");
@@ -88,6 +94,8 @@ public:
seenTouchEnd = seenTouchBegin && !seenTouchEnd;
touchEndPoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchEnd);
+ if (deleteInTouchEnd)
+ delete this;
break;
default:
return QWidget::event(event);
@@ -102,13 +110,21 @@ public:
QList<QTouchEvent::TouchPoint> touchBeginPoints, touchUpdatePoints, touchEndPoints;
bool seenTouchBegin, seenTouchUpdate, seenTouchEnd;
bool acceptTouchBegin, acceptTouchUpdate, acceptTouchEnd;
+ bool deleteInTouchBegin, deleteInTouchUpdate, deleteInTouchEnd;
+ tst_QTouchEventGraphicsItem **weakpointer;
tst_QTouchEventGraphicsItem()
- : QGraphicsItem()
+ : QGraphicsItem(), weakpointer(0)
{
reset();
}
+ ~tst_QTouchEventGraphicsItem()
+ {
+ if (weakpointer)
+ *weakpointer = 0;
+ }
+
void reset()
{
touchBeginPoints.clear();
@@ -116,6 +132,7 @@ public:
touchEndPoints.clear();
seenTouchBegin = seenTouchUpdate = seenTouchEnd = false;
acceptTouchBegin = acceptTouchUpdate = acceptTouchEnd = true;
+ deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false;
}
QRectF boundingRect() const { return QRectF(0, 0, 10, 10); }
@@ -131,6 +148,8 @@ public:
seenTouchBegin = !seenTouchBegin && !seenTouchUpdate && !seenTouchEnd;
touchBeginPoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchBegin);
+ if (deleteInTouchBegin)
+ delete this;
break;
case QEvent::TouchUpdate:
if (!seenTouchBegin) qWarning("TouchUpdate: have not seen TouchBegin");
@@ -138,6 +157,8 @@ public:
seenTouchUpdate = seenTouchBegin && !seenTouchEnd;
touchUpdatePoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchUpdate);
+ if (deleteInTouchUpdate)
+ delete this;
break;
case QEvent::TouchEnd:
if (!seenTouchBegin) qWarning("TouchEnd: have not seen TouchBegin");
@@ -145,6 +166,8 @@ public:
seenTouchEnd = seenTouchBegin && !seenTouchEnd;
touchEndPoints = static_cast<QTouchEvent *>(event)->touchPoints();
event->setAccepted(acceptTouchEnd);
+ if (deleteInTouchEnd)
+ delete this;
break;
default:
return QGraphicsItem::sceneEvent(event);
@@ -168,6 +191,8 @@ private slots:
void basicRawEventTranslation();
void multiPointRawEventTranslationOnTouchScreen();
void multiPointRawEventTranslationOnTouchPad();
+ void deleteInEventHandler();
+ void deleteInRawEventTranslation();
};
void tst_QTouchEvent::touchDisabledByDefault()
@@ -496,7 +521,7 @@ void tst_QTouchEvent::touchUpdateAndEndNeverPropagate()
res = QApplication::sendEvent(view.viewport(), &touchUpdateEvent);
QVERIFY(res);
// the scene accepts the event, since it found an item to send the event to
- QVERIFY(touchUpdateEvent.isAccepted());
+ QVERIFY(!touchUpdateEvent.isAccepted());
QVERIFY(child.seenTouchUpdate);
QVERIFY(!root.seenTouchUpdate);
@@ -510,7 +535,7 @@ void tst_QTouchEvent::touchUpdateAndEndNeverPropagate()
res = QApplication::sendEvent(view.viewport(), &touchEndEvent);
QVERIFY(res);
// the scene accepts the event, since it found an item to send the event to
- QVERIFY(touchEndEvent.isAccepted());
+ QVERIFY(!touchEndEvent.isAccepted());
QVERIFY(child.seenTouchEnd);
QVERIFY(!root.seenTouchEnd);
}
@@ -1059,6 +1084,225 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
}
}
+void tst_QTouchEvent::deleteInEventHandler()
+{
+ // QWidget
+ {
+ QWidget window;
+ tst_QTouchEventWidget *child1, *child2, *child3;
+ child1 = new tst_QTouchEventWidget;
+ child2 = new tst_QTouchEventWidget;
+ child3 = new tst_QTouchEventWidget;
+ child1->setParent(&window);
+ child2->setParent(&window);
+ child3->setParent(&window);
+ child1->setAttribute(Qt::WA_AcceptTouchEvents);
+ child2->setAttribute(Qt::WA_AcceptTouchEvents);
+ child3->setAttribute(Qt::WA_AcceptTouchEvents);
+ child1->deleteInTouchBegin = true;
+ child2->deleteInTouchUpdate = true;
+ child3->deleteInTouchEnd = true;
+
+ QList<QTouchEvent::TouchPoint> touchPoints;
+ touchPoints.append(QTouchEvent::TouchPoint(0));
+ QTouchEvent touchBeginEvent(QEvent::TouchBegin,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointPressed,
+ touchPoints);
+ QTouchEvent touchUpdateEvent(QEvent::TouchUpdate,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointStationary,
+ touchPoints);
+ QTouchEvent touchEndEvent(QEvent::TouchEnd,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointReleased,
+ touchPoints);
+ QWeakPointer<QWidget> p;
+ bool res;
+
+ touchBeginEvent.ignore();
+ p = child1;
+ res = QApplication::sendEvent(child1, &touchBeginEvent);
+ // event is handled, but widget should be deleted
+ QVERIFY(res && touchBeginEvent.isAccepted() && p.isNull());
+
+ touchBeginEvent.ignore();
+ p = child2;
+ res = QApplication::sendEvent(child2, &touchBeginEvent);
+ QVERIFY(res && touchBeginEvent.isAccepted() && !p.isNull());
+ touchUpdateEvent.ignore();
+ res = QApplication::sendEvent(child2, &touchUpdateEvent);
+ QVERIFY(res && touchUpdateEvent.isAccepted() && p.isNull());
+
+ touchBeginEvent.ignore();
+ p = child3;
+ res = QApplication::sendEvent(child3, &touchBeginEvent);
+ QVERIFY(res && touchBeginEvent.isAccepted() && !p.isNull());
+ touchUpdateEvent.ignore();
+ res = QApplication::sendEvent(child3, &touchUpdateEvent);
+ QVERIFY(res && touchUpdateEvent.isAccepted() && !p.isNull());
+ touchEndEvent.ignore();
+ res = QApplication::sendEvent(child3, &touchEndEvent);
+ QVERIFY(res && touchEndEvent.isAccepted() && p.isNull());
+ }
+
+ // QGraphicsView
+ {
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ tst_QTouchEventGraphicsItem *root, *child1, *child2, *child3;
+ root = new tst_QTouchEventGraphicsItem;
+ child1 = new tst_QTouchEventGraphicsItem;
+ child2 = new tst_QTouchEventGraphicsItem;
+ child3 = new tst_QTouchEventGraphicsItem;
+ child1->setParentItem(root);
+ child2->setParentItem(root);
+ child3->setParentItem(root);
+ child1->setZValue(1.);
+ child2->setZValue(0.);
+ child3->setZValue(-1.);
+ child1->setAcceptTouchEvents(true);
+ child2->setAcceptTouchEvents(true);
+ child3->setAcceptTouchEvents(true);
+ child1->deleteInTouchBegin = true;
+ child2->deleteInTouchUpdate = true;
+ child3->deleteInTouchEnd = true;
+
+ scene.addItem(root);
+ view.resize(200, 200);
+ view.fitInView(scene.sceneRect());
+
+ QTouchEvent::TouchPoint touchPoint(0);
+ touchPoint.setState(Qt::TouchPointPressed);
+ touchPoint.setPos(view.mapFromScene(child1->mapToScene(child1->boundingRect().center())));
+ touchPoint.setScreenPos(view.mapToGlobal(touchPoint.pos().toPoint()));
+ touchPoint.setScenePos(view.mapToScene(touchPoint.pos().toPoint()));
+ QList<QTouchEvent::TouchPoint> touchPoints;
+ touchPoints.append(touchPoint);
+ QTouchEvent touchBeginEvent(QEvent::TouchBegin,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointPressed,
+ touchPoints);
+ touchPoints[0].setState(Qt::TouchPointMoved);
+ QTouchEvent touchUpdateEvent(QEvent::TouchUpdate,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointMoved,
+ touchPoints);
+ touchPoints[0].setState(Qt::TouchPointReleased);
+ QTouchEvent touchEndEvent(QEvent::TouchEnd,
+ QTouchEvent::TouchScreen,
+ Qt::NoModifier,
+ Qt::TouchPointReleased,
+ touchPoints);
+ bool res;
+
+ child1->weakpointer = &child1;
+ touchBeginEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchBeginEvent);
+ QVERIFY(res && touchBeginEvent.isAccepted() && !child1);
+ touchUpdateEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchUpdateEvent);
+ QVERIFY(res && touchUpdateEvent.isAccepted() && !child1);
+ touchEndEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchEndEvent);
+ QVERIFY(res && touchUpdateEvent.isAccepted() && !child1);
+
+ child2->weakpointer = &child2;
+ touchBeginEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchBeginEvent);
+ QVERIFY(res && touchBeginEvent.isAccepted() && child2);
+ touchUpdateEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchUpdateEvent);
+ QVERIFY(res && !touchUpdateEvent.isAccepted() && !child2);
+ touchEndEvent.ignore();
+ res = QApplication::sendEvent(view.viewport(), &touchEndEvent);
+ QVERIFY(res && !touchUpdateEvent.isAccepted() && !child2);
+
+ child3->weakpointer = &child3;
+ res = QApplication::sendEvent(view.viewport(), &touchBeginEvent);
+ QVERIFY(res && touchBeginEvent.isAccepted() && child3);
+ res = QApplication::sendEvent(view.viewport(), &touchUpdateEvent);
+ QVERIFY(res && !touchUpdateEvent.isAccepted() && child3);
+ res = QApplication::sendEvent(view.viewport(), &touchEndEvent);
+ QVERIFY(res && !touchEndEvent.isAccepted() && !child3);
+
+ delete root;
+ }
+}
+
+void tst_QTouchEvent::deleteInRawEventTranslation()
+{
+ tst_QTouchEventWidget touchWidget;
+ touchWidget.setAttribute(Qt::WA_AcceptTouchEvents);
+ touchWidget.setGeometry(100, 100, 300, 300);
+
+ tst_QTouchEventWidget *leftWidget = new tst_QTouchEventWidget;
+ leftWidget->setParent(&touchWidget);
+ leftWidget->setAttribute(Qt::WA_AcceptTouchEvents);
+ leftWidget->setGeometry(0, 100, 100, 100);
+ leftWidget->deleteInTouchBegin = true;
+ leftWidget->show();
+
+ tst_QTouchEventWidget *centerWidget = new tst_QTouchEventWidget;
+ centerWidget->setParent(&touchWidget);
+ centerWidget->setAttribute(Qt::WA_AcceptTouchEvents);
+ centerWidget->setGeometry(100, 100, 100, 100);
+ centerWidget->deleteInTouchUpdate = true;
+ centerWidget->show();
+
+ tst_QTouchEventWidget *rightWidget = new tst_QTouchEventWidget;
+ rightWidget->setParent(&touchWidget);
+ rightWidget->setAttribute(Qt::WA_AcceptTouchEvents);
+ rightWidget->setGeometry(200, 100, 100, 100);
+ rightWidget->deleteInTouchEnd = true;
+ rightWidget->show();
+
+ QPointF leftPos = leftWidget->rect().center();
+ QPointF centerPos = centerWidget->rect().center();
+ QPointF rightPos = rightWidget->rect().center();
+ QPointF leftScreenPos = leftWidget->mapToGlobal(leftPos.toPoint());
+ QPointF centerScreenPos = centerWidget->mapToGlobal(centerPos.toPoint());
+ QPointF rightScreenPos = rightWidget->mapToGlobal(rightPos.toPoint());
+ QRectF screenGeometry = qApp->desktop()->screenGeometry(&touchWidget);
+
+ QWeakPointer<QWidget> pl = leftWidget, pc = centerWidget, pr = rightWidget;
+
+ QList<QTouchEvent::TouchPoint> rawTouchPoints;
+ rawTouchPoints.append(QTouchEvent::TouchPoint(0));
+ rawTouchPoints.append(QTouchEvent::TouchPoint(1));
+ rawTouchPoints.append(QTouchEvent::TouchPoint(2));
+ rawTouchPoints[0].setState(Qt::TouchPointPressed);
+ rawTouchPoints[0].setScreenPos(leftScreenPos);
+ rawTouchPoints[0].setNormalizedPos(normalized(rawTouchPoints[0].pos(), screenGeometry));
+ rawTouchPoints[1].setState(Qt::TouchPointPressed);
+ rawTouchPoints[1].setScreenPos(centerScreenPos);
+ rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
+ rawTouchPoints[2].setState(Qt::TouchPointPressed);
+ rawTouchPoints[2].setScreenPos(rightScreenPos);
+ rawTouchPoints[2].setNormalizedPos(normalized(rawTouchPoints[2].pos(), screenGeometry));
+
+ // generate begin events on all widgets, the left widget should die
+ qt_translateRawTouchEvent(&touchWidget, QTouchEvent::TouchScreen, rawTouchPoints);
+ QVERIFY(pl.isNull() && !pc.isNull() && !pr.isNull());
+
+ // generate update events on all widget, the center widget should die
+ rawTouchPoints[0].setState(Qt::TouchPointMoved);
+ rawTouchPoints[1].setState(Qt::TouchPointMoved);
+ rawTouchPoints[2].setState(Qt::TouchPointMoved);
+ qt_translateRawTouchEvent(&touchWidget, QTouchEvent::TouchScreen, rawTouchPoints);
+
+ // generate end events on all widget, the right widget should die
+ rawTouchPoints[0].setState(Qt::TouchPointReleased);
+ rawTouchPoints[1].setState(Qt::TouchPointReleased);
+ rawTouchPoints[2].setState(Qt::TouchPointReleased);
+ qt_translateRawTouchEvent(&touchWidget, QTouchEvent::TouchScreen, rawTouchPoints);
+}
+
QTEST_MAIN(tst_QTouchEvent)
#include "tst_qtouchevent.moc"
diff --git a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp
index 8d5f6e6..1c787e9 100644
--- a/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/benchmarks/qscriptengine/tst_qscriptengine.cpp
@@ -72,6 +72,8 @@ private slots:
void toStringHandle();
void castValueToQreal();
void nativeCall();
+ void translation_data();
+ void translation();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -259,5 +261,24 @@ void tst_QScriptEngine::nativeCall()
}
}
+void tst_QScriptEngine::translation_data()
+{
+ QTest::addColumn<QString>("text");
+ QTest::newRow("no translation") << "\"hello world\"";
+ QTest::newRow("qsTr") << "qsTr(\"hello world\")";
+ QTest::newRow("qsTranslate") << "qsTranslate(\"\", \"hello world\")";
+}
+
+void tst_QScriptEngine::translation()
+{
+ QFETCH(QString, text);
+ QScriptEngine engine;
+ engine.installTranslatorFunctions();
+
+ QBENCHMARK {
+ (void)engine.evaluate(text);
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/manual/qwidget_zorder/main.cpp b/tests/manual/qwidget_zorder/main.cpp
new file mode 100644
index 0000000..fe8e0a2
--- /dev/null
+++ b/tests/manual/qwidget_zorder/main.cpp
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite 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 <QtGui>
+
+class Widget : public QWidget
+{
+ Q_OBJECT
+public:
+ Widget()
+ {
+ QWidget *stackWidget = new QWidget;
+ stackWidget->setFixedSize(400, 300);
+ button = new QPushButton("pushbutton", stackWidget);
+ plainTextEdit = new QPlainTextEdit(stackWidget);
+ plainTextEdit->setWordWrapMode(QTextOption::NoWrap);
+ QString s = "foo bar bar foo foo bar bar foo";
+ for (int i = 0; i < 10; ++i) {
+ plainTextEdit->appendPlainText(s);
+ s.remove(1, 2);
+ }
+ calendar = new QCalendarWidget(stackWidget);
+ button->move(10, 10);
+ button->resize(100, 100);
+ plainTextEdit->move(30, 70);
+ plainTextEdit->resize(100, 100);
+ calendar->move(80, 40);
+
+ QWidget *buttonOps = new QWidget;
+ QVBoxLayout *l = new QVBoxLayout(buttonOps);
+ QPushButton *lower = new QPushButton("button: lower");
+ connect(lower, SIGNAL(clicked()), button, SLOT(lower()));
+ l->addWidget(lower);
+ QPushButton *raise = new QPushButton("button: raise");
+ connect(raise, SIGNAL(clicked()), button, SLOT(raise()));
+ l->addWidget(raise);
+
+ lower = new QPushButton("calendar: lower");
+ connect(lower, SIGNAL(clicked()), calendar, SLOT(lower()));
+ l->addWidget(lower);
+ raise = new QPushButton("calendar: raise");
+ connect(raise, SIGNAL(clicked()), calendar, SLOT(raise()));
+ l->addWidget(raise);
+ QPushButton *stackUnder = new QPushButton("calendar: stack under textedit");
+ connect(stackUnder, SIGNAL(clicked()), this, SLOT(stackCalendarUnderTextEdit()));
+ l->addWidget(stackUnder);
+
+ lower = new QPushButton("lower textedit");
+ connect(lower, SIGNAL(clicked()), plainTextEdit, SLOT(lower()));
+ l->addWidget(lower);
+ raise = new QPushButton("raise textedit");
+ connect(raise, SIGNAL(clicked()), plainTextEdit, SLOT(raise()));
+ l->addWidget(raise);
+
+ QHBoxLayout *mainLayout = new QHBoxLayout(this);
+ mainLayout->addWidget(buttonOps);
+ mainLayout->addWidget(stackWidget);
+ }
+
+private Q_SLOTS:
+ void stackCalendarUnderTextEdit()
+ {
+ calendar->stackUnder(plainTextEdit);
+ }
+
+private:
+ QPushButton *button;
+ QPlainTextEdit *plainTextEdit;
+ QCalendarWidget *calendar;
+};
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ Widget w;
+ w.show();
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/tests/manual/qwidget_zorder/qwidget_zorder.pro b/tests/manual/qwidget_zorder/qwidget_zorder.pro
new file mode 100644
index 0000000..5526f91
--- /dev/null
+++ b/tests/manual/qwidget_zorder/qwidget_zorder.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp