Results 1 to 8 of 8

Thread: qmake: does no generate .h file from .ui file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default qmake: does no generate .h file from .ui file

    //QT4
    //System: Ubuntu 10.10, x32


    Hi,
    I try run the example application (http://sector.ynet.sk/qt4-tutorial/t...rst_qt_app.zip)

    I have a files:
    main.cpp
    myqtapp.cpp
    myqtapp.h
    myqtapp.ui

    So i try generate a project: qmake -project
    In project folder was generate a file sym.pro with content:
    ################################################## ####################
    # Automatically generated by qmake (1.07a) Mon Apr 18 11:08:30 2011
    ################################################## ####################

    TEMPLATE = app
    INCLUDEPATH += .

    # Input
    INTERFACES += myqtapp.ui
    SOURCES += main.cpp
    btw. i also try write this file manualy

    Next i try: qmake
    Makefile was generated by i don't have a ui_myqtapp.h! Why?
    Of course when I try: make, i get errors caused missing ui_myqtapp.h.

    I'd by very grateful if someone tell me what is wrong.


    This is my Makefile:
    Qt Code:
    1. #############################################################################
    2. # Makefile for building: sym
    3. # Generated by qmake (1.07a) (Qt 3.3.8b) on: Mon Apr 18 11:13:01 2011
    4. # Project: sym.pro
    5. # Template: app
    6. # Command: $(QMAKE) -o Makefile sym.pro
    7. #############################################################################
    8.  
    9. ####### Compiler, tools and options
    10.  
    11. CC = gcc
    12. CXX = g++
    13. LEX = flex
    14. YACC = yacc
    15. CFLAGS = -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
    16. CXXFLAGS = -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
    17. LEXFLAGS =
    18. YACCFLAGS= -d
    19. INCPATH = -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3
    20. LINK = g++
    21. LFLAGS =
    22. LIBS = $(SUBLIBS) -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
    23. AR = ar cqs
    24. RANLIB =
    25. MOC = /usr/share/qt3/bin/moc
    26. UIC = /usr/share/qt3/bin/uic
    27. QMAKE = qmake
    28. TAR = tar -cf
    29. GZIP = gzip -9f
    30. COPY = cp -f
    31. COPY_FILE= $(COPY)
    32. COPY_DIR = $(COPY) -r
    33. INSTALL_FILE= $(COPY_FILE)
    34. INSTALL_DIR = $(COPY_DIR)
    35. DEL_FILE = rm -f
    36. SYMLINK = ln -sf
    37. DEL_DIR = rmdir
    38. MOVE = mv -f
    39. CHK_DIR_EXISTS= test -d
    40. MKDIR = mkdir -p
    41.  
    42. ####### Output directory
    43.  
    44. OBJECTS_DIR = ./
    45.  
    46. ####### Files
    47.  
    48. HEADERS =
    49. SOURCES = main.cpp
    50. OBJECTS = main.o \
    51. myqtapp.o
    52. FORMS = myqtapp.ui
    53. UICDECLS = myqtapp.h
    54. UICIMPLS = myqtapp.cpp
    55. SRCMOC = moc_myqtapp.cpp
    56. OBJMOC = moc_myqtapp.o
    57. DIST = sym.pro
    58. QMAKE_TARGET = sym
    59. DESTDIR =
    60. TARGET = sym
    61.  
    62. first: all
    63. ####### Implicit rules
    64.  
    65. .SUFFIXES: .c .o .cpp .cc .cxx .C
    66.  
    67. .cpp.o:
    68. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    69.  
    70. .cc.o:
    71. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    72.  
    73. .cxx.o:
    74. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    75.  
    76. .C.o:
    77. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
    78.  
    79. .c.o:
    80. $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
    81.  
    82. ####### Build rules
    83.  
    84. all: Makefile $(TARGET)
    85.  
    86. $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
    87. $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
    88.  
    89. mocables: $(SRCMOC)
    90. uicables: $(UICDECLS) $(UICIMPLS)
    91.  
    92. $(MOC):
    93. ( cd $(QTDIR)/src/moc && $(MAKE) )
    94.  
    95. Makefile: sym.pro /usr/share/qt3/mkspecs/default/qmake.conf /usr/share/qt3/lib/libqt-mt.prl
    96. $(QMAKE) -o Makefile sym.pro
    97. qmake:
    98. @$(QMAKE) -o Makefile sym.pro
    99.  
    100. dist:
    101. @mkdir -p .tmp/sym && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/sym/ && ( cd `dirname .tmp/sym` && $(TAR) sym.tar sym && $(GZIP) sym.tar ) && $(MOVE) `dirname .tmp/sym`/sym.tar.gz . && $(DEL_FILE) -r .tmp/sym
    102.  
    103. mocclean:
    104. -$(DEL_FILE) $(OBJMOC)
    105. -$(DEL_FILE) $(SRCMOC)
    106.  
    107. uiclean:
    108. -$(DEL_FILE) $(UICIMPLS) $(UICDECLS)
    109.  
    110. yaccclean:
    111. lexclean:
    112. clean: mocclean uiclean
    113. -$(DEL_FILE) $(OBJECTS)
    114. -$(DEL_FILE) *~ core *.core
    115.  
    116.  
    117. ####### Sub-libraries
    118.  
    119. distclean: clean
    120. -$(DEL_FILE) $(TARGET) $(TARGET)
    121.  
    122.  
    123. FORCE:
    124.  
    125. ####### Compile
    126.  
    127. main.o: main.cpp myqtapp.h
    128.  
    129. myqtapp.h: myqtapp.ui
    130. $(UIC) myqtapp.ui -o myqtapp.h
    131.  
    132. myqtapp.cpp: myqtapp.h myqtapp.ui
    133. $(UIC) myqtapp.ui -i myqtapp.h -o myqtapp.cpp
    134.  
    135. myqtapp.o: myqtapp.cpp myqtapp.h
    136.  
    137. moc_myqtapp.o: moc_myqtapp.cpp myqtapp.h
    138.  
    139. moc_myqtapp.cpp: $(MOC) myqtapp.h
    140. $(MOC) myqtapp.h -o moc_myqtapp.cpp
    141.  
    142. ####### Install
    143.  
    144. install:
    145.  
    146. uninstall:
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake: does no generate .h file from .ui file

    Try to update your qmake, because it looks like you have old version.
    To fix this by hand, I think you need to change INTERFACES += to FORMS += in .pro file.

  3. #3
    Join Date
    Apr 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake: does no generate .h file from .ui file

    To fix this by hand, I think you need to change INTERFACES += to FORMS += in .pro file.
    I try this way many time but i have any diffrents if I use FORM or INTERFACES

    Try to update your qmake, because it looks like you have old version.
    I have before qt4-make 4.6.2. Now I install qt4-make 4.7.0 by i still have this problem

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qmake: does no generate .h file from .ui file

    qt4-make 4.6.2. Now I install qt4-make 4.7.0
    What is the output of qmake -version ? Should be something like:
    QMake version 2.01a
    Using Qt version 4.7.2 in /usr/local/Trolltech/Qt-4.7.2/lib
    try
    sudo apt-get update
    sudo apt-get install qt4-qmake
    or build qt from sources ( qt-everywhere-opensource-src-4.7.2 )

Similar Threads

  1. how to generate sis file with qt
    By fareenafatima in forum Newbie
    Replies: 2
    Last Post: 27th February 2011, 18:53
  2. how to generate a PDF file with qt?
    By ghnie in forum Qt Programming
    Replies: 1
    Last Post: 25th March 2010, 07:23
  3. Generate a form from an XML file.
    By cbarmpar in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 15:54
  4. how to generate debug file???
    By sudheer in forum Qt Tools
    Replies: 2
    Last Post: 1st May 2008, 23:03
  5. how can i generate .cpp file in QT 4.3.0
    By gamitkumar in forum General Programming
    Replies: 4
    Last Post: 3rd September 2007, 22:23

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.