unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden
@ 2015-11-02 15:13 Angus Melville
  2020-12-03 10:51 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Angus Melville @ 2015-11-02 15:13 UTC (permalink / raw)
  To: 21813

[-- Attachment #1: Type: text/plain, Size: 3973 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 4609 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden
  2015-11-02 15:13 bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden Angus Melville
@ 2020-12-03 10:51 ` Lars Ingebrigtsen
  2021-02-08  7:30   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-03 10:51 UTC (permalink / raw)
  To: Angus Melville; +Cc: 21813

Angus Melville <anguscmelville@gmail.com> writes:

> 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

[...]

> However if run from EMACS using the default python.el mode, no widget
> will pop up on the screen.

(This bug report unfortunately got no response at the time.)

I tried reproducing this in Emacs 28, but I apparently do not have the
correct libraries installed, and after "apt install" on everything that
seemed likely, I still get

ImportError: No module named PySide

Anybody know what I should be installing?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden
  2020-12-03 10:51 ` Lars Ingebrigtsen
@ 2021-02-08  7:30   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-08  7:30 UTC (permalink / raw)
  To: Angus Melville; +Cc: 21813

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I tried reproducing this in Emacs 28, but I apparently do not have the
> correct libraries installed, and after "apt install" on everything that
> seemed likely, I still get
>
> ImportError: No module named PySide
>
> Anybody know what I should be installing?

There was no response here, so it seems unlikely that there'll be
further progress in this bug report, and I'm closing it.  If progress
can be made, please respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-08  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 15:13 bug#21813: 24.5; python.el & Qt (PySide) - widgets remain hidden Angus Melville
2020-12-03 10:51 ` Lars Ingebrigtsen
2021-02-08  7:30   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).