Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. What are Qt widget components doing in the background?

What are Qt widget components doing in the background?

Scheduled Pinned Locked Moved Unsolved Language Bindings
12 Posts 4 Posters 1.1k 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.
  • E Offline
    E Offline
    elifsz
    wrote on 22 Jun 2023, 16:31 last edited by
    #1

    How do the widget components we use in qt go through before they are compiled? What are the differences between the operating system and the compiler used? What is the point of separation with visual studio forms?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 22 Jun 2023, 18:55 last edited by
      #2

      Hi and welcome to devnet,

      What exactly do you want to know ?

      Qt widgets go through nothing. They are C++ classes. There's no transformation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      E 1 Reply Last reply 6 Jul 2023, 18:53
      1
      • S Offline
        S Offline
        SimonSchroeder
        wrote on 23 Jun 2023, 07:21 last edited by
        #3

        Qt widgets are adapters/wrappers to the native widgets to provide a cross platform way of handling this. For Linux and embedded systems they also provide their own implementation. These also come in handy when using stylesheets. Mouse event and keyboard events and other OS events get translated to Qt events. So, basically you have different backends for different operating systems. This selection is done when compiling Qt for a specific platform. There are only very few features that are specific to only one operating system. Basically, in these cases you could just switch over to native programming. The compiler does not matter as it is related to Qt. On Windows MSVC and MinGW are not compatible, but this is not a problem inherent to Qt.

        Unless anything that Microsoft does, Qt's main goal is cross platform portability. If you just want to write an app for Windows and are sure that never ever will you port it to a different operating system you don't have to use Qt. You can just go directly with anything Microsoft provides. One reason to still consider Qt is that it is stable whereas Microsoft reinvents a better GUI framework that you should use now every couple of years. Qt abstracts that away for you.

        1 Reply Last reply
        1
        • S SGaist
          22 Jun 2023, 18:55

          Hi and welcome to devnet,

          What exactly do you want to know ?

          Qt widgets go through nothing. They are C++ classes. There's no transformation.

          E Offline
          E Offline
          elifsz
          wrote on 6 Jul 2023, 18:53 last edited by
          #4

          @SGaist For example, we create and put a button on the screen. I'm wondering what kind of code is written to create this button object, what makes qt special here? Thank you very much for your reply.

          S 2 Replies Last reply 6 Jul 2023, 18:56
          0
          • E elifsz
            6 Jul 2023, 18:53

            @SGaist For example, we create and put a button on the screen. I'm wondering what kind of code is written to create this button object, what makes qt special here? Thank you very much for your reply.

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 6 Jul 2023, 18:56 last edited by
            #5

            If you want the gory details, take a look at Qt's code source, it will be easier to get the grip at what is happening.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            E 1 Reply Last reply 6 Jul 2023, 19:05
            0
            • S SGaist
              6 Jul 2023, 18:56

              If you want the gory details, take a look at Qt's code source, it will be easier to get the grip at what is happening.

              E Offline
              E Offline
              elifsz
              wrote on 6 Jul 2023, 19:05 last edited by
              #6

              @SGaist said in What are Qt widget components doing in the background?:

              If you want the gory details, take a look at Qt's code source, it will be easier to get the grip at what is happening.

              I reviewed it but I don't fully understand it. I didn't have an answer in my head

              S 1 Reply Last reply 6 Jul 2023, 19:08
              0
              • E elifsz
                6 Jul 2023, 19:05

                @SGaist said in What are Qt widget components doing in the background?:

                If you want the gory details, take a look at Qt's code source, it will be easier to get the grip at what is happening.

                I reviewed it but I don't fully understand it. I didn't have an answer in my head

                S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 6 Jul 2023, 19:08 last edited by
                #7

                What exactly did you go through ?
                Which part is not clear ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                E 1 Reply Last reply 6 Jul 2023, 19:20
                0
                • S SGaist
                  6 Jul 2023, 19:08

                  What exactly did you go through ?
                  Which part is not clear ?

                  E Offline
                  E Offline
                  elifsz
                  wrote on 6 Jul 2023, 19:20 last edited by
                  #8

                  @SGaist How do we write a code so that the object we created as a qpushbutton can exist as a button on the screen?
                  what is the most basic need for this? are there different processes for windows and different processes for linux?

                  I'm so sorry if my explanations or questions are complicated

                  J 1 Reply Last reply 6 Jul 2023, 19:28
                  0
                  • E elifsz
                    6 Jul 2023, 19:20

                    @SGaist How do we write a code so that the object we created as a qpushbutton can exist as a button on the screen?
                    what is the most basic need for this? are there different processes for windows and different processes for linux?

                    I'm so sorry if my explanations or questions are complicated

                    J Online
                    J Online
                    JonB
                    wrote on 6 Jul 2023, 19:28 last edited by JonB 7 Jun 2023, 19:57
                    #9

                    @elifsz
                    You either create a QPushbutton and directly call show() on it, which would be unlikely as it would give you a window which consisted of nothing but a pushbutton, or you add it onto some other qt QWidget and show that.

                    Whatever you question/thought about "What are Qt widget components doing in the background?" is, forget about it :) You are worrying about something unnecessary.

                    1 Reply Last reply
                    0
                    • E elifsz
                      6 Jul 2023, 18:53

                      @SGaist For example, we create and put a button on the screen. I'm wondering what kind of code is written to create this button object, what makes qt special here? Thank you very much for your reply.

                      S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 6 Jul 2023, 19:48 last edited by
                      #10

                      @elifsz sure things are different between Windows and Linux. If not, there would be no need for Qt.

                      As for your issue, you just build your interface using Qt's elements. The rest is done between the QStyle dedicated to the platform and the QPA backend.

                      You seem to be a bit over-thinking that part currently. Or are you looking to adapt Qt to a new platform ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      E 1 Reply Last reply 6 Jul 2023, 19:59
                      0
                      • S SGaist
                        6 Jul 2023, 19:48

                        @elifsz sure things are different between Windows and Linux. If not, there would be no need for Qt.

                        As for your issue, you just build your interface using Qt's elements. The rest is done between the QStyle dedicated to the platform and the QPA backend.

                        You seem to be a bit over-thinking that part currently. Or are you looking to adapt Qt to a new platform ?

                        E Offline
                        E Offline
                        elifsz
                        wrote on 6 Jul 2023, 19:59 last edited by
                        #11

                        @SGaist The reason I asked this question was because my manager, who did not write qt, said why there is qt, it already takes microsoft components directly.
                        There is no such situation that I know of, but I could not explain myself.

                        I wanted to ask because my research did not yield any final results.

                        S 1 Reply Last reply 6 Jul 2023, 20:08
                        0
                        • E elifsz
                          6 Jul 2023, 19:59

                          @SGaist The reason I asked this question was because my manager, who did not write qt, said why there is qt, it already takes microsoft components directly.
                          There is no such situation that I know of, but I could not explain myself.

                          I wanted to ask because my research did not yield any final results.

                          S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 6 Jul 2023, 20:08 last edited by
                          #12

                          At the beginning of times, creating a GUI, be it on Windows or Linux, was something that wasn't easy to learn nor do and was not reusable at all. Qt was created to make the life of developers way easier as well as provide a framework that allows you to write your code once and then build it on a per platform basis. If you want another example, try to show an OpenGL window using native APIs vs doing with Qt.

                          Qt is:

                          • simplicity
                          • elegance
                          • cross platform

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          • Login

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