[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2010-05-16 9:33:03
Message-ID: 20100516093303.4D7F9AC8B5 () svn ! kde ! org
[Download RAW message or body]

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<QWidget*>(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)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic