[PyQt] argument 1 of KDialog.setButtons() has an invalid type

Benno Dielmann lists at benno-dielmann.de
Sat Aug 2 13:22:19 BST 2008


Hi PyKDE4 - Experts, 

the setButtons() method of KDialog seems to be buggy - there's always an 
exception

argument 1 of KDialog.setButtons() has an invalid type

Argument 1 should be the KDialog instance, shouldn't it?

Or am I doing something wrong? Please have a look at this example code:

----------------------------------------------------
import sys
from PyKDE4.kdecore import ki18n, KAboutData, KCmdLineArgs
from PyKDE4.kdeui import KApplication, KXmlGuiWindow, KDialog

class WaitDialog(KDialog):
    def __init__(self, parent=None):
        super(WaitDialog, self).__init__(parent)
        # this doesn't work:
        self.setButtons(KDialog.Cancel | KDialog.Ok)
        
class MainWindow(KXmlGuiWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        d = WaitDialog(self)
        d.exec_()
        
appName     = "setButtonsTest"
catalog     = ""
programName = ki18n("setButtonsTest")
version     = "0.1"
aboutData   = KAboutData(appName, catalog, programName, version)
KCmdLineArgs.init(sys.argv, aboutData)
    
app = KApplication()
w = MainWindow()
w.show()
app.exec_()
--------------------------------------------------------------



More information about the PyQt mailing list