Skip to content

Instantly share code, notes, and snippets.

@slarosa
Created August 21, 2013 10:24
Show Gist options
  • Save slarosa/6292807 to your computer and use it in GitHub Desktop.
Save slarosa/6292807 to your computer and use it in GitHub Desktop.
QgsField::operator==
diff --git a/src/app/qgsaddattrdialog.cpp b/src/app/qgsaddattrdialog.cpp
index c21e204..b32cb00 100644
--- a/src/app/qgsaddattrdialog.cpp
+++ b/src/app/qgsaddattrdialog.cpp
@@ -61,7 +61,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() );
+ mLength->setEnabled( mLength->minimum() < mLength->maximum() );
if ( mLength->value() < mLength->minimum() )
mLength->setValue( mLength->minimum() );
if ( mLength->value() > mLength->maximum() )
@@ -79,7 +79,7 @@ void QgsAddAttrDialog::setPrecisionMinMax()
int idx = mTypeBox->currentIndex();
int minPrecType = mTypeBox->itemData( idx, Qt::UserRole + 4 ).toInt();
int maxPrecType = mTypeBox->itemData( idx, Qt::UserRole + 5 ).toInt();
- mPrec->setVisible( minPrecType < maxPrecType );
+ mPrec->setEnabled( minPrecType < maxPrecType );
if ( mPrec->isVisible() )
{
mPrec->setMinimum( minPrecType );
diff --git a/src/core/qgsfield.cpp b/src/core/qgsfield.cpp
index 180c00c..93a9a9b 100644
--- a/src/core/qgsfield.cpp
+++ b/src/core/qgsfield.cpp
@@ -43,7 +43,7 @@ QgsField::~QgsField()
bool QgsField::operator==( const QgsField& other ) const
{
return (( mName == other.mName ) && ( mType == other.mType )
- && ( mLength == other.mLength ) && ( mPrecision == other.mPrecision ) );
+ && ( mPrecision == other.mPrecision ) );
}
bool QgsField::operator!=( const QgsField& other ) const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment