Please comment: ComboBoxWidget change

Harri Porten porten at kde.org
Sun Oct 5 02:22:46 BST 2008


Hello (Germain and Rafael),

can you comment on the correctness of this proposed change - or rather the 
background of why it seems necessary:

I noticed that combo box elements like

   <select>
   <option>A</option>
   <option>B</option>
   <option>C</option>
   </select>

have some rendering issues. They can be used once just fine but on the 
second use the new selection is not updated automatically. The internal 
state is fine, just the rendering isn't.

After a long debugging session (really long, as I first had to dive into 
KHTML's redirection mechanism and Qt's backing store) I discovered that 
the update is not done because the KComboBoxWidget is explicitly hidden! 
None of the places were we call QWidget::hide() seems guilty. But the 
setParent() calls in ComboBoxWidget::showPopup() have this (documented) 
side effect. I saw that Rafael had reinstated those calls upon Germain's 
recommendation:

  http://websvn.kde.org/trunk/KDE/kdelibs/khtml/rendering/render_form.cpp?r1=862207&r2=862897

I am just curious about their purpose. Since I assume they are needed I 
suggested the following patch to undo their side effect:

--- rendering/render_form.cpp   (revision 867904)
+++ rendering/render_form.cpp   (working copy)
@@ -1352,6 +1352,8 @@
      blocked = blockSignals(true);
      if (v != parent) {
          setParent(parent);
+        // undo side effect of setParent()
+        show();
      }
      move( p );
      blockSignals(blocked);

Harri.




More information about the kfm-devel mailing list