Is there a way to catch all gui events like button clicked, text changed, check box toggled, into the same slot without using the connect() function for every widget?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your widgets are part of a form and you want to submit the changes to a model (or an SQL database), using a
QDataWidgetMappermight be more adapted than what you want.Anyway, these signals, except the button
clickedsignal for non checkable buttons, are declared as theNOTIFYsignal for theUSERproperty (in theQ_PROPERTYdeclaration).You can use Qt’s meta object system to connect all the widgets from a list:
PS: This will also connect the
QScrollBar::valueChanged(int)signals of theQTextEdits to your slot.