Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jul 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question how to let UIC generate BOTH header and source files?

    in the .pro file, I defined both UI_HEADERS_DIR = ./uic/include UI_SOURCES_DIR = ./uic/src but after compiling, I only get the ui_x.h files, which contain both declarations and implementations.

    Is this mean QMake can't produce a simple header file containing only the minimal declarations and put all the implementation details into source file?

    This is a sample generated .h file, you can find both declarations and implementations are placed within the .h file:

    Qt Code:
    1. /********************************************************************************
    2. ** Form generated from reading UI file 'DemoDialog.ui'
    3. **
    4. ** Created: Thu 21. Jul 16:08:58 2011
    5. ** by: Qt User Interface Compiler version 4.7.2
    6. **
    7. ** WARNING! All changes made in this file will be lost when recompiling UI file!
    8. ********************************************************************************/
    9.  
    10. QT_BEGIN_NAMESPACE
    11.  
    12. class Ui_DemoDialog
    13. {
    14. public:
    15.  
    16. void setupUi(QDialog *DemoDialog)
    17. {
    18. if (DemoDialog->objectName().isEmpty())
    19. DemoDialog->setObjectName(QString::fromUtf8("DemoDialog"));
    20. DemoDialog->resize(400, 300);
    21.  
    22. retranslateUi(DemoDialog);
    23.  
    24. QMetaObject::connectSlotsByName(DemoDialog);
    25. } // setupUi
    26.  
    27. void retranslateUi(QDialog *DemoDialog)
    28. {
    29. DemoDialog->setWindowTitle(QApplication::translate("DemoDialog", "Dialog", 0, QApplication::UnicodeUTF8));
    30. } // retranslateUi
    31. };
    32.  
    33. namespace Ui {
    34. class DemoDialog: public Ui_DemoDialog {};
    35. } // namespace Ui
    36.  
    37. QT_END_NAMESPACE
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 17th August 2011 at 08:27. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to let UIC generate BOTH header and source files?

    UIC doesn't produce .cpp files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    timewolf (17th August 2011)

  4. #3
    Join Date
    Jul 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to let UIC generate BOTH header and source files?

    Quote Originally Posted by wysota View Post
    UIC doesn't produce .cpp files.
    Thanks with noted:-)

Similar Threads

  1. Replies: 10
    Last Post: 6th April 2011, 10:05
  2. Replies: 12
    Last Post: 22nd March 2011, 15:08
  3. Auto-generate ui header & memory leak?
    By MorrisLiang in forum Newbie
    Replies: 12
    Last Post: 20th May 2010, 23:09
  4. Generate the .ts files for translation
    By skuallpa in forum Qt Programming
    Replies: 0
    Last Post: 17th June 2009, 12:22
  5. How to generate .lib files during a build?
    By QTInfinity in forum Installation and Deployment
    Replies: 2
    Last Post: 3rd October 2008, 18:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.