Skip to content
Permalink
Browse files

Add icon to field type combobox items

  • Loading branch information
DelazJ authored and nyalldawson committed Dec 8, 2017
1 parent 32b7c53 commit c1cebd98d2aa13b2d92453adec3baa4e2ef0351c
@@ -71,9 +71,9 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W

mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewAttribute.svg" ) ) );
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteAttribute.svg" ) ) );
mTypeBox->addItem( tr( "Text data" ), "text" );
mTypeBox->addItem( tr( "Whole number" ), "integer" );
mTypeBox->addItem( tr( "Decimal number" ), "real" );
mTypeBox->addItem( QIcon( path + "/mIconFieldText.svg" ), tr( "Text data" ), "text" );
mTypeBox->addItem( QIcon( path + "/mIconFieldInteger.svg" ), tr( "Whole number" ), "integer" );
mTypeBox->addItem( QIcon( path + "/mIconFieldFloat.svg" ), tr( "Decimal number" ), "real" );

// Populate the database list from the stored connections
settings.beginGroup( QStringLiteral( "SpatiaLite/connections" ) );
@@ -88,12 +88,12 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W
mCheckBoxCreateSpatialIndex->setEnabled( false );
mCrsSelector->setEnabled( false );

mFieldTypeBox->addItem( tr( "Text data" ), "text" );
mFieldTypeBox->addItem( tr( "Whole number (integer)" ), "integer" );
mFieldTypeBox->addItem( tr( "Whole number (integer 64 bit)" ), "integer64" );
mFieldTypeBox->addItem( tr( "Decimal number (real)" ), "real" );
mFieldTypeBox->addItem( tr( "Date" ), "date" );
mFieldTypeBox->addItem( tr( "Date&time" ), "datetime" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldText.svg" ), tr( "Text data" ), "text" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldInteger.svg" ), tr( "Whole number (integer)" ), "integer" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldInteger.svg" ), tr( "Whole number (integer 64 bit)" ), "integer64" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldFloat.svg" ), tr( "Decimal number (real)" ), "real" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldDate.svg" ), tr( "Date" ), "date" );
mFieldTypeBox->addItem( QIcon( path + "/mIconFieldDateTime.svg" ), tr( "Date&time" ), "datetime" );

mOkButton = buttonBox->button( QDialogButtonBox::Ok );
mOkButton->setEnabled( false );
@@ -48,10 +48,11 @@ QgsNewVectorLayerDialog::QgsNewVectorLayerDialog( QWidget *parent, Qt::WindowFla

mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewAttribute.svg" ) ) );
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionDeleteAttribute.svg" ) ) );
mTypeBox->addItem( tr( "Text data" ), "String" );
mTypeBox->addItem( tr( "Whole number" ), "Integer" );
mTypeBox->addItem( tr( "Decimal number" ), "Real" );
mTypeBox->addItem( tr( "Date" ), "Date" );
QString path = QgsApplication::defaultThemePath();
mTypeBox->addItem( QIcon( path + "/mIconFieldText.svg" ), tr( "Text data" ), "String" );
mTypeBox->addItem( QIcon( path + "/mIconFieldInteger.svg" ), tr( "Whole number" ), "Integer" );
mTypeBox->addItem( QIcon( path + "/mIconFieldFloat.svg" ), tr( "Decimal number" ), "Real" );
mTypeBox->addItem( QIcon( path + "/mIconFieldDate.svg" ), tr( "Date" ), "Date" );

mWidth->setValidator( new QIntValidator( 1, 255, this ) );
mPrecision->setValidator( new QIntValidator( 0, 15, this ) );

0 comments on commit c1cebd9

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