[Qt-creator] Multiple QMainWindow in one project

Andre Poenitz andre.poenitz at mathematik.tu-chemnitz.de
Mon Feb 16 21:29:38 CET 2009


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'



More information about the Qt-creator-old mailing list