Replaceable Backgound images now work

This commit is contained in:
Tim Bentley 2010-06-30 17:10:54 +01:00
parent 56e4e38b99
commit 7198148a48
2 changed files with 13 additions and 12 deletions

View File

@ -211,7 +211,7 @@ class MainDisplay(DisplayWidget):
#Sort out screen locations and sizes #Sort out screen locations and sizes
self.setGeometry(self.screen[u'size']) self.setGeometry(self.screen[u'size'])
self.scene.setSceneRect(0,0,self.size().width(), self.size().height()) self.scene.setSceneRect(0,0,self.size().width(), self.size().height())
self.imageDisplay.setGeometry(0, 0, self.size().width(), self.size().height()) self.webView.setGeometry(0, 0, self.size().width(), self.size().height())
#Build a custom splash screen #Build a custom splash screen
self.InitialFrame = QtGui.QImage( self.InitialFrame = QtGui.QImage(
self.screen[u'size'].width(), self.screen[u'size'].width(),
@ -255,12 +255,13 @@ class MainDisplay(DisplayWidget):
self.setScene(self.scene) self.setScene(self.scene)
def setupImage(self): def setupImage(self):
# self.display_image = QtGui.QGraphmaindisplay.pyicsPixmapItem() self.webView = QtWebKit.QWebView()
# self.display_image.setZValue(2) self.page = self.webView.page()
# self.scene.addItem(self.display_image) self.imageDisplay = self.page.mainFrame()
self.imageDisplay = QtWebKit.QWebView() self.imageDisplay.setScrollBarPolicy(QtCore.Qt.Vertical, QtCore.Qt.ScrollBarAlwaysOff)
self.imageDisplay.setScrollBarPolicy(QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff)
self.proxy = QtGui.QGraphicsProxyWidget() self.proxy = QtGui.QGraphicsProxyWidget()
self.proxy.setWidget(self.imageDisplay) self.proxy.setWidget(self.webView)
self.proxy.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) self.proxy.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint)
self.proxy.setZValue(2) self.proxy.setZValue(2)
self.scene.addItem(self.proxy) self.scene.addItem(self.proxy)

View File

@ -175,12 +175,12 @@ class ImageMediaItem(MediaManagerItem):
translate('ImagePlugin.MediaItem', 'No item selected'), translate('ImagePlugin.MediaItem', 'No item selected'),
translate('ImagePlugin.MediaItem', translate('ImagePlugin.MediaItem',
'You must select one item')) 'You must select one item'))
items = self.ListView.selectedIndexes() return
for item in items: item = self.buildServiceItem()
bitem = self.ListView.item(item.row()) item.render()
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString()) self.parent.live_controller.displayManager. \
frame = QtGui.QImage(unicode(filename)) displayImage(item.get_rendered_frame(0)[u'display'])
self.parent.maindisplay.addImageWithText(frame)
def onPreviewClick(self): def onPreviewClick(self):
MediaManagerItem.onPreviewClick(self) MediaManagerItem.onPreviewClick(self)