diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-04-07 15:25:40 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-04-07 15:25:40 (GMT) |
commit | df555a22e46fc348d9eda156bb80593129cdc28a (patch) | |
tree | 76cc71692cd238ef5145ff9cbee7db90528b2922 | |
parent | 18af4dfaabb4c3281abf2c2da575ced8dda672f1 (diff) | |
parent | 5d6b7757eebc76018eedd2fdfb5135df7b5cb460 (diff) | |
download | Qt-df555a22e46fc348d9eda156bb80593129cdc28a.zip Qt-df555a22e46fc348d9eda156bb80593129cdc28a.tar.gz Qt-df555a22e46fc348d9eda156bb80593129cdc28a.tar.bz2 |
Merge branch '4.5' of git@scm.dev-nokia.troll.no:qt/qt into 4.5
-rw-r--r-- | demos/embeddeddialogs/customproxy.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qcocoapanel_mac.mm | 5 | ||||
-rw-r--r-- | src/gui/kernel/qcocoawindow_mac.mm | 4 | ||||
-rw-r--r-- | src/gui/widgets/qabstractbutton.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qabstractbutton.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 24 | ||||
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 11 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkreply_p.h | 10 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 7 |
9 files changed, 49 insertions, 35 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp index 56a0548..ed2fc76 100644 --- a/demos/embeddeddialogs/customproxy.cpp +++ b/demos/embeddeddialogs/customproxy.cpp @@ -111,8 +111,15 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event) QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value) { - if (change == ItemChildRemovedChange) - removeSceneEventFilter(this); + if (change == ItemChildAddedChange || change == ItemChildRemovedChange) { + QGraphicsItem *item = qVariantValue<QGraphicsItem *>(value); + if (change == ItemChildAddedChange) { + item->setCacheMode(ItemCoordinateCache); + item->installSceneEventFilter(this); + } else { + item->removeSceneEventFilter(this); + } + } return QGraphicsProxyWidget::itemChange(change, value); } diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index c17b30c..95e20af 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -157,10 +157,11 @@ QT_USE_NAMESPACE [self release]; } - - (BOOL)makeFirstResponder:(NSResponder *)responder { - if (responder == nil) + // For some reason Cocoa wants to flip the first responder + // when Qt doesn't want to, sorry, but "No" :-) + if (responder == nil && qApp->focusWidget()) return NO; return [super makeFirstResponder:responder]; } diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index ba121cd..e7b76a7 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -182,7 +182,9 @@ extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview. - (BOOL)makeFirstResponder:(NSResponder *)responder { - if (responder == nil) + // For some reason Cocoa wants to flip the first responder + // when Qt doesn't want to, sorry, but "No" :-) + if (responder == nil && qApp->focusWidget()) return NO; return [super makeFirstResponder:responder]; } diff --git a/src/gui/widgets/qabstractbutton.cpp b/src/gui/widgets/qabstractbutton.cpp index 330a7f8..61ed0ea 100644 --- a/src/gui/widgets/qabstractbutton.cpp +++ b/src/gui/widgets/qabstractbutton.cpp @@ -1248,15 +1248,6 @@ void QAbstractButton::timerEvent(QTimerEvent *e) } } -#if defined(Q_OS_WINCE) && !defined(QT_NO_CONTEXTMENU) -/*! \reimp */ -void QAbstractButton::contextMenuEvent(QContextMenuEvent *e) -{ - e->ignore(); - setDown(false); -} -#endif - /*! \reimp */ void QAbstractButton::focusInEvent(QFocusEvent *e) { diff --git a/src/gui/widgets/qabstractbutton.h b/src/gui/widgets/qabstractbutton.h index 6503a56..f0cbb05 100644 --- a/src/gui/widgets/qabstractbutton.h +++ b/src/gui/widgets/qabstractbutton.h @@ -143,9 +143,6 @@ protected: void focusOutEvent(QFocusEvent *e); void changeEvent(QEvent *e); void timerEvent(QTimerEvent *e); -#ifdef Q_OS_WINCE - void contextMenuEvent(QContextMenuEvent *e); -#endif #ifdef QT3_SUPPORT public: diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 09a51fe..b9dbc62 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2572,19 +2572,21 @@ void QComboBox::changeEvent(QEvent *e) hidePopup(); break; case QEvent::PaletteChange: { - QStyleOptionComboBox opt; - initStyleOption(&opt); + if (d->container) { + QStyleOptionComboBox opt; + initStyleOption(&opt); #ifndef QT_NO_MENU - if (style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, this)) { - QMenu menu; - menu.ensurePolished(); - d->viewContainer()->setPalette(menu.palette()); - d->viewContainer()->setWindowOpacity(menu.windowOpacity()); - } else + if (style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, this)) { + QMenu menu; + menu.ensurePolished(); + d->viewContainer()->setPalette(menu.palette()); + d->viewContainer()->setWindowOpacity(menu.windowOpacity()); + } else #endif - { - d->viewContainer()->setPalette(palette()); - d->viewContainer()->setWindowOpacity(1.0); + { + d->viewContainer()->setPalette(palette()); + d->viewContainer()->setWindowOpacity(1.0); + } } break; } diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 85d6ea2..1babb6d 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -1153,6 +1153,17 @@ bool QToolBar::event(QEvent *event) if (d->mouseMoveEvent(static_cast<QMouseEvent*>(event))) return true; break; +#ifdef Q_OS_WINCE + case QEvent::ContextMenu: + { + QContextMenuEvent* contextMenuEvent = static_cast<QContextMenuEvent*>(event); + QWidget* child = childAt(contextMenuEvent->pos()); + QAbstractButton* button = qobject_cast<QAbstractButton*>(child); + if (button) + button->setDown(false); + } + break; +#endif case QEvent::Leave: if (d->state != 0 && d->state->dragging) { #ifdef Q_OS_WIN diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h index 21f4116..c17c65c 100644 --- a/src/network/access/qhttpnetworkreply_p.h +++ b/src/network/access/qhttpnetworkreply_p.h @@ -66,12 +66,10 @@ static const unsigned char gz_magic[2] = {0x1f, 0x8b}; // gzip magic header #define CHUNK 16384 #endif -#ifndef QT_NO_OPENSSL -# include <QtNetwork/qsslsocket.h> -# include <QtNetwork/qsslerror.h> -#else -# include <QtNetwork/qtcpsocket.h> -#endif +#include <QtNetwork/qtcpsocket.h> +// it's safe to include these even if SSL support is not enabled +#include <QtNetwork/qsslsocket.h> +#include <QtNetwork/qsslerror.h> #include <QtNetwork/qnetworkrequest.h> #include <QtNetwork/qnetworkreply.h> diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 35ab859..a20b66a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -250,7 +250,12 @@ QImage QDirectFBPixmapData::toImage() const #ifndef QT_NO_DIRECTFB_PREALLOCATED QImage ret(size(), QDirectFBScreen::getImageFormat(dfbSurface)); if (IDirectFBSurface *imgSurface = screen->createDFBSurface(ret, QDirectFBScreen::DontTrackSurface)) { - imgSurface->SetBlittingFlags(imgSurface, hasAlphaChannel() ? DSBLIT_BLEND_ALPHACHANNEL : DSBLIT_NOFX); + if (hasAlphaChannel()) { + imgSurface->SetBlittingFlags(imgSurface, DSBLIT_BLEND_ALPHACHANNEL); + imgSurface->Clear(imgSurface, 0, 0, 0, 0); + } else { + imgSurface->SetBlittingFlags(imgSurface, DSBLIT_NOFX); + } imgSurface->Blit(imgSurface, dfbSurface, 0, 0, 0); imgSurface->ReleaseSource(imgSurface); imgSurface->Release(imgSurface); |