mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 02:12:35 +02:00
Qt: QDoubleSpinBox, QSpinBox do not deliver messages if InUpdate().
git-svn-id: trunk@22078 -
This commit is contained in:
parent
c96137c619
commit
8915c4816d
@ -6599,6 +6599,9 @@ begin
|
||||
QLineEdit_text(LineEdit, @Result)
|
||||
else
|
||||
Result := '';
|
||||
{$ifdef VerboseQt}
|
||||
WriteLn('TQtAbstractSpinBox.GetText Result=',Result);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function TQtAbstractSpinBox.getTextStatic: Boolean;
|
||||
@ -6619,6 +6622,9 @@ end;
|
||||
|
||||
procedure TQtAbstractSpinBox.setText(const W: WideString);
|
||||
begin
|
||||
{$ifdef VerboseQt}
|
||||
WriteLn('TQtAbstractSpinBox.SetText W=',w);
|
||||
{$endif}
|
||||
if (LineEdit <> nil) then
|
||||
QLineEdit_setText(LineEdit, @W)
|
||||
end;
|
||||
@ -6653,8 +6659,8 @@ begin
|
||||
press TabKey to select next control, but if we
|
||||
connect OnKeyDown and say eg. VK_RETURN: SelectNext(ActiveControl, true, true)
|
||||
then spinedit text is always selected, nothing important but looks ugly.}
|
||||
// Msg.Msg := LM_EXIT;
|
||||
// DeliverMessage(Msg);
|
||||
// Msg.Msg := LM_EXIT;
|
||||
// DeliverMessage(Msg);
|
||||
end;
|
||||
|
||||
{ TQtFloatSpinBox }
|
||||
@ -6717,7 +6723,8 @@ var
|
||||
begin
|
||||
FillChar(Msg, SizeOf(Msg), #0);
|
||||
Msg.Msg := CM_TEXTCHANGED;
|
||||
DeliverMessage(Msg);
|
||||
if not InUpdate then
|
||||
DeliverMessage(Msg);
|
||||
end;
|
||||
|
||||
{ TQtSpinBox }
|
||||
@ -6775,7 +6782,8 @@ var
|
||||
begin
|
||||
FillChar(Msg, SizeOf(Msg), #0);
|
||||
Msg.Msg := CM_TEXTCHANGED;
|
||||
DeliverMessage(Msg);
|
||||
if not InUpdate then
|
||||
DeliverMessage(Msg);
|
||||
end;
|
||||
|
||||
function TQtListWidget.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||
|
@ -70,13 +70,18 @@ class procedure TQtWSCustomFloatSpinEdit.InternalUpdateControl(
|
||||
const ASpinWidget: TQtAbstractSpinBox;
|
||||
const ACustomFloatSpinEdit: TCustomFloatSpinEdit);
|
||||
begin
|
||||
if ASpinWidget is TQtFloatSpinBox then
|
||||
TQtFloatSpinBox(ASpinWidget).setDecimals(ACustomFloatSpinEdit.DecimalPlaces);
|
||||
ASpinWidget.BeginUpdate;
|
||||
try
|
||||
if ASpinWidget is TQtFloatSpinBox then
|
||||
TQtFloatSpinBox(ASpinWidget).setDecimals(ACustomFloatSpinEdit.DecimalPlaces);
|
||||
|
||||
ASpinWidget.setValue(ACustomFloatSpinEdit.Value);
|
||||
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
||||
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
||||
ASpinWidget.setSingleStep(ACustomFloatSpinEdit.Increment);
|
||||
ASpinWidget.setValue(ACustomFloatSpinEdit.Value);
|
||||
ASpinWidget.setMinimum(ACustomFloatSpinEdit.MinValue);
|
||||
ASpinWidget.setMaximum(ACustomFloatSpinEdit.MaxValue);
|
||||
ASpinWidget.setSingleStep(ACustomFloatSpinEdit.Increment);
|
||||
finally
|
||||
ASpinWidget.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user