summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-11-23 08:51:55 (GMT)
committeraxis <qt-info@nokia.com>2010-11-23 08:51:55 (GMT)
commit879c325b3ea8108790f46f3bb58e91ebc12fa550 (patch)
tree97463065a200e32bb80b19781fddc088cb81d025 /src
parentd7d0b1528fd200fc3110093244b8265fdf457238 (diff)
parentb1c412cefa51f0eea79dbf279f2a23414ccecc3d (diff)
downloadQt-879c325b3ea8108790f46f3bb58e91ebc12fa550.zip
Qt-879c325b3ea8108790f46f3bb58e91ebc12fa550.tar.gz
Qt-879c325b3ea8108790f46f3bb58e91ebc12fa550.tar.bz2
Merge branch '4.7' into 4.7-s60
Conflicts: src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qiodevice.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp48
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp3
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp2
-rw-r--r--src/sql/models/qsqlrelationaldelegate.h10
-rw-r--r--src/testlib/qtesttouch.h4
6 files changed, 50 insertions, 22 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 26e587d..68fb2bf 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -395,7 +395,10 @@ QIODevice::QIODevice(QIODevicePrivate &dd, QObject *parent)
/*!
- Destructs the QIODevice object.
+ The destructor is virtual, and QIODevice is an abstract base
+ class. This destructor does not call close(), but the subclass
+ destructor might. If you are in doubt, call close() before
+ destroying the QIODevice.
*/
QIODevice::~QIODevice()
{
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index a719e72..4eb0073 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -84,7 +84,8 @@ extern uint qGlobalPostedEventsCount();
enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
- WM_QT_SENDPOSTEDEVENTS = WM_USER + 1
+ WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
+ SendPostedEventsWindowsTimerId = ~1u
};
#if defined(Q_OS_WINCE)
@@ -353,7 +354,7 @@ public:
// for controlling when to send posted events
QAtomicInt serialNumber;
- int lastSerialNumber;
+ int lastSerialNumber, sendPostedEventsWindowsTimerId;
QAtomicInt wakeUps;
// timers
@@ -378,7 +379,7 @@ public:
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0),
- serialNumber(0), lastSerialNumber(0), wakeUps(0)
+ serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0), wakeUps(0)
{
resolveTimerAPI();
}
@@ -485,17 +486,21 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
}
}
return 0;
- } else if (message == WM_TIMER) {
- Q_ASSERT(d != 0);
- d->sendTimerEvent(wp);
- return 0;
- } else if (message == WM_QT_SENDPOSTEDEVENTS) {
+ } else if (message == WM_QT_SENDPOSTEDEVENTS
+ // we also use a Windows timer to send posted events when the message queue is full
+ || (message == WM_TIMER
+ && d->sendPostedEventsWindowsTimerId != 0
+ && wp == d->sendPostedEventsWindowsTimerId)) {
int localSerialNumber = d->serialNumber;
if (localSerialNumber != d->lastSerialNumber) {
d->lastSerialNumber = localSerialNumber;
QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData);
}
return 0;
+ } else if (message == WM_TIMER) {
+ Q_ASSERT(d != 0);
+ d->sendTimerEvent(wp);
+ return 0;
}
return DefWindowProc(hwnd, message, wp, lp);
@@ -507,21 +512,36 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
Q_ASSERT(q != 0);
if (q) {
+ MSG *msg = (MSG *) lp;
QEventDispatcherWin32Private *d = q->d_func();
int localSerialNumber = d->serialNumber;
- MSG unused;
- if ((HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT)) == 0
- && PeekMessage(&unused, 0, WM_TIMER, WM_TIMER, PM_NOREMOVE) == 0)) {
- // no more input or timer events in the message queue or more than 10ms has elapsed since
- // we send posted events, we can allow posted events to be sent now
+ if (HIWORD(GetQueueStatus(QS_TIMER | QS_INPUT | QS_RAWINPUT)) == 0) {
+ // no more input or timer events in the message queue, we can allow posted events to be sent normally now
+ if (d->sendPostedEventsWindowsTimerId != 0) {
+ // stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
+ KillTimer(d->internalHwnd, d->sendPostedEventsWindowsTimerId);
+ d->sendPostedEventsWindowsTimerId = 0;
+ }
(void) d->wakeUps.fetchAndStoreRelease(0);
- MSG *msg = (MSG *) lp;
if (localSerialNumber != d->lastSerialNumber
// if this message IS the one that triggers sendPostedEvents(), no need to post it again
&& (msg->hwnd != d->internalHwnd
|| msg->message != WM_QT_SENDPOSTEDEVENTS)) {
PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
}
+ } else if (d->sendPostedEventsWindowsTimerId == 0
+ && localSerialNumber != d->lastSerialNumber
+ // if this message IS the one that triggers sendPostedEvents(), no need to post it again
+ && (msg->hwnd != d->internalHwnd
+ || msg->message != WM_QT_SENDPOSTEDEVENTS)) {
+ // start a special timer to continue delivering posted events while
+ // there are still input and timer messages in the message queue
+ d->sendPostedEventsWindowsTimerId = SetTimer(d->internalHwnd,
+ SendPostedEventsWindowsTimerId,
+ 0, // we specify zero, but Windows uses USER_TIMER_MINIMUM
+ NULL);
+ // we don't check the return value of SetTimer()... if creating the timer failed, there's little
+ // we can do. we just have to accept that posted events will be starved
}
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index fc3954f..7686dde 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -260,6 +260,9 @@ void QDeclarativeRectangle::doUpdate()
A width of 1 creates a thin line. For no line, use a width of 0 or a transparent color.
+ \note The width of the rectangle's border does not affect the geometry of the
+ rectangle itself or its position relative to other items if anchors are used.
+
If \c border.width is an odd number, the rectangle is painted at a half-pixel offset to retain
border smoothness. Also, the border is rendered evenly on either side of the
rectangle's boundaries, and the spare pixel is rendered to the right and below the
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 2eeee24..fbc539b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -344,9 +344,11 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
if (!win)
return;
+#ifndef QT_NO_QWS_PROXYSCREEN
QWExtra *extra = qt_widget_private(widget)->extraData();
if (extra && extra->proxyWidget)
return;
+#endif
const quint8 windowOpacity = quint8(win->windowOpacity() * 0xff);
const QRect windowGeometry = geometry();
diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h
index 7600e52..96760e1 100644
--- a/src/sql/models/qsqlrelationaldelegate.h
+++ b/src/sql/models/qsqlrelationaldelegate.h
@@ -59,23 +59,23 @@ class QSqlRelationalDelegate: public QItemDelegate
{
public:
-explicit QSqlRelationalDelegate(QObject *parent = 0)
- : QItemDelegate(parent)
+explicit QSqlRelationalDelegate(QObject *aParent = 0)
+ : QItemDelegate(aParent)
{}
~QSqlRelationalDelegate()
{}
-QWidget *createEditor(QWidget *parent,
+QWidget *createEditor(QWidget *aParent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
const QSqlRelationalTableModel *sqlModel = qobject_cast<const QSqlRelationalTableModel *>(index.model());
QSqlTableModel *childModel = sqlModel ? sqlModel->relationModel(index.column()) : 0;
if (!childModel)
- return QItemDelegate::createEditor(parent, option, index);
+ return QItemDelegate::createEditor(aParent, option, index);
- QComboBox *combo = new QComboBox(parent);
+ QComboBox *combo = new QComboBox(aParent);
combo->setModel(childModel);
combo->setModelColumn(childModel->fieldIndex(sqlModel->relation(index.column()).displayColumn()));
combo->installEventFilter(const_cast<QSqlRelationalDelegate *>(this));
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index 1beef85..6c58e4c 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -106,8 +106,8 @@ namespace QTest
}
private:
- QTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType deviceType)
- : targetWidget(widget), deviceType(deviceType)
+ QTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType aDeviceType)
+ : targetWidget(widget), deviceType(aDeviceType)
{
}
QTouchEventSequence(const QTouchEventSequence &v);