25 #include <QPushButton> 30 #include <QFileDialog> 35 if ( dialog.exec() == QDialog::Rejected )
44 switch ( geometrytype )
50 geomType =
"linestring";
56 geomType =
"multipoint";
59 geomType =
"multilinestring";
62 geomType =
"multipolygon";
68 QString layerProperties = QString(
"%1?crs=%2&memoryid=%3" ).arg( geomType ).arg( crsId ).arg( QUuid::createUuid().toString() );
75 : QDialog( parent, fl )
80 restoreGeometry( settings.value(
"/Windows/NewMemoryLayer/geometry" ).toByteArray() );
82 mPointRadioButton->setChecked(
true );
87 mCrsSelector->setCrs( defaultCrs );
89 mNameLineEdit->setText(
tr(
"New scratch layer" ) );
95 settings.setValue(
"/Windows/NewMemoryLayer/geometry", saveGeometry() );
100 if ( mPointRadioButton->isChecked() )
104 else if ( mLineRadioButton->isChecked() )
108 else if ( mPolygonRadioButton->isChecked() )
112 else if ( mMultiPointRadioButton->isChecked() )
116 else if ( mMultiLineRadioButton->isChecked() )
120 else if ( mMultiPolygonRadioButton->isChecked() )
129 return mCrsSelector->crs();
134 return mNameLineEdit->text();
QGis::WkbType selectedType() const
Returns the selected geometry type.
QgsNewMemoryLayerDialog(QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags)
WkbType
Used for symbology operations.
bool createFromOgcWmsCrs(QString theCrs)
Set up this CRS from the given OGC CRS.
QString layerName() const
Returns the layer name.
~QgsNewMemoryLayerDialog()
Class for storing a coordinate reference system (CRS)
QgsCoordinateReferenceSystem crs() const
Returns the selected crs.
static QgsVectorLayer * runAndCreateLayer(QWidget *parent=0)
Runs the dialoag and creates a new memory layer.
Represents a vector layer which manages a vector based data sets.
const CORE_EXPORT QString GEO_EPSG_CRS_AUTHID
Geographic coord sys from EPSG authority.