Hans-Peter Jansen wrote:
On Wednesday 24 November 2010, 13:54:50 romain wrote:
is the cruical part again:

No, a method named HelpBrowser.loadResource() is called. Yours is named:
                   HelpBrowser.loadResources()

Hopefully, you you're able to spot the difference now. Btw, you still cover "help", "type", and missed the super calls in the c'tors. For that reason, your argument shuffle is suboptimal, better would be:

class HelpBrowser(QTextBrowser):
        def __init__(self, helpEngine, parent = None):
           super(HelpBrowser, self).__init__(parent)
           self.__helpEngine = helpEngine

        def loadResource(self, type_, url):
            if url.scheme() == "qthelp":
                return self.__helpEngine.fileData(url)
            return super(HelpBrowser, self).loadResources(type_, url)

Check the parent arg.
This might need something like before the very first PyQt4 import:

import sip
sip.setapi('QVariant', 2)

and is a good idea for new code anyway (similar to QString elimination).

Pete


Thanks, it works. I've read your previous answer and didn't noticed the difference between loadResource and loadResources, so I didn't understood what you meant. By 'you are covering a few python keywords in your code' I thought you were indirectly asking me to give more details about what I coded / wanted to do.

I'm sorry I made you waste your time with such an "issue". Thanks for your advices and answers.

  Regards,

--
Romain
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to