QCustomPlot can be compiled with the special Qt flags
QT_NO_CAST_TO_ASCII out of the box. All strings used in the library are wrapped in QLatin1String to avoid casts from string/char literals. So if your project requires the added cast safety from these Qt flags, you can use QCustomPlot without any changes necessary.
QCustomPlot is a library based on and written in Qt. This means it uses Qt keywords such as
emit for improved readability.
However, some projects wish to disable these Qt specific language extensions by using the define flag
QT_NO_KEYWORDS. To compile QCustomPlot with that flag set, it is necessary to replace all occurrences of Qt keywords. This is easily done with QCustomPlot code, by using the following regular expression replacements:
|Search pattern||Replace with|
QCustomPlot code is written with these replacements in mind. They always work and catch all occurrences of used Qt keywords. Their functioning is also automatically tested upon every release.
The regular expressions can be applied in any IDE/Editor that supports them, including QtCreator itself. Below is a python script that is used to test the functioning of the regular expressions. It takes the names of the files to process (e.g. qcustomplot.cpp qcustomplot.h) from the command line and performs the replacement on them.