Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. When ever i add button or checkbox or anything in any UI file form it doesn't appear
Qt 6.12 LTS is out! See what's new in the release blog

When ever i add button or checkbox or anything in any UI file form it doesn't appear

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 5 Posters 5.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JKSHJ JKSH
    1. Save your files
    2. Close Qt Creator
    3. Delete the folder C:\Users\Mostafa\Downloads\HospitalSoftware Last Version\build-Hospital-ClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug\
    4. Open Qt Creator and rebuild your project
    M Offline
    M Offline
    MostafaEzzat
    wrote on last edited by
    #5

    @JKSH

    i did that just right now and still the same result

    1 Reply Last reply
    0
    • aha_1980A aha_1980

      Hi @MostafaEzzat

      HospitalSoftware Last Version

      Please, please avoid project names with spaces or other special characters.

      You will run into problems sooner or later. Maybe this one is already a result of that.

      Regards

      M Offline
      M Offline
      MostafaEzzat
      wrote on last edited by
      #6

      @aha_1980

      this's the folder name the project name doesn't have any spaces but it has "-"

      Regards

      aha_1980A 1 Reply Last reply
      0
      • M MostafaEzzat

        @aha_1980

        this's the folder name the project name doesn't have any spaces but it has "-"

        Regards

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #7

        Hi @MostafaEzzat,

        I doesn't matter. The full path should be pure ASCII, without spaces.

        Regards

        Qt has to stay free or it will die.

        M 1 Reply Last reply
        0
        • aha_1980A aha_1980

          Hi @MostafaEzzat,

          I doesn't matter. The full path should be pure ASCII, without spaces.

          Regards

          M Offline
          M Offline
          MostafaEzzat
          wrote on last edited by
          #8

          @aha_1980

          i chagned the name of folders and .pro file to names without spaces or special characters (however when it was running on linux it was fine but i thought maybe it the issue , i even moved the folder to another directory ) but the problem still exists any change in UI FORM doesn't work

          Captureqts.PNG

          aha_1980A JonBJ Pl45m4P 3 Replies Last reply
          0
          • M MostafaEzzat

            @aha_1980

            i chagned the name of folders and .pro file to names without spaces or special characters (however when it was running on linux it was fine but i thought maybe it the issue , i even moved the folder to another directory ) but the problem still exists any change in UI FORM doesn't work

            Captureqts.PNG

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #9

            Hi @MostafaEzzat,

            ok, please make sure that no ui_xxxx.h files exist in your source folder (they should only be generated in the build folder).

            This is the most common reason for problems like yours.

            Regards

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • M MostafaEzzat

              @aha_1980

              i chagned the name of folders and .pro file to names without spaces or special characters (however when it was running on linux it was fine but i thought maybe it the issue , i even moved the folder to another directory ) but the problem still exists any change in UI FORM doesn't work

              Captureqts.PNG

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #10

              @MostafaEzzat
              You originally said "When ever i add button or checkbox or anything in any UI file form it doesn't appear", though I see there are at least a couple of buttons which do appear.

              That aside. I would think it's time you did some detective work yourself, to see where it's getting to/falling over.

              • Within Designer there is Tools > Form Editor > Preview. How does that look?

              • Have a look in the .ui file after saving (it's not read-only, is it?). Does that have your changes or not? If it has the ones you added, what is different about them compared against the couple I see which do work?

              • If the changes are going into the .ui file, have a look in the code generated into the ui_....h file. Does that have code for the new items? Again, is the code different from the ones which do work?

              Then at least we'll know where the problem actually is....

              M 1 Reply Last reply
              0
              • JonBJ JonB

                @MostafaEzzat
                You originally said "When ever i add button or checkbox or anything in any UI file form it doesn't appear", though I see there are at least a couple of buttons which do appear.

                That aside. I would think it's time you did some detective work yourself, to see where it's getting to/falling over.

                • Within Designer there is Tools > Form Editor > Preview. How does that look?

                • Have a look in the .ui file after saving (it's not read-only, is it?). Does that have your changes or not? If it has the ones you added, what is different about them compared against the couple I see which do work?

                • If the changes are going into the .ui file, have a look in the code generated into the ui_....h file. Does that have code for the new items? Again, is the code different from the ones which do work?

                Then at least we'll know where the problem actually is....

                M Offline
                M Offline
                MostafaEzzat
                wrote on last edited by MostafaEzzat
                #11

                @JonB @aha_1980

                Hi,

                i mean by whenever that all ui form files changes in this specific project doesn't appear but new projects it works fine

                .ui file it's not read only, Plus the new editing like adding button or whatever it added also in .ui file but it doesn't appear when i ran the software

                and this's.ui file code about new buttons which i added for the test

                   <widget class="QPushButton" name="pushButton_2">
                                  <property name="text">
                                   <string>PushButton</string>
                                  </property>
                                 </widget>
                                </item>
                                <item>
                                 <widget class="QPushButton" name="pushButton_5">
                                  <property name="text">
                                   <string>PushButton</string>
                                  </property>
                                 </widget>
                

                and this's the form editor it apears here but it doesn't apear after running and i check the folder files there is no such a file

                ui_xxxx.h
                

                Thanks for Responding
                Regards

                qttttt.PNG

                JonBJ 1 Reply Last reply
                0
                • M MostafaEzzat

                  @aha_1980

                  i chagned the name of folders and .pro file to names without spaces or special characters (however when it was running on linux it was fine but i thought maybe it the issue , i even moved the folder to another directory ) but the problem still exists any change in UI FORM doesn't work

                  Captureqts.PNG

                  Pl45m4P Offline
                  Pl45m4P Offline
                  Pl45m4
                  wrote on last edited by
                  #12

                  @MostafaEzzat

                  Do you have multiple *.ui files in your project dir? Maybe you've created a backup of your design file and / or the wrong one is included in your .pro. So that the one you edit, is not the one your program is loading...

                  How does your pro file look and what files do you have in your directory?


                  If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                  ~E. W. Dijkstra

                  1 Reply Last reply
                  2
                  • M MostafaEzzat

                    @JonB @aha_1980

                    Hi,

                    i mean by whenever that all ui form files changes in this specific project doesn't appear but new projects it works fine

                    .ui file it's not read only, Plus the new editing like adding button or whatever it added also in .ui file but it doesn't appear when i ran the software

                    and this's.ui file code about new buttons which i added for the test

                       <widget class="QPushButton" name="pushButton_2">
                                      <property name="text">
                                       <string>PushButton</string>
                                      </property>
                                     </widget>
                                    </item>
                                    <item>
                                     <widget class="QPushButton" name="pushButton_5">
                                      <property name="text">
                                       <string>PushButton</string>
                                      </property>
                                     </widget>
                    

                    and this's the form editor it apears here but it doesn't apear after running and i check the folder files there is no such a file

                    ui_xxxx.h
                    

                    Thanks for Responding
                    Regards

                    qttttt.PNG

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by JonB
                    #13

                    @MostafaEzzat
                    First, do follow what @Pl45m4 has suggested.

                    The ui....h files are generated during build (via uic) from your .ui into your build directory, where the *.obj files go. If your .ui file is getting updated there is something going astray during the uic build phase.

                    When you change the .ui file, have a look during the Build at what commands are being executed in the Compile Output window. If nothing then you have an issue!

                    M 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @MostafaEzzat
                      First, do follow what @Pl45m4 has suggested.

                      The ui....h files are generated during build (via uic) from your .ui into your build directory, where the *.obj files go. If your .ui file is getting updated there is something going astray during the uic build phase.

                      When you change the .ui file, have a look during the Build at what commands are being executed in the Compile Output window. If nothing then you have an issue!

                      M Offline
                      M Offline
                      MostafaEzzat
                      wrote on last edited by MostafaEzzat
                      #14

                      @JonB @Pl45m4

                      i do have multiple .ui file in the project but there is no dublicate ui file that have the same name
                      but i've multiple .pro files and there are dublicate like

                      Hospital-ClinicSoftware.pro.user.181918d.4.8-pre1
                      Hospital-ClinicSoftware.pro.user
                      HospitalClinicSoftware.pro.user
                      Hospital-ClinicSoftware
                      HospitalClinicSoftware "**note this not .pro it's normal file have the same name**"
                      

                      but i'm sorry i don't what's uic build exactly doing to ui files and i can't post Compile Output Result because it's more than 32000 character

                      this my .pro file code

                      #-------------------------------------------------
                      #
                      # Project created by QtCreator 2018-12-24T22:54:39
                      #
                      #-------------------------------------------------
                      #
                      
                      QT  += core gui sql
                       greaterThan(QT_MAJOR_VERSION, 4): QT +=  widgets designer
                      
                      TARGET = HospitalClinicSoftware
                      TEMPLATE += app lib libs
                      
                      # The following define makes your compiler emit warnings if you use
                      # any feature of Qt which has been marked as deprecated (the exact warnings
                      # depend on your compiler). Please consult the documentation of the
                      # deprecated API in order to know how to port your code away from it.
                      DEFINES += QT_DEPRECATED_WARNINGS
                      
                      # You can also make your code fail to compile if you use deprecated APIs.
                      # In order to do so, uncomment the following line.
                      # You can also select to disable deprecated APIs only up to a certain version of Qt.
                      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                      
                      
                      
                      CONFIG += c++11  plugins plugin designer
                      
                      SOURCES += \
                              main.cpp \
                              mainwindow.cpp \
                          mainprocess.cpp \
                          mysqldatabase.cpp \
                          showingdata.cpp \
                          delgate.cpp \
                          profile3.cpp \
                          profile.cpp \
                         multipagewidget.cpp \
                          multipagewidgetplugin.cpp \
                          multipagewidgetcontainerextension.cpp \
                           multipagewidgetextensionfactory.cpp \
                      
                      
                          mysqldatabase.cpp
                      
                      HEADERS += \
                               mainwindow.h \
                          mainprocess.h \
                          showingdata.h \
                          delgate.h \
                          profile3.h \
                          profile.h \
                          multipagewidget.h \
                                    multipagewidgetplugin.h \
                                    multipagewidgetcontainerextension.h \
                                    multipagewidgetextensionfactory.h \
                          mysqldatabase.h
                      
                      
                      
                      FORMS += \
                           mainwindow.ui \
                          mainprocess.ui \
                          showingdata.ui \
                          profile3.ui \
                          profile.ui
                      
                      # Default rules for deployment.
                      qnx: target.path = /tmp/$${TARGET}/bin
                      else: unix:!android: target.path += /opt/$${TARGET}/bin $$[QT_INSTALL_PLUGINS]/designer
                      !isEmpty(target.path): INSTALLS += target
                      
                      DISTFILES +=
                      
                      

                      Edit:

                      Thi's the part of uic in Compile Output

                      16:47:08: Running steps for project HospitalClinicSoftware...
                      16:47:08: Starting: "D:\Qt\5.15.1\mingw81_32\bin\qmake.exe" D:\HospitalClinicSoftware\HospitalClinicSoftware.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                      Info: creating stash file D:\build-HospitalClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug\.qmake.stash
                      Project WARNING: CONFIG+=designer is deprecated. Use QT+=designer instead.
                      Project WARNING: CONFIG+=designer is deprecated. Use QT+=designer instead.
                      Project WARNING: CONFIG+=designer is deprecated. Use QT+=designer instead.
                      16:47:12: The process "D:\Qt\5.15.1\mingw81_32\bin\qmake.exe" exited normally.
                      16:47:12: Starting: "D:\Qt\Tools\mingw810_32\bin\mingw32-make.exe" -f D:/build-HospitalClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug/Makefile qmake_all
                      mingw32-make: Nothing to be done for 'qmake_all'.
                      16:47:13: The process "D:\Qt\Tools\mingw810_32\bin\mingw32-make.exe" exited normally.
                      16:47:13: Starting: "D:\Qt\Tools\mingw810_32\bin\mingw32-make.exe" -j2
                      D:/Qt/Tools/mingw810_32/bin/mingw32-make -f Makefile.Debug
                      mingw32-make[1]: Entering directory 'D:/build-HospitalClinicSoftware-Desktop_Qt_5_15_1_MinGW_32_bit-Debug'
                      D:\Qt\5.15.1\mingw81_32\bin\uic.exe ..\HospitalClinicSoftware\mainwindow.ui -o ui_mainwindow.h
                      D:\Qt\5.15.1\mingw81_32\bin\uic.exe ..\HospitalClinicSoftware\mainprocess.ui -o ui_mainprocess.h
                      D:\Qt\5.15.1\mingw81_32\bin\uic.exe ..\HospitalClinicSoftware\showingdata.ui -o ui_showingdata.h
                      D:\Qt\5.15.1\mingw81_32\bin\uic.exe ..\HospitalClinicSoftware\profile3.ui -o ui_profile3.h
                      D:\Qt\5.15.1\mingw81_32\bin\uic.exe ..\HospitalClinicSoftware\profile.ui -o ui_profile.h
                      g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_PLUGIN -DQT_DESIGNER_LIB -DQT_UIPLUGIN_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -DQT_NEEDS_QMAIN -I..\HospitalClinicSoftware -I. -I..\Qt\5.15.1\mingw81_32\include -I..\Qt\5.15.1\mingw81_32\include\QtDesigner -I..\Qt\5.15.1\mingw81_32\include\QtUiPlugin -I..\Qt\5.15.1\mingw81_32\include\QtWidgets -I..\Qt\5.15.1\mingw81_32\include\QtGui -I..\Qt\5.15.1\mingw81_32\include\QtANGLE -I..\Qt\5.15.1\mingw81_32\include\QtSql -I..\Qt\5.15.1\mingw81_32\include\QtXml -I..\Qt\5.15.1\mingw81_32\include\QtCore -Idebug -I. -I..\Qt\5.15.1\mingw81_32\mkspecs\win32-g++  -o debug\main.o ..\HospitalClinicSoftware\main.cpp
                      g++ -c -fno-keep-inline-dllexport -g -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_PLUGIN -DQT_DESIGNER_LIB -DQT_UIPLUGIN_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -DQT_NEEDS_QMAIN -I..\HospitalClinicSoftware -I. -I..\Qt\5.15.1\mingw81_32\include -I..\Qt\5.15.1\mingw81_32\include\QtDesigner -I..\Qt\5.15.1\mingw81_32\include\QtUiPlugin -I..\Qt\5.15.1\mingw81_32\include\QtWidgets -I..\Qt\5.15.1\mingw81_32\include\QtGui -I..\Qt\5.15.1\mingw81_32\include\QtANGLE -I..\Qt\5.15.1\mingw81_32\include\QtSql -I..\Qt\5.15.1\mingw81_32\include\QtXml -I..\Qt\5.15.1\mingw81_32\include\QtCore -Idebug -I. -I..\Qt\5.15.1\mingw81_32\mkspecs\win32-g++  -o debug\mainwindow.o ..\HospitalClinicSoftware\mainwindow.cpp
                      
                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt
                      • Unsolved