File indexing completed on 2024-05-26 05:40:54
0001 #ifndef CODEEDITORDIALOG_H 0002 #define CODEEDITORDIALOG_H 0003 0004 #include <QDialog> 0005 #include <memory> 0006 #include <qmlhighlighter.h> 0007 0008 namespace Ui 0009 { 0010 class CodeEditorDialog; 0011 } 0012 0013 class CodeEditorDialog : public QDialog 0014 { 0015 Q_OBJECT 0016 Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText NOTIFY plainTextChanged FINAL) 0017 public: 0018 explicit CodeEditorDialog(QWidget* parent= nullptr); 0019 ~CodeEditorDialog(); 0020 0021 QString toPlainText() const; 0022 public slots: 0023 void setPlainText(const QString data); 0024 signals: 0025 void plainTextChanged(); 0026 0027 private: 0028 Ui::CodeEditorDialog* ui; 0029 std::unique_ptr<QmlHighlighter> m_syntaxHighlight; 0030 }; 0031 0032 #endif // CODEEDITORDIALOG_H