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?
Forum Updated to NodeBB v4.3 + New Features

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.
  • D Offline
    D Offline
    Dilip122
    wrote on 5 Jul 2017, 10:02 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
    • V Offline
      V Offline
      VRonin
      wrote on 5 Jul 2017, 10:05 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

      D 1 Reply Last reply 5 Jul 2017, 12:04
      1
      • V VRonin
        5 Jul 2017, 10:05

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

        D Offline
        D Offline
        Dilip122
        wrote on 5 Jul 2017, 12:04 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

        V 1 Reply Last reply 5 Jul 2017, 12:13
        0
        • D Dilip122
          5 Jul 2017, 12:04

          @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

          V Offline
          V Offline
          VRonin
          wrote on 5 Jul 2017, 12:13 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

          D 1 Reply Last reply 5 Jul 2017, 12:49
          1
          • V VRonin
            5 Jul 2017, 12:13

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

            D Offline
            D Offline
            Dilip122
            wrote on 5 Jul 2017, 12:49 last edited by
            #5

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

            J 1 Reply Last reply 6 Jul 2017, 04:40
            0
            • D Dilip122
              5 Jul 2017, 12:49

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

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 6 Jul 2017, 04:40 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

              D 1 Reply Last reply 6 Jul 2017, 10:52
              0
              • J jsulm
                6 Jul 2017, 04:40

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

                D Offline
                D Offline
                Dilip122
                wrote on 6 Jul 2017, 10:52 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

                1/7

                5 Jul 2017, 10:02

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved