panzi
21-06-2007, 23:10
Egal was ich mach, ich brings net zam das mein Tray-Icon Drops akzeptiert. dragEnterEvent wird aufgerufen und ich sag auch event.accept(True), aber dropEvent wird dann trotzdem nie aufgerufen!
Hat jemand eine Idee was da los sein kann?
#!/usr/bin/env python
import sys
from qt import *
from kdecore import *
from kdeui import *
import subprocess
appName="Get YouTube Video"
class SystemTray(KSystemTray):
def __init__(self):
KSystemTray.__init__(self,None,appName)
self.setAcceptDrops(True)
def dropEvent(self,event):
subprocess.call(['get_yt_vide.py','none',str(event.data('text/plain'))])
def dragEnterEvent(self,event):
event.accept(event.provides('text/plain'))
def closeEvent(self,event):
app.quit()
app = KApplication(['trayicon.py'],appName)
icons = KIconLoader()
systray=SystemTray()
icon=icons.loadIcon('down',KIcon.Small)
systray.setPixmap(icon)
systray.show()
app.exec_loop()
Hat jemand eine Idee was da los sein kann?
#!/usr/bin/env python
import sys
from qt import *
from kdecore import *
from kdeui import *
import subprocess
appName="Get YouTube Video"
class SystemTray(KSystemTray):
def __init__(self):
KSystemTray.__init__(self,None,appName)
self.setAcceptDrops(True)
def dropEvent(self,event):
subprocess.call(['get_yt_vide.py','none',str(event.data('text/plain'))])
def dragEnterEvent(self,event):
event.accept(event.provides('text/plain'))
def closeEvent(self,event):
app.quit()
app = KApplication(['trayicon.py'],appName)
icons = KIconLoader()
systray=SystemTray()
icon=icons.loadIcon('down',KIcon.Small)
systray.setPixmap(icon)
systray.show()
app.exec_loop()