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. ui_mainwindow.h does not update when adding something to the MainWindow
QtWS25 Last Chance

ui_mainwindow.h does not update when adding something to the MainWindow

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 632 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.
  • H Offline
    H Offline
    HenkCoder
    wrote on last edited by HenkCoder
    #1

    Hello, I'm new to Qt and I wanted to try to build something on my own but i noticed that whenever I add something to mainwindow.ui, the file ui_mainwindow.h does not update so when I try to refer to it (ui->label1) it says "No member named 'label1' in Ui::MainWindow.
    49db0aec-d9f2-4e00-baee-a49647f3cfb3-image.png
    (It is named "splashscreen" because I'm trying to make one for an app)
    ui_splashscreen.h:
    47867ae9-2bbf-4897-a11e-1cd989d94b60-image.png
    How do I fix this?
    As I said at the beginning, I'm new and I don't know much about it.

    Pl45m4P 1 Reply Last reply
    0
    • H HenkCoder

      Hello, I'm new to Qt and I wanted to try to build something on my own but i noticed that whenever I add something to mainwindow.ui, the file ui_mainwindow.h does not update so when I try to refer to it (ui->label1) it says "No member named 'label1' in Ui::MainWindow.
      49db0aec-d9f2-4e00-baee-a49647f3cfb3-image.png
      (It is named "splashscreen" because I'm trying to make one for an app)
      ui_splashscreen.h:
      47867ae9-2bbf-4897-a11e-1cd989d94b60-image.png
      How do I fix this?
      As I said at the beginning, I'm new and I don't know much about it.

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @HenkCoder

      Build / Rebuild and qmake after you modify your *.ui files. Then you can access your new stuff.

      Edit:
      QMake is not even necessary but after a rebuild and qmake, everything should be up to date and your QLabel should be accessible from your code.
      Btw: Don't edit the ui_xxx.h file, changes will get overwritten by moc / uic anyway.


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

      ~E. W. Dijkstra

      H 1 Reply Last reply
      1
      • Pl45m4P Pl45m4

        @HenkCoder

        Build / Rebuild and qmake after you modify your *.ui files. Then you can access your new stuff.

        Edit:
        QMake is not even necessary but after a rebuild and qmake, everything should be up to date and your QLabel should be accessible from your code.
        Btw: Don't edit the ui_xxx.h file, changes will get overwritten by moc / uic anyway.

        H Offline
        H Offline
        HenkCoder
        wrote on last edited by
        #3

        @Pl45m4
        Thank you very much man, I was looking for a solution for the past two days.
        Thanks again!

        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