bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden


From: Angus Melville
Subject: bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden
Date: Mon, 2 Nov 2015 15:13:39 +0000

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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]