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. Why qt creator stops to update the header file for the UI?
Forum Updated to NodeBB v4.3 + New Features

Why qt creator stops to update the header file for the UI?

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 12.5k 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.
  • D Offline
    D Offline
    dmmzy
    wrote on last edited by
    #1

    I don't why but it seems that my qt creator stops to update the header file for the ui when I add some one element in the UI edit window of the qt creator.

    It's like: I create a UI called userwindow in the UI design window. QT creator generates the two files for me:
    userwindow.ui
    ui_userwindow.h
    Everything worked fine, but now, when I add some elements in the userwindow, I use @ui->@ to locate those elements,but I failed.

    So now, in my qt creator design window, the UIs are all right. However, I can't locate the new-added element and therefore cannot operate them.

    Any one has similar experience? Or is there any method to ask qt creator to update the ui_userwindow.h file??

    Many thanks.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HuXiKa
      wrote on last edited by
      #2

      After you add new elements to your user interface rebuild / run you application, and after that you should be able to see your stuff.

      If you can find faults of spelling in the text above, you can keep them.

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        Normally saving the ui file should be enough.

        Do you have other projects open in Qt Creator? There could be some interference with other ui files?

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dmmzy
          wrote on last edited by
          #4

          Thanks for the help.

          -to HuxiKa
          I tried rebuild and run, but it does not work.

          -to Eddy
          I only open one project. Though, i did open several qt creators to edit a same project at the same time.
          But now, I only open one creator and one project, it still does not work.--

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dmmzy
            wrote on last edited by
            #5

            i found something in the compile output:
            @make: Leaving directory `/home/sz/Programming/codes/EC-build-desktop'
            make: *** [userwindow.o] Error 1
            The process "/usr/bin/make" exited with code 2.
            Error while building project EC (target: Desktop)
            When executing build step 'Make'@

            it seems the make cannot generate the userwindow.o.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dmmzy
              wrote on last edited by
              #6

              The above compile error is just because the h_userwindow.ui doesnot add the elements to the header file.

              1 Reply Last reply
              0
              • O Offline
                O Offline
                octal
                wrote on last edited by
                #7

                That's weird, you could maybe try « Rebuild all » and paste the whole compilation log.

                At least we'll see if uic is correctly invoked.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dmmzy
                  wrote on last edited by
                  #8

                  I think this issue probably derives from that I defined another class in the userwindow.h.

                  I try to move the definition of that class behind the definition of the userwindow class and rebuild the project, it still does not work.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dmmzy
                    wrote on last edited by
                    #9

                    Complier Output: (sorry about so many warnings)
                    @Running build steps for project EC...
                    Configuration unchanged, skipping qmake step.
                    Starting: "/usr/bin/make" -w
                    make: Entering directory /home/sz/Programming/codes/EC-build-desktop' /home/sz/Programming/QtSDK/Desktop/Qt/473/gcc/bin/qmake -spec ../../QtSDK/Desktop/Qt/473/gcc/mkspecs/linux-g++ CONFIG+=debug -o Makefile ../EC/EC.pro make: Leaving directory /home/sz/Programming/codes/EC-build-desktop'
                    make: Entering directory /home/sz/Programming/codes/EC-build-desktop' /home/sz/Programming/QtSDK/Desktop/Qt/473/gcc/bin/uic ../EC/ec.ui -o ui_ec.h /home/sz/Programming/QtSDK/Desktop/Qt/473/gcc/bin/uic ../EC/adminwindow.ui -o ui_adminwindow.h /home/sz/Programming/QtSDK/Desktop/Qt/473/gcc/bin/uic ../EC/userwindow.ui -o ui_userwindow.h g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -I../../QtSDK/Desktop/Qt/473/gcc/mkspecs/linux-g++ -I../EC -I../../QtSDK/Desktop/Qt/473/gcc/include/QtCore -I../../QtSDK/Desktop/Qt/473/gcc/include/QtGui -I../../QtSDK/Desktop/Qt/473/gcc/include -I/usr/include/cryptopp -I. -I. -I../EC -I. -o main.o ../EC/main.cpp In file included from ../EC/adminwindow.h:8, from ../EC/ec.h:5, from ../EC/main.cpp:2: (the message has too many warnings , i have to delete them to fit in the post) make: Leaving directory /home/sz/Programming/codes/EC-build-desktop'
                    make: *** [userwindow.o] Error 1
                    The process "/usr/bin/make" exited with code 2.
                    Error while building project EC (target: Desktop)
                    When executing build step 'Make'@

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      Sorry, you just cut the actual error message.

                      You must not change the ui_xxx.h files manually, as they are regenerated by uic for certain reasons.

                      If you move out your own class definition into another header file, make sure you

                      • #include that file where you included the ui_xxx.h file
                      • have "include guards":http://en.wikipedia.org/wiki/Include_guard in that file and make sure they are different from the other one!

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      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