Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76610

PyQt4 - Issue with deleting a QWidget from a QGridLayout

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <Alex.Murray@gmx.ch>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.031
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'attribute': 0.07; 'sys': 0.07; 'inserted': 0.09; 'received:gmx.net': 0.09; 'python': 0.11; 'exist.': 0.16; 'with?': 0.16; 'app': 0.19; 'trying': 0.19; 'subject:Issue': 0.19; 'import': 0.22; '&gt;&gt;&gt;': 0.24; "i've": 0.25; 'skip:g 30': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'skip:q 20': 0.31; 'file': 0.32; '(most': 0.33; 'sense': 0.34; 'subject:from': 0.34; 'subject:with': 0.35; 'returning': 0.36; 'method': 0.36; 'hi,': 0.36; 'should': 0.36; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'mar': 0.68; 'received:212.227.17': 0.68; 'discovered': 0.83; '2014,': 0.84; 'demonstrates': 0.84
MIME-Version 1.0
From "Alex Murray" <Alex.Murray@gmx.ch>
To python-list@python.org
Subject PyQt4 - Issue with deleting a QWidget from a QGridLayout
Content-Type text/html; charset=UTF-8
Date Wed, 20 Aug 2014 00:11:24 +0200
Importance normal
Sensitivity Normal
X-Priority 3
X-Provags-ID V03:K0:5d0RBFuhtmC0Jrc8BcH4gr8CeiA7tiKFo77YOhRfK4A 6+iogzLX6l3CHdYUv0rPT+v1iqktiFEtxcJiUzscM2N0yYXV0k u8w4Lbrogf2lp0gJc/y5eob5EnexR61HJQ/7WHtwpuIASaWos0 dErTeo17wNLhwn4J8NccoZR7oIp2jdbUXW9yZXamJWD9+38987 x7g9bohG0Ixanok9pYqzd5Ftmoc3XxT+UvUcwFc76qfmNd1rI9 7EX4IIBPoDHKB/EHOdjyxsB/Zxn3pWUuldTI+mBt1APPq3aO4y 5n68Tc=
X-UI-Out-Filterresults notjunk:1;
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13169.1408486595.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408486595 news.xs4all.nl 2944 [2001:888:2000:d::a6]:50256
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76610

Show key headers only | View raw


<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi,</div>

<div>&nbsp;</div>

<div>I&#39;ve discovered some very strange behaviour when trying to delete a QWidget from a QGridLayout. The following code demonstrates this behaviour:</div>

<div>&nbsp;</div>

<div>&gt;&gt;&gt; from PyQt4 import QtGui</div>

<div>&gt;&gt;&gt; import sys</div>

<div>&gt;&gt;&gt; app = QtGui.QApplication(sys.argv)</div>

<div>&gt;&gt;&gt; grid_layout = QtGui.QGridLayout()<br/>
&gt;&gt;&gt; grid_layout.addWidget(QtGui.QWidget())<br/>
&gt;&gt;&gt; item = self.grid_layout.takeAt(0)<br/>
&gt;&gt;&gt; item.deleteLater()</div>

<div>Traceback (most recent call last):<br/>
&nbsp; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br/>
AttributeError: &#39;QWidgetItem&#39; object has no attribute &#39;deleteLater&#39;</div>

<div>&nbsp;</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>

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


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