Compare commits

..

2 Commits

Author SHA1 Message Date
Massimo Magnano
a87b5c814f Merge branch 'main' into 'main'
Solved GTK2 TMenuItem.Default property does not works #41528

See merge request freepascal.org/lazarus/lazarus!449
2025-04-03 22:21:19 +02:00
zeljan1
91fbaca370 Qt5,Qt6: Fixed QLineEdit behaviour and automatic selectAll() by Qt when control is focused.Related issue #10155 and issue #41562 2025-04-03 21:57:50 +02:00
2 changed files with 12 additions and 2 deletions

View File

@ -107,6 +107,7 @@ type
TQtWidget = class(TQtObject, IUnknown)
private
FDefaultFocusReason: QtFocusReason;
FInResizeEvent: boolean;
FWidgetState: TQtWidgetStates;
FWidgetDefaultFont: TQtFont;
@ -319,6 +320,7 @@ type
nil): QPixmapH;
property ChildOfComplexWidget: TChildOfComplexWidget read FChildOfComplexWidget write FChildOfComplexWidget;
property Context: HDC read GetContext;
property DefaultFocusReason: QtFocusReason read FDefaultFocusReason write FDefaultFocusReason;
property HasCaret: Boolean read FHasCaret write SetHasCaret;
property HasPaint: Boolean read FHasPaint write FHasPaint;
property InResizeEvent: boolean read FInResizeEvent write FInResizeEvent;
@ -2161,6 +2163,7 @@ end;
procedure TQtWidget.InitializeWidget;
begin
FDefaultFocusReason := QtTabFocusReason;
FInResizeEvent := False;
// default states
FWidgetState := [];
@ -5164,7 +5167,7 @@ end;
procedure TQtWidget.setFocus;
begin
if getFocusPolicy <> QtNoFocus then
QWidget_setFocus(Widget, QtTabFocusReason) {issue #10155}
QWidget_setFocus(Widget, FDefaultFocusReason) {issue #10155}
else
QWidget_setFocus(Widget);
end;
@ -9769,6 +9772,7 @@ begin
FCachedSelectionLen := -1;
FIntValidator := nil;
FNumbersOnly := False;
FDefaultFocusReason := QtOtherFocusReason;
if AParams.WndParent <> 0 then
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
else
@ -16412,6 +16416,7 @@ end;
procedure TQtMenu.InitializeWidget;
begin
FDefaultFocusReason := QtTabFocusReason;
FWidgetState := [];
ChildOfComplexWidget := ccwNone;
WidgetColorRole := QPaletteWindow;

View File

@ -107,6 +107,7 @@ type
TQtWidget = class(TQtObject, IUnknown)
private
FDefaultFocusReason: QtFocusReason;
FInResizeEvent: boolean;
FWidgetState: TQtWidgetStates;
FWidgetDefaultFont: TQtFont;
@ -316,6 +317,7 @@ type
nil): QPixmapH;
property ChildOfComplexWidget: TChildOfComplexWidget read FChildOfComplexWidget write FChildOfComplexWidget;
property Context: HDC read GetContext;
property DefaultFocusReason: QtFocusReason read FDefaultFocusReason write FDefaultFocusReason;
property HasCaret: Boolean read FHasCaret write SetHasCaret;
property HasPaint: Boolean read FHasPaint write FHasPaint;
property InResizeEvent: boolean read FInResizeEvent write FInResizeEvent;
@ -2158,6 +2160,7 @@ end;
procedure TQtWidget.InitializeWidget;
begin
FDefaultFocusReason := QtTabFocusReason;
FInResizeEvent := False;
// default states
FWidgetState := [];
@ -5168,7 +5171,7 @@ end;
procedure TQtWidget.setFocus;
begin
if getFocusPolicy <> QtNoFocus then
QWidget_setFocus(Widget, QtTabFocusReason) {issue #10155}
QWidget_setFocus(Widget, FDefaultFocusReason) {issue #10155}
else
QWidget_setFocus(Widget);
end;
@ -9725,6 +9728,7 @@ begin
FCachedSelectionLen := -1;
FIntValidator := nil;
FNumbersOnly := False;
FDefaultFocusReason := QtOtherFocusReason;
if AParams.WndParent <> 0 then
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
else
@ -16322,6 +16326,7 @@ end;
procedure TQtMenu.InitializeWidget;
begin
FDefaultFocusReason := QtTabFocusReason;
FWidgetState := [];
ChildOfComplexWidget := ccwNone;
WidgetColorRole := QPaletteWindow;