15#ifndef QGSPROJECTSTYLESETTINGS_H
16#define QGSPROJECTSTYLESETTINGS_H
23#include <QAbstractListModel>
24#include <QSortFilterProxyModel>
130 void removeProjectStyle();
150 bool readXml(
const QDomElement &element,
const QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
175 QList< QgsStyle * > styles()
const;
180 QgsStyle *styleAtPath(
const QString &path );
194 void addStyleDatabasePath(
const QString &path );
208 void setStyleDatabasePaths(
const QStringList &paths );
271 std::unique_ptr< QgsSymbol > mDefaultMarkerSymbol;
272 std::unique_ptr< QgsSymbol > mDefaultLineSymbol;
273 std::unique_ptr< QgsSymbol > mDefaultFillSymbol;
274 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
277 bool mRandomizeDefaultSymbolColor =
true;
278 double mDefaultSymbolOpacity = 1.0;
281 QStringList mStyleDatabases;
282 QList< QPointer< QgsStyle > > mStyles;
286 void loadStyleAtPath(
const QString &path );
308 StyleRole = Qt::UserRole + 1,
317 int rowCount(
const QModelIndex &parent )
const override;
318 QVariant data(
const QModelIndex &index,
int role )
const override;
324 QgsStyle *styleFromIndex(
const QModelIndex &index )
const;
330 QModelIndex indexFromStyle(
QgsStyle *style )
const;
337 void setShowDefaultStyle(
bool show );
347 void styleDatabaseAboutToBeAdded(
const QString &path );
348 void styleDatabaseAboutToBeRemoved(
const QString &path );
349 void styleDatabaseAdded(
const QString &path );
350 void styleDatabaseRemoved(
const QString &path );
352 void setProjectStyle(
QgsStyle *style );
353 void projectStyleAboutToBeDestroyed();
354 void projectStyleDestroyed();
355 void projectStyleChanged();
359 bool mShowDefault =
false;
360 QPointer< QgsStyle > mProjectStyle;
380 FilterHideReadOnly = 1 << 0,
384 Q_DECLARE_FLAGS( Filters, Filter )
392 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
399 QgsProjectStyleDatabaseProxyModel::Filters filters()
const;
406 void setFilters( QgsProjectStyleDatabaseProxyModel::Filters filters );
410 QgsProjectStyleDatabaseProxyModel::Filters mFilters;
SymbolType
Attribute editing capabilities which may be supported by vector data providers.
Abstract base class for color ramps.
A model which contains entities from multiple QgsStyle databases.
List model representing the style databases associated with a QgsProject.
bool showDefaultStyle() const
Returns true if the model includes the default style.
A proxy model for filtering QgsProjectStyleDatabaseModel.
Filter
Available filter flags for filtering the model.
Contains settings and properties relating to how a QgsProject should handle styling.
double defaultSymbolOpacity() const
Returns the default symbol opacity.
void projectStyleChanged()
Emitted when the style returned by projectStyle() is changed.
bool randomizeDefaultSymbolColor() const
Returns whether the default symbol fill color is randomized.
QStringList styleDatabasePaths() const
Returns a list of all style databases (file paths) associated with the project.
void styleDatabaseAdded(const QString &path)
Emitted when a style database path is added.
void styleDatabaseAboutToBeRemoved(const QString &path)
Emitted when a style database path is about to be removed.
void setRandomizeDefaultSymbolColor(bool randomized)
Sets whether the default symbol fill color is randomized.
void styleDatabaseRemoved(const QString &path)
Emitted when a style database path is removed.
void setDefaultSymbolOpacity(double opacity)
Sets the default symbol opacity.
void styleDatabaseAboutToBeAdded(const QString &path)
Emitted when a style database path is about to be added.
void styleDatabasesChanged()
Emitted whenever the set of style databases associated with the project is changed.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The class is used as a container of context for various read/write operations on other objects.
Abstract base class for all rendered symbols.
Container for all settings relating to text rendering.
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)