It's been many years since I've written anything in c++ so bear with me. I'm trying to create a namespace for my project that will house all of the global objects and things for the project.

I have the folling name space set up.

myapp.h
-----
Qt Code:
  1. #include <QtGui>
  2.  
  3. namespace myapp {
  4. QList<QPixmap> statusIcons;
  5. statusIcons.insert(0,QPixmap(QString(":/icons/22/images/nuvola/22x22/ledgreen.png")));
  6. statusIcons.insert(0,QPixmap(QString(":/icons/22/images/nuvola/22x22/ledyellow.png")));
  7. statusIcons.insert(0,QPixmap(QString(":/icons/22/images/nuvola/22x22/ledorange.png")));
  8. statusIcons.insert(0,QPixmap(QString(":/icons/22/images/nuvola/22x22/ledred.png")));
  9. }
To copy to clipboard, switch view to plain text mode 

I'm accessing it like this:

frmMain.cpp
-----
Qt Code:
  1. void frmMain::setStatus(int status) {
  2. if(status<myapp::statusIcons.count())
  3. statusLight->setPixmap(myapp::statusIcons[status]);
  4. }
To copy to clipboard, switch view to plain text mode 

which gives me the following errors:

../include/myapp.h:28: error: expected constructor, destructor, or type conversion before ‘.’ token
../include/myapp.h:29: error: expected constructor, destructor, or type conversion before ‘.’ token
../include/myapp.h:30: error: expected constructor, destructor, or type conversion before ‘.’ token
../include/myapp.h:31: error: expected constructor, destructor, or type conversion before ‘.’ token

I'm guessing that the Qt datatypes aren't available or something inside my namespace, but I'm not really sure how to fix it.

thanks in advance.
--Steven