Skip to content

Commit

Permalink
Add icon to field type combobox items
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Dec 15, 2017
1 parent 32b7c53 commit c1cebd9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsnewspatialitelayerdialog.cpp
Expand Up @@ -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" ) );
Expand Down
12 changes: 6 additions & 6 deletions src/gui/qgsnewgeopackagelayerdialog.cpp
Expand Up @@ -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 );
Expand Down
9 changes: 5 additions & 4 deletions src/gui/qgsnewvectorlayerdialog.cpp
Expand Up @@ -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 ) );
Expand Down

0 comments on commit c1cebd9

Please sign in to comment.