[review] [PyKDE] bugs using PyKDE
Jim Bublitz
jbublitz at nwinternet.com
Tue Oct 4 00:57:33 BST 2005
On Monday 03 October 2005 14:35, Mathieu Bouchard wrote:
> Hi,
>
> I'm using a recent menu in one of my apps
> It is created with :
> ac = self.actionCollection()
> ...
> self.OpenRecent = KStdAction.openRecent(self.__slotOpenRecent_, ac)
>
> the slot is :
> def fileOpenRecent(self, url):
> if self.__checkModified_():
> self.mar_editor.openArchive(url)
> self.__file_choosed_ = url
>
> In the KDE documentation,
> (http://developer.kde.org/documentation/library/3.4-api/kdeui/html/namesp
> aceKStdAction.html#a68 ) it is written : "The signature of the slot being
> called is of the form slotURLSelected( const KURL & )" but the signal
> received seems to be slotURLSelected() in PyKDE, because I'm never
> receiving any URL.
>
> To make it working, I have to use the following code :
> self.OpenRecent = KStdAction.openRecent(self, PYSIGNAL(""), ac)
> self.connect(self.OpenRecent, SIGNAL("urlSelected(const KURL&)"),
> self.fileOpenRecent)
>
That looks like an error in kstdaction.sip - the openRecent function doesn't
have a signature specified. As far as I can tell, it's the only function in
KStdAction whose slot expects an argument, and there's no way to determine
that parsing the h file. I can patch that up in the next release. Since you
have a workaround, it wouldn't be worth rebuilding your version of PyKDE
until the patch is available.
> The second problem I'm having is with KDockWidget and KDockMainWindow.
> When creating the dock with :
> pix = QPixmap(16, 16)
> pix.fill()
> mainDock = win.createDockWidget("New Dock", pix, None,
> "main_dock_widget") the application is crashing (KCrash)
Not sure what's going on there - it may be a problem with the None value for
the "parent" argument. You could try:
mainDock = win.createDockWidget ("New Dock", pix)
or try using a 0 instead of None, or try assigning an actual widget as parent
(each of those just to localize the bug, not as a fix).
Let me know if any of that makes a difference. Otherwise, a short example
program would be helpful.
Jim
More information about the PyQt
mailing list