mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 07:58:37 +01:00
Qt: fixed inconsistency with win32,gtk2 and Delphi when setting SelStart.It shouldn't keep sellength. issue #11802
git-svn-id: trunk@35265 -
This commit is contained in:
parent
353087a643
commit
6758bba5e0
@ -984,15 +984,17 @@ class procedure TQtWSCustomEdit.SetSelStart(const ACustomEdit: TCustomEdit;
|
||||
var
|
||||
Widget: TQtWidget;
|
||||
QtEdit: IQtEdit;
|
||||
ALength: Integer;
|
||||
// ALength: Integer;
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACustomEdit, 'SetSelStart') then
|
||||
Exit;
|
||||
|
||||
Widget := TQtWidget(ACustomEdit.Handle);
|
||||
ALength := GetSelLength(ACustomEdit);
|
||||
// issue #11802, make qt consistent with gtk2 and win32.
|
||||
// Delphi docs says that setting selection start should reset sellength !
|
||||
// ALength := GetSelLength(ACustomEdit);
|
||||
if Supports(Widget, IQtEdit, QtEdit) then
|
||||
QtEdit.setSelection(NewStart, ALength);
|
||||
QtEdit.setSelection(NewStart, 0);
|
||||
end;
|
||||
|
||||
class procedure TQtWSCustomEdit.SetSelLength(const ACustomEdit: TCustomEdit;
|
||||
@ -1472,15 +1474,17 @@ class procedure TQtWSCustomComboBox.SetSelStart(const ACustomComboBox: TCustomCo
|
||||
var
|
||||
Widget: TQtWidget;
|
||||
QtEdit: IQtEdit;
|
||||
ALength: Integer;
|
||||
// ALength: Integer;
|
||||
begin
|
||||
if not WSCheckHandleAllocated(ACustomComboBox, 'SetSelStart') then
|
||||
Exit;
|
||||
|
||||
Widget := TQtWidget(ACustomComboBox.Handle);
|
||||
ALength := GetSelLength(ACustomComboBox);
|
||||
// issue #11802, make qt consistent with gtk2 and win32.
|
||||
// Delphi docs says that setting selection start should reset sellength !
|
||||
// ALength := GetSelLength(ACustomComboBox);
|
||||
if Supports(Widget, IQtEdit, QtEdit) then
|
||||
QtEdit.setSelection(NewStart, ALength);
|
||||
QtEdit.setSelection(NewStart, 0);
|
||||
end;
|
||||
|
||||
class procedure TQtWSCustomComboBox.SetSelLength(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user