[PyKDE] QLineEdit setCursorPosition & cursor blinking problems

Danu Kusmana danu at limabit.com
Thu Jul 7 10:33:27 BST 2005


Hi!
I have sent email about this problems before but no one reply it.

I reimplement the focusInEvent() with:

class classEntry(QLineEdit):
	def focusInEvent(self, event):
		self.setPaletteBackgroundColor(QColor(188,255,203))
		self.setCursorPosition(0)

	def focusOutEvent(self, event):
		self.setPaletteBackgroundColor(QColor("white"))

and make an object:

self.EntryDiastolik = classEntry(self.centralWidget(),
	"EntryDiastolik")
self.EntryDiastolik.setSizePolicy(QSizePolicy(0,0,0,0,
	self.EntryDiastolik.sizePolicy().hasHeightForWidth()))
self.EntryDiastolik.setMaxLength(3)
self.EntryDiastolik.setValidator(QIntValidator(self.EntryDiastolik))

What happen is that:
1. The cursor is not blinking at the focused line edit only the
background color changes.
2. After I entered some values to the line edit the cursor position 0 is
place after the entered values, not from the begining of the line edit.

Can anyone help me with this?

Thanx

danu 




More information about the PyQt mailing list