Try these questions to test your knowledge of this chapter:
- 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 emit() method does not exist on a signal object until the signal has been bound (that is, connected to a slot). Rewrite the CategoryWindow.onSubmit() method from our first calendar_app.py file to protect against the possibility of submitted being unbound.
- You find an object in the Qt documentation with a slot that requires a QString as an argument. Can you connect...