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?
QtWS25 Last Chance

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 248 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.
  • SammerS Offline
    SammerS Offline
    Sammer
    wrote on 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
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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

      SammerS 2 Replies Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        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?

        SammerS Offline
        SammerS Offline
        Sammer
        wrote on 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
        • Christian EhrlicherC Christian Ehrlicher

          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?

          SammerS Offline
          SammerS Offline
          Sammer
          wrote on 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

          Christian EhrlicherC 1 Reply Last reply
          0
          • SammerS Sammer

            @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

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 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

            SammerS 1 Reply Last reply
            1
            • Christian EhrlicherC Christian Ehrlicher

              @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)

              SammerS Offline
              SammerS Offline
              Sammer
              wrote on 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
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 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

                SammerS 1 Reply Last reply
                0
                • Christian EhrlicherC Christian Ehrlicher

                  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.

                  SammerS Offline
                  SammerS Offline
                  Sammer
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher I got it. Thanks.

                  1 Reply Last reply
                  0
                  • SammerS Sammer has marked this topic as solved on

                  • Login

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