I've done some coding using Qt and I need to list the code in a document. One of the advantages of Qt is the multiple template classes such as QList or QMap for example. I'm trying to get the correct syntax highlighting using minted, but can't seem to work out how.
Given all of the templates start with a Q is it possible to use regex to match these and highlight them as keywords? The idea comes from writing Qt in emacs, specifically Q[A-Z][A-Za-z]*.
Furthermore, is it possible to add other keywords, as Qt also uses SIGNAL, SLOT and Q_OBJECT among others? I know in listings it is possible using the emph option.
Example code from the Qt Website:
QMap<QString, int>::const_iterator i = map.constBegin();
while (i != map.constEnd()) {
cout << i.key() << ": " << i.value() << endl;
++i;
}
Qthat would not fit into the scheme of Qt classes. – Konrad Rudolph May 07 '15 at 01:40