I am trying to show/hide a QLineEdit (or some other widget) using QCheckBox or QComboBox.
You need to connect the stateChanged signal (for QCheckBox; emitted every time you check/uncheck the box) or currentIndexChanged signal (for QComboBox; emitted every time you select a different item in the combo box) to a slot (you can also use a lambda here). In that slot all you need to do is call the QLineEdit's show() or hide() method to toggle the visibility of the line edit.
Change widget visibility using QCheckBox or QComboBox in PyQt