From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angus Melville Newsgroups: gmane.emacs.bugs Subject: bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden Date: Mon, 2 Nov 2015 15:13:39 +0000 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bea3792dbcaca0523903862 X-Trace: ger.gmane.org 1446480684 14838 80.91.229.3 (2 Nov 2015 16:11:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2015 16:11:24 +0000 (UTC) To: 21813@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 02 17:11:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZtHhS-000223-IA for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Nov 2015 17:11:14 +0100 Original-Received: from localhost ([::1]:43088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtHhR-0006CQ-Oe for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Nov 2015 11:11:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtHhI-0006C6-VR for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 11:11:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtHhH-0007Mg-47 for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 11:11:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtHhH-0007Mc-0Z for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 11:11:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZtHhG-0007Y5-DA for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 11:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Angus Melville Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2015 16:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144648063328962 (code B ref -1); Mon, 02 Nov 2015 16:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Nov 2015 16:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:49879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtHgl-0007X3-Uu for submit@debbugs.gnu.org; Mon, 02 Nov 2015 11:10:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44707) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtGnt-00067l-LE for submit@debbugs.gnu.org; Mon, 02 Nov 2015 10:13:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtGno-00026X-Qb for submit@debbugs.gnu.org; Mon, 02 Nov 2015 10:13:49 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtGno-00026T-NJ for submit@debbugs.gnu.org; Mon, 02 Nov 2015 10:13:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtGnm-0005iF-TL for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 10:13:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtGnl-00021T-3v for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 10:13:42 -0500 Original-Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:37181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtGnk-000208-RV for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 10:13:41 -0500 Original-Received: by wicfv8 with SMTP id fv8so52561225wic.0 for ; Mon, 02 Nov 2015 07:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=OBvuFR2I893xPa5+WThANM5eoRmN8mrr2RvSktfFeuA=; b=UVispzGgsyx4mLT0RivQ9yOdqM008/tEKvJMHLOw2CJCwA9T9yPkSg6nbB3A7XLH6D +kyTAN+tq9sHHvXCfUuiVSXhGFPwjyhmBTt7LjHZHjgP6RH3tlyvqx07G53CMGKaS7LC xvR0eKy8VEaamWN1daDNeWKl+hVOg7zMvnQr8kKLM9moYfPf5l4Aozbax4I7/vcf7Rfk dN2NncWwoCWBhxKQZHjsAS8s19D7S8Rp4MPNMcFF5cc9Ur2ijpVKW9YCqoELsaaJMFj6 t+W+YEVZXDwXIdhITKuP1dN07uTK1rtNClAcaxMTI8TE09SF5XROVIPJuN9/aa7NK6ll 5Qpg== X-Received: by 10.194.190.19 with SMTP id gm19mr27367557wjc.0.1446477219742; Mon, 02 Nov 2015 07:13:39 -0800 (PST) Original-Received: by 10.194.249.35 with HTTP; Mon, 2 Nov 2015 07:13:39 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Mon, 02 Nov 2015 11:10:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108305 Archived-At: --047d7bea3792dbcaca0523903862 Content-Type: text/plain; charset=UTF-8 The following lines should make a QT widget appear on the screen, and will do if run direcly from IDLE or from iPython notebook: import sys from PySide import QtGui app = QtGui.QApplication.instance() if not app: app = QtGui.QApplication(sys.argv) class Widget(QtGui.QDialog): def __init__(self): super().__init__() widget = Widget() widget.show() sys.exit(app.exec_()) However if run from EMACS using the default python.el mode, no widget will pop up on the screen. This means that many Pyside programs, such as example programs found at https://github.com/nicoddemus/PySide-Examples/tree/master/examples when run from EMACS will produce no response. If we modify the program to embed a second widget within our main widget, as below, the widget does pop up on the screen: import sys from PySide import QtGui app = QtGui.QApplication.instance() if not app: app = QtGui.QApplication(sys.argv) class Widget1(QtGui.QDialog): def __init__(self): super().__init__() widget2 = Widget2() widget2.show() layout = QtGui.QVBoxLayout() layout.addWidget(widget2) self.setLayout(layout) class Widget2(QtGui.QDialog): def __init__(self): super().__init__() widget = Widget1() widget.show() sys.exit(app.exec_()) This suggests that perhaps in the first example the widget immediately goes out of scope. Thanks for any help Angus M In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.3.9600 Configured using: `configure --prefix=/c/usr --host=i686-pc-mingw32' Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: Inferior Python Minor modes in effect: compilation-shell-minor-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. byte-code: End of buffer completing-read-default: Command attempted to use minibuffer while in minibuffer [3 times] Making python-shell-interpreter local to *Python* while let-bound! Making python-shell-interpreter-args local to *Python* while let-bound! Sent python-shell-completion-setup-code Sent python-ffap-setup-code Sent python-eldoc-setup-code Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils compile cl-extra python easymenu json comint ring cl-loaddefs cl-lib ansi-color warnings package epg-config time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process w32notify w32 multi-tty emacs) Memory information: ((conses 8 94209 6459) (symbols 32 19059 0) (miscs 32 95 138) (strings 16 16099 3431) (string-bytes 1 475380) (vectors 8 11678) (vector-slots 4 407444 2242) (floats 8 64 390) (intervals 28 363 54) (buffers 508 15)) --047d7bea3792dbcaca0523903862 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The following lines should make a QT widget appear on the = screen, and will do if run direcly from IDLE or from iPython notebook:
<= br>import sys
from PySide import QtGui

app =3D QtGui.QApplication= .instance()
if not app:
=C2=A0=C2=A0=C2=A0 app =3D QtGui.QApplication= (sys.argv)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
class Widget(Q= tGui.QDialog):
=C2=A0=C2=A0=C2=A0 def __init__(self):
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 super().__init__()

widget =3D Widget()widget.show()

sys.exit(app.exec_())

However if run from EMA= CS using the default python.el mode, no widget
will pop up on the screen= .=C2=A0 This means that many Pyside programs, such
as example programs f= ound at
https://github.com/nicoddemus/PySide-Examples/tree/master/ex= amples when
run from EMACS will produce no response.

If we m= odify the program to embed a second widget within our main widget, as below= , the widget does pop up on the screen:

import sys
from PySide im= port QtGui

app =3D QtGui.QApplication.instance()
if not app:
= =C2=A0=C2=A0=C2=A0 app =3D QtGui.QApplication(sys.argv)
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0
class Widget1(QtGui.QDialog):
=C2=A0=C2= =A0=C2=A0 def __init__(self):
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= super().__init__()
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 widget2 = =3D Widget2()
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 widget2.show()<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 layout =3D QtGui.QVBoxLayout(= )
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 layout.addWidget(widget2)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.setLayout(layout)

= class Widget2(QtGui.QDialog):
=C2=A0=C2=A0=C2=A0 def __init__(self):
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 super().__init__()

widget= =3D Widget1()
widget.show()

sys.exit(app.exec_())


Thi= s suggests that perhaps in the first example the widget immediately goes ou= t of scope.

Thanks for any help

Angus M


In GNU Ema= cs 24.5.1 (i686-pc-mingw32)
=C2=A0of 2015-04-11 on LEG570
Windowing s= ystem distributor `Microsoft Corp.', version 6.3.9600
Configured usi= ng:
=C2=A0`configure --prefix=3D/c/usr --host=3Di686-pc-mingw32'
=
Important settings:
=C2=A0 value of $LANG: ENG
=C2=A0 locale-codi= ng-system: cp1252

Major mode: Inferior Python

Minor modes in = effect:
=C2=A0 compilation-shell-minor-mode: t
=C2=A0 tooltip-mode: t=
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 = tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode= : t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2= =A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-= encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number= -mode: t
=C2=A0 transient-mark-mode: t

Recent messages:
For in= formation about GNU Emacs and the GNU system, type C-h C-a.
byte-code: E= nd of buffer
completing-read-default: Command attempted to use minibuffe= r while in minibuffer [3 times]
Making python-shell-interpreter local to= *Python* while let-bound!
Making python-shell-interpreter-args local to= *Python* while let-bound!
Sent python-shell-completion-setup-code
Se= nt python-ffap-setup-code
Sent python-eldoc-setup-code

Load-path = shadows:
None found.

Features:
(shadow sort gnus-util mail-ext= r emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm= -encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2= 047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils compile cl= -extra python easymenu json
comint ring cl-loaddefs cl-lib ansi-color wa= rnings package epg-config
time-date tooltip electric uniquify ediff-hook= vc-hooks lisp-float-type
mwheel dos-w32 ls-lisp w32-common-fns disp-tab= le w32-win w32-vars
tool-bar dnd fontset image regexp-opt fringe tabulat= ed-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshado= w timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-= core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai ta= i-viet lao
korean japanese hebrew greek romanian slovak czech european e= thiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help s= imple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp = files
text-properties overlay sha1 md5 base64 format env code-pages mule=
custom widget hashtable-print-readable backquote make-network-processw32notify w32 multi-tty emacs)

Memory information:
((conses 8 9= 4209 6459)
=C2=A0(symbols 32 19059 0)
=C2=A0(miscs 32 95 138)
=C2= =A0(strings 16 16099 3431)
=C2=A0(string-bytes 1 475380)
=C2=A0(vecto= rs 8 11678)
=C2=A0(vector-slots 4 407444 2242)
=C2=A0(floats 8 64 390= )
=C2=A0(intervals 28 363 54)
=C2=A0(buffers 508 15))
--047d7bea3792dbcaca0523903862--