i need to popup a dialog, but everytime when the dialog popup, there is certain button is always checked, no matter how i set it's attribute before start up that always is checked, can anyone tell me reason?
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class Demo(QDialog):
def __init__(self):
super().__init__()
layout = QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
self.export_bn = QPushButton('export')
self.search_bn = QPushButton('search')
layout.addStretch(1)
layout.addWidget(self.export_bn)
layout.addWidget(self.search_bn)
main_layout = QVBoxLayout()
main_layout.addLayout(layout)
main_layout.addWidget(QTextEdit('Test'))
self.setLayout(main_layout)
#unchecked this button not working when start a window
self.export_bn.setChecked(False)
app = QApplication([])
demo = Demo()
demo.show()
app.exec()
The export button is checked, i want to no button checked when dialog popup.