[Qt-creator] Multiple QMainWindow in one project
Israel Brewster
israel at frontierflying.com
Tue Feb 17 00:21:59 CET 2009
check the name of the main widget in the designer view. the
Ui::MyWindow line needs to be named the same as the window there. So
if the window there was named MainWindow2 or something, the Ui:: line
would need to be Ui::MainWindow2, and you would need to include
ui_MainWindow2.h (in the mywindow.h file). I have on a number of
occasions seen QtCreator get this wrong when setting up the files...
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
On Feb 16, 2009, at 11:54 AM, Justin Giles wrote:
> Thanks for the reply, but that didn't seem to help.
>
> Just to clarify, the error falls in the "mywindow.h" file.
>
> so....
>
> error: invalid use of undefined type 'struct Ui::MyWindow'
> mywindow.h(6)
>
>
> Justin
>
> On Mon, Feb 16, 2009 at 2:29 PM, Andre Poenitz <andre.poenitz at mathematik.tu-chemnitz.de
> > wrote:
> On Mon, Feb 16, 2009 at 01:05:13PM -0600, Justin Giles wrote:
> > I'm fairly new to Qt and Qt Creator. I am creating an application
> where I
> > need to have 2 QMainWindows in the project. 1 primary window that
> has a
> > button that spawns the 2nd QMainWindow. I tried creating this
> second
> > QMainWindow in Creator and when I compile it gives me the
> following compile
> > error (among others related to the new class):
> >
> > error: invalid use of undefined type 'struct Ui::MyWindow'
> >
> > Nothing has been added to the 2nd QMainWindow through creator. I
> just went
> > through the new Designer form and class wizard to create the
> framework,
> > added it to my slot logic in the 1st qmainwindow and then tried to
> compile.
> >
> > Thoughts?
>
> Try adding an #include "ui_mywindow.h" or something similiar to
> the second .cpp file, too.
>
> Andre'
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090216/b47f23a6/attachment.html
More information about the Qt-creator-old
mailing list