cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
utility class to find input arguments from objects with text or value properties More...
#include <cucontrolsutils.h>
Public Member Functions | |
QString | findInput (const QString &objectName, const QObject *leaf) const |
QObject * | findObject (const QString &objectName, const QObject *leaf) const |
CuVariant | getArgs (const QString &target, const QObject *leaf) const |
finds the arguments in the source or target. If they are object names it finds the objects with those names and get the input from them, otherwise they are directly converted to CuVariant and returned. More... | |
QList< QObject * > | findObjects (const QString &target, const QObject *leaf) |
bool | initObjects (const QString &target, const QObject *leaf, const CuData &data, const char *value_key) |
initialize objects setting range (min, max, if relevant) and the value according to value_key More... | |
QString | msg (const CuData &da, const QString &date_time_fmt="yyyy-MM-dd HH:mm:ss.zzz") const |
return a string with a message derived from the da input parameter More... | |
utility class to find input arguments from objects with text or value properties
This class is used to search input arguments for sources or targets from widgets exposing text or value properties. Text or values are edited within the widget and can be passed as input arguments to readers or writers.
Please refer to the findInput method documentation for more details.
QString CuControlsUtils::findInput | ( | const QString & | objectName, |
const QObject * | leaf | ||
) | const |
find the input argument from an object and return it in the shape of a string.
objectName | the name of the object to search for |
leaf | the parent object under which the object providing input is searched for |
Referenced by getArgs().
QObject * CuControlsUtils::findObject | ( | const QString & | objectName, |
const QObject * | leaf | ||
) | const |
Referenced by findObjects().
QList< QObject * > CuControlsUtils::findObjects | ( | const QString & | target, |
const QObject * | leaf | ||
) |
References findObject().
Referenced by initObjects().
CuVariant CuControlsUtils::getArgs | ( | const QString & | target, |
const QObject * | leaf | ||
) | const |
finds the arguments in the source or target. If they are object names it finds the objects with those names and get the input from them, otherwise they are directly converted to CuVariant and returned.
target | the source or target string |
leaf | under this object getArgs searches for a child (children) with the object name(s) specified in the argument (s). |
The child is searched by the findInput method.
References findInput().
Referenced by QuButton::execute(), and QuWriter::execute().
bool CuControlsUtils::initObjects | ( | const QString & | target, |
const QObject * | leaf, | ||
const CuData & | data, | ||
const char * | value_key | ||
) |
initialize objects setting range (min, max, if relevant) and the value according to value_key
target | the name of the target |
leaf | the parent object under which children are searched by findObjects |
data | the CuData holding configuration values (min, max, if present), and a value to display on the object |
value_key | the key to look for the value that must be displayed (example: "value" or "w_value") |
References findObjects().
Referenced by QuButton::onUpdate().
QString CuControlsUtils::msg | ( | const CuData & | da, |
const QString & | date_time_fmt = "yyyy-MM-dd HH:mm:ss.zzz" |
||
) | const |
return a string with a message derived from the da input parameter
da | CuData |
date_time_fmt | a custom timestamp date / time format. Default: "yyyy-MM-dd HH:mm:ss.zzz" |
References msg().
Referenced by msg().