PDA

View Full Version : Signal and slot in Creator



poporacer
27th September 2010, 19:45
I have a form with a couple of buttons and a stacked widget. The pages of the stacked widget are shown by clicking on the buttons. I am using Creator. When I go to the Signal/Slot editor and drag the signal of one of the buttons to the stacked widget, it shows a list of signals and slots. One of the slots is the setCurrentIndex() function. However, when you choose any of the available signal functions, the setCurrentIndex() function is no longer available. I can code this functionality by hand, but curious why I am getting this problem?

squidge
27th September 2010, 20:06
It will only show slots which match the signature of the signal. Since setCurrentIndex() requires the index to set, and a button doesn't emit such a signal, it doesn't allow you to select that slot.

Just because you can do it by hand doesn't mean it'll work. The signatures must match.

poporacer
27th September 2010, 23:48
I am still trying to learn creator. I can hand code a function on_button_clicked...just thought I could do it through the Signals/Slots Editor....thanks for your help!!!