Code Blocks language syntax highlighting



  • Wouldn't it be better to have the language ''cpp-qt'' to be close to ''cpp'', having the default cpp highlighting and a additional color for Q* keywords instead of having some kind of markup not recognizing all cpp keywords?

    Some code for the Wiki Sandbox (Markdown won't work, sry...):

    ==Code Blocks Formatting==
    ===CPP===

    #include <test.h>
    #define CONSTANTVALUE 9
    if(x==true)
    {
      QList< QList< QStringList > > multiStringList;
      callSomeOtherFunction();
      switch(someVar)
      {
        default:
        case CONSTANTVALUE:
        {
          for(int i=0;i<CONSTANTVALUE;i++)
          {
            qDebug()<<"Text: "<< i;
          }
        }
          break;
      }
    }
    
    class Widget {
     ...
     private:
      Rect m_geometry;
      String m_stylesheet; // NEW in WidgetLib 1.1
    };
    
    class Label : public Widget {
     public:
     ...
      String text() const { return m_text; }
    
     private:
      String m_text;
      };
    

    ===CPP-QT===

    #include <test.h>
    #define CONSTANTVALUE 9
    if(x==true)
    {
      QList< QList< QStringList > > multiStringList;
      callSomeOtherFunction();
      switch(someVar)
      {
        default:
        case CONSTANTVALUE:
        {
          for(int i=0;i<CONSTANTVALUE;i++)
          {
            qDebug()<<"Text: "<< i;
          }
        }
          break;
      }
    }
    
    class Widget {
     ...
     private:
      Rect m_geometry;
      String m_stylesheet; // NEW in WidgetLib 1.1
    };
    
    class Label : public Widget {
     public:
     ...
      String text() const { return m_text; }
    
     private:
      String m_text;
      };
    

    ===None===

    #include <test.h>
    #define CONSTANTVALUE 9
    if(x==true)
    {
      QList< QList< QStringList > > multiStringList;
      callSomeOtherFunction();
      switch(someVar)
      {
        default:
        case CONSTANTVALUE:
        {
          for(int i=0;i<CONSTANTVALUE;i++)
          {
            qDebug()<<"Text: "<< i;
          }
        }
          break;
      }
    }
    
    class Widget {
     ...
     private:
      Rect m_geometry;
      String m_stylesheet; // NEW in WidgetLib 1.1
    };
    
    class Label : public Widget {
     public:
     ...
      String text() const { return m_text; }
    
     private:
      String m_text;
      };
    

    ===Error===

    #include <test.h>
    #define CONSTANTVALUE 9
    if(x==true)
    {
      QList< QList< QStringList > > multiStringList;
      callSomeOtherFunction();
      switch(someVar)
      {
        default:
        case CONSTANTVALUE:
        {
          for(int i=0;i<CONSTANTVALUE;i++)
          {
            qDebug()<<"Text: "<< i;
          }
        }
          break;
      }
    }
    
    class Widget {
     ...
     private:
      Rect m_geometry;
      String m_stylesheet; // NEW in WidgetLib 1.1
    };
    
    class Label : public Widget {
     public:
     ...
      String text() const { return m_text; }
    
     private:
      String m_text;
      };
    

    [edit: added missing codings tags``` SGaist]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.