15#ifndef QGSPROJECTSTYLESETTINGS_H
16#define QGSPROJECTSTYLESETTINGS_H
23#include <QAbstractListModel>
24#include <QSortFilterProxyModel>
143 bool readXml(
const QDomElement &element,
const QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
168 QList< QgsStyle * > styles()
const;
173 QgsStyle *styleAtPath(
const QString &path );
187 void addStyleDatabasePath(
const QString &path );
201 void setStyleDatabasePaths(
const QStringList &paths );
264 std::unique_ptr< QgsSymbol > mDefaultMarkerSymbol;
265 std::unique_ptr< QgsSymbol > mDefaultLineSymbol;
266 std::unique_ptr< QgsSymbol > mDefaultFillSymbol;
267 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
270 bool mRandomizeDefaultSymbolColor =
true;
271 double mDefaultSymbolOpacity = 1.0;
274 QStringList mStyleDatabases;
275 QList< QPointer< QgsStyle > > mStyles;
279 void loadStyleAtPath(
const QString &path );
301 StyleRole = Qt::UserRole + 1,
310 int rowCount(
const QModelIndex &parent )
const override;
311 QVariant data(
const QModelIndex &index,
int role )
const override;
317 QgsStyle *styleFromIndex(
const QModelIndex &index )
const;
323 QModelIndex indexFromStyle(
QgsStyle *style )
const;
330 void setShowDefaultStyle(
bool show );
340 void styleDatabaseAboutToBeAdded(
const QString &path );
341 void styleDatabaseAboutToBeRemoved(
const QString &path );
342 void styleDatabaseAdded(
const QString &path );
343 void styleDatabaseRemoved(
const QString &path );
345 void setProjectStyle(
QgsStyle *style );
346 void projectStyleAboutToBeDestroyed();
347 void projectStyleDestroyed();
348 void projectStyleChanged();
352 bool mShowDefault =
false;
353 QPointer< QgsStyle > mProjectStyle;
373 FilterHideReadOnly = 1 << 0,
377 Q_DECLARE_FLAGS( Filters, Filter )
385 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
392 QgsProjectStyleDatabaseProxyModel::Filters filters()
const;
399 void setFilters( QgsProjectStyleDatabaseProxyModel::Filters filters );
403 QgsProjectStyleDatabaseProxyModel::Filters mFilters;
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(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.