QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Friends | List of all members
QgsSvgSelectorListModel Class Reference

A model for displaying SVG files with a preview icon. More...

#include <qgssvgselectorwidget.h>

Inheritance diagram for QgsSvgSelectorListModel:
Inheritance graph
[legend]

Public Member Functions

 QgsSvgSelectorListModel (QObject *parent, const QString &path, int iconSize=30)
 Constructor for creating a model for SVG files in a specific path.
 
 QgsSvgSelectorListModel (QObject *parent, int iconSize=30)
 Constructor for QgsSvgSelectorListModel.
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 

Protected Attributes

QStringList mSvgFiles
 

Friends

class TestQgsSvgSelectorWidget
 

Detailed Description

A model for displaying SVG files with a preview icon.

Population of the model is performed in a background thread to ensure that initial creation of the model is responsive and does not block the GUI.

Definition at line 304 of file qgssvgselectorwidget.h.

Constructor & Destructor Documentation

◆ QgsSvgSelectorListModel() [1/2]

QgsSvgSelectorListModel::QgsSvgSelectorListModel ( QObject *  parent,
int  iconSize = 30 
)

Constructor for QgsSvgSelectorListModel.

All SVGs in folders from the application SVG search paths will be shown.

Parameters
parentparent object
iconSizedesired size of SVG icons to create

Definition at line 237 of file qgssvgselectorwidget.cpp.

◆ QgsSvgSelectorListModel() [2/2]

QgsSvgSelectorListModel::QgsSvgSelectorListModel ( QObject *  parent,
const QString &  path,
int  iconSize = 30 
)

Constructor for creating a model for SVG files in a specific path.

Parameters
parentparent object
pathinitial path, which is recursively searched
iconSizedesired size of SVG icons to create

Definition at line 241 of file qgssvgselectorwidget.cpp.

Member Function Documentation

◆ data()

QVariant QgsSvgSelectorListModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 286 of file qgssvgselectorwidget.cpp.

◆ rowCount()

int QgsSvgSelectorListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 251 of file qgssvgselectorwidget.cpp.

Friends And Related Symbol Documentation

◆ TestQgsSvgSelectorWidget

friend class TestQgsSvgSelectorWidget
friend

Definition at line 346 of file qgssvgselectorwidget.h.

Member Data Documentation

◆ mSvgFiles

QStringList QgsSvgSelectorListModel::mSvgFiles
protected

Definition at line 330 of file qgssvgselectorwidget.h.


The documentation for this class was generated from the following files: