View Issue Details

IDProjectCategoryView StatusLast Update
0015885LazarusWidgetsetpublic2010-03-17 19:25
ReporterJuha Manninen Assigned ToZeljan Rikalo  
Status closedResolutionfixed 
Product Version0.9.29 (SVN) 
Summary0015885: QT Combobox flickers when updating items list
DescriptionQT bindings version of TCombobox changes its visual text when a program adds items to its list. The list is not visible at that moment and it should not show to user.

This is a real life problem with Lazarus Object Inspector. ValueCombobox is updated every time it gets focus. It causes annoying flicker and makes it slow.
My patch "0015883: Object Inspector updates ValueComboBox control many times"
makes it little faster but this QT problem has a still bigger effect.

I attach a demo program. Click the different comboboxes and you see what I mean.
TagsNo tags attached.
Fixed in Revision23861,24062
Attached Files


2010-03-03 14:24


ComboboxAnomaly.tar.gz (129,223 bytes)

Zeljan Rikalo

2010-03-03 16:10

developer   ~0034921

hm..I don't see any problem with your example, no flickering or anything similar (plastique style on qt-4.5.3 - kde-3.5)

Juha Manninen

2010-03-03 22:11

developer   ~0034924

Last edited: 2010-03-04 10:56

What could cause the difference there. I have the latest KDE but it really should not affect QT widget drawing.
QT version is now 4.6 but I remember having the same error before.

Here the visual text part clearly shows all the items while they are added. The same thing shows in Lazarus Object Inspector. For all boolean properties "False" and "True" are shown before the right value sets still, when the property gets focus (by mouse or by up- down- arrow keys).

In a faster machine this may not be as obvious but my machine is not completely antique either: about 2 GHz Pentium 4.

Zeljan Rikalo

2010-03-04 10:45

developer   ~0034927

Also, I don't see any problem under vmware (FC12 - with 1.5 GB ram) on my machine (Core2Duo 2.4, 4MB L2, 4GB Ram).
I'll take a look if there's any older machine in my company and then I'll try to reproduce it.
Is it possible to create video of problem (I mean somehow record complete example) and upload it somewhere (youtube ?).

2010-03-04 11:26


comboboxinsertpolicy.diff (438 bytes)   
Index: qtwidgets.pas
--- qtwidgets.pas	(revision 23837)
+++ qtwidgets.pas	(working copy)
@@ -6284,6 +6284,7 @@
   Result := QComboBox_create();
   // disable AutoCompletion. LCL has its own
   QComboBox_setAutoCompletion(QComboboxH(Result), False);
+  QComboBox_setInsertPolicy(QComboboxH(Result), QComboBoxNoInsert);
   FLineEdit := nil;
   FOwnerDrawn := False;
comboboxinsertpolicy.diff (438 bytes)   

Zeljan Rikalo

2010-03-04 11:26

developer   ~0034930

@Juha, can you test with attached patch and give feedback ?

Juha Manninen

2010-03-04 22:55

developer   ~0034941

Doesn't help, sorry.
Also tried for curiosity QComboBox_addItem instead of QComboBox_insertItem but it didn't make any difference.

Zeljan Rikalo

2010-03-05 08:29

developer   ~0034945

Can you create non-LCL app with qt bindings and see is there similar problem with adding items ?

Juha Manninen

2010-03-05 08:38

developer   ~0034946

Sorry, how to make a non-LCL app with qt bindings?

Zeljan Rikalo

2010-03-05 10:16

developer   ~0034947

I've posted example to qt mailing list

Zeljan Rikalo

2010-03-07 09:21

developer   ~0034999

