Bug 184426 - connect failed for signal in PyKDE4.kedui.KWindowSystem
Summary: connect failed for signal in PyKDE4.kedui.KWindowSystem
Status: RESOLVED UNMAINTAINED
Alias: None
Product: bindings
Classification: Developer tools
Component: pykde (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-15 17:31 UTC by Haoyu Bai
Modified: 2018-11-17 05:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Haoyu Bai 2009-02-15 17:31:38 UTC
Version:            (using KDE 4.2.0)
Compiler:          Python 2.6 and gcc 4.3.3 
OS:                Linux
Installed from:    Unlisted Binary Package

The following pykde program try to connect KWindowSystem::activeWindowChange(WId) to a Python function. But it failed - there's no exception raised when running, but the Python is not triggered when window focus changed. Even more strange, QObject.connect doesn't raise any exception when a non exist signal passed in (for example SIGNAL("balbal()"), is that the normal behavior of connect()?

I'm using Archlinux, the version of PyQt is 4.4.4, sip is 4.7.9.


import sys
from PyQt4.QtCore import SIGNAL, SLOT, pyqtSignature, QObject
from PyQt4.QtGui import QApplication, QMainWindow
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import KApplication, KMainWindow, KWindowSystem

class FocusListener(KMainWindow):
    def __init__(self):
        KMainWindow.__init__(self)
        kwin = KWindowSystem.self()
        QObject.connect(kwin, SIGNAL("activeWindowChanged(WId)"), self.printChange)

    @pyqtSignature("int")
    def printChange(self, wid):
        print "Focus changed to", wid



def get_about():
    appName     = "TestKApplication"
    catalog     = "Test"
    programName = ki18n ("TestKApplication")
    version     = "1.0"
    description = ki18n ("Test KApplication")
    license     = KAboutData.License_GPL
    copyright   = ki18n ("(c) 2009 Haoyu Bai")
    text        = ki18n ("none")
    homePage    = "http://localhost"
    bugEmail    = "baihaoyu@gmail.com"
     
    aboutData   = KAboutData (appName, catalog, programName, version, 
                description, license, copyright, text, homePage, bugEmail)
    return aboutData

def main():
    aboutData = get_about()
    KCmdLineArgs.init(sys.argv, aboutData)
    app = KApplication()
    listener = FocusListener()
    listener.show()
    app.exec_()

if __name__=="__main__":
    main()
Comment 1 Haoyu Bai 2009-02-22 06:12:03 UTC
Is here the correct place to report this bug? Why there's no any response in one week?
Comment 2 Andrew Crouthamel 2018-11-10 03:15:28 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Andrew Crouthamel 2018-11-17 05:30:12 UTC
Hello, unfortunately this bug is being closed as unmaintained, per request of einar77.