Loading ...
Sorry, an error occurred while loading the content.

More C++ formatting problems

Expand Messages
  • salmankhilji
    I am using the Dec 2002 release on Linux. I have a C++ constructor like: AnalogClock::AnalogClock( QWidget *parent, const char *name ) ... { time =
    Message 1 of 2 , Dec 7, 2003
    View Source
    • 0 Attachment
      I am using the Dec 2002 release on Linux. I have a C++ constructor like:

      AnalogClock::AnalogClock( QWidget *parent, const char *name )
      : QWidget( parent, name )
      {
      time = QTime::currentTime(); // get current time
      QTimer *internalTimer = new QTimer( this ); // create internal
      }



      If I issue the restyle region command, I get this:

      AnalogClock::AnalogClock( QWidget *parent, const char *name )
      : QWidget( parent, name )
      {
      time = QTime::currentTime(); // get current time
      QTimer *internalTimer = new QTimer( this ); // create internal
      }



      Notice that the ": QWidget" constructor initialization list is take to
      the beginning of the line. It is preferable in C++ to indent the
      constructor initialization list a little bit---like it was before
      restyle region.

      Has this been fixed in the latest release?

      Salman
    • Jon Green
      ... No it was not, but it is now. Thanks Jon.
      Message 2 of 2 , Dec 8, 2003
      View Source
      • 0 Attachment
        salmankhilji wrote:
        > I am using the Dec 2002 release on Linux. I have a C++ constructor like:
        >
        > AnalogClock::AnalogClock( QWidget *parent, const char *name )
        > : QWidget( parent, name )
        > {
        > time = QTime::currentTime(); // get current time
        > QTimer *internalTimer = new QTimer( this ); // create internal
        > }
        >
        >
        >
        > If I issue the restyle region command, I get this:
        >
        > AnalogClock::AnalogClock( QWidget *parent, const char *name )
        > : QWidget( parent, name )
        > {
        > time = QTime::currentTime(); // get current time
        > QTimer *internalTimer = new QTimer( this ); // create internal
        > }
        >
        >
        >
        > Notice that the ": QWidget" constructor initialization list is take to
        > the beginning of the line. It is preferable in C++ to indent the
        > constructor initialization list a little bit---like it was before
        > restyle region.
        >
        > Has this been fixed in the latest release?
        >

        No it was not, but it is now.
        Thanks
        Jon.

        >
        > Salman
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.