Seem that I reproduce this problem @home , Fedora 11 KDE-4.4 oxygen theme.
When I change theme to plastique problem is not visible (that's my devel machine default).

Zeljan Rikalo

2010-03-07 10:38

developer   ~0035003

@Juha can you test with this change:

procedure TQtComboBox.insertItem(AIndex: Integer; AText: PWideString);
  QComboBox_insertItem(QComboBoxH(WIdget), AIndex, AText, QVariant_create());


procedure TQtComboBox.insertItem(AIndex: Integer; AText: PWideString);
    QComboBox_insertItem(QComboBoxH(WIdget), AIndex, AText, QVariant_create());

Now I don't see items while added in oxygen theme (only current text).

Zeljan Rikalo

2010-03-07 11:47

developer   ~0035004

Test and close if ok.

Zeljan Rikalo

2010-03-07 11:48

developer   ~0035005

oops , wrong issue closed.

Juha Manninen

2010-03-10 10:41

developer   ~0035145

I modified insertItem and tested but still have the same problem.

At least it is good you have seen the problem now in one machine (your Fedora 11 KDE-4.4 with oxygen).

Zeljan Rikalo

2010-03-10 14:07

developer   ~0035177

It's visible on any fedora with qt-4.5/4.6 and oxygen theme (kde 4.3/4.4).
Can you start lazarus from terminal like this:
cd lazarus_directory
./lazarus -style plastique
./lazarus -style redmond
and see if it shows problem on slow machine with other themes ?

Juha Manninen

2010-03-10 16:18

developer   ~0035185

Amazing, it really helped! Actually oxygen is the only style that gives this error. I changed my default style now.

How to fix it? Maybe oxygen style should be fixed instead of QT-bindings.
It is little frightening that the problems can come from so many directions. They are difficult to track and to fix.

Zeljan Rikalo

2010-03-10 17:41

developer   ~0035189

Don't know yet, since I don't have enough time to dive into KDE sources and look for oxygen implementation. But you said that it doesn't happen with pure code (via qt bindings) instead of LCL, so there must be some problem with too many update calls while adding items or something like that.

Juha Manninen

2010-03-10 20:10

developer   ~0035198

Also remember my note in QT list mail:
"I didn't find the actual problem I was looking for. I noticed however that the
problem happens AFTER assigning stringlist to combobox items, not during the

There are some extra messages running around I guess.

Zeljan Rikalo

2010-03-17 13:50

developer   ~0035711

Test and close if ok.
Note that it will get some better performance (OnGetItems) when 0015948 is fixed.
I can see big diff with your example (vmware, Fedora 12).

Juha Manninen

2010-03-17 19:25

developer   ~0035721


Issue History

Date Modified Username Field Change
2010-03-03 14:24 Juha Manninen New Issue
2010-03-03 14:24 Juha Manninen File Added: ComboboxAnomaly.tar.gz
2010-03-03 14:24 Juha Manninen LazTarget => -
2010-03-03 14:24 Juha Manninen Widgetset => QT
2010-03-03 16:10 Zeljan Rikalo Note Added: 0034921
2010-03-03 16:10 Zeljan Rikalo Status new => feedback
2010-03-03 22:11 Juha Manninen Note Added: 0034924
2010-03-04 10:45 Zeljan Rikalo Note Added: 0034927
2010-03-04 10:56 Juha Manninen Note Edited: 0034924
2010-03-04 11:15 Zeljan Rikalo Status feedback => assigned
2010-03-04 11:15 Zeljan Rikalo Assigned To => Zeljan Rikalo
2010-03-04 11:26 Zeljan Rikalo File Added: comboboxinsertpolicy.diff
2010-03-04 11:26 Zeljan Rikalo Note Added: 0034930
2010-03-04 11:26 Zeljan Rikalo Status assigned => feedback
2010-03-04 22:55 Juha Manninen Note Added: 0034941
2010-03-05 08:29 Zeljan Rikalo Note Added: 0034945
2010-03-05 08:38 Juha Manninen Note Added: 0034946
2010-03-05 10:16 Zeljan Rikalo Note Added: 0034947
2010-03-07 09:21 Zeljan Rikalo Note Added: 0034999
2010-03-07 10:38 Zeljan Rikalo Note Added: 0035003
2010-03-07 11:47 Zeljan Rikalo Fixed in Revision => 23861
2010-03-07 11:47 Zeljan Rikalo Status feedback => resolved
2010-03-07 11:47 Zeljan Rikalo Resolution open => fixed
2010-03-07 11:47 Zeljan Rikalo Note Added: 0035004
2010-03-07 11:48 Zeljan Rikalo Note Added: 0035005
2010-03-07 11:48 Zeljan Rikalo Status resolved => feedback
2010-03-10 10:41 Juha Manninen Note Added: 0035145
2010-03-10 14:07 Zeljan Rikalo Note Added: 0035177
2010-03-10 14:07 Zeljan Rikalo Status feedback => confirmed
2010-03-10 16:18 Juha Manninen Note Added: 0035185
2010-03-10 17:41 Zeljan Rikalo Note Added: 0035189
2010-03-10 20:10 Juha Manninen Note Added: 0035198
2010-03-12 16:49 Vincent Snijders Resolution fixed => open
2010-03-17 13:50 Zeljan Rikalo Fixed in Revision 23861 => 23861,24062
2010-03-17 13:50 Zeljan Rikalo Status confirmed => resolved
2010-03-17 13:50 Zeljan Rikalo Resolution open => fixed
2010-03-17 13:50 Zeljan Rikalo Note Added: 0035711
2010-03-17 19:25 Juha Manninen Status resolved => closed
2010-03-17 19:25 Juha Manninen Note Added: 0035721