39 defaultTags.sort( Qt::CaseInsensitive );
40 mTags->addItems( defaultTags );
42 QList< QgsStyle::StyleEntity > possibleEntities;
46 this->setWindowTitle( tr(
"Save New Symbol" ) );
51 this->setWindowTitle( tr(
"Save New Color Ramp" ) );
56 this->setWindowTitle( tr(
"Save New Text Format" ) );
61 this->setWindowTitle( tr(
"Save New Label Settings" ) );
66 this->setWindowTitle( tr(
"Save New Legend Patch Shape" ) );
71 this->setWindowTitle( tr(
"Save New 3D Symbol" ) );
84 if ( styleProxyModel->rowCount( QModelIndex() ) == 0 )
86 mLabelDestination->hide();
87 mComboBoxDestination->hide();
92 mComboBoxDestination->setModel( styleProxyModel );
95 if ( possibleEntities.size() < 2 )
107 mComboSaveAs->addItem( tr(
"Symbol" ), e );
135 mComboSaveAs->setCurrentIndex( 0 );
141 return mName->text();
146 mTags->setCurrentText(
tags );
151 return mTags->currentText();
156 return mFavorite->isChecked();
161 if ( mComboSaveAs->count() > 0 )
169 if (
QgsStyle *style = qobject_cast< QgsStyle * >( mComboBoxDestination->model()->data( mComboBoxDestination->model()->index( mComboBoxDestination->currentIndex(), 0, QModelIndex() ),
QgsProjectStyleDatabaseModel::StyleRole ).value< QObject * >() ) )
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
List model representing the style databases associated with a QgsProject.
void setShowDefaultStyle(bool show)
Sets whether the default style should also be included in the model.
A proxy model for filtering QgsProjectStyleDatabaseModel.
void setFilters(QgsProjectStyleDatabaseProxyModel::Filters filters)
Sets the current filters used for filtering available styles.
@ FilterHideReadOnly
Hide read-only style databases.
static QgsProject * instance()
Returns the QgsProject singleton instance.
bool isFavorite() const
Returns true if the favorite is checked for the symbol.
QString name() const
Returns the entered name for the new symbol.
QgsStyle::StyleEntity selectedType() const
Returns the type of style entity to save.
void setDefaultTags(const QString &tags)
Sets the default tags for the newly created item.
QgsStyleSaveDialog(QWidget *parent=nullptr, QgsStyle::StyleEntity type=QgsStyle::SymbolEntity)
Constructor for QgsSymbolSaveDialog.
QString tags() const
Returns any tags entered for the new symbol (as a comma separated value list).
QgsStyle * destinationStyle()
Returns the destination style database.
QStringList tags() const
Returns a list of all tags in the style database.
StyleEntity
Enum for Entities involved in a style.
@ LabelSettingsEntity
Label settings.
@ TextFormatEntity
Text formats.
@ SmartgroupEntity
Smart groups.
@ Symbol3DEntity
3D symbol entity (since QGIS 3.14)
@ ColorrampEntity
Color ramps.
@ LegendPatchShapeEntity
Legend patch shape (since QGIS 3.14)
static QgsStyle * defaultStyle()
Returns default application-wide style.