26 Jan 2003 12:40
26 Jan 2003 14:10
Re: lineedit on focus
Danu Kusmana <danu <at> limabit.com>
2003-01-26 13:10:06 GMT
2003-01-26 13:10:06 GMT
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
Can anyone help?
danu
On Tue, 2005-06-28 at 14:21 +0200, Giovanni Bajo wrote:
> Danu Kusmana <danu <at> 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).
(Continue reading)
27 Jan 2003 06:56
Re: lineedit on focus + setCursorPosition(0)
Danu Kusmana <danu <at> limabit.com>
2003-01-27 05:56:15 GMT
2003-01-27 05:56:15 GMT
The focusInEvent is working but the cursor position didn't change the
way I wanted. how come?
#**classEntry.py**
import sys
from qt import *
class classEntry(QLineEdit):
def focusInEvent(self, event):
self.setText("999")
self.setCursorPosition(0)
#**SkorKardioJakarta.py**
import sys
from qt import *
from classEntry import classEntry
self.EntryTinggiBadan = classEntry(self.centralWidget(),
"EntryTinggiBadan")
self.EntryTinggiBadan.setSizePolicy(QSizePolicy(0,0,0,0,
self.EntryTinggiBadan.sizePolicy().hasHeightForWidth()))
self.EntryTinggiBadan.setInputMask("999")
thanx
danu
On Tue, 2005-06-28 at 16:21 +0200, Sebastian Kügler wrote:
(Continue reading)
27 Jan 2003 08:44
QLineEdit focusInEvent() & setCursorPosition() problems
Danu Kusmana <danu <at> limabit.com>
2003-01-27 07:44:37 GMT
2003-01-27 07:44:37 GMT
I have notice several things after I reimplement focusInEvent(): 1. The cursor focus on QLineEdit widget is not blinking 2. eventhough I use setCursorPosition(0) after I entered some value to the line edit the cursor position at index 0 is start after the value I had entered I don't know if I do something wrong or is it the default behaviour of QLineEdit widget. danu
RSS Feed