Created
August 16, 2012 15:36
-
-
Save arkottke/3371142 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import glob | |
import sys | |
from PySide import QtGui, QtCore | |
class MainWindow(QtGui.QMainWindow): | |
def __init__(self): | |
super(MainWindow, self).__init__() | |
self.scene = QtGui.QGraphicsScene() | |
layout = QtGui.QGraphicsLinearLayout() | |
for f in glob.glob('./test/*.JPG'): | |
pixmap = QtGui.QPixmap(f).scaledToHeight(200) | |
pixmapItem = self.scene.addPixmap(pixmap) | |
widget = QtGui.QGraphicsWidget(pixmapItem) | |
layout.addItem(widget) | |
form = QtGui.QGraphicsWidget() | |
form.setLayout(layout) | |
self.scene.addItem(form) | |
view = QtGui.QGraphicsView() | |
view.setScene(self.scene) | |
self.setCentralWidget(view) | |
app = QtGui.QApplication(sys.argv) | |
mw = MainWindow() | |
mw.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment