summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-04-07 14:37:08 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-04-07 14:43:15 (GMT)
commit35c26d696cbff269d551c012a212c09692dd6f6b (patch)
treeb5f9f5c298e1f2d1b0ef6b4986dc03c7822df12d /src/gui/widgets
parent773c4d326c24f8db12ab58e379bd223ce1126d72 (diff)
downloadQt-35c26d696cbff269d551c012a212c09692dd6f6b.zip
Qt-35c26d696cbff269d551c012a212c09692dd6f6b.tar.gz
Qt-35c26d696cbff269d551c012a212c09692dd6f6b.tar.bz2
Bt: Fix regression in the Embedded dialogs example
We had to revert an earlier fix since it obviously did not work correctly. However since we do not really need to propagate the palette on the viewContainer _before_ it is created, we can simply avoid the issue alltogether as it would happen because we implicitly added a child widget during the polish of the combo box. Reviewed-by: nrc
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qcombobox.cpp24
1 files changed, 13 insertions, 11 deletions
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;
}