from PyQt4.QtCore import Qt, QRect
from PyQt4.QtGui import QApplication, QMainWindow, QGraphicsScene, QPushButton, QGraphicsView, QRegion, QWidget, QVBoxLayout

def gotAClick():
  print "Got a click";

if __name__ == '__main__':
  import sys

  app = QApplication(sys.argv)

  button1 = QPushButton("1111111");
  button2 = QPushButton("2222222");
  button1.clicked.connect(gotAClick)
  button2.clicked.connect(gotAClick)
  graphics_scene = QGraphicsScene();
  graphics_view = QGraphicsView(graphics_scene);

  graphics_scene.addWidget(button1)
 
  window = QMainWindow();
  main_widget = QWidget();
  main_layout = QVBoxLayout();
  main_layout.addWidget(graphics_view);
  main_layout.addWidget(button2);
  main_widget.setLayout(main_layout);
  window.setCentralWidget(main_widget);
  window.show();

  button1.setMask(QRegion(QRect(0,0,button1.width()/2, button1.height())));
  button2.setMask(QRegion(QRect(0,0,button2.width()/2, button2.height())));

  sys.exit(app.exec_())