Skip to content

Commit b92e124

Browse files
committed
Attribute edit widgets LongLong support
Fix #9145
1 parent 3b81b1a commit b92e124

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/app/qgsattributetypedialog.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ void QgsAttributeTypeDialog::setIndex( int index, QgsVectorLayer::EditType editT
472472

473473
QString text;
474474
//calculate min and max for range for this field
475-
if ( mLayer->pendingFields()[index].type() == QVariant::Int )
475+
if ( mLayer->pendingFields()[index].type() == QVariant::Int
476+
|| mLayer->pendingFields()[index].type() == QVariant::LongLong )
476477
{
477478
rangeWidget->clear();
478479
rangeWidget->addItems( QStringList() << tr( "Editable" ) << tr( "Slider" ) << tr( "Dial" ) );
@@ -553,7 +554,8 @@ void QgsAttributeTypeDialog::setIndex( int index, QgsVectorLayer::EditType editT
553554
case QgsVectorLayer::SliderRange:
554555
case QgsVectorLayer::DialRange:
555556
{
556-
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Int )
557+
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Int
558+
|| mLayer->pendingFields()[mIndex].type() != QVariant::LongLong )
557559
{
558560
minimumSpinBox->setValue( mRangeData.mMin.toInt() );
559561
maximumSpinBox->setValue( mRangeData.mMax.toInt() );
@@ -635,7 +637,8 @@ void QgsAttributeTypeDialog::setStackPage( int index )
635637
{
636638
case 2:
637639
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Double &&
638-
mLayer->pendingFields()[mIndex].type() != QVariant::Int )
640+
mLayer->pendingFields()[mIndex].type() != QVariant::Int &&
641+
mLayer->pendingFields()[mIndex].type() != QVariant::LongLong )
639642
{
640643
okDisabled = true;
641644
}
@@ -742,7 +745,8 @@ void QgsAttributeTypeDialog::accept()
742745
break;
743746
case 2:
744747
//store range data
745-
if ( mLayer->pendingFields()[mIndex].type() == QVariant::Int )
748+
if ( mLayer->pendingFields()[mIndex].type() == QVariant::Int
749+
|| mLayer->pendingFields()[mIndex].type() == QVariant::LongLong )
746750
{
747751
mRangeData = QgsVectorLayer::RangeData( minimumSpinBox->value(),
748752
maximumSpinBox->value(),

src/gui/qgsattributeeditor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
510510
case QgsVectorLayer::SliderRange:
511511
case QgsVectorLayer::EditRange:
512512
{
513-
if ( myFieldType == QVariant::Int )
513+
if ( myFieldType == QVariant::Int || myFieldType == QVariant::LongLong )
514514
{
515515
int min = vl->range( idx ).mMin.toInt();
516516
int max = vl->range( idx ).mMax.toInt();

0 commit comments

Comments
 (0)