[Qt-interest] Configure QtDesigner ui.h

Bo Thorsen bo at fioniasoftware.dk
Fri Sep 2 07:27:43 CEST 2011


Den 02-09-2011 06:48, Jos Collin skrev:
> Hello,
>
> How can I configure the QtDesigner to add the code to the dialog.cpp
> file, instead of adding the code to dialog.ui.h file?

You can't do that.

> I don't think it
> is a good practice to add the implementation code to a header file.

Doesn't matter, if it's only included in the cpp file of the class using 
this. Just remember to make the ui a pointer in the class and do a "new 
MyUIThing" in the constructor. Don't let your class inherit the UI class.

You are going to have to accept that this is just the way it is. Just 
like with templates, the implementation is in the .h file.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Qt-interest-old mailing list