Designer not listing slots in sub-classed controls
-
I have a subclass of QWidget that has a public slot declared in the header file:
public slots: void on_fourCorners_clicked(bool) { m_fourCorners = !m_fourCorners; drawOnPixmap(); update(); }
I have a ui file that uses this control and I promoted the QWidget to be a DSS::ImageView object:
Why doesn't the Signals/Slots configuration list this slot? It knows the name of the header file so it should be able to see that there's a slot declared there...
I manually edited the ui file to add that connection, but surely I shouldn't need to descend to that level!
David -
I have a subclass of QWidget that has a public slot declared in the header file:
public slots: void on_fourCorners_clicked(bool) { m_fourCorners = !m_fourCorners; drawOnPixmap(); update(); }
I have a ui file that uses this control and I promoted the QWidget to be a DSS::ImageView object:
Why doesn't the Signals/Slots configuration list this slot? It knows the name of the header file so it should be able to see that there's a slot declared there...
I manually edited the ui file to add that connection, but surely I shouldn't need to descend to that level!
David -
@Perdrix Promotion is for simple replacement of type when generating the C++ code. It does not expose your custom type to the editor i.e. signals, slots, properties etc. If you want a full support for custom type you have to create a designer plugin. Don't hack the .ui file manually. This may work now and silently break at any time in the future, as it's not a supported feature.