View Single Post
Old 04-04-2021, 08:03 PM   #146
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,221
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by mapozyan View Post
Hi Thiago,

Bad news is that QToolButton doesn't have "default" property. Will need to figure out how to emulate that.

Thanks for feedback!
Yeah, I noticed that. Really unfortunate.
There must be a more elegant way to do this but this kind of work:

Spoiler:
Code:
self.search_textbox.editTextChanged.connect(self.on_search_text_changed)
self.search_textbox.lineEdit().returnPressed.connect(self.on_search_all)
...
self.search_help_button = Qt.QPushButton('?', self)
self.search_help_button.setDefault(False)
self.search_help_button.setAutoDefault(False)
...
self.cancel_button = Qt.QPushButton('&Cancel', self)
self.cancel_button.clicked.connect(self.on_cancel)
self.cancel_button.setVisible(False)
self.cancel_button.setDefault(False)
self.cancel_button.setAutoDefault(False)
self.layout.addWidget(self.cancel_button)

I said "kind of work" because it sets the 'Details' button as default, so it will be activated after a conversion starts.
thiago.eec is offline   Reply With Quote