Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Wiki Discussion
  4. Code Blocks language syntax highlighting
Forum Updated to NodeBB v4.3 + New Features

Code Blocks language syntax highlighting

Scheduled Pinned Locked Moved Wiki Discussion
1 Posts 1 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NetZwerg
    wrote on 7 Jul 2015, 13:42 last edited by SGaist 7 Jul 2015, 21:28
    #1

    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]

    1 Reply Last reply
    0

    1/1

    7 Jul 2015, 13:42

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved