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 quickstart page is active.


[read-only] buildNumber : string

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


[read-only] databaseValid : bool

Returns whether the current database is valid or not.


[read-only] defaultCurrencyCode : string

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


[read-only] lastDatabaseUpdate : date

This property holds the date and time of the last successful database update.


[read-only] online : bool

The current online state of the application. This is mirroring the operating system's online state.


[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 currencies, denoted as ISO currency code (e.g. EUR).


stringlist nameFiltersForBrickLinkXML(bool includeAll = false)

Returns a list of file extension that can be used when creating a FileDialog to open BrickLink XML files. If includeAll is set, a match-everything filter * will be added to this list.


stringlist nameFiltersForBrickStoreXML(bool includeAll = false)

Returns a list of file extension that can be used when creating a FileDialog to open BrickStore document files. If includeAll is set, a match-everything filter * will be added to this list.


stringlist nameFiltersForLDraw(bool includeAll = false)

Returns a list of file extension that can be used when creating a FileDialog to open LDraw files. If includeAll is set, a match-everything filter * will be added to this list.


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 asychronous database update in the background.


© 2004-2023 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.