[Qt-interest] Using more than one .ui files in a project

John McClurkin jwm at nei.nih.gov
Thu Jul 15 13:51:00 CEST 2010


jaff at student.dei.uc.pt wrote:
> Hi all,
> 
> I made a simple login dialog and the app is running just fine, but now 
> I'm facing a new problem: I want to add another .ui file to the project 
> and I don't know how to use it. I'll be more specific: I want to use a 
> ..ui file that is already created. I imported it to my project 
> (File->Open File Or Project...) and I thought it was mandatory to create 
> a new class (both .h and .cpp file) to instantiate it, but the little 
> code I did just brought confusion and errors to the project, so I 
> deleted both files (header and source).

You need a new class for the second .ui file. If you get confusion and 
errors, resolve the confusion and fix the errors, don't delete the 
files. If you are using qmake, make sure that the new files are in the 
qmake .pro file and rerun qmake -makefile.


> 
> The real question here is, now that I have 2 .ui files in my project, 
> how can I use the second one (I don't know if this is useful but I 
> already have a login window and the new one is the main window, so I 
> want to go from the login to the main window)?

Instantiate the main window on the heap from the login dialog and show it.

> 
> I don't know if I'm being confusing explaining my issue, but I'm new to 
> this. I send the files in attachment (is little and simple).
> 
> If anyone knows what I'm looking for please say something, it will be 
> much appreciated :]
> 
> Thanks in advance,
> João
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 



More information about the Qt-interest-old mailing list