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?
Forum Updated to NodeBB v4.3 + New Features

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.4k Views 2 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.
  • M Offline
    M Offline
    Mucip
    wrote on 27 Apr 2019, 13:10 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:)

    A 1 Reply Last reply 27 Apr 2019, 13:16
    0
    • M Mucip
      27 Apr 2019, 13:10

      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:)

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 27 Apr 2019, 13:16 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.

      M 1 Reply Last reply 27 Apr 2019, 13:21
      0
      • A aha_1980
        27 Apr 2019, 13:16

        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 :)

        M Offline
        M Offline
        Mucip
        wrote on 27 Apr 2019, 13:21 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:)

        A 1 Reply Last reply 27 Apr 2019, 13:34
        0
        • M Mucip
          27 Apr 2019, 13:21

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

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

          Regards,
          Mucip:)

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 27 Apr 2019, 13:34 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.

          M 1 Reply Last reply 27 Apr 2019, 13:40
          0
          • A aha_1980
            27 Apr 2019, 13:34

            @Mucip

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

            M Offline
            M Offline
            Mucip
            wrote on 27 Apr 2019, 13:40 last edited by
            #5

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

            Regards,
            Mucip:)

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 27 Apr 2019, 13:44 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.

              A 1 Reply Last reply 27 Apr 2019, 14:51
              2
              • M mrjj
                27 Apr 2019, 13:44

                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.

                A Offline
                A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on 27 Apr 2019, 14:51 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.

                M 1 Reply Last reply 27 Apr 2019, 14:59
                0
                • A aha_1980
                  27 Apr 2019, 14:51

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

                  Anyone wanting to create a bugreport?

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 27 Apr 2019, 14:59 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 )

                  A M 2 Replies Last reply 27 Apr 2019, 15:21
                  0
                  • M mrjj
                    27 Apr 2019, 14:59

                    @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 )

                    A Offline
                    A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on 27 Apr 2019, 15:21 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
                    • M mrjj
                      27 Apr 2019, 14:59

                      @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 )

                      M Offline
                      M Offline
                      Mucip
                      wrote on 27 Apr 2019, 15:27 last edited by
                      #10

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

                      Regards,
                      Mucip:)

                      M 1 Reply Last reply 27 Apr 2019, 18:10
                      0
                      • M Mucip
                        27 Apr 2019, 15:27

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

                        Regards,
                        Mucip:)

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 27 Apr 2019, 18:10 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.

                        M 1 Reply Last reply 27 Apr 2019, 18:13
                        0
                        • M mrjj
                          27 Apr 2019, 18:10

                          @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.

                          M Offline
                          M Offline
                          Mucip
                          wrote on 27 Apr 2019, 18:13 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
                          • M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 27 Apr 2019, 20:42 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

                            M 1 Reply Last reply 27 Apr 2019, 20:52
                            1
                            • M mrjj
                              27 Apr 2019, 20:42

                              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

                              M Offline
                              M Offline
                              Mucip
                              wrote on 27 Apr 2019, 20:52 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:)

                              M 1 Reply Last reply 27 Apr 2019, 21:08
                              1
                              • M Mucip
                                27 Apr 2019, 20:52

                                @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:)

                                M Offline
                                M Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on 27 Apr 2019, 21:08 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.

                                M 1 Reply Last reply 27 Apr 2019, 21:22
                                1
                                • M mrjj
                                  27 Apr 2019, 21:08

                                  @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.

                                  M Offline
                                  M Offline
                                  Mucip
                                  wrote on 27 Apr 2019, 21:22 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:)

                                  M 1 Reply Last reply 27 Apr 2019, 21:24
                                  1
                                  • M Mucip
                                    27 Apr 2019, 21:22

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

                                    Regards,
                                    Mucip:)

                                    M Offline
                                    M Offline
                                    mrjj
                                    Lifetime Qt Champion
                                    wrote on 27 Apr 2019, 21:24 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.

                                    M 1 Reply Last reply 27 Apr 2019, 21:47
                                    0
                                    • M mrjj
                                      27 Apr 2019, 21:24

                                      @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.

                                      M Offline
                                      M Offline
                                      Mucip
                                      wrote on 27 Apr 2019, 21:47 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:)

                                      M 1 Reply Last reply 27 Apr 2019, 21:57
                                      0
                                      • M Mucip
                                        27 Apr 2019, 21:47

                                        Hi @mrjj,
                                        There is still nothing! :(

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

                                        Regards,
                                        Mucip:)

                                        M Offline
                                        M Offline
                                        mrjj
                                        Lifetime Qt Champion
                                        wrote on 27 Apr 2019, 21:57 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 :)

                                        M 1 Reply Last reply 27 Apr 2019, 22:09
                                        1
                                        • M mrjj
                                          27 Apr 2019, 21:57

                                          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 :)

                                          M Offline
                                          M Offline
                                          Mucip
                                          wrote on 27 Apr 2019, 22:09 last edited by
                                          #20

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

                                          Regards,
                                          Mucip:)

                                          M 1 Reply Last reply 27 Apr 2019, 23:33
                                          1

                                          7/27

                                          27 Apr 2019, 14:51

                                          topic:navigator.unread, 20
                                          • Login

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