| 
    QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
    
   | 
 
List model representing the style databases associated with a QgsProject. More...
#include <qgsprojectstylesettings.h>

Public Types | |
| enum | Role { StyleRole = Qt::UserRole + 1 , PathRole } | 
| Custom model roles.  More... | |
Public Member Functions | |
| QgsProjectStyleDatabaseModel (QgsProjectStyleSettings *settings, QObject *parent SIP_TRANSFERTHIS=nullptr) | |
| Constructor for QgsProjectStyleDatabaseModel, showing the styles from the specified settings.  More... | |
| QVariant | data (const QModelIndex &index, int role) const override | 
| QModelIndex | indexFromStyle (QgsStyle *style) const | 
| Returns the model index corresponding to a style.  More... | |
| int | rowCount (const QModelIndex &parent) const override | 
| void | setShowDefaultStyle (bool show) | 
| Sets whether the default style should also be included in the model.  More... | |
| bool | showDefaultStyle () const | 
Returns true if the model includes the default style.  More... | |
| QgsStyle * | styleFromIndex (const QModelIndex &index) const | 
| Returns the style at the corresponding index.  More... | |
List model representing the style databases associated with a QgsProject.
Definition at line 299 of file qgsprojectstylesettings.h.
Custom model roles.
| Enumerator | |
|---|---|
| StyleRole | Style object.  | 
| PathRole | Style path.  | 
Definition at line 306 of file qgsprojectstylesettings.h.
      
  | 
  explicit | 
Constructor for QgsProjectStyleDatabaseModel, showing the styles from the specified settings.
Definition at line 450 of file qgsprojectstylesettings.cpp.
      
  | 
  override | 
Definition at line 470 of file qgsprojectstylesettings.cpp.
| QModelIndex QgsProjectStyleDatabaseModel::indexFromStyle | ( | QgsStyle * | style | ) | const | 
Returns the model index corresponding to a style.
Definition at line 535 of file qgsprojectstylesettings.cpp.
      
  | 
  override | 
Definition at line 464 of file qgsprojectstylesettings.cpp.
| void QgsProjectStyleDatabaseModel::setShowDefaultStyle | ( | bool | show | ) | 
Sets whether the default style should also be included in the model.
Definition at line 560 of file qgsprojectstylesettings.cpp.
      
  | 
  inline | 
Returns true if the model includes the default style. 
Definition at line 344 of file qgsprojectstylesettings.h.
| QgsStyle * QgsProjectStyleDatabaseModel::styleFromIndex | ( | const QModelIndex & | index | ) | const | 
Returns the style at the corresponding index.
Definition at line 523 of file qgsprojectstylesettings.cpp.