Vuo  2.3.2
VuoInputEditorMathExpressionList.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
13 
14 extern "C"
15 {
16  #include "VuoText.h"
17  #include "VuoList_VuoText.h"
18 }
19 
24 {
25  Q_OBJECT
26  Q_PLUGIN_METADATA(IID "org.vuo.inputEditor" FILE "VuoInputEditorMathExpressionList.json")
27  Q_INTERFACES(VuoInputEditorFactory)
28 
29 public:
31 };
32 
38 {
39  Q_OBJECT
40 
41 public:
43 
44 private:
45  void setUpDialog(QDialog &dialog, json_object *originalValue, json_object *details);
46  QLayout * setUpRow(QDialog &dialog, QLineEdit *lineEdit);
47  void tearDownRow(QLayout *rowLayout);
48  json_object * getAcceptedValue(void);
49  QList<QString> convertToLineEditListFormat(json_object *value);
50  json_object * convertFromLineEditListFormat(const QList<QString> &lineEditTexts);
51  VuoList_VuoText getExpressionsFromLineEditTexts(const QList<QString> &lineEditTexts);
52  QString convertToUserLocale(QString valueInStandardLocale);
53  QString convertFromUserLocale(QString valueAsString);
54  QChar getDecimalPointInUserLocale(void);
55  QChar getListSeparatorInUserLocale(void);
56  bool eventFilter(QObject *o, QEvent *event) VuoWarnUnusedResult;
57 
58 private slots:
59  void validate();
60  void validateMathExpressionList(bool shouldCheckForAtLeastOneExpression=false);
61 
62 private:
63  bool isMathExpressionListValid(void);
64 
65  bool hasError;
66  QLabel *errorMessage;
67  QMap<QLayout *, QLabel *> errorSymbols;
68  QRegExpValidator *validator;
69  json_object *originalValue;
70 };