[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] lineedit on focus
From: Sebastian =?utf-8?q?K=C3=BCgler?= <sebas () kde ! nl>
Date: 2005-06-28 14:21:06
Message-ID: 200506281621.07184.sebas () kde ! nl
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
> On Tue, 2005-06-28 at 14:21 +0200, Giovanni Bajo wrote:
> > Danu Kusmana <danu@limabit.com> wrote:
> > > Im m trying to find something todo with QLineEdit object when the
> > > object recived focus by clicking on it. There aren't any signal
> > > like "on focus" for QLineEdit or is there?
> >
> > Just reimplemet focusInEvent(). In the QFocusEvent you receive
> > there is also a reason() method which tells you how the widget got
> > the focus (in case you want to do something only if it got focus by
> > mouse).
On Sunday 26 January 2003 14:10, Danu Kusmana wrote:
> I set the input mask with:
> self.EntryUmur.setInputMask("99")
>
> then I want that when user click on the line edit the cursor
> prosition on 0, but it never happened.
>
> I tried:
> self.EntryUmur.focusInEvent(self.test())
>
> def test(self):
> self.EntryUmur.setCursorPosition(0)
>
> but this method is not general for other line edit.
>
> I dont get it how to reimplement the event filter :P
You can subclass the QLineEdit and then overload the focusInEvent
method. See attached script for an example of how to do this.
Cheers,
--
sebas
http://vizZzion.org | GPG Key ID: 9119 0EF9
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I have no right, by anything I do or say, to demean a human being in his
own eyes. What matters is not what I think of him; it is what he
thinks of himself. To undermine a man's self-respect is a sin. -
Antoine de Saint-Exupery
[Attachment #5 (application/pgp-signature)]
["line.py" (application/x-python)]
_______________________________________________
PyKDE mailing list PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic