diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2015-11-18 21:40:59 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2015-12-03 20:45:54 (GMT) |
commit | fc656fa4fe2926c7a50de91ff1b5564802ac4a7e (patch) | |
tree | ad3915eb2fe0b35bc0e17d4e2c93c8ec61832e67 /Source/QtDialog/RegexExplorer.h | |
parent | 9cbb8058ca843c1a3f3b67d155718b03a3e91d6c (diff) | |
download | CMake-fc656fa4fe2926c7a50de91ff1b5564802ac4a7e.zip CMake-fc656fa4fe2926c7a50de91ff1b5564802ac4a7e.tar.gz CMake-fc656fa4fe2926c7a50de91ff1b5564802ac4a7e.tar.bz2 |
cmake-gui: Add regex explorer window
Diffstat (limited to 'Source/QtDialog/RegexExplorer.h')
-rw-r--r-- | Source/QtDialog/RegexExplorer.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/QtDialog/RegexExplorer.h b/Source/QtDialog/RegexExplorer.h new file mode 100644 index 0000000..2ac9c3e --- /dev/null +++ b/Source/QtDialog/RegexExplorer.h @@ -0,0 +1,48 @@ +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2015 Kitware, Inc., Gregor Jasny + + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. + + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ + +#ifndef RegexExplorer_h +#define RegexExplorer_h + +#include <string> +#include <cmsys/RegularExpression.hxx> +#include <QDialog> + +#include "ui_RegexExplorer.h" + +class QString; +class QWidget; + +class RegexExplorer : public QDialog, public Ui::RegexExplorer +{ + Q_OBJECT +public: + RegexExplorer(QWidget* p); + +private slots: + void on_regularExpression_textChanged(const QString& text); + void on_inputText_textChanged(); + void on_matchNumber_currentIndexChanged(int index); + +private: + static void setStatusColor(QWidget* widget, bool successful); + static bool stripEscapes(std::string& regex); + + void clearMatch(); + + cmsys::RegularExpression m_regexParser; + std::string m_text; + std::string m_regex; + bool m_matched; +}; + +#endif |