summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-01 03:26:29 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-01 03:26:29 (GMT)
commit8599a1002a6ed9ab8571d80f7e704b73de853f34 (patch)
tree275b29632ac25f581eb0f6cdfdf96ae4b521c6cf
parent95606772b0f12ab4bc51c2544d3c864153da4e2f (diff)
parent74f995c1b64ef34d361130ac51169af1c29344e1 (diff)
downloadQt-8599a1002a6ed9ab8571d80f7e704b73de853f34.zip
Qt-8599a1002a6ed9ab8571d80f7e704b73de853f34.tar.gz
Qt-8599a1002a6ed9ab8571d80f7e704b73de853f34.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Crash when dragging an empty URL-list. Fixed autotest tst_QWidget::translucentWidget() on Windows Vista & above Remove unwanted code after c027f0ae1967ec1d64cb2c9679c8b57f18faf7f5 ActiveQt Internet Explorer component causes Desktop Icons to flicker.
-rw-r--r--src/activeqt/container/qaxwidget.cpp6
-rw-r--r--src/gui/image/qpixmap.cpp6
-rw-r--r--src/gui/kernel/qmime_win.cpp10
-rw-r--r--src/gui/kernel/qwidget.cpp13
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp10
5 files changed, 29 insertions, 16 deletions
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 9149320..865c26c 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -1438,9 +1438,6 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent;
HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable)
{
-#if !defined(Q_OS_WINCE)
- LockWindowUpdate(host->window()->winId());
-#endif
EnableWindow(host->window()->winId(), fEnable);
if (!fEnable) {
@@ -1451,9 +1448,6 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable)
QApplicationPrivate::leaveModal(host);
}
qt_win_ignoreNextMouseReleaseEvent = false;
-#if !defined(Q_OS_WINCE)
- LockWindowUpdate(0);
-#endif
return S_OK;
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 1df7946..08003e5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -2026,12 +2026,16 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
over the one you grab, you get pixels from the overlying window,
too. The mouse cursor is generally not grabbed.
- Note on X11that if the given \a window doesn't have the same depth
+ Note on X11 that if the given \a window doesn't have the same depth
as the root window, and another window partially or entirely
obscures the one you grab, you will \e not get pixels from the
overlying window. The contents of the obscured areas in the
pixmap will be undefined and uninitialized.
+ On Windows Vista and above grabbing a layered window, which is
+ created by setting the Qt::WA_TranslucentBackground attribute, will
+ not work. Instead grabbing the desktop widget should work.
+
\warning In general, grabbing an area outside the screen is not
safe. This depends on the underlying window system.
diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_win.cpp
index e191d7b..39633bf 100644
--- a/src/gui/kernel/qmime_win.cpp
+++ b/src/gui/kernel/qmime_win.cpp
@@ -640,14 +640,18 @@ bool QWindowsMimeURI::convertFromMime(const FORMATETC &formatetc, const QMimeDat
} else if (getCf(formatetc) == CF_INETURL_W) {
QList<QUrl> urls = mimeData->urls();
QByteArray result;
- QString url = urls.at(0).toString();
- result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort));
+ if (!urls.isEmpty()) {
+ QString url = urls.at(0).toString();
+ result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort));
+ }
result.append('\0');
result.append('\0');
return setData(result, pmedium);
} else if (getCf(formatetc) == CF_INETURL) {
QList<QUrl> urls = mimeData->urls();
- QByteArray result = urls.at(0).toString().toLocal8Bit();
+ QByteArray result;
+ if (!urls.isEmpty())
+ result = urls.at(0).toString().toLocal8Bit();
return setData(result, pmedium);
}
}
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index d3340df..29ae51f 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -7929,13 +7929,16 @@ inline void setDisabledStyle(QWidget *w, bool setStyle)
// set/reset WS_DISABLED style.
if(w && w->isWindow() && w->isVisible() && w->isEnabled()) {
LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE);
+ LONG newStyle = dwStyle;
if (setStyle)
- dwStyle |= WS_DISABLED;
+ newStyle |= WS_DISABLED;
else
- dwStyle &= ~WS_DISABLED;
- SetWindowLong(w->winId(), GWL_STYLE, dwStyle);
- // we might need to repaint in some situations (eg. menu)
- w->repaint();
+ newStyle &= ~WS_DISABLED;
+ if (newStyle != dwStyle) {
+ SetWindowLong(w->winId(), GWL_STYLE, newStyle);
+ // we might need to repaint in some situations (eg. menu)
+ w->repaint();
+ }
}
}
#endif
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index b59017b..abd9604 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -8829,7 +8829,15 @@ void tst_QWidget::translucentWidget()
#endif
QTest::qWait(200);
- QPixmap widgetSnapshot = QPixmap::grabWindow(label.winId());
+ QPixmap widgetSnapshot;
+
+#ifdef Q_WS_WIN
+ QWidget *desktopWidget = QApplication::desktop()->screen(0);
+ if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
+ widgetSnapshot = QPixmap::grabWindow(desktopWidget->winId(), 0,0, label.width(), label.height());
+ else
+#endif
+ widgetSnapshot = QPixmap::grabWindow(label.winId());
QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32);
QCOMPARE(actual.size(),expected.size());