26 #include <QPushButton> 31 #include <QFileDialog> 36 if ( dialog.
exec() == QDialog::Rejected )
44 switch ( geometrytype )
50 geomType =
"linestring";
56 geomType =
"multipoint";
59 geomType =
"multilinestring";
62 geomType =
"multipolygon";
89 mPointRadioButton->setChecked(
true );
93 mCrsSelector->setCrs( defaultCrs );
95 mNameLineEdit->setText(
tr(
"New scratch layer" ) );
106 if ( !buttonGroupGeometry->isChecked() )
110 else if ( mPointRadioButton->isChecked() )
114 else if ( mLineRadioButton->isChecked() )
118 else if ( mPolygonRadioButton->isChecked() )
122 else if ( mMultiPointRadioButton->isChecked() )
126 else if ( mMultiLineRadioButton->isChecked() )
130 else if ( mMultiPolygonRadioButton->isChecked() )
139 return mCrsSelector->crs();
144 return mNameLineEdit->text();
QByteArray toByteArray() const
QgsNewMemoryLayerDialog(QWidget *parent=nullptr, const Qt::WindowFlags &fl=QgisGui::ModalDialogFlags)
QgsCoordinateReferenceSystem crs() const
Returns the selected crs.
QString & append(QChar ch)
QgsCoordinateReferenceSystem crsByOgcWmsCrs(const QString &ogcCrs) const
Returns the CRS from a given OGC WMS-format Coordinate Reference System string.
void validate()
Perform some validation on this CRS.
static QgsVectorLayer * runAndCreateLayer(QWidget *parent=nullptr)
Runs the dialoag and creates a new memory layer.
WkbType
Used for symbology operations.
QString tr(const char *sourceText, const char *disambiguation, int n)
void setValue(const QString &key, const QVariant &value)
const char * name() const
QGis::WkbType selectedType() const
Returns the selected geometry type.
const QString GEO_EPSG_CRS_AUTHID
Geographic coord sys from EPSG authority.
QVariant value(const QString &key, const QVariant &defaultValue) const
~QgsNewMemoryLayerDialog()
Class for storing a coordinate reference system (CRS)
Represents a vector layer which manages a vector based data sets.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
static QgsCRSCache * instance()
Returns a pointer to the QgsCRSCache singleton.
QString authid() const
Returns the authority identifier for the CRS, which includes both the authority (eg EPSG) and the CRS...
QString layerName() const
Returns the layer name.