[PyKDE] Can I use QString as key in Python dictionary?

Matej Cepl cepl at surfbest.net
Thu Jun 2 03:10:58 BST 2005


I have this simple dialog in PyQt, but whenever I press any item in the list
(or click OK), I get this error:

        chelcicky:pycatsel$ ./pycatsel
        Traceback (most recent call last):
          File "/home/matej/archiv/programky/vim-qadas/pycatsel/selectCode.py",\
        line 148, in Quit
            note = unicode(self.dictCategories[key])
        KeyError: <__main__.qt.QString object at 0xb7e12c5c>

Does anybody have any idea, what's wrong? Can I use QString as a key in
Python dictionary (both key and dict's values are QStrings)?

Thanks a lot,


Matej Cepl, http://www.ceplovi.cz/matej
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
I am a Roman Catholic, so that I do not expect `history' to be
anything but a `long defeat' -- though it contains (and in
a legend may contain more clearly and movingly) some samples or
glimpses of final victory.
      -- J.R.R. Tolkien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pycatsel.tar.bz2
Type: application/x-bzip2
Size: 11997 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050602/913742a4/pycatsel.tar.bz2

More information about the PyQt mailing list