30 case QVariant::LongLong:
32 rangeStackedWidget->setCurrentIndex( 0 );
35 rangeWidget->addItem(
tr(
"Editable" ),
"SpinBox" );
36 rangeWidget->addItem(
tr(
"Slider" ),
"Slider" );
37 rangeWidget->addItem(
tr(
"Dial" ),
"Dial" );
42 text =
tr(
"Current minimum for this value is %1 and current maximum is %2." ).arg( min.toString() ).arg( max.toString() );
46 case QVariant::Double:
48 rangeStackedWidget->setCurrentIndex( 1 );
51 rangeWidget->addItem(
tr(
"Editable" ),
"SpinBox" );
52 rangeWidget->addItem(
tr(
"Slider" ),
"Slider" );
57 text =
tr(
"Current minimum for this value is %1 and current maximum is %2." ).arg( min.toString() ).arg( max.toString() );
63 text =
tr(
"Attribute has no integer or real type, therefore range is not usable." );
68 valuesLabel->setText( text );
70 connect( rangeWidget, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
rangeWidgetChanged(
int ) ) );
77 switch (
layer()->pendingFields()[
field()].type() )
80 case QVariant::LongLong:
81 cfg.insert(
"Min", minimumSpinBox->value() );
82 cfg.insert(
"Max", maximumSpinBox->value() );
83 cfg.insert(
"Step", stepSpinBox->value() );
86 case QVariant::Double:
87 cfg.insert(
"Min", minimumDoubleSpinBox->value() );
88 cfg.insert(
"Max", maximumDoubleSpinBox->value() );
89 cfg.insert(
"Step", stepDoubleSpinBox->value() );
96 cfg.insert(
"Style", rangeWidget->itemData( rangeWidget->currentIndex() ).toString() );
97 cfg.insert(
"AllowNull", allowNullCheckBox->isChecked() );
99 if ( suffixLineEdit->text() !=
"" )
101 cfg.insert(
"Suffix", suffixLineEdit->text() );
109 minimumDoubleSpinBox->setValue( config.value(
"Min", 0.0 ).toDouble() );
110 maximumDoubleSpinBox->setValue( config.value(
"Max", 5.0 ).toDouble() );
111 stepDoubleSpinBox->setValue( config.value(
"Step", 1.0 ).toDouble() );
113 minimumSpinBox->setValue( config.value(
"Min", 0 ).toInt() );
114 maximumSpinBox->setValue( config.value(
"Max", 5 ).toInt() );
115 stepSpinBox->setValue( config.value(
"Step", 1 ).toInt() );
117 rangeWidget->setCurrentIndex( rangeWidget->findData( config.value(
"Style",
"SpinBox" ) ) );
119 suffixLineEdit->setText( config.value(
"Suffix" ).toString() );
121 allowNullCheckBox->setChecked( config.value(
"AllowNull",
true ).toBool() );
126 QString style = rangeWidget->itemData( index ).toString();
127 allowNullCheckBox->setEnabled( style ==
"SpinBox" );