Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2191

Moc file fails to compile under MSVC2008 and Qt4.4 if "using namespace" directive is used

    XMLWordPrintable

Details

    Description

      If the "using namespace" directive is used with Qt specific code as exemplified below, the application doesn’t compile with MSVS2008 on Windows.
      This behavior is reproduced on Windows Vista.

      #include <QtGui>

      namespace A
      {

      class AA
      {
      };
      };

      namespace B
      {
      using namespace A;
      class BB : public QObject

      { Q_OBJECT signals: /* if we make foo as simple member function in spite of signal it complies*/ void foo(AA *a); }

      ;
      };

      #include "main.moc"
      using namespace B;
      int main()
      {

      BB b;
      return 0;
      }

      It compiles without error on Linux and MSVS2005.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stormols Marius Storm-Olsen
            smk smk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes