Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. New UI widgets elements inaccessible to code model

New UI widgets elements inaccessible to code model

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
24 Posts 4 Posters 2.6k 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.
  • ThirdStrandT ThirdStrand

    This post is deleted!

    ThirdStrandT Offline
    ThirdStrandT Offline
    ThirdStrand
    wrote on last edited by ThirdStrand
    #10
    This post is deleted!
    1 Reply Last reply
    0
    • ThirdStrandT ThirdStrand

      @Pl45m4 Ok is this a Qt5 vs. Qt6 issue then? I tested an older Qt5 project. I'll retest with a newer Qt6 qmake project and report back.

      ThirdStrandT Offline
      ThirdStrandT Offline
      ThirdStrand
      wrote on last edited by ThirdStrand
      #11

      @ThirdStrand said in New UI widgets elements inaccessible to code model:

      @Pl45m4 Ok is this a Qt5 vs. Qt6 issue then? I tested an older Qt5 project. I'll retest with a newer Qt6 qmake project and report back.

      So I opened a qmake project and set the kit to Qt 6.5.2. I built it. Then I opened the main UI file and added a QLabel. Ctrl + S to save, Shift + F4 to go to the source code and the code model found the QLabel immediately. Same as happened in Qt5 qmake. AND THIS HAPPENS WITH THE clangd process running.

      I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

      ThirdStrandT 1 Reply Last reply
      0
      • ThirdStrandT ThirdStrand

        @ThirdStrand said in New UI widgets elements inaccessible to code model:

        @Pl45m4 Ok is this a Qt5 vs. Qt6 issue then? I tested an older Qt5 project. I'll retest with a newer Qt6 qmake project and report back.

        So I opened a qmake project and set the kit to Qt 6.5.2. I built it. Then I opened the main UI file and added a QLabel. Ctrl + S to save, Shift + F4 to go to the source code and the code model found the QLabel immediately. Same as happened in Qt5 qmake. AND THIS HAPPENS WITH THE clangd process running.

        I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

        ThirdStrandT Offline
        ThirdStrandT Offline
        ThirdStrand
        wrote on last edited by
        #12

        ...

        I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

        INTERESTING:
        The qmake project, when viewed in the "Tools/Debug QtCreator Code Model Inspector" (Ctrl+Shift+F12) shows both of my project's UI header files (ui_classname.h) as part of the Project Files tab.

        The cmake project with the same set of files, however, does NOT show them in the Project Files tab. If I explicitly add the ui_classname.h files to the cmake list of input files, there is no (discernable) activity when either of those two files change.

        Next stop bug report unless someone has further information.

        ThirdStrandT 1 Reply Last reply
        0
        • ThirdStrandT ThirdStrand

          ...

          I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

          INTERESTING:
          The qmake project, when viewed in the "Tools/Debug QtCreator Code Model Inspector" (Ctrl+Shift+F12) shows both of my project's UI header files (ui_classname.h) as part of the Project Files tab.

          The cmake project with the same set of files, however, does NOT show them in the Project Files tab. If I explicitly add the ui_classname.h files to the cmake list of input files, there is no (discernable) activity when either of those two files change.

          Next stop bug report unless someone has further information.

          ThirdStrandT Offline
          ThirdStrandT Offline
          ThirdStrand
          wrote on last edited by
          #13

          @ThirdStrand said in New UI widgets elements inaccessible to code model:

          ...

          I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

          INTERESTING:
          ...

          Next stop bug report unless someone has further information.

          If clangd is turned off completely (confirmed not even running on the PC), the same behavior remains. Works in qmake, and doesn't work in cmake. This may have something to do with cmake and AUTOUIC perhaps????????

          Pl45m4P 1 Reply Last reply
          0
          • ThirdStrandT ThirdStrand

            @ThirdStrand said in New UI widgets elements inaccessible to code model:

            ...

            I cannot believe that I am the only one who has noticed this. Not being able to have code completion when adding UI elements severely slows down creation of UI projects.

            INTERESTING:
            ...

            Next stop bug report unless someone has further information.

            If clangd is turned off completely (confirmed not even running on the PC), the same behavior remains. Works in qmake, and doesn't work in cmake. This may have something to do with cmake and AUTOUIC perhaps????????

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

            Hm... maybe somebody else will comment on this whole thing and possibly can reproduce it. Could be some weird config, could be a bug or some unhandled behavior...
            Good luck ;-)


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

            ~E. W. Dijkstra

            ThirdStrandT 1 Reply Last reply
            0
            • Pl45m4P Pl45m4

              Hm... maybe somebody else will comment on this whole thing and possibly can reproduce it. Could be some weird config, could be a bug or some unhandled behavior...
              Good luck ;-)

              ThirdStrandT Offline
              ThirdStrandT Offline
              ThirdStrand
              wrote on last edited by
              #15

              Yes, I am of the same hopes. Bear in mind also that this is a fresh Win11Pro PC, a freshly installed QtCreator 11.0.0 and the universal installer downloaded and installed all of the kits. Totally stock standard Qt.

              1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
              • ThirdStrandT Offline
                ThirdStrandT Offline
                ThirdStrand
                wrote on last edited by
                #16

                @Christian-Ehrlicher Thanks for moving this topic around in attempts to get visibility. Much appreciated.

                1 Reply Last reply
                0
                • ThirdStrandT Offline
                  ThirdStrandT Offline
                  ThirdStrand
                  wrote on last edited by
                  #17

                  For the record as no noise here yet:

                  https://bugreports.qt.io/browse/QTCREATORBUG-29465

                  JonBJ 1 Reply Last reply
                  0
                  • ThirdStrandT ThirdStrand

                    For the record as no noise here yet:

                    https://bugreports.qt.io/browse/QTCREATORBUG-29465

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

                    @ThirdStrand Have you noticed it is marked "Duplicate" of https://bugreports.qt.io/browse/QTCREATORBUG-28787 ?

                    1 Reply Last reply
                    0
                    • ThirdStrandT Offline
                      ThirdStrandT Offline
                      ThirdStrand
                      wrote on last edited by
                      #19

                      and ::

                      https://bugreports.qt.io/browse/QTCREATORBUG-28787

                      appears to have been reported this past February.

                      1 Reply Last reply
                      0
                      • cristian-adamC Online
                        cristian-adamC Online
                        cristian-adam
                        wrote on last edited by
                        #20

                        The CMake project using AUTOUIC set to ON do not work.

                        But if you don't use AUTOUIC it works as expected.

                        I've changed a hello-widgets-cmake project like this:

                        #set(CMAKE_AUTOUIC ON)
                        
                        qt_wrap_ui(UI_SRC mainwindow.ui)
                        
                        set(PROJECT_SOURCES
                                main.cpp
                                mainwindow.cpp
                                mainwindow.h
                                ${UI_SRC}
                        )
                        target_include_directories(hello-widgets-cmake PRIVATE ${CMAKE_BINARY_DIR})
                        

                        And got it working for me.

                        ThirdStrandT 1 Reply Last reply
                        0
                        • cristian-adamC cristian-adam

                          The CMake project using AUTOUIC set to ON do not work.

                          But if you don't use AUTOUIC it works as expected.

                          I've changed a hello-widgets-cmake project like this:

                          #set(CMAKE_AUTOUIC ON)
                          
                          qt_wrap_ui(UI_SRC mainwindow.ui)
                          
                          set(PROJECT_SOURCES
                                  main.cpp
                                  mainwindow.cpp
                                  mainwindow.h
                                  ${UI_SRC}
                          )
                          target_include_directories(hello-widgets-cmake PRIVATE ${CMAKE_BINARY_DIR})
                          

                          And got it working for me.

                          ThirdStrandT Offline
                          ThirdStrandT Offline
                          ThirdStrand
                          wrote on last edited by
                          #21

                          @cristian-adam Thank you for the follow-up. I was reading about this old way yesterday, but I was not sure if it would make any difference.

                          Noting that CMake mark that generic command "qt_wrap_ui" as deprecated.

                          One should use qt6_wrap_ui which is supposedly provided by the Qt installation of CMake. (or the qt5 variant as required)

                          I will experiment with this in the meantime, and it appears promising!, while waiting for an official word from the Bug Report. If AUTOUIC is not terribly useful in it's current state, I am in hopes that it will be "fixed" to do what this manual qt6_wrap_ui accomplishes.

                          1 Reply Last reply
                          0
                          • ThirdStrandT Offline
                            ThirdStrandT Offline
                            ThirdStrand
                            wrote on last edited by
                            #22

                            Confirming changing to the qt6_wrap_ui method seems to work "normally". The bug under which mine was closed as a duplicate shows Fixed on the Kanban board, so looking forward to finding out soon.

                            cristian-adamC 1 Reply Last reply
                            0
                            • ThirdStrandT ThirdStrand has marked this topic as solved on
                            • ThirdStrandT ThirdStrand

                              Confirming changing to the qt6_wrap_ui method seems to work "normally". The bug under which mine was closed as a duplicate shows Fixed on the Kanban board, so looking forward to finding out soon.

                              cristian-adamC Online
                              cristian-adamC Online
                              cristian-adam
                              wrote on last edited by
                              #23

                              The bug is fixed. You could get binaries from https://github.com/qt-creator/qt-creator/actions/runs/5763934496 when the job is done.

                              Or wait until the fix landed in https://download.qt.io/snapshots/qtcreator/11.0/

                              1 Reply Last reply
                              0
                              • ThirdStrandT Offline
                                ThirdStrandT Offline
                                ThirdStrand
                                wrote on last edited by
                                #24

                                Additional note:

                                I built a new CMake file (using a file from another project and editing it) for an existing qmake project and attempted to build it. All components built until it got to building the UI. For some unknown reason, the resulting "ui_mainwindows.h" file, which is in it's normal place in the build folder was not found by CMake.

                                I changed CMake to turning on AUTOUIC and it built properly. Then changed it back to the qt6_wrap_ui method and it continues to build properly.

                                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 Extensions
                                • Unsolved