简体   繁体   中英

QStackedWidget area cleared on ESC in child widget line edit

There are couple of widgets ( all in UI files ) representing pages for stacked widget. One of the contain QLineEdit field. When stacked widget current page show this widget and line edit have focus, when ESC is pressed whole area is cleared. All stacked widget pages are defined in UI file. Any ideas how to prevent area clearing on ESC?

Qt: 5.9.2

My mistake. Each stacked widget was derived from QDialog by mistake. And default handler for ESC for QDialog - is close. Changed to QWidget and it is working as expected now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM