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. Compiler error after reinstalling Qt
QtWS25 Last Chance

Compiler error after reinstalling Qt

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 1.0k Views
  • 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
    AdviInfo
    wrote on last edited by
    #1

    I recently had to reinstall Qt on my system. Was earlier using Qt creator 7.0.2 community it got upgraded to Qt Creator 12. I chose the same supporting Qt version 5.15.2 as was used before from Qt installer tool. When trying to build the project which I was working on, I get the following error:

    uic: Error in line 498, column 27 : Unexpected element fontweight
    File '..<projectname-removed for privacy>\settings.ui' is not valid
    jom: <build path>\Makefile.Release [ui_settings.h] Error 1

    jom: <build path>\Makefile [release] Error 2
    16:22:07: The process "C:\Qt\Tools\QtCreator\bin\jom\jom.exe" exited with code 2.
    Error while building/deploying project <project name> (kit: Desktop Qt 5.15.2 MSVC2019 64bit)
    When executing step "Make"

    There appears to be a mismatch in how Qt was reading UI files before and after. I checked the design file, the error is thrown for a push button randomly, whereas there are many other screens with QPushButtons.

    What could be the reason for this error.. I am totally lost. Would really appreciate any help. Attaching the kits and compilers being currently usedScreenshot 2024-03-14 163429.png

    jsulmJ JonBJ 2 Replies Last reply
    0
    • A AdviInfo

      @JonB I checked. The project was created using an older version of Qt. The pushbuttons in designer forms had a property 'fontweight' - which doesn't come up in forms created using the newer version of qt creator which I'm using. There are numerous buttons on different screens, so it's not possible to replace them all. Is there any way to import older ui files/projects as a whole to newer Qt versions?

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

      @AdviInfo said in Compiler error after reinstalling Qt:

      Is there any way to import older ui files/projects as a whole to newer Qt versions?

      Well doubtless not (other than using an older uic), else it would have said so? I don't know how old it is if fontweight used to exist but no longer does. Anyway, suggest you use a text editor/substitution script across your .ui files to make whatever change is necessary.

      A 1 Reply Last reply
      2
      • A AdviInfo

        I recently had to reinstall Qt on my system. Was earlier using Qt creator 7.0.2 community it got upgraded to Qt Creator 12. I chose the same supporting Qt version 5.15.2 as was used before from Qt installer tool. When trying to build the project which I was working on, I get the following error:

        uic: Error in line 498, column 27 : Unexpected element fontweight
        File '..<projectname-removed for privacy>\settings.ui' is not valid
        jom: <build path>\Makefile.Release [ui_settings.h] Error 1

        jom: <build path>\Makefile [release] Error 2
        16:22:07: The process "C:\Qt\Tools\QtCreator\bin\jom\jom.exe" exited with code 2.
        Error while building/deploying project <project name> (kit: Desktop Qt 5.15.2 MSVC2019 64bit)
        When executing step "Make"

        There appears to be a mismatch in how Qt was reading UI files before and after. I checked the design file, the error is thrown for a push button randomly, whereas there are many other screens with QPushButtons.

        What could be the reason for this error.. I am totally lost. Would really appreciate any help. Attaching the kits and compilers being currently usedScreenshot 2024-03-14 163429.png

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @AdviInfo Trx to delete the build folder and rebuild

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        0
        • jsulmJ jsulm

          @AdviInfo Trx to delete the build folder and rebuild

          A Offline
          A Offline
          AdviInfo
          wrote on last edited by
          #3

          @jsulm Tried it many times. Didn't work

          Pl45m4P 1 Reply Last reply
          0
          • A AdviInfo

            @jsulm Tried it many times. Didn't work

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

            @AdviInfo

            CMake or QMake?
            If you use QMake, delete everything .pro.user related, except your *.pro file of course.


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

            ~E. W. Dijkstra

            A 1 Reply Last reply
            0
            • A AdviInfo

              I recently had to reinstall Qt on my system. Was earlier using Qt creator 7.0.2 community it got upgraded to Qt Creator 12. I chose the same supporting Qt version 5.15.2 as was used before from Qt installer tool. When trying to build the project which I was working on, I get the following error:

              uic: Error in line 498, column 27 : Unexpected element fontweight
              File '..<projectname-removed for privacy>\settings.ui' is not valid
              jom: <build path>\Makefile.Release [ui_settings.h] Error 1

              jom: <build path>\Makefile [release] Error 2
              16:22:07: The process "C:\Qt\Tools\QtCreator\bin\jom\jom.exe" exited with code 2.
              Error while building/deploying project <project name> (kit: Desktop Qt 5.15.2 MSVC2019 64bit)
              When executing step "Make"

              There appears to be a mismatch in how Qt was reading UI files before and after. I checked the design file, the error is thrown for a push button randomly, whereas there are many other screens with QPushButtons.

              What could be the reason for this error.. I am totally lost. Would really appreciate any help. Attaching the kits and compilers being currently usedScreenshot 2024-03-14 163429.png

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

              @AdviInfo
              If you can't find anything else which works. Try telling jom not to do any builds in parallel and see if that goes through. Just maybe uic was being run to generate ui_settings.h at the same time as compilation was trying to read it?

              Having said that

              File '..<projectname-removed for privacy>\settings.ui' is not valid

              implies it does not like the content of the .ui file in the first place. Is the error repeatable? I would look at line 498, column 27 to see what is going on.

              A 1 Reply Last reply
              0
              • Pl45m4P Pl45m4

                @AdviInfo

                CMake or QMake?
                If you use QMake, delete everything .pro.user related, except your *.pro file of course.

                A Offline
                A Offline
                AdviInfo
                wrote on last edited by
                #6

                @Pl45m4 Using qmake. Tried deleting .pro user file and reselecting the required kit

                1 Reply Last reply
                0
                • JonBJ JonB

                  @AdviInfo
                  If you can't find anything else which works. Try telling jom not to do any builds in parallel and see if that goes through. Just maybe uic was being run to generate ui_settings.h at the same time as compilation was trying to read it?

                  Having said that

                  File '..<projectname-removed for privacy>\settings.ui' is not valid

                  implies it does not like the content of the .ui file in the first place. Is the error repeatable? I would look at line 498, column 27 to see what is going on.

                  A Offline
                  A Offline
                  AdviInfo
                  wrote on last edited by
                  #7

                  @JonB I checked. The project was created using an older version of Qt. The pushbuttons in designer forms had a property 'fontweight' - which doesn't come up in forms created using the newer version of qt creator which I'm using. There are numerous buttons on different screens, so it's not possible to replace them all. Is there any way to import older ui files/projects as a whole to newer Qt versions?

                  JonBJ 1 Reply Last reply
                  0
                  • A AdviInfo

                    @JonB I checked. The project was created using an older version of Qt. The pushbuttons in designer forms had a property 'fontweight' - which doesn't come up in forms created using the newer version of qt creator which I'm using. There are numerous buttons on different screens, so it's not possible to replace them all. Is there any way to import older ui files/projects as a whole to newer Qt versions?

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

                    @AdviInfo said in Compiler error after reinstalling Qt:

                    Is there any way to import older ui files/projects as a whole to newer Qt versions?

                    Well doubtless not (other than using an older uic), else it would have said so? I don't know how old it is if fontweight used to exist but no longer does. Anyway, suggest you use a text editor/substitution script across your .ui files to make whatever change is necessary.

                    A 1 Reply Last reply
                    2
                    • JonBJ JonB

                      @AdviInfo said in Compiler error after reinstalling Qt:

                      Is there any way to import older ui files/projects as a whole to newer Qt versions?

                      Well doubtless not (other than using an older uic), else it would have said so? I don't know how old it is if fontweight used to exist but no longer does. Anyway, suggest you use a text editor/substitution script across your .ui files to make whatever change is necessary.

                      A Offline
                      A Offline
                      AdviInfo
                      wrote on last edited by
                      #9

                      @JonB That actually worked. Thank you!

                      1 Reply Last reply
                      0
                      • A AdviInfo has marked this topic as solved on

                      • Login

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