Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. How can I execute a method when the window is closed with Qt Jambi?
Forum Updated to NodeBB v4.3 + New Features

How can I execute a method when the window is closed with Qt Jambi?

Scheduled Pinned Locked Moved Unsolved Language Bindings
4 Posts 2 Posters 1.7k 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.
  • L Offline
    L Offline
    Lorenzo Gentile
    wrote on last edited by
    #1

    Hi, I would like to do something similar to what I've done with the following code, i.e. calling actionBtnOptimize_clicked() when btnOptimize is clicked, but when the user closes the window.

    private static Ui_MainWindow ui;     
    ui.btnOptimize.clicked.connect(this, "actionBtnOptimize_clicked()");
    
    
    public static void actionBtnOptimize_clicked(){
    ...
    }        
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What about re-implementing closeEvent ?

      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
      • L Offline
        L Offline
        Lorenzo Gentile
        wrote on last edited by
        #3

        Thanks. Since the code of my GUI is generated automatically using Qt 4 Designer , I don't know how to modify the standard behavior when the main window is closed. I cannot find something that explains how to do it in practice. Could you please give me an useful link or example?

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

          Here you have lots of examples. The Main Window Example call Application shows how to re-implement closeEvent

          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