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. (Solved) GUI created form widgets suddenly not being automatically added to ui_mainwindow.h
Forum Updated to NodeBB v4.3 + New Features

(Solved) GUI created form widgets suddenly not being automatically added to ui_mainwindow.h

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.4k Views 1 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.
  • T Offline
    T Offline
    thedude1107
    wrote on last edited by
    #1

    The title says it all. Suddently, the new form widgets I create using the GUI editor are not being added to ui_mainwindow.h, so I cannot use the objects in my code.

    I tried Clean All -> Run qMake -> rebuild all, as the only online help I could find suggested.

    Also, currently the object Ui::MainWindow ui is only present in my MainWindow class, although it was previously also in another class. I know this can screw things up so that's why I mention it, and it may be linked to the problem. However, currently, the ui object is only a member to my MainWindow class and any new objects made by the GUI editor aren't being added properly.

    Has anybody found a cause and/or solution to this problem?

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      Perhaps you've switched from composition to inheritance?

      @
      // Composition:
      this->ui->label->setText("Hello");

      // Inheritance:
      this->label->setText("Hello");
      @

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Soraltan
        wrote on last edited by
        #3

        Hello and welcome

        Generally it sounds as if the Ui-Compiler uic is not executed. The GUI Editor (I suppose you refer to the QtDesigner) produces ui-Files which are xml-descriptions of your gui. These are then translated by the uic into C++ code (ui_xy.h files).

        Anyhow, this should have been executed when you performed all the steps you mentioned above. As to why this is apparently not executed, I can only guess. Could you post your .pro file? This is pretty much the only source of error I can think of given, that you executed make clean, qmake and make (which the steps you describe do).

        Best Soraltan

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thedude1107
          wrote on last edited by
          #4

          Thanks for the replies guys.

          I was able to solve this by pressing "ctrl+shift+w", which closed all open source files. Then, after doing clean all -> run qmake, rebuild all, I can now find the widgets in my ui object.

          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