Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python PyQt5 How do i run a function on combobox selection? [duplicate]

$
0
0

I have a PyQt5 code and in my GUI i have a combobox with bunch of values.
WHat i want to achieve is that when the user selects any value from the combobox it should trigger a function. Is it possible to achieve in PyQt5?

        self.comboBox_2 = QtWidgets.QComboBox(self.centralwidget)        self.comboBox_2.setGeometry(QtCore.QRect(150, 90, 211, 31))        self.comboBox_2.setObjectName("comboBox_2")        # something like this        self.comboBox_2.clicked.connect(self.timezone_selected)

But obviously this clicked.connect only works with buttons.I am using PyQt5.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>