mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 02:20:35 +02:00
Qt: TToolBar should have QtTabFocus focuspolicy.Removed WSToolbar (native qt toolbar implementation) define.issue #19211
git-svn-id: trunk@30555 -
This commit is contained in:
parent
e8bc8ac225
commit
a40f6e162e
@ -188,18 +188,13 @@ type
|
|||||||
|
|
||||||
TQtWSToolButton = class(TWSToolButton)
|
TQtWSToolButton = class(TWSToolButton)
|
||||||
published
|
published
|
||||||
{$ifdef WSToolBar}
|
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TQtWSToolBar }
|
{ TQtWSToolBar }
|
||||||
|
|
||||||
TQtWSToolBar = class(TWSToolBar)
|
TQtWSToolBar = class(TWSToolBar)
|
||||||
published
|
published
|
||||||
{$ifdef WSToolBar}
|
|
||||||
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TQtWSTrackBar }
|
{ TQtWSTrackBar }
|
||||||
@ -226,6 +221,7 @@ type
|
|||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
const
|
const
|
||||||
TickMarkToQtSliderTickPositionMap: array[TTickMark] of QSliderTickPosition =
|
TickMarkToQtSliderTickPositionMap: array[TTickMark] of QSliderTickPosition =
|
||||||
(
|
(
|
||||||
@ -253,31 +249,23 @@ const
|
|||||||
{iaLeft} QListViewLeftToRight
|
{iaLeft} QListViewLeftToRight
|
||||||
);
|
);
|
||||||
|
|
||||||
{ TQtWSToolButton }
|
|
||||||
|
|
||||||
{$ifdef WSToolBar}
|
|
||||||
class function TQtWSToolButton.CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
|
||||||
var
|
|
||||||
QtToolButton: TQtToolButton;
|
|
||||||
begin
|
|
||||||
QtToolButton := TQtToolButton.Create(AWinControl, AParams);
|
|
||||||
QtToolButton.AttachEvents;
|
|
||||||
|
|
||||||
Result := TLCLIntfHandle(QtToolButton);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TQtWSToolBar }
|
{ TQtWSToolBar }
|
||||||
|
|
||||||
class function TQtWSToolBar.CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
class function TQtWSToolBar.CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
QtToolBar: TQtToolBar;
|
QtToolBar: TQtCustomControl;
|
||||||
begin
|
begin
|
||||||
QtToolBar := TQtToolBar.Create(AWinControl, AParams);
|
{$note TToolBar implementation under LCL is wrong. TToolBar isn't
|
||||||
|
TCustomControl but TWinControl.
|
||||||
|
To avoid theoretical crashes we use TQtCustomControl here, but indeed it
|
||||||
|
should be TQtWidget - so no viewport.}
|
||||||
|
QtToolBar := TQtCustomControl.Create(AWinControl, AParams);
|
||||||
|
QtToolBar.setFrameShape(QFrameNoFrame);
|
||||||
|
QtToolBar.viewportNeeded;
|
||||||
|
QtToolBar.setFocusPolicy(QtTabFocus);
|
||||||
QtToolBar.AttachEvents;
|
QtToolBar.AttachEvents;
|
||||||
|
|
||||||
Result := TLCLIntfHandle(QtToolBar);
|
Result := TLCLIntfHandle(QtToolBar);
|
||||||
end;
|
end;
|
||||||
{$endif}
|
|
||||||
|
|
||||||
{ TQtWSTrackBar }
|
{ TQtWSTrackBar }
|
||||||
|
|
||||||
|
@ -184,22 +184,13 @@ end;
|
|||||||
|
|
||||||
function RegisterCustomToolButton: Boolean; alias : 'WSRegisterCustomToolButton';
|
function RegisterCustomToolButton: Boolean; alias : 'WSRegisterCustomToolButton';
|
||||||
begin
|
begin
|
||||||
{$ifdef WSToolBar}
|
|
||||||
RegisterWSComponent(TCustomToolButton, TQtWSToolButton);
|
|
||||||
Result := True;
|
|
||||||
{$else}
|
|
||||||
Result := False;
|
Result := False;
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RegisterToolBar: Boolean; alias : 'WSRegisterToolBar';
|
function RegisterToolBar: Boolean; alias : 'WSRegisterToolBar';
|
||||||
begin
|
begin
|
||||||
{$ifdef WSToolBar}
|
RegisterWSComponent(TToolBar, TQtWSToolBar);
|
||||||
RegisterWSComponent(TCustomToolBar, TQtWSToolBar);
|
|
||||||
Result := True;
|
Result := True;
|
||||||
{$else}
|
|
||||||
Result := False;
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function RegisterCustomTrackBar: Boolean; alias : 'WSRegisterCustomTrackBar';
|
function RegisterCustomTrackBar: Boolean; alias : 'WSRegisterCustomTrackBar';
|
||||||
|
Loading…
Reference in New Issue
Block a user