From kde-commits Sun May 16 09:33:03 2010 From: =?utf-8?q?Jaros=C5=82aw=20Staniek?= Date: Sun, 16 May 2010 09:33:03 +0000 To: kde-commits Subject: koffice/kexi Message-Id: <20100516093303.4D7F9AC8B5 () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=127400208932273 SVN commit 1127309 by staniek: Forms *Fix Kexi combo box widgets in forms (did not display values and were non-functional) **Workaround used by adding KexiComboBoxBase::m_setReinstantiatePopupOnShow and recreating popups from scratch CCBUG:235964 M +7 -0 plugins/forms/widgets/kexidbcombobox.cpp M +8 -0 widget/tableview/kexicomboboxbase.cpp M +4 -0 widget/tableview/kexicomboboxbase.h --- trunk/koffice/kexi/plugins/forms/widgets/kexidbcombobox.cpp #1127308:1127309 @@ -73,6 +73,13 @@ , KexiComboBoxBase() , d(new Private()) { +#ifdef __GNUC__ +#warning TODO fix creating popup for forms instead; remove KexiComboBoxBase::m_setReinstantiatePopupOnShow +#else +#pragma WARNING( fix creating popup for forms instead; remove KexiComboBoxBase::m_setReinstantiatePopupOnShow ) +#endif + m_reinstantiatePopupOnShow = true; + setMouseTracking(true); setFocusPolicy(Qt::WheelFocus); installEventFilter(this); --- trunk/koffice/kexi/widget/tableview/kexicomboboxbase.cpp #1127308:1127309 @@ -44,6 +44,7 @@ m_selectAllInInternalEditor_enabled = true; m_setValueInInternalEditor_enabled = true; m_setVisibleValueOnSetValueInternal = false; + m_reinstantiatePopupOnShow = false; } KexiComboBoxBase::~KexiComboBoxBase() @@ -346,6 +347,13 @@ m_insideCreatePopup = true; QWidget* thisWidget = dynamic_cast(this); QWidget *widgetToFocus = internalEditor() ? internalEditor() : thisWidget; + + if (m_reinstantiatePopupOnShow) { + QWidget *oldPopup = popup(); + setPopup(0); + delete oldPopup; + } + if (!popup()) { setPopup(column() ? new KexiComboBoxPopup(thisWidget, *column()) : new KexiComboBoxPopup(thisWidget, *field())); --- trunk/koffice/kexi/widget/tableview/kexicomboboxbase.h #1127308:1127309 @@ -145,6 +145,10 @@ //! Used by KexiDBComboBox. void undoChanges(); + //! A hack for createPopup(), used by forms only. Avoid magical disappearing of the popup in forms after 2nd and subsequent use. + //! fix creating popup for forms instead! + bool m_reinstantiatePopupOnShow; + QVariant m_visibleValue; QVariant m_userEnteredValue; //!< value (usually a text) entered by hand (by the user)