Skip to content

Commit a3ed6cb

Browse files
nirvnnyalldawson
authored andcommitted
[gui] Fix cursor jump when editing row/column width of a cell in the table designer
(fixes qgis#50257)
1 parent 51648de commit a3ed6cb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/gui/editorwidgets/qgsdoublespinbox.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ void QgsDoubleSpinBox::clear()
128128

129129
void QgsDoubleSpinBox::setClearValue( double customValue, const QString &specialValueText )
130130
{
131+
if ( mClearValueMode == CustomValue && mCustomClearValue == customValue && QAbstractSpinBox::specialValueText() == specialValueText )
132+
{
133+
return;
134+
}
135+
131136
mClearValueMode = CustomValue;
132137
mCustomClearValue = customValue;
133138

@@ -142,6 +147,11 @@ void QgsDoubleSpinBox::setClearValue( double customValue, const QString &special
142147

143148
void QgsDoubleSpinBox::setClearValueMode( QgsDoubleSpinBox::ClearValueMode mode, const QString &clearValueText )
144149
{
150+
if ( mClearValueMode == mode && mCustomClearValue == 0 && QAbstractSpinBox::specialValueText() == clearValueText )
151+
{
152+
return;
153+
}
154+
145155
mClearValueMode = mode;
146156
mCustomClearValue = 0;
147157

src/gui/editorwidgets/qgsspinbox.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ void QgsSpinBox::clear()
124124

125125
void QgsSpinBox::setClearValue( int customValue, const QString &specialValueText )
126126
{
127+
if ( mClearValueMode == CustomValue && mCustomClearValue == customValue && QAbstractSpinBox::specialValueText() == specialValueText )
128+
{
129+
return;
130+
}
131+
127132
mClearValueMode = CustomValue;
128133
mCustomClearValue = customValue;
129134

@@ -138,6 +143,11 @@ void QgsSpinBox::setClearValue( int customValue, const QString &specialValueText
138143

139144
void QgsSpinBox::setClearValueMode( QgsSpinBox::ClearValueMode mode, const QString &specialValueText )
140145
{
146+
if ( mClearValueMode == mode && mCustomClearValue == 0 && QAbstractSpinBox::specialValueText() == specialValueText )
147+
{
148+
return;
149+
}
150+
141151
mClearValueMode = mode;
142152
mCustomClearValue = 0;
143153

0 commit comments

Comments
 (0)