How to customize the text in the quantum gates when drawing a quantum circuit diagram?

I mean, add text at the right of the wires, like in the red square of the graph below.