Did you try declaring the interface inside the namespace?

Qt Code:
  1. namespace ... {
  2. class X ... { ... };
  3. Q_DECLARE_INTERFACE(X, "...");
  4. }
To copy to clipboard, switch view to plain text mode 

Alternatively you can just make your class inherit QObject and add Q_OBJECT macro, you won't need Q_DECLARE_INTERFACE then.