I have a problem using namespaces with promoted classes.
In my company with use a structure where all the namespaces have a relative directory with the same name so,
if a have a project that uses namespace aaa { namespace bbb { namespace ccc,
the files are in <path>/aaa/bbb/ccc
Now, my current project is inside 3 namespaces. In qtcreator I promote a QTableWidget object to my own CTableWidget class.
When I compile, the file CTableWidget.h is found but, as the file uses namespace aaa { namespace bbb { namespace ccc,
the compiler throws and error:
as ui_MainWindow.h doesn't know that there are namespaces and, of course, I cannot modify it as it's created by qmake.ui_MainWindow.h:50: error: ISO C++ forbids declaration of ‘CTableWidget’ with no type
Is there a solution for this ?
Actually I've solved in this way:
Qt Code:
using namespace aaa::bbb::ccc; #include "ui_MainWindow.h"To copy to clipboard, switch view to plain text mode
but it's ugly![]()
Bookmarks