BrickStore QML Type

This singleton represents global settings and state. More...

Import Statement: import BrickStore 1.0

Properties

Methods

Detailed Description

A kitchen sink type singleton for all global state, settings and utility functions.

Property Documentation

[read-only] activeDocument : Document

The currently active document, i.e. the document the user is working on. Can be null, if no documents are open, but also if the quick-start page is active.


[read-only] buildNumber : string

BrickStore's build number as a string (e.g. "42").


[read-only] defaultCurrencyCode : string

The user's default ISO currency code (e.g. EUR).


[read-only] mainWindow : Window

A reference to the main Window of BrickStore. Can be used to open dialogs and other windows on top of the main window by setting transientParent.


[read-only] versionNumber : string

BrickStore's version as a string (e.g. "2021.10.2").


Method Documentation

string exchangeRate(string fromCode, string toCode)

Returns the currency exchange cross-rate between the two given fromCode and toCode currencies, denoted as ISO currency code (e.g. EUR).


string symbolForCurrencyCode(string currencyCode)

Returns the currency symbol for the ISO currencyCode if available or the currencyCode itself otherwise. E.g. EUR will be mapped to .


string toCurrencyString(real value, string symbol = "", int precision = 3)

Correctly formats the given currency value according to the user's locale and returns it as a string. Also appends a currency symbol if provided. The default number of decimal places is 3, but you can change this via the precision parameter.


string toWeightString(real value, bool showUnit = false)

Correctly formats the given weight value according to the user's locale and the metric/imperial setting in BrickStore and returns it as a string. Also appends the corresponding unit if showUnit is set to true.


void updateDatabase()

Starts an asynchronous database update in the background.


© 2004-2024 Robert Griebl. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. All trademarks are property of their respective owners.