| 
    QGIS API Documentation
    3.26.3-Buenos Aires (65e4edfdad)
    
   | 
 
 
 
 
Go to the documentation of this file.
   16 #ifndef QGSSTRINGSTATISTICALSUMMARY_H 
   17 #define QGSSTRINGSTATISTICALSUMMARY_H 
   20 #include <QVariantList> 
   22 #include "qgis_core.h" 
   61       All = Count | CountDistinct | CountMissing | Min | Max | MinimumLength | MaximumLength | MeanLength | Minority | Majority, 
 
   63     Q_DECLARE_FLAGS( Statistics, Statistic )
 
   84     void setStatistics( QgsStringStatisticalSummary::Statistics stats ) { mStatistics = stats; }
 
   97     void calculate( 
const QStringList &values );
 
  106     void calculateFromVariants( 
const QVariantList &values );
 
  122     void addString( 
const QString &
string );
 
  137     void addValue( 
const QVariant &value );
 
  156     int count()
 const { 
return mCount; }
 
  168     QSet< QString > 
distinctValues()
 const { 
return qgis::listToSet( mValues.keys() ); }
 
  178     QString 
min()
 const { 
return mMin; }
 
  183     QString 
max()
 const { 
return mMax; }
 
  229     Statistics mStatistics;
 
  232     QMap< QString, int > mValues;
 
  243     void testString( 
const QString &
string );
 
  248 #endif // QGSSTRINGSTATISTICALSUMMARY_H 
  
int count() const
Returns the calculated count of values.
 
QSet< QString > distinctValues() const
Returns the set of distinct string values.
 
QString min() const
Returns the minimum (non-null) string value.
 
int minLength() const
Returns the minimum length of strings.
 
Statistic
Enumeration of flags that specify statistics to be calculated.
 
QString max() const
Returns the maximum (non-null) string value.
 
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.
 
void setStatistics(QgsStringStatisticalSummary::Statistics stats)
Sets flags which specify which statistics will be calculated.
 
Statistics statistics() const
Returns flags which specify which statistics will be calculated.
 
QString majority() const
Returns the most common string.
 
int countMissing() const
Returns the number of missing (null) string values.
 
QString minority() const
Returns the least common string.
 
int countDistinct() const
Returns the number of distinct string values.
 
int maxLength() const
Returns the maximum length of strings.
 
Calculator for summary statistics and aggregates for a list of strings.
 
double meanLength() const
Returns the mean length of strings.