Skip to main content
Tweeted twitter.com/StackGIS/status/1352360355788423170
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

Displaying an alert before closing QgisQGIS

I would like to display a message before QgisQGIS close. But iI can't intercept the closeEvent of the main window from my plugin. I've tested this code which doesn't work.

# Main method
QgsApplication.instance().closeEvent = self.mainWindowCloseEvent

def mainWindowCloseEvent(self, event) :
    # displaying message...
    event.ignore()

Displaying an alert before closing Qgis

I would like to display a message before Qgis close. But i can't intercept the closeEvent of the main window from my plugin. I've tested this code which doesn't work.

# Main method
QgsApplication.instance().closeEvent = self.mainWindowCloseEvent

def mainWindowCloseEvent(self, event) :
    # displaying message...
    event.ignore()

Displaying an alert before closing QGIS

I would like to display a message before QGIS close. But I can't intercept the closeEvent of the main window from my plugin. I've tested this code which doesn't work.

# Main method
QgsApplication.instance().closeEvent = self.mainWindowCloseEvent

def mainWindowCloseEvent(self, event) :
    # displaying message...
    event.ignore()

Source Link
TrsBar
  • 523
  • 2
  • 13

Displaying an alert before closing Qgis

I would like to display a message before Qgis close. But i can't intercept the closeEvent of the main window from my plugin. I've tested this code which doesn't work.

# Main method
QgsApplication.instance().closeEvent = self.mainWindowCloseEvent

def mainWindowCloseEvent(self, event) :
    # displaying message...
    event.ignore()