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. QtCreator can't Self-recognition new ui item

QtCreator can't Self-recognition new ui item

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 607 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.
  • R Offline
    R Offline
    RobinsonSir
    wrote on last edited by
    #1

    In QtCreator, I drag one QLabel into ui in design mode, then checkout to code edit mode,But I can't use the new QLabel pointer like this in ui class(In old version QtCreator can Self-recognition),

    ui->macLab->setText(id);
    

    I must rebuid project to generate new ui_xxxx.h,then the UI item can be used normal.

    My Qt version:

    0_1553075139020_bddda0e3-a000-41d7-99af-1ffd7db6e7be-image.png

    aha_1980A CP71C jsulmJ 3 Replies Last reply
    0
    • R RobinsonSir

      In QtCreator, I drag one QLabel into ui in design mode, then checkout to code edit mode,But I can't use the new QLabel pointer like this in ui class(In old version QtCreator can Self-recognition),

      ui->macLab->setText(id);
      

      I must rebuid project to generate new ui_xxxx.h,then the UI item can be used normal.

      My Qt version:

      0_1553075139020_bddda0e3-a000-41d7-99af-1ffd7db6e7be-image.png

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

      @RobinsonSir

      I guess you have the Clang Code Model enabled (Help > About Plugins > Clang Code Model). You can try to update Creator to 4.8 or even 4.9-beta (a release candidate is just around the corner).

      Regards

      Qt has to stay free or it will die.

      R 1 Reply Last reply
      0
      • aha_1980A aha_1980

        @RobinsonSir

        I guess you have the Clang Code Model enabled (Help > About Plugins > Clang Code Model). You can try to update Creator to 4.8 or even 4.9-beta (a release candidate is just around the corner).

        Regards

        R Offline
        R Offline
        RobinsonSir
        wrote on last edited by
        #3

        @aha_1980 Thanks for your reply , but i didn't load clangCodeModel

        0_1553077340599_decaefe9-9b20-4226-bfb7-0bdbc95ce8c8-image.png

        I will try your suggestion to update QtCreator verion .

        1 Reply Last reply
        1
        • R RobinsonSir

          In QtCreator, I drag one QLabel into ui in design mode, then checkout to code edit mode,But I can't use the new QLabel pointer like this in ui class(In old version QtCreator can Self-recognition),

          ui->macLab->setText(id);
          

          I must rebuid project to generate new ui_xxxx.h,then the UI item can be used normal.

          My Qt version:

          0_1553075139020_bddda0e3-a000-41d7-99af-1ffd7db6e7be-image.png

          CP71C Offline
          CP71C Offline
          CP71
          wrote on last edited by
          #4

          @RobinsonSir
          Hi,
          Try to manually delete the build directory, I often do this when I have compile o run problems that seem to be unjustified.

          1 Reply Last reply
          0
          • R RobinsonSir

            In QtCreator, I drag one QLabel into ui in design mode, then checkout to code edit mode,But I can't use the new QLabel pointer like this in ui class(In old version QtCreator can Self-recognition),

            ui->macLab->setText(id);
            

            I must rebuid project to generate new ui_xxxx.h,then the UI item can be used normal.

            My Qt version:

            0_1553075139020_bddda0e3-a000-41d7-99af-1ffd7db6e7be-image.png

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

            @RobinsonSir Just a note: what you posted is NOT necessarily the Qt version you're using, it's the version of Qt which was used to build QtCreator. To see which Qt version you're using go to the Kit you're using and check which Qt is selected there.

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

            R 1 Reply Last reply
            3
            • jsulmJ jsulm

              @RobinsonSir Just a note: what you posted is NOT necessarily the Qt version you're using, it's the version of Qt which was used to build QtCreator. To see which Qt version you're using go to the Kit you're using and check which Qt is selected there.

              R Offline
              R Offline
              RobinsonSir
              wrote on last edited by RobinsonSir
              #6

              @jsulm 0_1553491155729_5df22d01-9b6d-4153-8ce4-e1780ee896ae-image.png

              I think it's a QtCreator bug. I can write code like this:
              ui->macLab->setText(id);
              and compile app ok without error, just QtCreator can't Self-recognition macLab, it doesn't have keyword color.

              0_1553491514756_6199c84c-7f69-4e7e-9696-a329b4126c27-image.png

              Like this, first row macLab is not self-recognition, it's color is black, it should be red color like second row.

              But after I build or rebuild the project , macLab will have red color.

              0_1553491836701_d88f034a-0209-48ff-9a95-5bf6977588d3-image.png

              Some error info like this:

              0_1553503720151_20f1ae2f-2652-4dd3-8481-bbd5c0794f16-image.png

              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