Qt,Qt5,Qt6: fixed wierd focus behaviour. issue #10155

This commit is contained in:
Željan Rikalo 2024-03-08 20:33:35 +01:00
parent d2e0bdee01
commit 559078741e
3 changed files with 6 additions and 6 deletions

View File

@ -5002,7 +5002,7 @@ end;
procedure TQtWidget.setFocus;
begin
if getFocusPolicy <> QtNoFocus then
QWidget_setFocus(Widget, QtTabFocusReason)
QWidget_setFocus(Widget, QtOtherFocusReason) {issue #10155}
else
QWidget_setFocus(Widget);
end;
@ -12615,7 +12615,7 @@ begin
begin
// issue #40089
if {(ViewStyle < 0) and} (QEvent_type(Event) = QEventFocusIn) and
(QFocusEvent_reason(QFocusEventH(Event)) = QtTabFocusReason) and
(QFocusEvent_reason(QFocusEventH(Event)) >= QtTabFocusReason) and
(TCustomListBox(LCLObject).ItemIndex = -1) then
begin
Result := True;

View File

@ -5093,7 +5093,7 @@ end;
procedure TQtWidget.setFocus;
begin
if getFocusPolicy <> QtNoFocus then
QWidget_setFocus(Widget, QtTabFocusReason)
QWidget_setFocus(Widget, QtOtherFocusReason) {issue #10155}
else
QWidget_setFocus(Widget);
end;
@ -12900,7 +12900,7 @@ begin
begin
// issue #40089
if {(ViewStyle < 0) and} (QEvent_type(Event) = QEventFocusIn) and
(QFocusEvent_reason(QFocusEventH(Event)) = QtTabFocusReason) and
(QFocusEvent_reason(QFocusEventH(Event)) >= QtTabFocusReason) and
(TCustomListBox(LCLObject).ItemIndex = -1) then
begin
Result := True;

View File

@ -5100,7 +5100,7 @@ end;
procedure TQtWidget.setFocus;
begin
if getFocusPolicy <> QtNoFocus then
QWidget_setFocus(Widget, QtTabFocusReason)
QWidget_setFocus(Widget, QtOtherFocusReason) {issue #10155}
else
QWidget_setFocus(Widget);
end;
@ -12932,7 +12932,7 @@ begin
begin
// issue #40089
if {(ViewStyle < 0) and} (QEvent_type(Event) = QEventFocusIn) and
(QFocusEvent_reason(QFocusEventH(Event)) = QtTabFocusReason) and
(QFocusEvent_reason(QFocusEventH(Event)) >= QtTabFocusReason) and
(TCustomListBox(LCLObject).ItemIndex = -1) then
begin
Result := True;