diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-05-06 09:16:35 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-05-06 09:16:35 (GMT) |
commit | 98280b5e5d2be28dffcc4a6b642996dd6ab8b79f (patch) | |
tree | b39602c3938dfd4fab7174129f2d6ecad35b7f71 /src | |
parent | 1bdd2553b744de425b5952d2e9ab31753cd5b110 (diff) | |
parent | 3c4d3a65bbce6b1f9e649412f141ee8890a7b6cd (diff) | |
download | Qt-98280b5e5d2be28dffcc4a6b642996dd6ab8b79f.zip Qt-98280b5e5d2be28dffcc4a6b642996dd6ab8b79f.tar.gz Qt-98280b5e5d2be28dffcc4a6b642996dd6ab8b79f.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.cpp | 8 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget_p.cpp | 12 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget_p.h | 2 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 28 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 4 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_unix.cpp | 1 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_win.cpp | 1 |
8 files changed, 31 insertions, 27 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 42abe59..074e571 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -3578,6 +3578,8 @@ void QGraphicsItem::setPos(const QPointF &pos) // Update and repositition. if (!(d_ptr->flags & ItemSendsGeometryChanges)) { d_ptr->setPosHelper(pos); + if (d_ptr->isWidget) + static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos(); return; } diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 8b80bc8..3151e76 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1044,13 +1044,7 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & } break; case ItemPositionHasChanged: - if (!d->inSetGeometry) { - d->inSetPos = 1; - // Ensure setGeometry is called (avoid recursion when setPos is - // called from within setGeometry). - setGeometry(QRectF(pos(), size())); - d->inSetPos = 0 ; - } + d->setGeometryFromSetPos(); break; case ItemParentChange: { QGraphicsItem *parent = qVariantValue<QGraphicsItem *>(value); diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp index 1835c74..daa007f 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.cpp +++ b/src/gui/graphicsview/qgraphicswidget_p.cpp @@ -825,6 +825,18 @@ void QGraphicsWidgetPrivate::setLayout_helper(QGraphicsLayout *l) } } +void QGraphicsWidgetPrivate::setGeometryFromSetPos() +{ + if (inSetGeometry) + return; + Q_Q(QGraphicsWidget); + inSetPos = 1; + // Ensure setGeometry is called (avoid recursion when setPos is + // called from within setGeometry). + q->setGeometry(QRectF(pos, q->size())); + inSetPos = 0 ; +} + QT_END_NAMESPACE #endif //QT_NO_GRAPHICSVIEW diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h index 2c5b3bf..140bc0e 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.h +++ b/src/gui/graphicsview/qgraphicswidget_p.h @@ -130,6 +130,8 @@ public: void windowFrameHoverLeaveEvent(QGraphicsSceneHoverEvent *event); bool hasDecoration() const; + void setGeometryFromSetPos(); + // State inline int attributeToBitIndex(Qt::WidgetAttribute att) const { diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 559124f..def4c34 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -716,6 +716,7 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // This function must be called from the event loop. The only // exception is documented in QHttpNetworkConnectionPrivate::queueRequest +// although it is called _q_startNextRequest, it will actually start multiple requests when possible void QHttpNetworkConnectionPrivate::_q_startNextRequest() { //resend the necessary ones. @@ -733,26 +734,23 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest() // dequeue new ones - QAbstractSocket *socket = 0; + // return fast if there is nothing to do + if (highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty()) + return; + // try to get a free AND connected socket for (int i = 0; i < channelCount; ++i) { - QAbstractSocket *chSocket = channels[i].socket; - // try to get a free AND connected socket if (!channels[i].isSocketBusy() && channels[i].socket->state() == QAbstractSocket::ConnectedState) { - socket = chSocket; - dequeueAndSendRequest(socket); - break; + dequeueAndSendRequest(channels[i].socket); } } - if (!socket) { - for (int i = 0; i < channelCount; ++i) { - QAbstractSocket *chSocket = channels[i].socket; - // try to get a free unconnected socket - if (!channels[i].isSocketBusy()) { - socket = chSocket; - dequeueAndSendRequest(socket); - break; - } + // return fast if there is nothing to do + if (highPriorityQueue.isEmpty() && lowPriorityQueue.isEmpty()) + return; + // try to get a free unconnected socket + for (int i = 0; i < channelCount; ++i) { + if (!channels[i].isSocketBusy()) { + dequeueAndSendRequest(channels[i].socket); } } diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 2dd6485..311ee70 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -44,14 +44,10 @@ #include "QtCore/qscopedpointer.h" #include <qabstracteventdispatcher.h> -#include <private/qunicodetables_p.h> #include <qcoreapplication.h> #include <qmetaobject.h> -#include <qregexp.h> -#include <private/qnativesocketengine_p.h> #include <qstringlist.h> #include <qthread.h> -#include <qtimer.h> #include <qurl.h> #ifdef Q_OS_UNIX diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index be06b6e..df98d5d 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -44,6 +44,7 @@ #include "qplatformdefs.h" #include "qhostinfo_p.h" +#include "private/qnativesocketengine_p.h" #include "qiodevice.h" #include <qbytearray.h> #include <qlibrary.h> diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 4264f60..b30204b 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -50,7 +50,6 @@ #include "private/qnativesocketengine_p.h" #include <ws2tcpip.h> #include <qlibrary.h> -#include <qtimer.h> #include <qmutex.h> #include <qurl.h> #include <private/qmutexpool_p.h> |