One QAction checkable at time in QMenu
问题 I am trying to make my choices from QMenu to be checkable in a way that only one might be selected at time and first item is set checked by default (this works actually). Here is a snippet of my code: paymentType = QMenu('Payment Type', self) paymentType.addAction(QAction('Cash', paymentType, checkable=True, checked = True)) paymentType.addAction(QAction('Noncash Payment', paymentType, checkable=True)) paymentType.addAction(QAction('Cash on Delivery', paymentType, checkable=True)) paymentType