KItinerary::PriceUtil

Search for usage in LXR

KItinerary::PriceUtil Class Reference

#include <priceutil.h>

Static Public Member Functions

static Q_INVOKABLE bool canHavePrice (const QVariant &item)
 
static Q_INVOKABLE QString currency (const QVariant &item)
 
static Q_INVOKABLE int decimalCount (const QString &currency)
 
static int decimalCount (QStringView currency)
 
static Q_INVOKABLE bool hasPrice (const QVariant &item)
 
static Q_INVOKABLE double price (const QVariant &item)
 
static Q_INVOKABLE void setPrice (QVariant &item, double price, const QString &currency)
 

Detailed Description

Utilities for dealing with price/currency information of items.

Definition at line 20 of file priceutil.h.

Member Function Documentation

◆ canHavePrice()

bool PriceUtil::canHavePrice ( const QVariant & item)
static

Returns true if item can have price/currency information.

Definition at line 33 of file priceutil.cpp.

◆ currency()

QString PriceUtil::currency ( const QVariant & item)
static

Returns the currency value from item.

Definition at line 52 of file priceutil.cpp.

◆ decimalCount() [1/2]

int PriceUtil::decimalCount ( const QString & currency)
static

Definition at line 106 of file priceutil.cpp.

◆ decimalCount() [2/2]

int PriceUtil::decimalCount ( QStringView currency)
static

Returns the number of decimals to represent the sub-unit of currency.

Parameters
currencyISO 4217 currency code

Definition at line 92 of file priceutil.cpp.

◆ hasPrice()

bool PriceUtil::hasPrice ( const QVariant & item)
static

Returns true if item has valid price and currency information.

Definition at line 16 of file priceutil.cpp.

◆ price()

double PriceUtil::price ( const QVariant & item)
static

Returns the price value from item.

Definition at line 38 of file priceutil.cpp.

◆ setPrice()

void PriceUtil::setPrice ( QVariant & item,
double price,
const QString & currency )
static

Sets price and currency on item.

Definition at line 66 of file priceutil.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:40:33 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.