Python Forum
[PyQt] command require close window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] command require close window
#1
Hi,
I have defined a command for a button wich terminates like this:

 # save map data to data object
                    data = io.BytesIO()
                    m.save(data, close_file=False)

                    webView = QWebEngineView()
                    webView.setHtml(data.getvalue().decode())
                    layout.addWidget(webView)

            if __name__ == '__main__':
                app = QApplication(sys.argv)
                app.setStyleSheet('''
                    QWidget {
                        font-size: 35px;
                    }
                ''')

                myApp = MyApp()
                myApp.show()


                try:
                    sys.exit(app.exec_())
                except SystemExit:
                    print('Closing Window...')
The problem is that when finnish to execute the command it also require to close the main window. where's the mistake, thanks.
Reply


Messages In This Thread
command require close window - by Krissstian - Nov-18-2022, 06:49 PM
RE: command require close window - by deanhystad - Nov-18-2022, 06:56 PM
RE: command require close window - by Krissstian - Nov-18-2022, 07:29 PM
RE: command require close window - by deanhystad - Nov-18-2022, 07:47 PM
RE: command require close window - by Krissstian - Nov-18-2022, 08:04 PM
RE: command require close window - by deanhystad - Nov-18-2022, 08:48 PM
RE: command require close window - by Krissstian - Nov-18-2022, 09:03 PM
RE: command require close window - by Axel_Erfurt - Nov-18-2022, 09:34 PM
RE: command require close window - by deanhystad - Nov-18-2022, 09:48 PM
RE: command require close window - by Krissstian - Nov-19-2022, 06:08 AM
RE: command require close window - by Yoriz - Nov-18-2022, 11:19 PM
RE: command require close window - by Krissstian - Nov-19-2022, 06:23 AM
RE: command require close window - by Axel_Erfurt - Nov-19-2022, 10:46 AM
RE: command require close window - by Krissstian - Nov-19-2022, 02:34 PM
RE: command require close window - by Krissstian - Nov-19-2022, 04:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 652 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  tkinter window and turtle window error 1885 3 6,807 Nov-02-2019, 12:18 PM
Last Post: 1885
  Require scroll bars horizontal and vertical throughout the window tejgandhi 2 2,743 Jun-28-2019, 03:13 AM
Last Post: tejgandhi
  Launch pdf and close on delete window event ashtona 6 5,750 Mar-22-2018, 03:04 PM
Last Post: ashtona
  update a variable in parent window after closing its toplevel window gray 5 9,194 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  [Tkinter] I have a Toplevel button in tkinker that I want to close the window and then perform Bloodypizza17 2 7,853 Jan-06-2017, 07:18 PM
Last Post: Bloodypizza17
  Hide command window sparkz_alot 8 20,963 Sep-29-2016, 10:14 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020