- Look at the following table and determine which of the connections could actually be made, and which would result in an error. You may need to look up the signatures of these signals and slots in the documentation:
# |
Signal |
Slot |
---|---|---|
1 |
QPushButton.clicked |
QLineEdit.clear |
2 |
QComboBox.currentIndexChanged |
QListWidget.scrollToItem |
3 |
QLineEdit.returnPressed |
QCalendarWidget.setGridVisible |
4 |
QLineEdit.textChanged |
QTextEdit.scrollToAnchor |
The answers are as follows:
-
- Yes, because the Boolean argument of clicked can be ignored by clear
- No, because currentIndexChanged sends int, but scrollToItem expects an item and a scroll hint
- No, because returnPressed sends no arguments and setGridVisible expects one
- Yes, because textChanged sends a string, which scrollToAnchor accepts
- The emit() method does not exist on a signal object until...