QMake: how to let UIC generate BOTH header and source files? -


in .pro file, defined both ui_headers_dir = ./uic/include ui_sources_dir = ./uic/src after compiling, ui_x.h files, contain both declarations , implementations.

is mean qmake can't produce simple header file containing minimal declarations , put implementation details source file?

this sample generated .h file, can find both declarations , implementations placed within .h file:

/******************************************************************************** ** form generated reading ui file 'demodialog.ui' ** ** created: thu 21. jul 16:08:58 2011 **      by: qt user interface compiler version 4.7.2 ** ** warning! changes made in file lost when recompiling ui file! ********************************************************************************/  qt_begin_namespace  class ui_demodialog { public:      void setupui(qdialog *demodialog)     {         if (demodialog->objectname().isempty())             demodialog->setobjectname(qstring::fromutf8("demodialog"));         demodialog->resize(400, 300);          retranslateui(demodialog);          qmetaobject::connectslotsbyname(demodialog);     } // setupui      void retranslateui(qdialog *demodialog)     {         demodialog->setwindowtitle(qapplication::translate("demodialog", "dialog", 0, qapplication::unicodeutf8));     } // retranslateui };  namespace ui {     class demodialog: public ui_demodialog {}; } // namespace ui  qt_end_namespace 

the program reads .ui file , converts code 'uic', user interface compiler.

it doesn't write out source files: writes headers.

see its documentation.

so mystery why qmake variable reference page bothers ui_sources_dir exists?

there may undocumented uic option now, or previously, made qmake make uic write out .cpp file. if there is, not recommend using it, fear might disappear in future.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -