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. Delay in code section when I change the widget name in Object explorer?

Delay in code section when I change the widget name in Object explorer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
27 Posts 3 Posters 3.3k 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.
  • MucipM Offline
    MucipM Offline
    Mucip
    wrote on last edited by
    #1

    Hi,
    I put any widget on the window in GUI design section. For instance I change the Object name from ComboBox to ComboCountryName.
    Then I go to code section and try to write;
    ui->ComboCountryName->currentText()
    But I got error! Because the object name is still
    ui->ComboBox->currentText()
    When I try to RUN first than Object name changed to ComboCountryName?!

    By the way when I try to create slot of this object. it's name is still ComboBox?!...

    I mean it need to be run first to recognize changed name?!
    Why?...

    Regards,
    Mucip:)

    aha_1980A 1 Reply Last reply
    0
    • MucipM Mucip

      Hi,
      I put any widget on the window in GUI design section. For instance I change the Object name from ComboBox to ComboCountryName.
      Then I go to code section and try to write;
      ui->ComboCountryName->currentText()
      But I got error! Because the object name is still
      ui->ComboBox->currentText()
      When I try to RUN first than Object name changed to ComboCountryName?!

      By the way when I try to create slot of this object. it's name is still ComboBox?!...

      I mean it need to be run first to recognize changed name?!
      Why?...

      Regards,
      Mucip:)

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

      Hi @Mucip,

      do you have the Clange Code Model activated? (In Help > About Plugins)

      Changes in the GUI are stored in the window.ui files, which cannot be compiled. Therefore, a tool called uic creates a "ui_window.h" file that contains your dialogs logic and is then compiled with your app.

      With the classic code model, Creator does this compiling already in RAM, so the code model can provide the completions before you actually compile. With Clang, it seems this is not working as well, so I most often compile my code to get the completion back.

      I know, that's rather a workaround then a solution, but maybe it helps you.

      Edit: I just tested it again, and for the small example it worked well, even with Clang (Creator 4.9). So it seems things have improved :)

      Qt has to stay free or it will die.

      MucipM 1 Reply Last reply
      0
      • aha_1980A aha_1980

        Hi @Mucip,

        do you have the Clange Code Model activated? (In Help > About Plugins)

        Changes in the GUI are stored in the window.ui files, which cannot be compiled. Therefore, a tool called uic creates a "ui_window.h" file that contains your dialogs logic and is then compiled with your app.

        With the classic code model, Creator does this compiling already in RAM, so the code model can provide the completions before you actually compile. With Clang, it seems this is not working as well, so I most often compile my code to get the completion back.

        I know, that's rather a workaround then a solution, but maybe it helps you.

        Edit: I just tested it again, and for the small example it worked well, even with Clang (Creator 4.9). So it seems things have improved :)

        MucipM Offline
        MucipM Offline
        Mucip
        wrote on last edited by
        #3

        Hi @aha_1980 ,
        Yes, it's active...

        I use 4.9 too. But I need to run first still?!... :(

        Regards,
        Mucip:)

        aha_1980A 1 Reply Last reply
        0
        • MucipM Mucip

          Hi @aha_1980 ,
          Yes, it's active...

          I use 4.9 too. But I need to run first still?!... :(

          Regards,
          Mucip:)

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

          @Mucip

          On which operating system are you? I tested a minimal Qt Widgets project on Linux.

          Qt has to stay free or it will die.

          MucipM 1 Reply Last reply
          0
          • aha_1980A aha_1980

            @Mucip

            On which operating system are you? I tested a minimal Qt Widgets project on Linux.

            MucipM Offline
            MucipM Offline
            Mucip
            wrote on last edited by
            #5

            Hi @aha_1980 ,
            Unfortunatelly I must use Windows... :(

            Regards,
            Mucip:)

            1 Reply Last reply
            0
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi
              Same for me in Windows with Creator 4.9
              i have to press shift+ctrl+b to have it pick up
              any newly added widgets/renames and show in auto complete dropdown.
              Else the old are still shown.

              With clang off, switching back to code with shift +f4, it's
              already updated in autocomplete.

              aha_1980A 1 Reply Last reply
              2
              • mrjjM mrjj

                Hi
                Same for me in Windows with Creator 4.9
                i have to press shift+ctrl+b to have it pick up
                any newly added widgets/renames and show in auto complete dropdown.
                Else the old are still shown.

                With clang off, switching back to code with shift +f4, it's
                already updated in autocomplete.

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

                @mrjj that confirms my observation, that Clang works better on Linux.

                Anyone wanting to create a bugreport?

                Qt has to stay free or it will die.

                mrjjM 1 Reply Last reply
                0
                • aha_1980A aha_1980

                  @mrjj that confirms my observation, that Clang works better on Linux.

                  Anyone wanting to create a bugreport?

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @aha_1980
                  But is it a bug ?
                  On linux, it will be ready for auto-completion as soon as switching back to code?
                  (i have older Creator on linux so could not test it )

                  aha_1980A MucipM 2 Replies Last reply
                  0
                  • mrjjM mrjj

                    @aha_1980
                    But is it a bug ?
                    On linux, it will be ready for auto-completion as soon as switching back to code?
                    (i have older Creator on linux so could not test it )

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

                    @mrjj

                    On linux, it will be ready for auto-completion as soon as switching back to code?

                    Yup. Same way as in former times with classic code model. I was impressed too :)

                    Qt has to stay free or it will die.

                    1 Reply Last reply
                    0
                    • mrjjM mrjj

                      @aha_1980
                      But is it a bug ?
                      On linux, it will be ready for auto-completion as soon as switching back to code?
                      (i have older Creator on linux so could not test it )

                      MucipM Offline
                      MucipM Offline
                      Mucip
                      wrote on last edited by
                      #10

                      Dear @mrjj ,
                      So what else? It works on Linux but doesn't work on windows?!...

                      Regards,
                      Mucip:)

                      mrjjM 1 Reply Last reply
                      0
                      • MucipM Mucip

                        Dear @mrjj ,
                        So what else? It works on Linux but doesn't work on windows?!...

                        Regards,
                        Mucip:)

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @Mucip
                        thats why i asked. :)
                        If it also did not work like old times in Linux, it might be intended but seems not.
                        (and i sorely missed even build file is fast)
                        I will create a bug report.

                        MucipM 1 Reply Last reply
                        0
                        • mrjjM mrjj

                          @Mucip
                          thats why i asked. :)
                          If it also did not work like old times in Linux, it might be intended but seems not.
                          (and i sorely missed even build file is fast)
                          I will create a bug report.

                          MucipM Offline
                          MucipM Offline
                          Mucip
                          wrote on last edited by
                          #12

                          @mrjj said in Delay in code section when I change the widget name in Object explorer?:

                          I will create a bug report.

                          Hi,
                          Thanks a lot...

                          Regards,
                          Mucip:)

                          1 Reply Last reply
                          0
                          • mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by mrjj
                            #13

                            Hi
                            we need to talk a bit about this.

                            To be sure i used the same version in both Linux and windows, i removed my windows Qt versions and
                            installed the newest from the online installer. And now autocompletion works as in Linux.??

                            @Mucip
                            Could you please try
                            Make new default GUI project. ( with the wizard)
                            Click on MainWindow.ui to see form
                            Drop pushbutton on the form
                            press shift+f4 to switch to code
                            start type ui-> and then see if the button is listed ?
                            For me that works now in Windows with Creator 4.9
                            No need to run or compile.
                            It also picks up renames now. And i cannot reproduce it. :(

                            alt text

                            MucipM 1 Reply Last reply
                            1
                            • mrjjM mrjj

                              Hi
                              we need to talk a bit about this.

                              To be sure i used the same version in both Linux and windows, i removed my windows Qt versions and
                              installed the newest from the online installer. And now autocompletion works as in Linux.??

                              @Mucip
                              Could you please try
                              Make new default GUI project. ( with the wizard)
                              Click on MainWindow.ui to see form
                              Drop pushbutton on the form
                              press shift+f4 to switch to code
                              start type ui-> and then see if the button is listed ?
                              For me that works now in Windows with Creator 4.9
                              No need to run or compile.
                              It also picks up renames now. And i cannot reproduce it. :(

                              alt text

                              MucipM Offline
                              MucipM Offline
                              Mucip
                              wrote on last edited by Mucip
                              #14

                              @mrjj,
                              I shocked! I did what you write.
                              I put one lineEdit on the form and change name to lineEditName.
                              Then press Shift+F4 to code section. And I start to see ui->lineEditName.

                              So what is the problem now?! Why old created project works bad then?!...

                              Edit: I tryed old code and still same problem?! I need to run code first to see code compşlation of new added object?!
                              Very strange!!! :(

                              Regards,
                              Mucip:)

                              mrjjM 1 Reply Last reply
                              1
                              • MucipM Mucip

                                @mrjj,
                                I shocked! I did what you write.
                                I put one lineEdit on the form and change name to lineEditName.
                                Then press Shift+F4 to code section. And I start to see ui->lineEditName.

                                So what is the problem now?! Why old created project works bad then?!...

                                Edit: I tryed old code and still same problem?! I need to run code first to see code compşlation of new added object?!
                                Very strange!!! :(

                                Regards,
                                Mucip:)

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                @Mucip
                                Hi
                                Tested some more.
                                Can you try something?
                                In your real project. Add a new button, name it "there"
                                shift to code
                                And then WAIT. count at least slowly to 30.
                                then type
                                ui->

                                I found out that in the larger projects, if you do it fast, it is not there
                                but then i went for coffee. and when i came back, it was in autocomplete.
                                I did not compile!
                                So Im starting to think its maybe just slower than we think.

                                MucipM 1 Reply Last reply
                                1
                                • mrjjM mrjj

                                  @Mucip
                                  Hi
                                  Tested some more.
                                  Can you try something?
                                  In your real project. Add a new button, name it "there"
                                  shift to code
                                  And then WAIT. count at least slowly to 30.
                                  then type
                                  ui->

                                  I found out that in the larger projects, if you do it fast, it is not there
                                  but then i went for coffee. and when i came back, it was in autocomplete.
                                  I did not compile!
                                  So Im starting to think its maybe just slower than we think.

                                  MucipM Offline
                                  MucipM Offline
                                  Mucip
                                  wrote on last edited by
                                  #16

                                  Hi @mrjj,
                                  I did what you advice and it's been 4 minutes and still nothing about ui->there?!... :(

                                  Regards,
                                  Mucip:)

                                  mrjjM 1 Reply Last reply
                                  1
                                  • MucipM Mucip

                                    Hi @mrjj,
                                    I did what you advice and it's been 4 minutes and still nothing about ui->there?!... :(

                                    Regards,
                                    Mucip:)

                                    mrjjM Offline
                                    mrjjM Offline
                                    mrjj
                                    Lifetime Qt Champion
                                    wrote on last edited by mrjj
                                    #17

                                    @Mucip
                                    Thank you for testing :)
                                    Ok, so yours clearly have another issue.
                                    Can i ask how BIG your project is ?
                                    is any of the files over 5MB?

                                    Still trying to find a really large Qt project to try on.
                                    Maybe Creators own source.

                                    MucipM 1 Reply Last reply
                                    0
                                    • mrjjM mrjj

                                      @Mucip
                                      Thank you for testing :)
                                      Ok, so yours clearly have another issue.
                                      Can i ask how BIG your project is ?
                                      is any of the files over 5MB?

                                      Still trying to find a really large Qt project to try on.
                                      Maybe Creators own source.

                                      MucipM Offline
                                      MucipM Offline
                                      Mucip
                                      wrote on last edited by
                                      #18

                                      Hi @mrjj,
                                      There is still nothing! :(

                                      I have 86 cpp file in project and max size is 41 KB...

                                      Regards,
                                      Mucip:)

                                      mrjjM 1 Reply Last reply
                                      0
                                      • MucipM Mucip

                                        Hi @mrjj,
                                        There is still nothing! :(

                                        I have 86 cpp file in project and max size is 41 KB...

                                        Regards,
                                        Mucip:)

                                        mrjjM Offline
                                        mrjjM Offline
                                        mrjj
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        Hi
                                        Well that is nothing. or far from 5 mb.

                                        I did notice while testing if there is anything it complains about with the
                                        red circles, sometimes it won't autocomplete.
                                        Im wondering if there is something in your project that stalls it.
                                        But i assume its for all UI files so that seems unlikely.

                                        However, if you are willing
                                        we could try
                                        https://wiki.qt.io/Qt_Creator_Clang_Code_Model
                                        (the windows part in the top. ) and then see if anything shows up in the log.
                                        DebugView is ultra small download so its not very time consuming.
                                        You do not have to read all of it. just the log part in top :)

                                        MucipM 1 Reply Last reply
                                        1
                                        • mrjjM mrjj

                                          Hi
                                          Well that is nothing. or far from 5 mb.

                                          I did notice while testing if there is anything it complains about with the
                                          red circles, sometimes it won't autocomplete.
                                          Im wondering if there is something in your project that stalls it.
                                          But i assume its for all UI files so that seems unlikely.

                                          However, if you are willing
                                          we could try
                                          https://wiki.qt.io/Qt_Creator_Clang_Code_Model
                                          (the windows part in the top. ) and then see if anything shows up in the log.
                                          DebugView is ultra small download so its not very time consuming.
                                          You do not have to read all of it. just the log part in top :)

                                          MucipM Offline
                                          MucipM Offline
                                          Mucip
                                          wrote on last edited by
                                          #20

                                          Hi @mrjj ,
                                          Well, I downloaded DebugView. But where is the log file to view in Debug View?...

                                          Regards,
                                          Mucip:)

                                          mrjjM 1 Reply Last reply
                                          1

                                          • Login

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