Latest News :
- December 24, 2011:
- Version 0.2.3 released (fixing some interface and some compilation problems).
- March 6, 2010:
- Version 0.2.2 released.
- Jan 16, 2010:
- Version 0.2.1 released.
- Sept 25, 2009:
- Version 0.2 released.
- July 04, 2009:
- The very first version is released.
Screenshots :
some screenshots of
the example program qeditexample:
This is the ColorDialog provided by the library
This is the Source-Highlight Settings Dialog provided by the library
This is the ColorDialog provided by the library
This is the Source-Highlight Settings Dialog provided by the library
Blog :
My blog sections:
Source-highlight-qt: A library for highlighting Qt documents using GNU Source-highlight.
Source-highlight-qt is a
library for performing syntax highlighting in
Qt documents by relying on GNU Source-Highlight library,
http://www.gnu.org/software/src-highlite/.
Although the use of GNU Source-highlight library is pretty hidden by this library, so the programmer must not need the details of GNU Source-highlight library, yet, some general notions of GNU Source-highlight might be useful (especially how language definition files are defined, where the configuration files are stored, etc.).
This library provides an implementation of the qt abstract class
Please note, the Qt3 version has less features and it is there only for old qt applications; furthermore,
You can also get the source code via git (this way you will also access the latest version - probably the one in development stage, and not yet released):
Remember that you need to install GNU Source-highlight first, and you need at least version 3.0 (i.e., the first version providing the library that source-highlight-qt will use). GNU Source-highlight relies on Boost regex library, and in particular its development files (thus, if you install boost from your Linux distribution, make sure to install also the development package).
See the installation section of the manual for further details.
However, for standard usage, it's just a matter of executing this code (you can pass the language syntax, i.e., the source-highlight language definition file, to the init method):
We also suggest to take a look at the example program qeditexample, for some use cases of the library.
Although the use of GNU Source-highlight library is pretty hidden by this library, so the programmer must not need the details of GNU Source-highlight library, yet, some general notions of GNU Source-highlight might be useful (especially how language definition files are defined, where the configuration files are stored, etc.).
This library provides an implementation of the qt abstract class
QSyntaxHighlighter
class, and
it deals both with Qt3 and Qt4,
although you will need to build a separate version of the library for
the two different qt frameworks. Please note, the Qt3 version has less features and it is there only for old qt applications; furthermore,
QSyntaxHighlighter
class in Qt3
has some design problems which make it quite inefficient to
use.
Author
Lorenzo Bettini, http://www.lorenzobettini.it
Download
You can download the sources and binaries (released under GPL), from the SourceForge site.You can also get the source code via git (this way you will also access the latest version - probably the one in development stage, and not yet released):
and you can also browse the repository.git clone git://srchiliteqt.git.sourceforge.net/gitroot/srchiliteqt/srchiliteqt
Remember that you need to install GNU Source-highlight first, and you need at least version 3.0 (i.e., the first version providing the library that source-highlight-qt will use). GNU Source-highlight relies on Boost regex library, and in particular its development files (thus, if you install boost from your Linux distribution, make sure to install also the development package).
See the installation section of the manual for further details.
Documentation
Here's the available documentation (the same files are also part of the library distribution):However, for standard usage, it's just a matter of executing this code (you can pass the language syntax, i.e., the source-highlight language definition file, to the init method):
QTextEdit *editor = new QTextEdit;
srchiliteqt::Qt4SyntaxHighlighter *highlighter =
new srchiliteqt::Qt4SyntaxHighlighter(editor->document());
highlighter->init("java.lang");
We also suggest to take a look at the example program qeditexample, for some use cases of the library.
Support
You can refer to the corresponding sourceforge support page, or you can email me directly (please, find my email address at my home page).Links
Here we list some software related to Source-highlight-qt library in the sense that it uses it as a backend (i.e., provides an interface to source-highlight) or it uses some of its features (e.g., definition files):- QSource-Highlight is a Qt4 front-end for GNU Source-Highlight (it relies on the library Source-Highlight-Qt). You can highlight your code on the fly, and have the highlighted output in all the formats supported by source-highlight (e.g., HTML, LaTeX, Texinfo, etc.). You can then copy the formatted output and paste it (e.g., in your blog), or save it to a file. A preview of the highlighted output is available for some output formats (e.g., HTML, XHTML, etc.).
- Roberto Alsina made a partial python binding using SIP so that you can use it in PyQt programs.