Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. changing objectName in design view does not update names in mainwindow.cpp
Forum Updated to NodeBB v4.3 + New Features

changing objectName in design view does not update names in mainwindow.cpp

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 3 Posters 6.8k Views 1 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.
  • A Offline
    A Offline
    arif_sohaib
    wrote on 26 May 2018, 15:36 last edited by
    #5

    I just made another project starting from scratch and it now works.
    Thanks for the help

    A 1 Reply Last reply 26 May 2018, 18:54
    2
    • A arif_sohaib
      26 May 2018, 15:36

      I just made another project starting from scratch and it now works.
      Thanks for the help

      A Offline
      A Offline
      arif_sohaib
      wrote on 26 May 2018, 18:54 last edited by
      #6

      I had run into one more problem that others looking at this thread might want a solution to.
      After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
      So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed.

      M A 2 Replies Last reply 26 May 2018, 19:12
      0
      • A arif_sohaib
        26 May 2018, 18:54

        I had run into one more problem that others looking at this thread might want a solution to.
        After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
        So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed.

        M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 26 May 2018, 19:12 last edited by mrjj
        #7

        @arif_sohaib
        Hi
        Its not normal at all.
        I use Designer all day and renaming anything is available at once
        via UI-> with no action on my part.

        Did you change/use shadow build folder or did anything special with the ui_xxx files ?

        Also check that you dont have a virus scanner blocking the files in the build folder.
        Especially if you are using Avast.

        A 1 Reply Last reply 26 May 2018, 23:58
        3
        • A arif_sohaib
          26 May 2018, 18:54

          I had run into one more problem that others looking at this thread might want a solution to.
          After building and running the program, I added a checkBox widgit and it was not showing up in code. This was the same thing as was happening before. I deleted the ui_mainwindow.h file and then it started working.
          So it looks like the problem was that qmake was not rebuilding the ui_mainwindow.h file after updates to the display unless its old version is deleted. I am not sure if this is the intended behavior or if it is my settings but if it is the normal behavior, this could turn a lot of people away from using Qt and needs to be fixed.

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 26 May 2018, 20:01 last edited by aha_1980
          #8

          @arif_sohaib,

          as @mrjj said, this usually works out of the box.

          one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.

          so if you have Clang Code Model enabled, you could check if it works if you don't open the generated files.

          Qt has to stay free or it will die.

          A 1 Reply Last reply 27 May 2018, 00:01
          2
          • M mrjj
            26 May 2018, 19:12

            @arif_sohaib
            Hi
            Its not normal at all.
            I use Designer all day and renaming anything is available at once
            via UI-> with no action on my part.

            Did you change/use shadow build folder or did anything special with the ui_xxx files ?

            Also check that you dont have a virus scanner blocking the files in the build folder.
            Especially if you are using Avast.

            A Offline
            A Offline
            arif_sohaib
            wrote on 26 May 2018, 23:58 last edited by
            #9

            @mrjj said in changing objectName in design view does not update names in mainwindow.cpp:

            Did you change/use shadow build folder or did anything special with the ui_xxx files ?
            Also check that you dont have a vir

            I tried with both Shadow Build on and off. I also changed the build folder because under the default settings, it wasn't able to find the .exe file when I hit run so I changed it to "project folder/build" and it started working.
            As for virus scanner, I only have the default Windows Defender.

            1 Reply Last reply
            0
            • A aha_1980
              26 May 2018, 20:01

              @arif_sohaib,

              as @mrjj said, this usually works out of the box.

              one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.

              so if you have Clang Code Model enabled, you could check if it works if you don't open the generated files.

              A Offline
              A Offline
              arif_sohaib
              wrote on 27 May 2018, 00:01 last edited by
              #10

              @aha_1980 said in changing objectName in design view does not update names in mainwindow.cpp:

              one more idea: usually you don't open the generated ui_*.h files. if you do, you may be hit by a Clang bug that forbids updating the file.

              I know not to touch generated files, and I don't for anything important, but I was just experimenting with getting it to work.
              I am not sure about Clang, I am not sure. I am using the Visual Studio 2017 15 C++ compiler. Most things that I didn't mention are on their default settings.
              And thanks for the reply.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 27 May 2018, 07:08 last edited by aha_1980
                #11

                @arif_sohaib

                sorry for being so unspecific, I had QTCREATORBUG-15449 in mind.

                you can check with Help > About Plugins if Clang Code Model is enabled.

                Regards

                Qt has to stay free or it will die.

                1 Reply Last reply
                2
                • M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 27 May 2018, 07:29 last edited by
                  #12

                  Hi
                  That is very strange.
                  if you manually delete the ui_ file and compile it works every time ?

                  if you are using qmake, it normally call the UI tool correctly
                  http://doc.qt.io/qt-5/uic.html

                  Its just Creator + visual studio compiler and nothing special extra?

                  1 Reply Last reply
                  2
                  • A Offline
                    A Offline
                    arif_sohaib
                    wrote on 27 May 2018, 16:31 last edited by
                    #13

                    After the application compiled the first time alone with allowing adding more ui widgits, adding more widgits and compiling isn't causing any more problems.
                    Now any ui elements I add immediately show up in the mainwindow.cpp file without any additional steps.

                    M 1 Reply Last reply 27 May 2018, 16:33
                    1
                    • A arif_sohaib
                      27 May 2018, 16:31

                      After the application compiled the first time alone with allowing adding more ui widgits, adding more widgits and compiling isn't causing any more problems.
                      Now any ui elements I add immediately show up in the mainwindow.cpp file without any additional steps.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 27 May 2018, 16:33 last edited by
                      #14

                      @arif_sohaib
                      Ok super. Not sure what was up with it :)

                      1 Reply Last reply
                      1

                      14/14

                      27 May 2018, 16:33

                      • Login

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