From: Zabin on
Hey!

I am new PyQt programmer and want to restrict users to allow only
numeric values into a table and lineedit boxes. I found the
QDoubleValidator class but am unsure as to how to implement it. (I am
a little shaky on the concept of parent and how to define them). Any
help would be much appreciated!
From: Zabin on
On Jan 7, 10:23 am, Zabin <zabin.faris...(a)gmail.com> wrote:
> Hey!
>
> I am new PyQt programmer and want to restrict users to allow only
> numeric values into a table and lineedit boxes. I found the
> QDoubleValidator class but am unsure as to how to implement it. (I am
> a little shaky on the concept of parent and how to define them). Any
> help would be much appreciated!

I managed to get it going for the line edit- but am stuck with
checking a cell in a table as cells do not have the set validator
attribute- here's the code i had for the line edit:

self.ui.Thickness_datum.setValidator(QtGui.QDoubleValidator(-999.0,
999.0, 2, self.ui.Thickness_datum))

for the table i thought it would be:

self.ui.table_process.item(row,2).setValidator(QtGui.QDoubleValidator
(-999.0, 999.0, 2, self.ui.table_process.item(row,2)))

Any help would be appreciated
From: John Posner on
On Wed, 06 Jan 2010 17:47:37 -0500, Zabin <zabin.farishta(a)gmail.com> wrote:

> On Jan 7, 10:23 am, Zabin <zabin.faris...(a)gmail.com> wrote:
>> Hey!
>>
>> I am new PyQt programmer and want to restrict users to allow only
>> numeric values into a table and lineedit boxes. I found the
>> QDoubleValidator class but am unsure as to how to implement it. (I am
>> a little shaky on the concept of parent and how to define them). Any
>> help would be much appreciated!

You'll probably get more help in these Qt-specific forums:

http://lists.trolltech.com/mailman/listinfo/qt-interest

http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Good luck,
John