mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 04:49:40 +02:00
Merged revision(s) 51114 #b538c367a2, 51264 #9f6df04a52, 51302 #07d5c8bea6 from trunk:
Qt: do not restore hints which are not visible by lcl. ........ Qt: fixed compilation with QTOPIA define. issue #29379 ........ QT: Fix T(Float)SpinEdit OnChange. Issue #0029343. ........ git-svn-id: branches/fixes_1_6@51322 -
This commit is contained in:
parent
bebbb5aa73
commit
21b33a482c
@ -235,7 +235,7 @@ begin
|
||||
|
||||
if not FIsLibraryInstance then
|
||||
begin
|
||||
{$IFDEF HAIKU}
|
||||
{$IF DEFINED(HAIKU) OR DEFINED(QTOPIA)}
|
||||
FAppSessionQuit := nil;
|
||||
FAppSaveSessionRequest := nil;
|
||||
{$ELSE}
|
||||
@ -1155,7 +1155,7 @@ begin
|
||||
' errorInteraction ',dbgs(QSessionManager_allowsErrorInteraction(sessionManager)),
|
||||
' phase2 ',dbgs(QSessionManager_isPhase2(sessionManager)));
|
||||
{$ENDIF}
|
||||
{$IFNDEF HAIKU}
|
||||
{$IF NOT DEFINED(HAIKU) AND NOT DEFINED(QTOPIA)}
|
||||
// if session manager does not allow interaction, then we close app without any intf calls
|
||||
if QSessionManager_allowsInteraction(sessionManager) then
|
||||
begin
|
||||
@ -1425,7 +1425,8 @@ begin
|
||||
if IsValidHintHandle(TObject(SavedHintHandlesList.Items[i])) then
|
||||
begin
|
||||
AWidget := TQtHintWindow(SavedHintHandlesList.Items[i]);
|
||||
AWidget.NeedRestoreVisible := AWidget.getVisible;
|
||||
AWidget.NeedRestoreVisible := AWidget.getVisible and
|
||||
Assigned(AWidget.LCLObject) and AWidget.LCLObject.Visible;
|
||||
AWidget.Hide;
|
||||
end;
|
||||
end;
|
||||
@ -1448,7 +1449,8 @@ begin
|
||||
if IsValidHintHandle(TObject(SavedHintHandlesList.Items[i])) then
|
||||
begin
|
||||
AWidget := TQtHintWindow(SavedHintHandlesList.Items[i]);
|
||||
if AWidget.NeedRestoreVisible then
|
||||
if AWidget.NeedRestoreVisible and Assigned(AWidget.LCLObject) and
|
||||
AWIdget.LCLObject.Visible then
|
||||
begin
|
||||
AWidget.NeedRestoreVisible := False;
|
||||
AWidget.Show;
|
||||
|
@ -1066,8 +1066,10 @@ type
|
||||
{$ENDIF}
|
||||
FEditingFinishedHook: QAbstractSpinBox_hookH;
|
||||
FLineEditHook: QObject_hookH;
|
||||
FTextChangedHook: QLineEdit_hookH;
|
||||
// parts
|
||||
FLineEdit: QLineEditH;
|
||||
FTextChangedByValueChanged: Boolean;
|
||||
function GetLineEdit: QLineEditH;
|
||||
function LineEditEventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||
protected
|
||||
@ -1082,10 +1084,12 @@ type
|
||||
procedure setMaxLength(const ALength: Integer);
|
||||
procedure setSelection(const AStart, ALength: Integer);
|
||||
procedure setCursorPosition(const ACursorPosition: Integer);
|
||||
procedure SignalLineEditTextChanged(AnonParam1: PWideString); virtual; cdecl;
|
||||
procedure Cut;
|
||||
procedure Copy;
|
||||
procedure Paste;
|
||||
procedure Undo;
|
||||
property TextChangedByValueChanged: Boolean read FTextChangedByValueChanged write FTextChangedByValueChanged;
|
||||
public
|
||||
function getValue: Double; virtual; abstract;
|
||||
function getReadOnly: Boolean;
|
||||
@ -10923,6 +10927,8 @@ begin
|
||||
begin
|
||||
FLineEditHook := QObject_hook_create(FLineEdit);
|
||||
QObject_hook_hook_events(FLineEditHook, @LineEditEventFilter);
|
||||
FTextChangedHook := QLineEdit_hook_create(FLineEdit);
|
||||
QLineEdit_hook_hook_textChanged(FTextChangedHook, @SignalLineEditTextChanged);
|
||||
end;
|
||||
Result := FLineEdit;
|
||||
end;
|
||||
@ -10936,6 +10942,21 @@ begin
|
||||
Result := EventFilter(QWidgetH(Sender), Event);
|
||||
end;
|
||||
|
||||
procedure TQtAbstractSpinBox.SignalLineEditTextChanged(AnonParam1: PWideString); cdecl;
|
||||
var
|
||||
Msg: TLMessage;
|
||||
begin
|
||||
if FTextChangedByValueChanged then
|
||||
begin
|
||||
FTextChangedByValueChanged := False;
|
||||
Exit;
|
||||
end;
|
||||
FillChar(Msg{%H-}, SizeOf(Msg), #0);
|
||||
Msg.Msg := CM_TEXTCHANGED;
|
||||
if not InUpdate then
|
||||
DeliverMessage(Msg);
|
||||
end;
|
||||
|
||||
function TQtAbstractSpinBox.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||
var
|
||||
Parent: QWidgetH;
|
||||
@ -10949,6 +10970,7 @@ begin
|
||||
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
|
||||
else
|
||||
Parent := nil;
|
||||
FTextChangedByValueChanged := False;
|
||||
Result := QAbstractSpinBox_create(Parent);
|
||||
end;
|
||||
|
||||
@ -11134,6 +11156,12 @@ begin
|
||||
QObject_hook_destroy(FLineEditHook);
|
||||
FLineEditHook := nil;
|
||||
end;
|
||||
|
||||
if FTextChangedHook <> nil then
|
||||
begin
|
||||
QLineEdit_hook_destroy(FTextChangedHook);
|
||||
FTextChangedHook := nil;
|
||||
end;
|
||||
|
||||
inherited DetachEvents;
|
||||
end;
|
||||
@ -11265,6 +11293,7 @@ var
|
||||
Msg: TLMessage;
|
||||
begin
|
||||
FValue := p1;
|
||||
FTextChangedByValueChanged := True;
|
||||
FillChar(Msg{%H-}, SizeOf(Msg), #0);
|
||||
Msg.Msg := CM_TEXTCHANGED;
|
||||
if not InUpdate then
|
||||
@ -11340,10 +11369,11 @@ var
|
||||
Msg: TLMessage;
|
||||
begin
|
||||
FValue := p1;
|
||||
FTextChangedByValueChanged := True;
|
||||
FillChar(Msg{%H-}, SizeOf(Msg), #0);
|
||||
Msg.Msg := CM_TEXTCHANGED;
|
||||
if not InUpdate then
|
||||
DeliverMessage(Msg);
|
||||
DeliverMessage(Msg);
|
||||
end;
|
||||
|
||||
{ TQtListView }
|
||||
|
Loading…
Reference in New Issue
Block a user