mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:39:30 +02:00
Qt: workaround for #10706, stop events processing on DropList after combobox destroy called ...
git-svn-id: trunk@13910 -
This commit is contained in:
parent
17d475dec4
commit
a64bd53ce5
@ -621,6 +621,8 @@ type
|
|||||||
// used to store values if no selection
|
// used to store values if no selection
|
||||||
FSelStart: Integer;
|
FSelStart: Integer;
|
||||||
FSelLength: Integer;
|
FSelLength: Integer;
|
||||||
|
// stop event processing on droplist
|
||||||
|
FDynPropChanged: Boolean;
|
||||||
function GetDropList: TQtListWidget;
|
function GetDropList: TQtListWidget;
|
||||||
function GetLineEdit: QLineEditH;
|
function GetLineEdit: QLineEditH;
|
||||||
procedure SetOwnerDrawn(const AValue: Boolean);
|
procedure SetOwnerDrawn(const AValue: Boolean);
|
||||||
@ -5093,6 +5095,7 @@ begin
|
|||||||
WriteLn('TQtComboBox.Create');
|
WriteLn('TQtComboBox.Create');
|
||||||
{$endif}
|
{$endif}
|
||||||
Result := QComboBox_create();
|
Result := QComboBox_create();
|
||||||
|
FDynPropChanged := False;
|
||||||
FLineEdit := nil;
|
FLineEdit := nil;
|
||||||
FOwnerDrawn := False;
|
FOwnerDrawn := False;
|
||||||
end;
|
end;
|
||||||
@ -5297,7 +5300,18 @@ function TQtComboBox.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cde
|
|||||||
var
|
var
|
||||||
ev: QEventH;
|
ev: QEventH;
|
||||||
str: WideString;
|
str: WideString;
|
||||||
|
DynPropName: QByteArrayH;
|
||||||
|
DynPropChars: PAnsiChar;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := FDynPropChanged;
|
||||||
|
|
||||||
|
if Result then
|
||||||
|
begin
|
||||||
|
QEvent_accept(Event);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
BeginEventProcessing;
|
BeginEventProcessing;
|
||||||
if (FDropList <> nil) and (Sender = FDropList.Widget) then
|
if (FDropList <> nil) and (Sender = FDropList.Widget) then
|
||||||
begin
|
begin
|
||||||
@ -5306,6 +5320,24 @@ begin
|
|||||||
QEvent_accept(Event);
|
QEvent_accept(Event);
|
||||||
|
|
||||||
case QEvent_type(Event) of
|
case QEvent_type(Event) of
|
||||||
|
QEventDynamicPropertyChange:
|
||||||
|
begin
|
||||||
|
DynPropName := QByteArray_create();
|
||||||
|
try
|
||||||
|
QDynamicPropertyChangeEvent_propertyName(
|
||||||
|
QDynamicPropertyChangeEventH(Event), DynPropName);
|
||||||
|
DynPropChars := QByteArray_constData(DynPropName);
|
||||||
|
Str := '';
|
||||||
|
for i := 0 to QByteArray_length(DynPropName) - 1 do
|
||||||
|
begin
|
||||||
|
Str := Str + DynPropChars^;
|
||||||
|
inc(DynPropChars);
|
||||||
|
end;
|
||||||
|
FDynPropChanged := Str = 'lclwidget';
|
||||||
|
finally
|
||||||
|
QByteArray_destroy(DynPropName);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
QEventShow: SlotDropListVisibility(True);
|
QEventShow: SlotDropListVisibility(True);
|
||||||
QEventHide:
|
QEventHide:
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user