[QScintilla] No syntax highlighting with provided example

DYNAWORKS, Tools tools.dynaworks at airbus.com
Wed Dec 20 09:54:48 GMT 2017


Hello,
I have just compiled source code of QScintilla to use it in an editor. All seems good, but I have no syntax highlighting whereas I have created a QsciLexerCPP and set it to the QsciScintilla object. Here is the code I use to test some functionalities :

#include <QApplication>
#include <QScintilla/Qsci/qsciscintilla.h>
#include <QScintilla/Qsci/qscilexercpp.h>

int main(int argc, char* argv[])
{
     QApplication app(argc, argv);

     QsciLexerCPP *lexerCPP = new QsciLexerCPP;
     lexerCPP->setColor(Qt::magenta, QsciLexerCPP::Comment);

     QsciScintilla *scintilla = new QsciScintilla;
     scintilla->setLexer(lexerCPP);
     scintilla->SendScintilla(QsciScintilla::SCI_SETHSCROLLBAR, 0);
     scintilla->setMinimumSize(600, 450);
     scintilla->setText("#include <toto.hg>\n#define titi 12\n\n\n\n");

     scintilla->show();

     return app.exec();
}

Here is what I get at program execution, there is no color for specific syntax elements, someone might have an idea of my problem ?
Thanks, regards
Julien

[cid:image001.png at 01D37980.F3C20570]

***************************************************************
Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Airbus Defence and Space et les sociétés Airbus Group declinent toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique.
This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Airbus Defence and Space and Airbus Group companies disclaim any and all liability if this email transmission was virus corrupted, altered or falsified. 
---------------------------------------------------------------------
Airbus Defence and Space SAS (393 341 516 RCS Toulouse) - Capital: 29.821.072 EUR - Siege social: 31 rue des Cosmonautes, ZI du Palays, 31402 Toulouse cedex 4, France
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20171220/3f0576d1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8172 bytes
Desc: image001.png
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20171220/3f0576d1/attachment.png>


More information about the QScintilla mailing list