[Qt] QT binding anomalies
Juha Manninen
juha.manninen at phnet.fi
Fri Mar 5 15:49:53 CET 2010
> 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).
Right, but your LCL binding code also has a separate FDropList. Actually I was
thinking of that when I asked my question.
function TQtComboBox.GetDropList: TQtListWidget;
begin
if FDropList = nil then
begin
FDropList := TQtListWidget.CreateFrom(LCLObject, QListWidget_create());
FDropList.setAttribute(QtWA_NoMousePropagation, False);
FDropList.OwnerDrawn := OwnerDrawn;
QComboBox_setModel(QComboBoxH(Widget), FDropList.getModel);
QComboBox_setView(QComboBoxH(Widget), QListWidgetH(FDropList.Widget));
end;
Result := FDropList;
end;
However, it seems to work in the qt only pascal app without blinking so is was
not the problem.
But, now I found a big (?) difference:
FLineEdit: TQtLineEdit;
FDropList: TQtListWidget;
So, there is not only a separate DropList but also a separate LineEdit !
Your qt only pascal app doesn't have it.
I feel we are nearing the essence of the problem... :-)
Why are those sub-controls separated if the QT control already provides them
built-in? I ask it because I don't know the code well. I am ready to
experiment with the LCL bindings code but I guess you have already tried the
obvious solutions and there was a problem and then you ended up with the
current solution.
There is also a variable:
FDropListVisibleInternal: Boolean;
which (I guess) means you were testing with both built-in and internal
DropLists.
> QComboBox_setEditable(qCombo, True);
Ok, right, it was so easy. It didn't change the behaviour though. Still no
flicker.
Regards,
Juha
More information about the Qt
mailing list