From d19dd41a306b72133d42375df056e88d2ffd6f80 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 16 Nov 2009 15:40:56 +0100 Subject: Fixed swipe gesture on the Mac. Swipe on Mac is a singleshot gesture which goes directly to the finished state (fake gesture started event will be sent by Qt in this case). Reviewed-by: Richard --- src/gui/kernel/qmacgesturerecognizer_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qmacgesturerecognizer_mac.mm b/src/gui/kernel/qmacgesturerecognizer_mac.mm index f142d71..3e0ba23 100644 --- a/src/gui/kernel/qmacgesturerecognizer_mac.mm +++ b/src/gui/kernel/qmacgesturerecognizer_mac.mm @@ -67,7 +67,7 @@ QMacSwipeGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *e case QNativeGestureEvent::Swipe: { QSwipeGesture *g = static_cast(gesture); g->setSwipeAngle(ev->angle); - return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint; + return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint; break; } default: break; -- cgit v0.12 From 1a45567434b564c0c0e4129033bed3fcdac52ba0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 16 Nov 2009 17:11:15 +0100 Subject: Prospective Symbian/abld build fix Include QtNetwork as module to work around abld issue of local includes not working. Reviewed-by: axis --- examples/webkit/domtraversal/domtraversal.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webkit/domtraversal/domtraversal.pro b/examples/webkit/domtraversal/domtraversal.pro index dda63ba..49400de 100644 --- a/examples/webkit/domtraversal/domtraversal.pro +++ b/examples/webkit/domtraversal/domtraversal.pro @@ -1,4 +1,4 @@ -QT += webkit +QT += webkit network FORMS = window.ui HEADERS = window.h SOURCES = main.cpp \ -- cgit v0.12 From 45ed11461d479172d6a92e77b6e1a09916ca4556 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 16 Nov 2009 10:25:44 +0100 Subject: tst_qtcpsocket: Check if proper connection error occurs We have a bug in our way of calling select() on Windows, this test case triggers it. Task-number: QTBUG-5799 Reviewed-by: thiago --- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 5577903..4ed9fca 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -192,6 +192,8 @@ private slots: void connectToMultiIP(); void moveToThread0(); void increaseReadBufferSize(); + void taskQtBug5799ConnectionErrorWaitForConnected(); + void taskQtBug5799ConnectionErrorEventLoop(); #ifdef TEST_QNETWORK_PROXY void invalidProxy_data(); void invalidProxy(); @@ -2214,6 +2216,47 @@ void tst_QTcpSocket::increaseReadBufferSize() delete active; } +void tst_QTcpSocket::taskQtBug5799ConnectionErrorWaitForConnected() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + // check that we get a proper error connecting to port 12346 + // use waitForConnected, e.g. this should use a synchronous select() on the OS level + + QTcpSocket socket; + socket.connectToHost(QtNetworkSettings::serverName(), 12346); + QTime timer; + timer.start(); + socket.waitForConnected(10000); + QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong"); + QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, "Socket connected unexpectedly!"); + QVERIFY2(socket.error() == QAbstractSocket::ConnectionRefusedError, + QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit()); +} + +void tst_QTcpSocket::taskQtBug5799ConnectionErrorEventLoop() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + // check that we get a proper error connecting to port 12346 + // This testcase uses an event loop + QTcpSocket socket; + connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); + socket.connectToHost(QtNetworkSettings::serverName(), 12346); + + QTestEventLoop::instance().enterLoop(10); + QVERIFY2(!QTestEventLoop::instance().timeout(), "Connection to closed port timed out instead of refusing, something is wrong"); + QVERIFY2(socket.state() == QAbstractSocket::UnconnectedState, "Socket connected unexpectedly!"); + QVERIFY2(socket.error() == QAbstractSocket::ConnectionRefusedError, + QString("Could not reach server: %1").arg(socket.errorString()).toLocal8Bit()); +} + + + #ifdef TEST_QNETWORK_PROXY void tst_QTcpSocket::invalidProxy_data() { -- cgit v0.12