QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Public Member Functions | List of all members
QtMvvm::SimpleFormatter< T > Class Template Reference

A very basic formatter that uses QString::arg with the value on the format string. More...

#include <inputviewfactory.h>

+ Inheritance diagram for QtMvvm::SimpleFormatter< T >:

Public Member Functions

QString format (const QString &formatString, const QVariant &value, const QVariantMap &viewProperties) const override
 Is called to format a value to a localized, human readable text. More...
 

Detailed Description

template<typename T>
class QtMvvm::SimpleFormatter< T >

A very basic formatter that uses QString::arg with the value on the format string.

Definition at line 32 of file inputviewfactory.h.

Member Function Documentation

◆ format()

template<typename T >
QString QtMvvm::SimpleFormatter< T >::format ( const QString formatString,
const QVariant value,
const QVariantMap &  viewProperties 
) const
inlineoverridevirtual

Is called to format a value to a localized, human readable text.

Parameters
formatStringSome kind of format string, depending on what your formatter wants here
valueThe actual value, packet as a variant
viewPropertiesAdditional properies set on the delegate
Returns
A localized, human readable text, the formatted the value based on formatString

formatString can be whatever you need it to be, but typically it is a localized text with a placeholder to be replaced with the given value. See InputViewFactory::format for known formats.

See also
InputViewFactory::format

Implements QtMvvm::Formatter.

Definition at line 141 of file inputviewfactory.h.


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