Skip to content
Permalink
Browse files

Add attribute dialog: Hide Length/Precision labels when unavailable

Fix #9259
  • Loading branch information
m-kuhn committed Dec 28, 2013
1 parent ca450cc commit 36d9d4bfa16ff6af6a036d321ad654be62f067ee
Showing with 5 additions and 3 deletions.
  1. +2 −0 src/app/qgsaddattrdialog.cpp
  2. +3 −3 src/ui/qgsaddattrdialogbase.ui
@@ -62,6 +62,7 @@ void QgsAddAttrDialog::on_mTypeBox_currentIndexChanged( int idx )
mLength->setMinimum( mTypeBox->itemData( idx, Qt::UserRole + 2 ).toInt() );
mLength->setMaximum( mTypeBox->itemData( idx, Qt::UserRole + 3 ).toInt() );
mLength->setVisible( mLength->minimum() < mLength->maximum() );
mLengthLabel->setVisible( mLength->minimum() < mLength->maximum() );
if ( mLength->value() < mLength->minimum() )
mLength->setValue( mLength->minimum() );
if ( mLength->value() > mLength->maximum() )
@@ -80,6 +81,7 @@ void QgsAddAttrDialog::setPrecisionMinMax()
int minPrecType = mTypeBox->itemData( idx, Qt::UserRole + 4 ).toInt();
int maxPrecType = mTypeBox->itemData( idx, Qt::UserRole + 5 ).toInt();
mPrec->setVisible( minPrecType < maxPrecType );
mPrecLabel->setVisible( minPrecType < maxPrecType );
mPrec->setMinimum( minPrecType );
mPrec->setMaximum( qMax( minPrecType, qMin( maxPrecType, mLength->value() ) ) );
}
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>267</width>
<height>235</height>
<height>267</height>
</rect>
</property>
<property name="windowTitle">
@@ -67,7 +67,7 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel2_2">
<widget class="QLabel" name="mLengthLabel">
<property name="text">
<string>Width</string>
</property>
@@ -80,7 +80,7 @@
<widget class="QSpinBox" name="mLength"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="textLabel2_3">
<widget class="QLabel" name="mPrecLabel">
<property name="text">
<string>Precision</string>
</property>

0 comments on commit 36d9d4b

Please sign in to comment.
You can’t perform that action at this time.