QVisu
Qt-based visualization for smart homes
|
#include <qvelement.h>
Public Slots | |
virtual void | onValueChanged (QString, QString) |
virtual void | onSeriesReceived (QString, QMap< double, double >) |
void | onContainerChanged (QString) |
virtual void | onInitCompleted () |
Signals | |
void | valueModified (QString, QString) |
void | requestSeries (QString item, QString series_type, QString start) |
Public Member Functions | |
QVElement (QDomElement xml_desc, QString container, QWidget *parent=0) | |
QList< QString > | getItemList () |
QList< int > | getGeometry () |
Static Public Member Functions | |
static QString | findFilePath (QString name) |
static QString | colorString (QString) |
Protected Member Functions | |
virtual void | resizeEvent (QResizeEvent *event) |
QString | getItemByAction (QString action, int index=0) |
int | height () |
int | width () |
int | ofs_x () |
int | ofs_y () |
double | max_icon_width () |
double | max_label_height () |
Protected Attributes | |
int | w |
int | h |
QString | container |
QMap< QString, QVItem > | items |
QString | color |
QString | active_color |
The base class for all elements which can be displayed. Actual elements need to be subclassed from QVElement.
Takes care of position, size, container and list of items.
All other functionaliy is to be implemented in the subclass.
|
explicit |
Basic constructor for all elements.
xml_desc | The XML <element> node |
container | The parent container |
parent | Parent widget, as in all Qt widgets |
Will determine width, height, position, color and active color. Extracts all items which are direct children of the <element>
node. They are then accessible via getItemList()
Get position of element and container. All other info is extracted in the derived classes
|
static |
Convert a Windows 8 color string to the #xxxxxx format.
Returns the color code for a Windows color name. If the name is not found, it will return the input string (as lowercase).
|
static |
Try to find the file name in one of the directories specified by <path>
QList< int > QVElement::getGeometry | ( | ) |
Returns x,y,w,h in this order.
|
protected |
Returns the item name which corresponds to the action.
action | The action as defined in |
index | If the action is contained several times in the <element> node, retrieves the n-th entry. Counting starts at 0. |
An | empty string if the action is not configured or index is out of range. |
QList< QString > QVElement::getItemList | ( | ) |
Return a list of all items which have been configured inside the <element>
node.
|
protected |
Height of the content in pixels
|
protected |
Content margin (x direction) in pixels
|
protected |
Content margin (y direction) in pixels
|
slot |
Called on ontainer change. Handled by QVElement(), to be overloaded only with reason (e.g. video element)
|
virtualslot |
Called when the websocket connection is established.
|
virtualslot |
Handle an incoming series. To be overloaded in QVPlot
|
virtualslot |
Handle incoming values. Will also be called after the element itself emits valueModified(). To be overloaded in a child class.
|
signal |
Emitted to request a series. Used only by the plot element.
|
protectedvirtual |
Unless you use a layout, overload this method to place Qt widgets inside the element
Reimplemented in QVWeather, QVSelector, QVGoogleCalendar, QVHeating, QVDimmer, QVPlot, QVSwitch, QVShutter, and QVFritz.
|
signal |
Emitted when a value has been changed actively in the element
|
protected |
Width of the content in pixels
|
protected |
Container in which the element is contained
|
protected |
Height in the grid. May be overwritten in the constructor of the derived class.
|
protected |
List of items. Key is the item name, content is a QVItem
|
protected |
Width in the grid. May be overwritten in the constructor of the derived class.