Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76650
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!news.unit0.net!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!post02.fr7!fx17.am4.POSTED!not-for-mail |
|---|---|
| From | alister <alister.nospam.ware@ntlworld.com> |
| Subject | Re: PyQt4 - Issue with deleting a QWidget from a QGridLayout |
| Newsgroups | comp.lang.python |
| References | <mailman.13169.1408486595.18130.python-list@python.org> |
| User-Agent | Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| Lines | 51 |
| Message-ID | <hXZIv.18639$ck2.6303@fx17.am4> (permalink) |
| NNTP-Posting-Host | 82.9.78.47 |
| X-Complaints-To | http://netreport.virginmedia.com |
| X-Trace | 1408527181 82.9.78.47 (Wed, 20 Aug 2014 09:33:01 UTC) |
| NNTP-Posting-Date | Wed, 20 Aug 2014 09:33:01 UTC |
| Organization | virginmedia.com |
| Date | Wed, 20 Aug 2014 09:33:01 GMT |
| X-Received-Body-CRC | 715412642 |
| X-Received-Bytes | 2525 |
| Xref | csiph.com comp.lang.python:76650 |
Show key headers only | View raw
On Wed, 20 Aug 2014 00:11:24 +0200, Alex Murray wrote:
> <html><head></head><body><div style="font-family: Verdana;font-size:
> 12.0px;"><div>Hi,</div>
>
> <div> </div>
>
> <div>I've discovered some very strange behaviour when trying to
> delete a QWidget from a QGridLayout. The following code demonstrates
> this behaviour:</div>
>
> <div> </div>
>
> <div>>>> from PyQt4 import QtGui</div>
>
> <div>>>> import sys</div>
>
> <div>>>> app = QtGui.QApplication(sys.argv)</div>
>
> <div>>>> grid_layout = QtGui.QGridLayout()<br/>
> >>> grid_layout.addWidget(QtGui.QWidget())<br/>
> >>> item = self.grid_layout.takeAt(0)<br/>
> >>> item.deleteLater()</div>
>
> <div>Traceback (most recent call last):<br/>
> File "<stdin>", line 1, in <module><br/>
> AttributeError: 'QWidgetItem' object has no attribute
> 'deleteLater'</div>
>
> <div> </div>
>
> <div>This makes no sense to me whatsoever. Firstly, why is it returning
> a QWidgetItem when I inserted a QWidget to begin with? Secondly, every
> Qt object derives from QObject, and deleteLater() is a method of
> QObject, so that method should exist. Additional info:</div>
>
> <div>
> <div>Python 2.7.6 (default, Mar 22 2014, 22:59:56)<br/>
> [GCC 4.8.2] on linux2</div>
>
> <div>using PyQt4</div>
> </div></div></body></html>
Please do not post in HTML it makes everything an unreadable mess
(I have left you original post above so you can see what I mean.)
--
<dark> "Yes, your honour, I have RSA encryption code tattood on my
penis. Shall I show the jury?"
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PyQt4 - Issue with deleting a QWidget from a QGridLayout "Alex Murray" <Alex.Murray@gmx.ch> - 2014-08-20 00:11 +0200
Re: PyQt4 - Issue with deleting a QWidget from a QGridLayout alister <alister.nospam.ware@ntlworld.com> - 2014-08-20 09:33 +0000
Re: Re: PyQt4 - Issue with deleting a QWidget from a QGridLayout "Alex Murray" <Alex.Murray@gmx.ch> - 2014-08-20 16:22 +0200
Re: PyQt4 - Issue with deleting a QWidget from a QGridLayout Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2014-08-20 17:27 +0200
csiph-web