[PyKDE] KDialogBase bug(?) with IconList and TreeList dialogFace

Matt T. Matt at boons.net
Tue Dec 28 19:25:35 GMT 2004

Hello all of you already back at your PCs after another Xmas:

Is it possible that I'm running in my first pykde app (the second with pyqt
though) in a nasty bug with KDialogBase?

After testing and googling for a whole day this is what I found:

Scripts terminate "unexpectedly" whenever KDialogBase is used with the
dialogFace "IconList" or "TreeList", but work fine with the dialogFace

Tested on a suse 9.2 amd64 installation updated with the latest kdebindings
from SuSE, and on a  suse 9.1 (pentium 32 bit) box using kde3.3.1 but with
the latest python kdebindings from SuSE for kde3.3.2:

Here's the codeline in question:

KDialogBase.__init__(self, KDialogBase.IconList, "The kdialog test app",
buttonMask, Ok)

(with buttonMask and Ok being both 0)

Changing from KDialogBase.IconList to KDialogBase.Tabbed works fine, but is
not :-( what I want :

KDialogBase.__init__(self, KDialogBase.Tabbed, "The kdialog test app",
buttonMask, Ok)

Below is a simple script to test and show the problem.

Is my code incorrect? (There is no sample for this to be found anywhere, at
least I did not find anything, despite googling for a day. I ported this code
from a working c++ app. )

If yes, how should this be coded?

Or is this a bug, and if yes, is it in all pykde or just in the SuSE

Thanks for any help,
========== DialogTest script begin ============
# -*- coding: utf-8 -*-
## testing of KDialogBase with different dialogFaces
## DialogBase.IconList  KDialogBase.Tabbed  KDialogBase.Plain

import sys
from qt import *
from kdecore import *
from kdeui import *

class DialogTest(KDialogBase):
def __init__(self,parent = None, name = None, modal = 0,
fl = 0, buttonMask= 0, Ok= 0 ):

## the c++ code for KDialogBase:
##KDialogBase( int dialogFace, const QString  &caption,
##                     int buttonMask,
##                     ButtonCode defaultButton,
##                          QWidget *parent=0, const char *name=0,
##                       bool modal=true,
##                          bool separator=false,
##                          const KGuiItem &user1=KGuiItem(),
##                          const KGuiItem &user2=KGuiItem(),
##                          const KGuiItem &user3=KGuiItem() );

print "still running..."

## available as dialogFace are:
## KDialogBase.IconList  KDialogBase.Tabbed
## KDialogBase.Plain  KDialogBase.TreeList etc.

KDialogBase.__init__(self, KDialogBase.IconList, "The kdialog test
app", buttonMask, Ok)
##KDialogBase.__init__(self, KDialogBase.Tabbed, "The kdialog test
app", buttonMask, Ok)

## terminating here if using KDialogBase.IconList
## or KDialogBase.TreeList
## however working fine if using KDialogBase.Tabbed

print "this is not printing with KDialogBase.IconList",
print " and KDialogBase.TreeList"

if not name:


infoPixmap = QPixmap("info.png")

frame = self.addPage("Info", "Info about it", infoPixmap)
frameLayout =  QVBoxLayout(frame)
self.infopage =  QLabel(frame,"Infopage")
self.infopage.setText("This is the Info page which I want to see")
## using a simple QLabel instead of the real page for testing

frame = self.addPage("Setup", "Setup of it", infoPixmap)
frameLayout =  QVBoxLayout(frame)
self.setuppage =  QLabel(frame,"Setuppage")
self.setuppage.setText("This is the Setup page which I want to see")
## using a simple QLabel instead of the real page for testing


print "finished"

def languageChange(self):

def __tr(self,s,c = None):
return qApp.translate("DialogTest",s,c)

if __name__ == "__main__":
a = QApplication(sys.argv)
w = DialogTest()
========== DialogTest script end ============

More information about the PyQt mailing list