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

List:       pykde
Subject:    QImage.setAlphaChannel missing from PyQt5.QtGui
From:       FeRD <ferdnyc () gmail ! com>
Date:       2020-12-05 9:31:20
Message-ID: CAN1OggVqzkz-KcTMuf57Tsfu6Ht41nANi8wsHDQGstRCH-C1gg () mail ! gmail ! com
[Download RAW message or body]

Hey all,

It seems QImage::setAlphaChannel
<https://doc.qt.io/qt-5/qimage.html#setAlphaChannel> was un-deprecated in
Qt 5.15
<https://forum.qt.io/topic/121460/qimage-setalphachannel-obsolete-or-not>,
but it's missing from the 5.15.2 wheels:

> > > from PyQt5 import QtCore, QtGui>>> i = QtGui.QImage("/tmp/front3.jpg")>>> m = \
> > > QtGui.QImage("/tmp/mask.png")>>> m = \
> > > m.convertToFormat(QtGui.QImage.Format_Alpha8)>>> i.setAlphaChannel(m)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'QImage' object has no attribute 'setAlphaChannel'>>>
QtCore.QT_VERSION_STR'5.15.2'>>> QtCore.PYQT_VERSION_STR'5.15.2'


[Attachment #3 (text/html)]

<div dir="ltr">Hey all,<div><br></div><div>It seems <a \
href="https://doc.qt.io/qt-5/qimage.html#setAlphaChannel">QImage::setAlphaChannel</a> \
was <a href="https://forum.qt.io/topic/121460/qimage-setalphachannel-obsolete-or-not">un-deprecated \
in Qt 5.15</a>, but it&#39;s missing from the 5.15.2 wheels:</div><div><pre \
class="gmail-markdown-highlight" \
style="box-sizing:border-box;overflow:auto;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:13px;padding:9.5px;margin-top:1rem;margin-bottom:10px;li \
ne-height:1.42857;word-break:break-all;color:rgb(51,51,51);border:none;border-radius:0px;max-height:350px"><code \
class="gmail-language-python gmail-hljs" \
style="box-sizing:border-box;font-family:Menlo,Monaco,Consolas,&quot;Courier \
New&quot;,monospace;font-size:inherit;padding:0.5em;color:black;background-image:initi \
al;background-position:initial;background-size:initial;background-repeat:initial;backg \
round-origin:initial;background-clip:initial;border-radius:0px;display:inline-block;overflow-x:auto;min-width:100%"><span \
class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; </span><span \
class="gmail-hljs-keyword" \
style="box-sizing:border-box;color:rgb(0,0,136)">from</span> PyQt5 <span \
class="gmail-hljs-keyword" \
style="box-sizing:border-box;color:rgb(0,0,136)">import</span> QtCore, QtGui <span \
class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; </span>i = \
QtGui.QImage(<span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&quot;/tmp/front3.jpg&quot;</span>) \
<span class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; </span>m = \
QtGui.QImage(<span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&quot;/tmp/mask.png&quot;</span>) \
<span class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; </span>m = \
m.convertToFormat(QtGui.QImage.Format_Alpha8) <span class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; \
</span>i.setAlphaChannel(m) Traceback (most recent call last):
  File <span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&quot;&lt;stdin&gt;&quot;</span>, \
line <span class="gmail-hljs-number" \
style="box-sizing:border-box;color:rgb(0,102,102)">1</span>, <span \
class="gmail-hljs-keyword" style="box-sizing:border-box;color:rgb(0,0,136)">in</span> \
                &lt;module&gt;
AttributeError: <span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&#39;QImage&#39;</span> object has \
no attribute <span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&#39;setAlphaChannel&#39;</span> \
<span class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; \
</span>QtCore.QT_VERSION_STR <span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&#39;5.15.2&#39;</span> <span \
class="gmail-hljs-meta" \
style="box-sizing:border-box;color:rgb(0,102,102)">&gt;&gt;&gt; \
</span>QtCore.PYQT_VERSION_STR <span class="gmail-hljs-string" \
style="box-sizing:border-box;color:rgb(0,136,0)">&#39;5.15.2&#39;</span></code></pre></div></div>




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

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