<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Le 23/10/10 09:09, leo kirotawa a écrit :
<blockquote
 cite="mid:AANLkTimGGcJ62XrF3P_Zm5rzP2XNkicHpxc8=AYYt=hi@mail.gmail.com"
 type="cite"> Hi,
  <div><br>
  </div>
  <div>I  have the piece of code <br clear="all">
  <br>
  </div>
  <div><br>
  </div>
  <div>
  <div> view = QtGui.QGraphicsView(scene)</div>
  <div>   </div>
  <div>    view.setRenderHint(QtGui.QPainter.Antialiasing)</div>
  <div>    view.setRenderHint(QtGui.QPainter.Antialiasing)</div>
  <div>    pixmap = QtGui.QImage(":/images/background.jpg")</div>
  <div>    </div>
  <div>    view.setBackgroundBrush(QtGui.QBrush(pixmap))</div>
  <div>    view.setCacheMode(QtGui.QGraphicsView.CacheBackground)</div>
  <div><br>
  </div>
  <div>So my scene have 800 x 600 pixel, and my image too. When I try
put the background in view just show a view in white color with no
image. What I 'm doing wrong?</div>
-- <br>
Leônidas S. Barbosa (Kirotawa)<br>
[DesenvolvedorWeb/CEFET/RN]<br>
[Ciências da Computação/UFRN]<br>
[pós-graduando em Inteligência Computacional/Processamento Gráfico /UFRN<br>
[Estudante de japonês nível Intermediário I  - Japanese Student]<br>
[Desenvolvedor em python, PyGame]<br>
blog nerd: <a moz-do-not-send="true"
 href="http://corecode.wordpress.com/" target="_blank">corecode.wordpress.com/</a><br>
blog music: <a moz-do-not-send="true"
 href="http://essenaomanja.blogspot.com" target="_blank">essenaomanja.blogspot.com</a>
  <div>blog tirinhas: <a moz-do-not-send="true"
 href="http://elminiche.wordpress.com/" target="_blank">elminiche.wordpress.com/</a><br>
  <br>
"Mais sábio é aquele que sabe que não sabe" (Sócrates)<br>
  <br>
日本語の学生です。<br>
コンピュータサイエンスの学位.<br>
  </div>
  <br>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
PyQt mailing list    <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
</blockquote>
Hi,<br>
<br>
I have reproduce your code like this:<br>
<br>
class GraphicView(object):<br>
    def __init__(self, MainWindow):<br>
        MainWindow.resize(864, 649)<br>
        self.centralwidget = QtGui.QWidget(MainWindow)<br>
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)<br>
        self.scene = QtGui.QGraphicsScene(self.centralwidget)<br>
        self.graphicsView = QtGui.QGraphicsView(self.scene)<br>
        self.graphicsView.setRenderHints(QtGui.QPainter.Antialiasing)<br>
        pixmap = QtGui.QImage("amymc1.jpg")   <br>
        self.graphicsView.setBackgroundBrush(QtGui.QBrush(pixmap))<br>
       
self.graphicsView.setCacheMode(QtGui.QGraphicsView.CacheBackground)<br>
        self.gridLayout.addWidget(self.graphicsView, 0, 0, 1, 1)<br>
        MainWindow.setCentralWidget(self.centralwidget)<br>
<br>
On Qt 4.6, PyQt 4.7.2<br>
and Qt 4.7, PyQt 4.7.4<br>
<br>
That functions but the result is unexpected.(See attachement)<br>
<br>
<div class="moz-signature">-- <br>
Vincent V.V.<br>
<a href="https://launchpad.net/oqapy">Oqapy</a></div>
</body>
</html>