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. How class.ui is shown, when class::show() function is called?
QtWS25 Last Chance

How class.ui is shown, when class::show() function is called?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.3k 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.
  • Dilip122D Offline
    Dilip122D Offline
    Dilip122
    wrote on last edited by
    #1

    When a ui_class.h is included in class.cpp and we do setupUi(this), and we call class::show() function , how class.ui becomes visible? Please elaborate. How the instance of class defined in ui_class.h is passed to class?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      You can actually step into setupUi(this) in debug mode and see exaclty every operation that is executed

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      Dilip122D 1 Reply Last reply
      1
      • VRoninV VRonin

        You can actually step into setupUi(this) in debug mode and see exaclty every operation that is executed

        Dilip122D Offline
        Dilip122D Offline
        Dilip122
        wrote on last edited by
        #3

        @VRonin
        I think main class inherits the UI class. This is the code snippet from ui_busmain.h file:
        namespace Ui {
        class BusMain: public Ui_BusMain {};
        } // namespace Ui

        VRoninV 1 Reply Last reply
        0
        • Dilip122D Dilip122

          @VRonin
          I think main class inherits the UI class. This is the code snippet from ui_busmain.h file:
          namespace Ui {
          class BusMain: public Ui_BusMain {};
          } // namespace Ui

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          uic will generate all the code for Ui_BusMain you can step into that class with your debugger no problem

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          Dilip122D 1 Reply Last reply
          1
          • VRoninV VRonin

            uic will generate all the code for Ui_BusMain you can step into that class with your debugger no problem

            Dilip122D Offline
            Dilip122D Offline
            Dilip122
            wrote on last edited by
            #5

            @VRonin Has ui_busmain.h class done forward declaration of BusMain class?

            jsulmJ 1 Reply Last reply
            0
            • Dilip122D Dilip122

              @VRonin Has ui_busmain.h class done forward declaration of BusMain class?

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

              @Dilip122 Why don't you just check the content of ui_busmain.h to see whether it did?

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

              Dilip122D 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Dilip122 Why don't you just check the content of ui_busmain.h to see whether it did?

                Dilip122D Offline
                Dilip122D Offline
                Dilip122
                wrote on last edited by
                #7

                @jsulm I have seen it, as I have posted the code snippet. Fact is, it is taking time for me to understand and connect the whole picture.

                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