سؤال

Im trying to use QInputDialog without buttons. It looks just like I want, but I connot confirm input (using it for text input). Is there a possibility to confirm with the enter key, so that exec() returns QInputDialog::Accepted ? Just like escape key makes the dialog return QInputDialog::Rejected ?

هل كانت مفيدة؟

المحلول

You could installEventFilter() on the QInputDialog, then have the eventFilter() accept() the dialog on a keypressevent(). :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top