I'm having some trouble with PyQt4 isn't behaving quite as desired.

I have a search box, a list below and a optional picture to the right of the searchbox and list.

Without a stretching spacer, the items will get all the excess space divided between them.

The problem is that when I add a stretch item, it takes up more space than needed when there is nothing in the list, adding excess blank space in the window.

This is a minimal example demonstrating the issue
-------------------------------------------------

```
#!/usr/bin/python
# -*- coding: utf8 -*-

import sys

from PyQt4 import QtGui, QtCore

class SearchTool(QtGui.QWidget):
    def __init__(self):
        super(SearchTool, self).__init__()
        self.initUI()

    def initUI(self):
        self.searchField = QtGui.QLineEdit()

        self.gui_0 = QtGui.QVBoxLayout()

        self.gui_0.addWidget(self.searchField)

        # Comment out the following line to see desired output.
        self.gui_0.addStretch()

        self.setLayout(self.gui_0)
        self.show()

def main():
    app = QtGui.QApplication(sys.argv)
    ex = SearchTool()
    sys.exit(app.exec_())

if __name__ == '__main__':
    main()

```

**With .addStretch()**  

![with stretch](https://i.stack.imgur.com/ps0Dz.png)

**Without .addStretch()**  

![without stretch](https://i.stack.imgur.com/FGbYp.png)  

This is what I want it to look like.

The reason for the stretch
--------------------------

**Just the list, no picture on this item.**  

![List without picture and stretch](https://i.stack.imgur.com/cs3Hh.png)

**The list and the picture, without the stretch.**  

![List with picture, without stretch](https://i.stack.imgur.com/MWMDj.png)

**The list and the picture, with stretch.**  

![List with picture, with stretch](https://i.stack.imgur.com/BltoZ.png)  

This is what I want it to look like.