UtilsJS QML Type

Javascript Utility Functions. More...

Import Statement: import CSDataQuick.Components 1.0

Methods

Detailed Description

Method Documentation

dumpCSData(data)

This function returns a printable string representation of the data object.


formatString(value, format, type, precision, states)

Format the value based on data type.

typeoutput
Enumstring at the value index from the states list.
Stringas it is.
Charstring by joinning the char array with ending null character removed.
Numberstring determined by format and precision.

See also Utils::convert.


getBestFontSize(item_height, with_frame)

Calculates the font size/family based on item height.

This function uses an imperically determined (item height, font size) table. Actually two sets of tables are defined. One for items without enclosing frame, e.g. CSText. One for items with a border frame, e.g. CSTextEntry. The reason for this manual tweak is to match MEDM displays.

The font family is either Dejavu Sans Mono for font size less than 20 or Helvetica otherwise.


popupDataLimitsDialog(parent)

This function popups up a dialog for user to configure the limits settings.


popupPromptDialog(parent, title, hint, input)

This function popups a dialog to obtains user's input.