import sys
from PyQt4 import QtCore, QtGui, QAxContainer

class MainWindow(QtGui.QMainWindow):
	def __init__(self, parent=None):
		super(MainWindow, self).__init__(parent)
		self.init_widgets()
	
	def init_widgets(self):
		mainLayout = QtGui.QGridLayout()
		
		self.browser = QAxContainer.QAxWidget()
		self.browser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}")
		
		self.button1 = QtGui.QCommandLinkButton("Test1")
		self.button2 = QtGui.QCommandLinkButton("Test2")
		self.button1.clicked.connect(self.test_slot)

		mainLayout.addWidget(self.button1, 1, 0)
		mainLayout.addWidget(self.button2, 1, 1)
		mainLayout.addWidget(self.browser, 2, 0) # this creates the bug
		
		central_widget = QtGui.QWidget()
		central_widget.setLayout(mainLayout)
		self.setCentralWidget(central_widget)
		
	def test_slot(self):
		fade_effect = QtGui.QGraphicsOpacityEffect()
		self.button1.setGraphicsEffect(fade_effect)
		hideAnimation = QtCore.QPropertyAnimation(fade_effect, "opacity")
		hideAnimation.setDuration(5000)
		hideAnimation.setStartValue(1.0)
		hideAnimation.setEndValue(0.01)
		
		animation = QtCore.QPropertyAnimation(self.button2, "geometry")
		animation.setDuration(5000)
		animation.setStartValue(self.button2.geometry())
		animation.setEndValue(self.button1.geometry())
		
		hideAnimation.start()
		animation.start()
		
		self.animation = animation
		self.hideAnimation = hideAnimation

if __name__ == '__main__':
	app = QtGui.QApplication(sys.argv)
	MainWindow = MainWindow()
	MainWindow.show()
	eventLoop = app.exec_()
	sys.exit(eventLoop)