I have:
class DisplayItem(QGraphicsPixmapItem):
def __init__(self, parent, graphView=None):
QGraphicsPixmapItem.__init__(self)
pic = QPixmap("/.../.../pic1.png")
self.setPixmap(pic)
and then when I do QGraphicsScene.addItem(DisplayItem), nothing shows up.
I can use t
Subject: [PyQt] QGraphicsPixmapItem not showing set pixmap
I have:
class DisplayItem(QGraphicsPixmapItem):
def __init__(self, parent, graphView=None):
QGraphicsPixmapItem.__init__(self)
pic = QPixmap("/.../.../pic1.png")
self.setPixmap(pic)
and then when I
You aren't looking at it. Try using ensureVisible() on it in case its
> off-screen.
>
>
>
>
> - Original Message
> From: dizou
> To: pyqt@riverbankcomputing.com
> Sent: Tue, January 19, 2010 12:23:19 PM
> Subject: [PyQt] QGraphicsPixmapItem n
creen.
- Original Message
From: dizou
To: pyqt@riverbankcomputing.com
Sent: Tue, January 19, 2010 12:23:19 PM
Subject: [PyQt] QGraphicsPixmapItem not showing set pixmap
I have:
class DisplayItem(QGraphicsPixmapItem):
def __init__(self, parent, graphView=None):
QGrap
print QFile.exists('/.../.../pic1.png') outputs True.
I am doing pic = QPixmap('/../../pic1.png') not
pic = QPixmap('../../pic1.png')
nickgaens wrote:
>
> Did you try QFile.exists('/.../.../pic1.png') ?
>
> I'm guessing you are trying to do:
>
> pic = QPixmap('../../pic1.png') <- note the ch
Can someone give me some more help about this?
dizou wrote:
>
> I did print QFile.exists('/.../.../pic1.png'); it outputs "True."
> I am doing pic = QPixmap('/../../pic1.png') not
> pic = QPixmap('../../pic1.png')
>
>
> nickgaens wrote:
>>
>> Did you try QFile.exists('/.../.../pic1.png') ?
>
It doesn't make that much sense to me.
> I did print QFile.exists('/.../.../pic1.png'); it outputs "True."
Ok, great, so there is a file there, named "pic1.png". What exactly is the
meaning of three dots for a folders name? I am asking this, because you say
in the next sentence:
> I am doing pic
The dots are just me replacing the name of the folders. It's not the ..
command.
By resources file do you mean a .qrc file?
--
View this message in context:
http://old.nabble.com/QGraphicsPixmapItem-not-showing-set-pixmap-tp27229352p27372427.html
Sent from the PyQt mailing list archive at Nabble
I made a Icons.qrc file. I am now doing this:
pyrcc4 -py2 Icons.qrc -o IconsCompiled
What should the extension IconsCompiled be? How would I import that file to
my PyQt program?
--
View this message in context:
http://old.nabble.com/QGraphicsPixmapItem-not-showing-set-pixmap-tp27229352p2737314
On Fri, 29 Jan 2010 07:00:13 -0800 (PST), dizou wrote:
> I made a Icons.qrc file. I am now doing this:
>
> pyrcc4 -py2 Icons.qrc -o IconsCompiled
>
> What should the extension IconsCompiled be? How would I import that file to
> my PyQt program?
It's a Python module, so call it IconsCompiled.py or
So I've got a Icons.qrc file; I've got the IconsCompiled.py file. I'm doing
import IconsCompiled.
print QFile.exists('/.../.../images/humvee.png') returns "True"
print QFile.exists(':/images/humvee.png') returns "True"
I am still not getting a pixmap displayed on the screen.
--
View this messag
I still haven't gotten this to work. Any other suggestions?
I've tried this:
class DisplayItem(QGraphicsPixmapItem):
def __init__(self, parent, pixmap=None, graphView=None):
QGraphicsPixmapItem.__init__(self, QPixmap(':/humvee.png'))
and after I do QGraphicsScene.addItem(DisplayItem
I still haven't gotten this to work. Any other suggestions?
I've tried this:
class DisplayItem(QGraphicsPixmapItem):
def __init__(self, parent, pixmap=None, graphView=None):
QGraphicsPixmapItem.__init__(self, QPixmap(':/humvee.png'))
and after I do QGraphicsScene.addItem(DisplayItem
[Resending from the correct address...]
On Mon Mar 22 14:12:10 GMT 2010, dizou wrote:
> I still haven't gotten this to work. Any other suggestions?
>
> I've tried this:
>
> class DisplayItem(QGraphicsPixmapItem):
> def __init__(self, parent, pixmap=None, graphView=None):
> QGraphicsPi
I figured out the problem. I had overloaded the paint() function, and in my
overloaded function, I wasn't calling the superclass's paint()
--
View this message in context:
http://old.nabble.com/QGraphicsPixmapItem-not-showing-set-pixmap-tp27229352p28005332.html
Sent from the PyQt mailing list ar
15 matches
Mail list logo