Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Exit Application
Forum Updated to NodeBB v4.3 + New Features

Exit Application

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 292 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    satyanarayana143
    wrote on last edited by
    #1

    Hi friends,

    I want to close Mainwindow when child window is closed i used signals and slots to communicate but it is not Exit. Can anybody tell how to exit Application When child widget closed.

    J.HilkJ 1 Reply Last reply
    0
    • S satyanarayana143

      Hi friends,

      I want to close Mainwindow when child window is closed i used signals and slots to communicate but it is not Exit. Can anybody tell how to exit Application When child widget closed.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @satyanarayana143

      inside the child widget header you can add the following

      protected:
          virtual void closeEvent(QCloseEvent *event) override{qApp->quit();}
      

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      4

      • Login

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