[Qt-interest] [newbie] invalid use of incomplete type ‘struct Ui::NN’
Raja Rokkam
rokkamraja at gmail.com
Thu Oct 29 02:25:51 CET 2009
Your nn.cpp and nn.h files are qt generated is what I presume and you will
be getting another file ui_nn.h as well.
Now, can you move the loadtextfile to nn.cpp instead of main.cpp ? Ui::NN
*ui is a private struct so that function wouldnt work if you write it in
main.
-Raja.
On Thu, Oct 29, 2009 at 5:15 AM, Paul Colby <qt at colby.id.au> wrote:
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091029/de70e2d1/attachment.html
More information about the Qt-interest-old
mailing list