mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-02-19 17:56:39 +01:00
Qt: Fixed AV's in qt IDE under darwin. Removed GetControlConstraints() completely unneeded by linux,darwin, win32.
git-svn-id: trunk@12521 -
This commit is contained in:
parent
7040ba14db
commit
175fed87a6
@ -154,66 +154,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: GetControlConstraints
|
||||
Params: Constraints: TObject
|
||||
Returns: true on success
|
||||
|
||||
Updates the constraints object (e.g. TSizeConstraints) with interface specific
|
||||
bounds.
|
||||
------------------------------------------------------------------------------}
|
||||
function TQtWidgetSet.GetControlConstraints(Constraints: TObject): boolean;
|
||||
var
|
||||
SizeConstraints: TSizeConstraints;
|
||||
MinWidth: Integer;
|
||||
MinHeight: Integer;
|
||||
MaxWidth: Integer;
|
||||
MaxHeight: Integer;
|
||||
SizeHint: TSize;
|
||||
Ct: TWinControl;
|
||||
begin
|
||||
Result := True;
|
||||
if Constraints is TSizeConstraints then
|
||||
begin
|
||||
|
||||
MinWidth := 0;
|
||||
MinHeight := 0;
|
||||
MaxWidth:=0;
|
||||
MaxHeight:=0;
|
||||
|
||||
SizeConstraints := TSizeConstraints(Constraints);
|
||||
|
||||
if (SizeConstraints.Control=nil) then exit;
|
||||
|
||||
if SizeConstraints.Control is TStatusBar then
|
||||
exit;
|
||||
|
||||
if SizeConstraints.Control is TWinControl then
|
||||
Ct := TWinControl(SizeConstraints.Control);
|
||||
|
||||
if Assigned(Ct) and ct.HandleAllocated then
|
||||
begin
|
||||
QWidget_minimumSize(TQtWidget(Ct.Handle).Widget, @SizeHint);
|
||||
|
||||
MinWidth := SizeHint.cx;
|
||||
MinHeight := SizeHint.cy;
|
||||
|
||||
if MinWidth < 0 then
|
||||
MinWidth := 0;
|
||||
if MinHeight < 0 then
|
||||
MinHeight := 0;
|
||||
|
||||
QWidget_maximumSize(TQtWidget(Ct.Handle).Widget, @SizeHint);
|
||||
|
||||
MaxWidth := SizeHint.cx;
|
||||
MaxHeight := SizeHint.cy;
|
||||
|
||||
SizeConstraints.SetInterfaceConstraints(MinWidth,MinHeight,
|
||||
MinWidth,MinHeight);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: IntfSendsUTF8KeyPress
|
||||
Params:
|
||||
|
||||
@ -36,8 +36,6 @@ procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
|
||||
function FontCanUTF8(Font: HFont): boolean; override;
|
||||
function FontIsMonoSpace(Font: HFont): boolean; override;
|
||||
|
||||
function GetControlConstraints(Constraints: TObject): boolean; override;
|
||||
|
||||
function IntfSendsUTF8KeyPress: boolean; override;
|
||||
|
||||
function PromptUser(const DialogCaption : string;
|
||||
|
||||
@ -2928,7 +2928,10 @@ end;
|
||||
|
||||
function TQtWidget.GetWidget: QWidgetH;
|
||||
begin
|
||||
Result := QWidgetH(TheObject);
|
||||
if TheObject <> nil then
|
||||
Result := QWidgetH(TheObject)
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TQtWidget.DeliverMessage(var Msg): LRESULT;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user