Talk:Sandbox

From Qt Wiki
Jump to navigation Jump to search

Regarding Code Blocks

Shouldn't we change the default cpp-qt to be more like the cpp syntax highlighter (+having Q* keywords)? Seems a lot more readable.

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;
  };