[QScintilla] Setting Up Styles in QScintilla

Patrick Mabie pmabie at gmail.com
Sun Nov 4 01:28:09 GMT 2007


To Phil
         Thanks for your reply!


Using Vista, msvc2005,C++,QScintilla-1.73-gpl-2.1

I am trying to set Styles in QScintilla.

textEdit->SendScintilla(textEdit->SCI_STYLESETFORE,m_pCpp->Comment,newColor); 
:-(

This Fails , I am not sure why , but it does.

My Question is what is the proper way to do this , QScintilla is so well 
done, I must be  overlooking something.

I am also trying to set up a api for the cpp lexer but it's failing to. :'(
void Props::LoadStyles()
{
    m_pStyles << "Default" << "Comment" << "CommentLine" << "CommentDoc" 
<< "Number" << "Keyword"
   << "DoubleQuotedString" << "SingleQuotedString" << "UUID" << 
"PreProcessor" << "Operator"  << "Identifier"
   << "UnclosedString" << "VerbatimString" << "Regex"  << 
"CommentLineDoc" << "KeywordSet2"
   << "CommentDocKeyword" << "CommentDocKeywordError" << "GlobalClass";
}

void Props::LangCpp()
{
   CheckLexer();
   m_pCpp = new QsciLexerCPP(textEdit);
   SetLexer(m_pCpp);
   m_pApi = new QsciAPIs(m_pCpp);

   m_pApi = new QsciAPIs(m_pCpp);
   foreach(QString style,m_pStyles)
   {
      m_pApi->add(tr("/")+style+tr("\\"));
   }

   m_pApi->prepare();
   QString FileName = m_pApi->defaultPreparedName();
    if(m_pApi->isPrepared(FileName))
    {
       m_pApi->savePrepared(FileName); <----------------- I never get to 
this point
    }
}

Any help on either problem would greatly be appreciated.  
Thanks for your time everyone .

Patrick Mabie.

Have a great night or day depending of your location!



More information about the QScintilla mailing list