Skip to content

Commit

Permalink
Attribute edit widgets LongLong support
Browse files Browse the repository at this point in the history
Fix #9145
  • Loading branch information
m-kuhn committed Dec 6, 2013
1 parent 3b81b1a commit b92e124
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/app/qgsattributetypedialog.cpp
Expand Up @@ -472,7 +472,8 @@ void QgsAttributeTypeDialog::setIndex( int index, QgsVectorLayer::EditType editT

QString text;
//calculate min and max for range for this field
if ( mLayer->pendingFields()[index].type() == QVariant::Int )
if ( mLayer->pendingFields()[index].type() == QVariant::Int
|| mLayer->pendingFields()[index].type() == QVariant::LongLong )
{
rangeWidget->clear();
rangeWidget->addItems( QStringList() << tr( "Editable" ) << tr( "Slider" ) << tr( "Dial" ) );
Expand Down Expand Up @@ -553,7 +554,8 @@ void QgsAttributeTypeDialog::setIndex( int index, QgsVectorLayer::EditType editT
case QgsVectorLayer::SliderRange:
case QgsVectorLayer::DialRange:
{
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Int )
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Int
|| mLayer->pendingFields()[mIndex].type() != QVariant::LongLong )
{
minimumSpinBox->setValue( mRangeData.mMin.toInt() );
maximumSpinBox->setValue( mRangeData.mMax.toInt() );
Expand Down Expand Up @@ -635,7 +637,8 @@ void QgsAttributeTypeDialog::setStackPage( int index )
{
case 2:
if ( mLayer->pendingFields()[mIndex].type() != QVariant::Double &&
mLayer->pendingFields()[mIndex].type() != QVariant::Int )
mLayer->pendingFields()[mIndex].type() != QVariant::Int &&
mLayer->pendingFields()[mIndex].type() != QVariant::LongLong )
{
okDisabled = true;
}
Expand Down Expand Up @@ -742,7 +745,8 @@ void QgsAttributeTypeDialog::accept()
break;
case 2:
//store range data
if ( mLayer->pendingFields()[mIndex].type() == QVariant::Int )
if ( mLayer->pendingFields()[mIndex].type() == QVariant::Int
|| mLayer->pendingFields()[mIndex].type() == QVariant::LongLong )
{
mRangeData = QgsVectorLayer::RangeData( minimumSpinBox->value(),
maximumSpinBox->value(),
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributeeditor.cpp
Expand Up @@ -510,7 +510,7 @@ QWidget* QgsAttributeEditor::createAttributeEditor( QWidget* parent, QWidget* ed
case QgsVectorLayer::SliderRange:
case QgsVectorLayer::EditRange:
{
if ( myFieldType == QVariant::Int )
if ( myFieldType == QVariant::Int || myFieldType == QVariant::LongLong )
{
int min = vl->range( idx ).mMin.toInt();
int max = vl->range( idx ).mMax.toInt();
Expand Down

0 comments on commit b92e124

Please sign in to comment.