[PyKDE] keypressevent + qdatedit

Torsten Marek shlomme at gmx.net
Thu Apr 7 22:56:51 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Juan Fernando Estrada Henao schrieb:
> hello
> 
> how to i do the implementation keypressevent of a qdateedit make in
> qtdesigner and converted with pyuic?.

Hello Juan,

by outsmarting pyuic.

1. Create a Python file and subclass QDateEdit to your needs (let's call the
file foodate.py and the subimpl FooDateEdit)
2. In Designer, open the form settings dialog and write
Python:from foodate import FooDateEdit as QDateEdit
3. Recreate the UI.

Neither did I test this, nor did I ever do such a thing, but it should work
IMHO. If it doesn't, just keep complaining!

The dark side approach would be overwriting the keyPressEvent with another
method in your widget's __init__ method. To get the taste of it, just look here:
http://www.diotavelli.net/PyQtWiki/DragAndDropWithPytQt
and adapt the code to your needs.

greetings

Torsten

- --
Torsten Marek <shlomme at gmx.net>
ID: A244C858 -- FP: 1902 0002 5DFC 856B F146  894C 7CC5 451E A244 C858
Keyserver: subkeys.pgp.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCVayjfMVFHqJEyFgRAk4hAJ9FHHdqPCGK1E8p/XlUL/7cwQX/vACeIR6i
KAmSdUGBf+wbeHUS5fIc15I=
=LeE9
-----END PGP SIGNATURE-----




More information about the PyQt mailing list