Skip to content

Commit 721cab1

Browse files
committedSep 25, 2014
[composer] Switch attribute table column dialog over to QgsDoubleSpinBox
1 parent 272b79b commit 721cab1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/app/composer/qgsattributeselectiondialog.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgscomposerattributetablemodelv2.h"
2222
#include "qgsvectorlayer.h"
2323
#include "qgsfieldexpressionwidget.h"
24+
#include "qgsdoublespinbox.h"
2425
#include <QCheckBox>
2526
#include <QDialogButtonBox>
2627
#include <QGridLayout>
@@ -231,26 +232,27 @@ QWidget *QgsComposerColumnWidthDelegate::createEditor( QWidget *parent, const QS
231232
{
232233
Q_UNUSED( index );
233234
Q_UNUSED( option );
234-
QDoubleSpinBox *editor = new QDoubleSpinBox( parent );
235+
QgsDoubleSpinBox *editor = new QgsDoubleSpinBox( parent );
235236
editor->setMinimum( 0 );
236237
editor->setMaximum( 1000 );
237238
editor->setDecimals( 2 );
238239
editor->setSuffix( tr( " mm" ) );
239240
editor->setSpecialValueText( tr( "Automatic" ) );
241+
editor->setShowClearButton( true );
240242
return editor;
241243
}
242244

243245
void QgsComposerColumnWidthDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const
244246
{
245247
int value = index.model()->data( index, Qt::EditRole ).toInt();
246248

247-
QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>( editor );
249+
QgsDoubleSpinBox *spinBox = static_cast<QgsDoubleSpinBox*>( editor );
248250
spinBox->setValue( value );
249251
}
250252

251253
void QgsComposerColumnWidthDelegate::setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const
252254
{
253-
QDoubleSpinBox *spinBox = static_cast<QDoubleSpinBox*>( editor );
255+
QgsDoubleSpinBox *spinBox = static_cast<QgsDoubleSpinBox*>( editor );
254256
spinBox->interpretText();
255257
int value = spinBox->value();
256258

0 commit comments

Comments
 (0)
Please sign in to comment.