Public Member Functions | List of all members
pqScalarSetModel Class Reference

Qt model that stores a sorted collection of unique floating-point numbers. More...

#include <pqScalarSetModel.h>

Inherits QAbstractListModel.

Public Member Functions

 pqScalarSetModel ()
 
 ~pqScalarSetModel () override
 
void clear ()
 Clears the model contents. More...
 
QModelIndex insert (double value)
 Inserts a floating-point number into the model. More...
 
void erase (double value)
 Erases a floating-point number from the model. More...
 
void erase (int row)
 Erases a zero-based row from the model. More...
 
const QList< doublevalues ()
 Returns the sorted collection of numbers stored in the model. More...
 
void setFormat (char f, int precision=3)
 Controls formatting of displayed data, supports the 'e', 'E', 'f', 'F', 'g', and 'G' formats provided by printf() More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void setPreserveOrder (bool)
 Get/Set if the order in which the values are inserted must be preserved. More...
 
bool preserveOrder () const
 

Detailed Description

Qt model that stores a sorted collection of unique floating-point numbers.

Definition at line 43 of file pqScalarSetModel.h.

Constructor & Destructor Documentation

◆ pqScalarSetModel()

pqScalarSetModel::pqScalarSetModel ( )

◆ ~pqScalarSetModel()

pqScalarSetModel::~pqScalarSetModel ( )
override

Member Function Documentation

◆ clear()

void pqScalarSetModel::clear ( )

Clears the model contents.

◆ insert()

QModelIndex pqScalarSetModel::insert ( double  value)

Inserts a floating-point number into the model.

◆ erase() [1/2]

void pqScalarSetModel::erase ( double  value)

Erases a floating-point number from the model.

◆ erase() [2/2]

void pqScalarSetModel::erase ( int  row)

Erases a zero-based row from the model.

◆ values()

const QList<double> pqScalarSetModel::values ( )

Returns the sorted collection of numbers stored in the model.

◆ setFormat()

void pqScalarSetModel::setFormat ( char  f,
int  precision = 3 
)

Controls formatting of displayed data, supports the 'e', 'E', 'f', 'F', 'g', and 'G' formats provided by printf()

◆ data()

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

◆ flags()

Qt::ItemFlags pqScalarSetModel::flags ( const QModelIndex &  index) const
override

◆ rowCount()

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

◆ setData()

bool pqScalarSetModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

◆ setPreserveOrder()

void pqScalarSetModel::setPreserveOrder ( bool  )

Get/Set if the order in which the values are inserted must be preserved.

Off by default i.e. values will be sorted. If set after inserting a few values, the order of values inserted until the flag was set is lost.

◆ preserveOrder()

bool pqScalarSetModel::preserveOrder ( ) const

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