Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Why is there no an Extension abstract class for SIGNAL/SLOT EDITOR in Qt Designer's Custom Widget Creation?

Why is there no an Extension abstract class for SIGNAL/SLOT EDITOR in Qt Designer's Custom Widget Creation?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 2 Posters 255 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.
  • S Offline
    S Offline
    Sammer
    wrote on 20 Feb 2025, 09:17 last edited by
    #1

    Hi. friends! I have made a custom dialog which ease me to create the template dialog in Qt Designer. But now, just look at the screen cut of the official document, I am confused that Qt provides every extension abstract class for Qt Designer except the Signal/Slot Editor. Why? And if I wanna connect the dialog button box's signals and dialog's slots by default, how could i do it and eventually show this feature in the Signal/Slot Editor once I create the template dialog in Qt Designer?
    ca05c01d-a0db-4b55-b1dd-cf9bb98c921f-image.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 20 Feb 2025, 09:41 last edited by
      #2

      Apart from the fact that I would make such connections in code - signal and slots are automatically added when properly annotedated as such (with Q_SIGNALS,...) so why would you need an abstract class here?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      S 2 Replies Last reply 21 Feb 2025, 02:15
      0
      • C Christian Ehrlicher
        20 Feb 2025, 09:41

        Apart from the fact that I would make such connections in code - signal and slots are automatically added when properly annotedated as such (with Q_SIGNALS,...) so why would you need an abstract class here?

        S Offline
        S Offline
        Sammer
        wrote on 21 Feb 2025, 02:15 last edited by
        #3

        @Christian-Ehrlicher Thanks, I'll try it. I just wanna provide a interface to edit the display of the Qt Designer once I've created the custom widget(i.e. click the "create" btn in New Form Dialog). Now I know how to do, thanks again.

        1 Reply Last reply
        0
        • C Christian Ehrlicher
          20 Feb 2025, 09:41

          Apart from the fact that I would make such connections in code - signal and slots are automatically added when properly annotedated as such (with Q_SIGNALS,...) so why would you need an abstract class here?

          S Offline
          S Offline
          Sammer
          wrote on 21 Feb 2025, 02:56 last edited by
          #4

          @Christian-Ehrlicher Hi again! Thanks for replying. And I just tried register my signals and slots to a custom MemberSheetExtension.
          Now I could see my signals and slots in signals/slots editor. However, I connected them in the constructor of my custom widget. I still could not see the connection in the signals/slots editor. But we can see these connections when we create the template provided by Qt. How could i achieve this effect?
          1d3e5ed0-371b-494b-b99a-233f808afd99-image.png

          C 1 Reply Last reply 21 Feb 2025, 05:14
          0
          • S Sammer
            21 Feb 2025, 02:56

            @Christian-Ehrlicher Hi again! Thanks for replying. And I just tried register my signals and slots to a custom MemberSheetExtension.
            Now I could see my signals and slots in signals/slots editor. However, I connected them in the constructor of my custom widget. I still could not see the connection in the signals/slots editor. But we can see these connections when we create the template provided by Qt. How could i achieve this effect?
            1d3e5ed0-371b-494b-b99a-233f808afd99-image.png

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 21 Feb 2025, 05:14 last edited by
            #5

            @Sammer said in Why is there no an Extension abstract class for SIGNAL/SLOT EDITOR in Qt Designer's Custom Widget Creation?:

            I still could not see the connection in the signals/slots editor.

            How should this be possible? They are done in code and not in the ui file so Qt designer can't show them and you also can't edit them in any way in the ui file (how should this be possible though)

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            S 1 Reply Last reply 21 Feb 2025, 06:24
            1
            • C Christian Ehrlicher
              21 Feb 2025, 05:14

              @Sammer said in Why is there no an Extension abstract class for SIGNAL/SLOT EDITOR in Qt Designer's Custom Widget Creation?:

              I still could not see the connection in the signals/slots editor.

              How should this be possible? They are done in code and not in the ui file so Qt designer can't show them and you also can't edit them in any way in the ui file (how should this be possible though)

              S Offline
              S Offline
              Sammer
              wrote on 21 Feb 2025, 06:24 last edited by Sammer
              #6

              @Christian-Ehrlicher I see... I know that .ui file is an XML file which indicates setupUi() to implement. So you mean the reason a dialog template provided by Qt (shown in the picture) can automatically add connection in the signal/slot editor when we create it, is that it loads an existing .ui file so that Qt Designer can know it. When we create a custom widget in code, we have no way to make the QtDesigner know the connection we made. We need provide a .ui file to load to achieve automatic adding in signal/slot editor. Am i right?
              ac8d9d7e-40b3-4cab-9403-a7116192e393-image.png

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 21 Feb 2025, 06:30 last edited by
                #7

                Yes, Qt designer only works with the ui files for the signal/slot connections.
                As I said earlier I would avoid this and do all connections in the code.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                S 1 Reply Last reply 21 Feb 2025, 07:54
                0
                • C Christian Ehrlicher
                  21 Feb 2025, 06:30

                  Yes, Qt designer only works with the ui files for the signal/slot connections.
                  As I said earlier I would avoid this and do all connections in the code.

                  S Offline
                  S Offline
                  Sammer
                  wrote on 21 Feb 2025, 07:54 last edited by
                  #8

                  @Christian-Ehrlicher I got it. Thanks.

                  1 Reply Last reply
                  0
                  • S Sammer has marked this topic as solved on 26 Feb 2025, 05:57

                  1/8

                  20 Feb 2025, 09:17

                  • Login

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