Why is there no an Extension abstract class for SIGNAL/SLOT EDITOR in Qt Designer's Custom Widget Creation?
-
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?
-
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?
-
@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.
-
@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?
-
@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)
-
@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?
-
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. -
@Christian-Ehrlicher I got it. Thanks.