4#include "QeStateDetailed.hpp"
130 explicit
QeState(QWidget *parent =
nullptr);
424 void paintEvent(QPaintEvent *event)
override;
425 void resizeEvent(QResizeEvent *event)
override;
426 void moveEvent(QMoveEvent *event)
override;
427 void mousePressEvent(QMouseEvent *event)
override;
428 QSize sizeHint()
const override;
431 void processStateString();
432 const QColor fillColorForState(
const QString&
state);
433 QString lastSubState(QString compositeState);
434 QString compactString(QString oldState);
435 QColor foregroundFromBackgroundColor(QColor fgColor);
437 QString m_stateString = {
""};
438 QString m_state ={
""};
439 QStringList m_orthogonalStates = {};
440 QString m_orthogonalSep = {
";"};
441 QString m_substateSep = {
":"};
443 QColor positive = QColor(
"#3C7A0C");
444 QColor neutral = QColor(
"#095AD3");
445 QColor negative = QColor(
"#FF3317");
446 QColor viewBackgroundAlternate = QColor(
"#F2F2F2");
447 QColor warning = QColor(
"#FF8E26");
449 QStringList m_subStates = {};
450 bool m_showAll =
false;
451 bool m_autoCompact =
false;
453 QString m_positiveWords =
"idle goingrunning goingidle updateidle";
454 QString m_warningWords =
"recovering";
455 QString m_negativeWords =
"error";
456 QString m_neutralWords =
"running updating";
457 QString m_offWords =
"off";
458 QString m_initialisingWords =
"initialising starting notready ready enabling disabling";
459 QPointer<QeStateDetailed> m_popup;
460 int m_showOnlyIndex = -1;
void substateSepChanged(QString newValue)
Indicates a change in the substate separator property.
QString positiveWords
Words considered for Positive color (normally green), space separated.
Definition QeState.hpp:92
int spacing() const
Returns the ammount of pixels left as spacing between states.
Definition QeState.hpp:195
QString substateSep
Substates separator.
Definition QeState.hpp:62
void stateStringChanged(QString newValue)
Indicates a change in the stateString property.
void positiveWordsChanged(QString positiveWords)
Indicates a change in the positiveWords property.
QString getInitialisingWords() const
Gets the list of initialiasing words.
Definition QeState.hpp:237
bool showsAll() const
Indicates when the widget shows all orthogonal regions instead of just one.
Definition QeState.hpp:180
void initialisingWordsChanged(QString initialisingWords)
Indicates a change in the initialisingWords property.
QString orthogonalSep
Orthogonal Regions separator.
Definition QeState.hpp:56
QString getNegativeWords() const
Gets the list of negative words.
Definition QeState.hpp:216
QString getState()
Returns the parsed state.
Definition QeState.hpp:145
void offWordsChanged(QString offWords)
Indicates a change in the offWords property.
void setShowOnlyIndex(int showOnlyIndex)
Sets the showOnlyIndex property.
Definition QeState.cpp:142
QString getSubstateSep()
Returns the separator used to parse between States whithin an orthogonal region.
Definition QeState.hpp:166
QString offWords
Words considered for Off color (normally grey), space separated.
Definition QeState.hpp:116
void neutralWordsChanged(QString neutralWords)
Indicates a change in the neutralWords property.
QString getOrthogonalSep()
Returns the separator used to parse between Orthogonal regions.
Definition QeState.hpp:159
void setInitialisingWords(QString initialisingWords)
Sets the initialising words property.
Definition QeState.cpp:132
void orthogonalSepChanged(QString newValue)
Indicates a change in the orthogonal separator property.
void warningWordsChanged(QString warningWords)
Indicates a change in the warningWords property.
void subStatesChanged(QStringList subStates)
Indicates a change in the substates property.
void setShowAll(bool showAll)
When true configures the widget to show the complete Substates string.
Definition QeState.cpp:54
void setOrthogonalSep(QString newValue)
Defines which separator is to be used between Orthogonal regions.
Definition QeState.cpp:38
void orthogonalStatesChanged(QStringList newValue)
Indicates a change in the orthogonalStates property.
QStringList orthogonalStates
Orthogonal regions states, in a list.
Definition QeState.hpp:44
bool isAutoCompacting() const
Indicates if the widget is set to automatically summarize states is horizontal space is not enough.
Definition QeState.hpp:188
QStringList subStates
Substates in a list.
Definition QeState.hpp:50
int spacing
Separation in pixels between one state and the next.
Definition QeState.hpp:80
void setAutoCompact(bool autoCompact)
Sets the autoCompact property.
Definition QeState.cpp:63
QString neutralWords
Words considered for Neutral color (normally blue), space separated.
Definition QeState.hpp:110
QString getStateString()
Gets the stateString property.
Definition QeState.hpp:138
bool showAll
Shows states and substates for first region.
Definition QeState.hpp:68
QString negativeWords
Words considered for Negative color (normally red), space separated.
Definition QeState.hpp:104
QString getPositiveWords() const
Gets the list of positive words.
Definition QeState.hpp:202
void setOffWords(QString offWords)
Sets the off words property.
Definition QeState.cpp:122
QString getWarningWords() const
Gets the list of warning words.
Definition QeState.hpp:209
int showOnlyIndex
Shows only the state for the orthogonal region in the index N.
Definition QeState.hpp:122
QString state
Read-only property that contains the state of the component/application after interpretation of the s...
Definition QeState.hpp:38
void clicked()
Emitted when a mouse click is done in the widget.
QString initialisingWords
Words considered for Initialising color (normally yellow), space separated.
Definition QeState.hpp:86
QString getNeutralWords() const
Gets the list of neutral words.
Definition QeState.hpp:223
void setWarningWords(QString warningWords)
Sets the warning words property.
Definition QeState.cpp:92
QString getOffWords() const
Gets the list of off words.
Definition QeState.hpp:230
void setStateString(QString newValue)
Main setter of the QeState widget.
Definition QeState.cpp:25
void negativeWordsChanged(QString negativeWords)
Indicates a change in the negativeWords property.
void setSpacing(int spacing)
Sets the spacing property.
Definition QeState.cpp:72
void setPositiveWords(QString positiveWords)
Sets the positve words property.
Definition QeState.cpp:81
void setNeutralWords(QString neutralWords)
Sets the neutral words property.
Definition QeState.cpp:112
void autoCompactChanged(bool autoCompact)
Indicates a change in the autoCompact property.
QString warningWords
Words considered for Warning color (normally orange), space separated.
Definition QeState.hpp:98
QeState(QWidget *parent=nullptr)
Constructor for the QeState class.
Definition QeState.cpp:13
void showOnlyIndexChanged(int showOnlyIndex)
Signal emitted when the showOnlyIndex property changes.
void showAllChanged(bool showAll)
Indicates a change in the showAll property.
void setNegativeWords(QString negativeWords)
Sets the negative words property.
Definition QeState.cpp:102
void stateChanged(QString newValue)
Indicates a change in the state property.
QStringList getOrthogonalStates()
Returns a list of strings that contains the separated orthogonal state.
Definition QeState.hpp:152
int getShowOnlyIndex() const
Gets the currently shown orthogonal region index.
Definition QeState.hpp:244
QString stateString
Communicates the widget of the string that contains the state information.
Definition QeState.hpp:32
QStringList getSubStates() const
Returns list of parsed sub states.
Definition QeState.hpp:173
bool autoCompact
Automatically compact representation to Initials when no space is available.
Definition QeState.hpp:74
void setSubstateSep(QString newValue)
Defines which separator is to be used between Substates.
Definition QeState.cpp:46