rule_editing.h
Go to the documentation of this file.
1 #ifndef RULE_EDITING_H
2 #define RULE_EDITING_H
3 
4 #include <QDialog>
5 #include <QTimer>
6 #include <QSyntaxHighlighter>
7 #include <QTextCharFormat>
8 #include <QTextEdit>
10 
11 namespace Ui
12 {
13 class RuleEditing;
14 }
15 
16 class XMLSyntaxHighlighter : public QSyntaxHighlighter
17 {
18  Q_OBJECT
19 public:
20  XMLSyntaxHighlighter(QObject* parent);
21  XMLSyntaxHighlighter(QTextDocument* parent);
22  XMLSyntaxHighlighter(QTextEdit* parent);
23 
24 protected:
25  virtual void highlightBlock(const QString& text);
26 
27 private:
28  void highlightByRegex(const QTextCharFormat& format, const QRegExp& regex, const QString& text);
29  void setRegexes();
30  void setFormats();
31 
32 private:
33  QTextCharFormat _xmlKeywordFormat;
34  QTextCharFormat _xmlElementFormat;
35  QTextCharFormat _xmlAttributeFormat;
36  QTextCharFormat _xmlValueFormat;
37  QTextCharFormat _xmlCommentFormat;
38 
42  QRegExp _xmlValueRegex;
44 };
45 
46 class RuleEditing : public QDialog
47 {
48  Q_OBJECT
49 
50 public:
51  explicit RuleEditing(QWidget* parent = 0);
52  ~RuleEditing();
53 
54  static RosIntrospection::SubstitutionRuleMap getRenamingRules();
55 
56  static QString getRenamingXML();
57 
58 private slots:
59 
60  void on_pushButtonSave_pressed();
61 
62  void on_pushButtonReset_pressed();
63 
64  void on_timer();
65 
66  void on_pushButtonCancel_pressed();
67 
68 private:
69  bool isValidXml();
70 
71  Ui::RuleEditing* ui;
72 
74  QTimer _timer;
75 
76 private slots:
77 
78  virtual void closeEvent(QCloseEvent* event) override;
79 };
80 
81 #endif // RULE_EDITING_H
QList< QRegExp > _xmlKeywordRegexes
Definition: rule_editing.h:39
QRegExp _xmlAttributeRegex
Definition: rule_editing.h:41
QTextCharFormat _xmlCommentFormat
Definition: rule_editing.h:37
Ui::RuleEditing * ui
Definition: rule_editing.h:71
QTextCharFormat _xmlValueFormat
Definition: rule_editing.h:36
std::map< ROSType, std::vector< SubstitutionRule > > SubstitutionRuleMap
QTextCharFormat _xmlElementFormat
Definition: rule_editing.h:34
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&... args)
Definition: core.h:2081
QTextCharFormat _xmlKeywordFormat
Definition: rule_editing.h:33
XMLSyntaxHighlighter * _highlighter
Definition: rule_editing.h:73
QTimer _timer
Definition: rule_editing.h:74
QTextCharFormat _xmlAttributeFormat
Definition: rule_editing.h:35


plotjuggler_ros
Author(s): Davide Faconti
autogenerated on Fri Jun 23 2023 02:28:03