[Qt-interest] [newbie] invalid use of incomplete type ‘struct Ui::NN’

Paul Colby qt at colby.id.au
Thu Oct 29 00:45:29 CET 2009


I think the problem is in your nn.h/cpp file...

> -------------> nn.h
> namespace Ui
> {
>     class NN;
> }

Here you've declared the Ui:NN class.

> class NN : public QMainWindow
> { ...
> };

And here you're declaring the NN class (ie without the Ui:: namespace.

Should be more like:

> -------------> nn.h
> namespace Ui
> {
>     class NN : public QMainWindow
>     { ...
>     }
> }

Or perhaps:

> -------------> nn.h
> namespace Ui
> {
>     class NN;
> }
>
> class Ui::NN : public QMainWindow // Note the "Ui::" near the start.
> { ...
> };


Then you'd need to update nn.cpp to look something like:

Ui::NN::NN(QMainWindow *parent)

etc.

Hope that helps.

PS this is all C++ related, not Qt ;)

paul.
-- 
http://colby.id.au




More information about the Qt-interest-old mailing list