Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Close secondary window by escape through keyPressEvent function

Close secondary window by escape through keyPressEvent function

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 167 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aadil50
    wrote on last edited by
    #1

    I have main window which contain another window..When call keyPressEvent function for escape key it works for main window which close by self.close().. How can I do escape button do it for secondary window as well? Whether it is possible in same function whenever secondary window (qwidget) is shown or enabled it also close on escape button .. For 2 times press it closes main window as well.. I hope you understand my problem.. Kindly give me some solid solution for it..

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Something is not clear: did you implement the same thing for your secondary window as you did for your main window ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved