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::Formatter Class Referenceabstract

A class to format the preview text in the delegates. More...

#include <inputviewfactory.h>

+ Inheritance diagram for QtMvvm::Formatter:

Public Member Functions

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

Detailed Description

A class to format the preview text in the delegates.

Definition at line 16 of file inputviewfactory.h.

Member Function Documentation

◆ format()

QtMvvm::Formatter::format ( const QString formatString,
const QVariant value,
const QVariantMap &  viewProperties 
) const
pure virtual

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

Implemented in QtMvvm::SimpleFormatter< T >.


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