qt5: implement combobox readonly

git-svn-id: branches/comboboxreadonly@63240 -
This commit is contained in:
dmitry 2020-05-28 14:21:42 +00:00
parent 02b7d44d7d
commit 6c358d11ef

View File

@ -90,6 +90,7 @@ type
class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
class procedure SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean); override;
class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
@ -1589,6 +1590,17 @@ begin
inherited SetStyle(ACustomComboBox, NewStyle);
end;
class procedure TQtWSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox; NewReadOnly: boolean);
var
LineEdit : TQtLineEdit;
begin
if not WSCheckHandleAllocated(ACustomComboBox, 'SetReadOnly') then
Exit;
LineEdit := TQtComboBox(ACustomComboBox.Handle).LineEdit;
if LineEdit <> nil then
LineEdit.setReadOnly(NewReadOnly);
end;
{------------------------------------------------------------------------------
Method: TQtWSCustomComboBox.GetItems
Params: None