[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Semi-transparent QDrag pixmap
From:       Jugdish <jugdizh () gmail ! com>
Date:       2009-09-30 17:36:10
Message-ID: 4beab6d40909301036n7dfaeabcx72d914d7bb7a304e () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Is there any way to make the pixmap on a QDrag object be semi-transparent?

Here is the code I've got right now:

################################################

def startDrag(self, supportedActions):
    drag = QDrag(self)

    pixmap = QPixmap("/path/to/my/image.png")
    alphaChannel = QPixmap(pixmap.width(), pixmap.height())
    alphaChannel.fill(QColor(128, 128, 128))
    pixmap.setAlphaChannel(alphaChannel)

    drag.setPixmap(pixmap)

    drag.exec_(supportedActions)

################################################

However, setting the alpha channel on the pixmap just makes it look faded,
but doesn't actually show the window contents underneath the pixmap, so it's
not really transparent.

[Attachment #5 (text/html)]

Is there any way to make the pixmap on a QDrag object be \
semi-transparent?<br><br>Here is the code I&#39;ve got right \
now:<br><br>################################################<br><br>def \
startDrag(self, supportedActions):<br>

    drag = QDrag(self)<br><br>    pixmap = \
QPixmap(&quot;/path/to/my/image.png&quot;)<br>    alphaChannel = \
QPixmap(pixmap.width(), pixmap.height())<br>    alphaChannel.fill(QColor(128, 128, \
128))<br>    pixmap.setAlphaChannel(alphaChannel)<br>

<br>    drag.setPixmap(pixmap)<br><br>    \
drag.exec_(supportedActions)<br><br>################################################<br>
 <br>However, setting the alpha channel on the pixmap just makes it look faded, but \
doesn&#39;t actually show the window contents underneath the pixmap, so it&#39;s not \
really transparent.<br><br>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic