source: orange/Orange/OrangeCanvas/application/application.py @ 11522:425d83b20b96

Revision 11522:425d83b20b96, 519 bytes checked in by Ales Erjavec <ales.erjavec@…>, 11 months ago (diff)

Handle QFileOpenEvent request events.

Line 
1"""
2Orange Canvas Application
3
4"""
5
6from PyQt4.QtGui import QApplication
7
8from PyQt4.QtCore import Qt, QUrl, QEvent, pyqtSignal as Signal
9
10
11class CanvasApplication(QApplication):
12    fileOpenRequest = Signal(QUrl)
13
14    def __init__(self, argv):
15        QApplication.__init__(self, argv)
16        self.setAttribute(Qt.AA_DontShowIconsInMenus, True)
17
18    def event(self, event):
19        if event.type() == QEvent.FileOpen:
20            self.fileOpenRequest.emit(event.url())
21
22        return QApplication.event(self, event)
Note: See TracBrowser for help on using the repository browser.