summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-08 08:25:06 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-04-08 08:32:35 (GMT)
commit3f3d09cf1511dde99797671a7bc848cdabc8d7fa (patch)
treeda1736fea9ee4a1afff5abdaf5937e70dd9a74bc
parentdf461a4a1bc7492729f701d38c81916b1be386b0 (diff)
downloadQt-3f3d09cf1511dde99797671a7bc848cdabc8d7fa.zip
Qt-3f3d09cf1511dde99797671a7bc848cdabc8d7fa.tar.gz
Qt-3f3d09cf1511dde99797671a7bc848cdabc8d7fa.tar.bz2
Revert "Bt: Fix regression in the Embedded dialogs example"
This reverts commit 35c26d696cbff269d551c012a212c09692dd6f6b. The change to QComboBox introduces a behavior change; whereas before the view container would always get its palette set as a response to QEvent::PaletteChange, it would now miss this event and rely on regular palette propagation to get the right contens. The difference in behavior is that QWidget::setPalette() also resolves the palette mask, and after 35c26d69 this would no longer happen. The bug in the embedded dialogs demo is caused by the embedded dialogs demo. See upcoming commit. Reviewed-by: Alexis Reviewed-by: Jens Bache-Wiig <jbache@trolltech.com>
-rw-r--r--demos/embeddeddialogs/customproxy.cpp11
-rw-r--r--src/gui/widgets/qcombobox.cpp24
2 files changed, 13 insertions, 22 deletions
diff --git a/demos/embeddeddialogs/customproxy.cpp b/demos/embeddeddialogs/customproxy.cpp
index ed2fc76..56a0548 100644
--- a/demos/embeddeddialogs/customproxy.cpp
+++ b/demos/embeddeddialogs/customproxy.cpp
@@ -111,15 +111,8 @@ bool CustomProxy::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
QVariant CustomProxy::itemChange(GraphicsItemChange change, const QVariant &value)
{
- if (change == ItemChildAddedChange || change == ItemChildRemovedChange) {
- QGraphicsItem *item = qVariantValue<QGraphicsItem *>(value);
- if (change == ItemChildAddedChange) {
- item->setCacheMode(ItemCoordinateCache);
- item->installSceneEventFilter(this);
- } else {
- item->removeSceneEventFilter(this);
- }
- }
+ if (change == ItemChildRemovedChange)
+ removeSceneEventFilter(this);
return QGraphicsProxyWidget::itemChange(change, value);
}
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index b9dbc62..09a51fe 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -2572,21 +2572,19 @@ void QComboBox::changeEvent(QEvent *e)
hidePopup();
break;
case QEvent::PaletteChange: {
- if (d->container) {
- QStyleOptionComboBox opt;
- initStyleOption(&opt);
+ 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;
}