What about

```python
if hasattr(QtGui.QLineEdit(), 'setPlaceholderText'):
    if  sys.platform == 'win32':
        ...
    else:
        ...
```

lets you get rid of one if-statement.