.ui form conversion into C++ header file by UIC



  • CHALLENGE (problem):
    #include "ui_Central.h"

    Issues: ui_Central.h: No such file or directory

    I am following a tutorial for my first Qt application:
    http://sector.ynet.sk/qt4-tutorial/my-first-qt-gui-application.html

    I used the code exactly as it is BUT I renamed
    myqtapp
    to
    Central
    in every occurrence.

    After about 40 hours straight and downloading many of the various selections from Qt website, I finally discovered that the downloads are based on the compiler to be used. The current download version I am using is qt-enterprise-windows-x86-mingw-w64-492-5.5.1.exe

    Please, what do I need to do to correct this error?

    Any and all suggestions greatly appreciated.


  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    Hello,
    Could you please provide your .pro file?

    Kind regards.



  • wow, thank you shall do. I just re did the entire tutorial in the original as provided.
    how do I attach the files or code?


  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    Just paste your .pro file as a post here between tree backticks: ```. This will generate a code block and everything should be clearly visible.



  • Thank you! for your kindness.

    it is the same as in the tuturial url
    http://sector.ynet.sk/qt4-tutorial/my-first-qt-gui-application.html

    HEADERS     = Central.h 
    SOURCES     = Central.cpp main.cpp
    FORMS       = Central.ui
    
    # install
    target.path = Central
    sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
    sources.path = .
    INSTALLS += target sources
    

  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    Hello,
    Is this your whole project file, it seems a bit strange. For example a pro file from a project of mine looks like this:

    QT += core gui widgets
    CONFIG += link_prl
    
    TARGET = ageditor
    TEMPLATE = app
    
    win32  {
    	DESTDIR = $$OUT_PWD  //< This is because I'm using shadow builds
    }
    
    SOURCES += \
    	ageditormain.cpp \
    	ageditorwindow.cpp
    
    HEADERS  += \
    	ageditorwindow.h
    
    FORMS    += \
    	ageditorwindow.ui
    

    You don't seem to have put your full Qt configuration. Could you add these lines:

    QT += core gui widgets
    TARGET = Central
    TEMPLATE = app
    

    Rerun qmake and see what you get.

    Also this part:

    target.path = Central
    sources.files = $SOURCES $HEADERS $RESOURCES $FORMS *.pro
    sources.path = .
    INSTALLS += target sources
    

    I don't really understand.

    As a side note, what IDE are you using for development?

    Kind regards.



  • This is the IDE:

    Filename: qt-enterprise-windows-x86-mingw-w64-492-5.5.1.exe

    Description: Qt Enterprise offline installer for Windows host operating system. The package provides everything you need to start Qt development:


  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    Hello,

    This is the IDE:
    Filename: qt-enterprise-windows-x86-mingw-w64-492-5.5.1.exe

    Well this is an SDK package that contains the MinGW 65 bit compiler, Qt 5.5.1 and (probably) QtCreator. However you're not bound in any way to the QtCreator IDE, that's why I'm asking. You could be using some other tool to build your projects. In any case, I'd assume you're using the QtCreator, but that notwithstanding, you should still at least add the QT += configuration in your project.

    Kind regards.



  • ok how do I do that please


  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    You just edit your .pro file (double-clicking on it in the project view) and edit it manually. Look inhere I think it'll help you set your project up.

    Kind regards.



  • The whole thing is in Qt Creator. That is not the problem, the problem is why ui_Central.h is not being created.


  • Qt Champions 2016

    @TahorSuiJurisBenYAH
    Hello,
    It should be, provided your form is called Central.ui and you have the line FORMS += Central.ui in your project file the uic is supposed to create ui_Central.h for you when qmake runs. Maybe there's some problem with the path. Could you check whether the ui_Central.h is created or not in your build folder?

    Kind regards.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.