Hey Jonas,

Are you by chance using PyQt4 with Maya 2011? It seems in Qt 4.5.3, the 
QDoubleValidator constructor did not have an *optional* parent argument:
http://doc.qt.digia.com/4.5/qdoublevalidator.html#QDoubleValidator

QDoubleValidator::QDoubleValidator ( QObject * parent )

If you can pop open the calc_app2.py file, make these changes:
87:             self.ui.inputA.setValidator(QtGui.QDoubleValidator(self))
88:             self.ui.inputB.setValidator(QtGui.QDoubleValidator(self))

Note I am passing in `self` to the QDoubleValidator. `self` is the QWidget 
subclass, and it tells QDoubleValidator to use it as the parent object. 

I can make these fixes and update the project files for future people using Qt 
4.5.3 with this tutorial. And I will try to scan everything to see if any other 
constructors are missing the argument. If you see this error again, just pass 
in the `self` variable.

Thanks for pointing this out. Sorry you were faced with it.

Let me know if you run into anything else!

-- justin



On Nov 14, 2012, at 6:02 PM, Jonas Avrin wrote:

> Getting this error when running example code calc_app2.py on Linux:
> 
> python calc_app2.py 
> Traceback (most recent call last):
>   File "calc_app2.py", line 143, in <module>
>     win = Window()
>   File "calc_app2.py", line 57, in __init__
>     self.calcWidget = Calculator()
>   File "calc_app2.py", line 87, in __init__
>     self.ui.inputA.setValidator(QtGui.QDoubleValidator())
> TypeError: arguments did not match any overloaded call:
>   QDoubleValidator(QObject): not enough arguments
>   QDoubleValidator(float, float, int, QObject): not enough arguments
> 
> 
> -- 
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings: 
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to