Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'attribute': 0.07; 'sys': 0.07; 'inserted': 0.09; 'mess': 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; '>>>': 0.22; 'import': 0.22; 'sorry,': 0.24; "i've": 0.25; 'post': 0.26; 'header:In- Reply-To:1': 0.27; 'skip:g 30': 0.30; 'code': 0.31; "skip:' 10": 0.31; '"",': 0.31; 'skip:q 20': 0.31; 'file': 0.32; '(most': 0.33; 'plain': 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; 'to:addr:python-list': 0.38; 'recent': 0.39; 'delete': 0.39; 'to:addr:python.org': 0.39; 'mar': 0.68; 'discovered': 0.83; '2014,': 0.84; 'demonstrates': 0.84 MIME-Version: 1.0 From: "Alex Murray" To: python-list@python.org Subject: Re: Re: PyQt4 - Issue with deleting a QWidget from a QGridLayout Content-Type: text/plain; charset=UTF-8 Date: Wed, 20 Aug 2014 16:22:18 +0200 Importance: normal Sensitivity: Normal In-Reply-To: References: , X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:9dtwsryYYKB5nHFfm51cQjIDmAUJoARm0kNKi2GiFb3 7NCuPin1aisZcMH2w6k/+QHNjj7WL2H1s5VdS4LW6s3PODowvv inpgejJ6wXLuSNhhGpp4OiZsEZ0r/qEramvSIlNpQfuk+14zBt 0LlZ9DgYfYBML20aEnHt6sRi43qFcaXuKC/zdCrf6VxyKJ/GfU BLrrq7cv3YnetW0Hm/vqgld//0c2S6bDXp66kMhDLuB0ZdH+6v skEzVmlY9YPakloiiueKhs2NBeNn6Mv+CYqf+WpI4eybRn4bnR 9IUyPU= X-UI-Out-Filterresults: notjunk:1; X-Mailman-Approved-At: Wed, 20 Aug 2014 16:43:16 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408545797 news.xs4all.nl 2888 [2001:888:2000:d::a6]:39329 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76666 > 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.) Sorry, here's the original e-mail in plain text: Hi, I've discovered some very strange behaviour when trying to delete a QWidget from a QGridLayout. The following code demonstrates this behaviour: >>> from PyQt4 import QtGui >>> import sys >>> app = QtGui.QApplication(sys.argv) >>> grid_layout = QtGui.QGridLayout() >>> grid_layout.addWidget(QtGui.QWidget()) >>> item = grid_layout.takeAt(0) >>> item.deleteLater() Traceback (most recent call last): File "", line 1, in AttributeError: 'QWidgetItem' object has no attribute 'deleteLater' 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: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2