[Qt] QT binding anomalies
zeljko
zeljko at holobit.net
Fri Mar 5 12:34:01 CET 2010
On Friday 05 March 2010 12:27, Juha Manninen wrote:
> Why do you need to create FDropList separately? Doesn't QT combobox provide
> its own list? I guess in real (C++) QT program you don't need to do that.
> I haven't really programmed with QT but I have compiled some programs and
> the code looks compact and clear (considering it is C++).
I told you that it's my test case for something (don't know what purpose), so
change code according your needs. No, you don't need separate FDropList.
You can reach items from QComboBox_view() abstract item view (which is
QListWidget afaik).
>
> Then I found :
> function TApp.ProgresEventFilter(Sender: QObjectH; Event: QEventH):
> Boolean;
>
> I added FillCombo() there like this:
>
> case QEvent_type(Event) of
> QEventFocusIn:
> begin
> writeln('COMBO IS FOCUSED !');
> FillCombo(qCombo);
> end;
>
> I really don't understand how it knows that the combobox gets focus and not
> some other control, but somehow it works.
just because progresEventFilter() hook is attached to combo box and not to
other controls , as i can see from my example only qCombo and one line edit
should trigger, but progressbar not since it's focuspolicy=QtNoFocus .
> Now more items get added to the combo-list every time it gets focus. (I
> didn't clear the old ones but for this test it is OK.)
> No flicker! It works like any other QT application, smoothly and nicely.
> I will not change my QT version or window manager after all. The problem is
> somewhere else.
>
> One important note: this combobox is fundamentally different from LCL
> combobox. The LCL version has an edit control, the QT version in this demo
> program does not. My problem is exactly in the edit control drawing.
> How to create a similar combobox with edit control?
QComboBox_setEditable(qCombo, True);
More information about the Qt
mailing list