|
21 | 21 | #include "qgscomposerattributetablemodelv2.h"
|
22 | 22 | #include "qgsvectorlayer.h"
|
23 | 23 | #include "qgsfieldexpressionwidget.h"
|
| 24 | +#include "qgsdoublespinbox.h" |
24 | 25 | #include <QCheckBox>
|
25 | 26 | #include <QDialogButtonBox>
|
26 | 27 | #include <QGridLayout>
|
@@ -231,26 +232,27 @@ QWidget *QgsComposerColumnWidthDelegate::createEditor( QWidget *parent, const QS
|
231 | 232 | {
|
232 | 233 | Q_UNUSED( index );
|
233 | 234 | Q_UNUSED( option );
|
234 |
| - QDoubleSpinBox *editor = new QDoubleSpinBox( parent ); |
| 235 | + QgsDoubleSpinBox *editor = new QgsDoubleSpinBox( parent ); |
235 | 236 | editor->setMinimum( 0 );
|
236 | 237 | editor->setMaximum( 1000 );
|
237 | 238 | editor->setDecimals( 2 );
|
238 | 239 | editor->setSuffix( tr( " mm" ) );
|
239 | 240 | editor->setSpecialValueText( tr( "Automatic" ) );
|
| 241 | + editor->setShowClearButton( true ); |
240 | 242 | return editor;
|
241 | 243 | }
|
242 | 244 |
|
243 | 245 | void QgsComposerColumnWidthDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const
|
244 | 246 | {
|
245 | 247 | int value = index.model()->data( index, Qt::EditRole ).toInt();
|
246 | 248 |
|
247 |
| - QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>( editor ); |
| 249 | + QgsDoubleSpinBox *spinBox = static_cast<QgsDoubleSpinBox*>( editor ); |
248 | 250 | spinBox->setValue( value );
|
249 | 251 | }
|
250 | 252 |
|
251 | 253 | void QgsComposerColumnWidthDelegate::setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const
|
252 | 254 | {
|
253 |
| - QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>( editor ); |
| 255 | + QgsDoubleSpinBox *spinBox = static_cast<QgsDoubleSpinBox*>( editor ); |
254 | 256 | spinBox->interpretText();
|
255 | 257 | int value = spinBox->value();
|
256 | 258 |
|
|
0 commit comments