Results 1 to 3 of 3

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

Threaded View

Previous Post Previous Post   Next Post Next Post
  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

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
  •  
Qt is a trademark of The Qt Company.