-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt console crashes on Ubuntu 11.10 #812
Comments
Previously sent bug report had a bit more info, so I'm posting it in case it's relevant (this is 0.11 and above is 0.12dev): 361
--> 362 return QtCore.QSize(width, height)
global QtCore.QSize = <class 'PyQt4.QtCore.QSize'>
width = -4269769018.0
height = 335.0
363
364 #---------------------------------------------------------------------------
365 # 'ConsoleWidget' public interface
366 #--------------------------------------------------------------------------- |
Also |
I found out that line Also running
|
Seems simple enough - QtCore.QSize officially expects int, but sometimes we pass it floats. Some combinations of bindings (e.g. my PySide right now) will just cast floats to int, but we apparently can't rely on it. A simple cast before call should suffice. |
After that running I then uncommented line 359 if self.paging == 'hsplit':
360 width = width * 2 + splitwidth
361
362 height = font_metrics.height() * 25 + margin
363 if self.paging == 'vsplit':
364 height = height * 2 + splitwidth
365
--> 366 return QtCore.QSize(int(width), int(height))
global QtCore.QSize = <class 'PyQt4.QtCore.QSize'>
global int = undefined
width = -4234948154.0
height = 335.0
367
368 #---------------------------------------------------------------------------
369 # 'ConsoleWidget' public interface
370 #--------------------------------------------------------------------------- Now it crashes also from command line (with --paging=hsplit switch) even if I revert changes in BTW above process crashed also Metacity once and this line I get always when running qtconsole:
In the past only ipython internals were shown in terminal when after launching qtconsole |
If I run If I go to location of |
I'm having hard time trying to figure the problem. I somehow managed to reproduce this with import from installed IPython folder (/usr/local/lib/python2.7/dist-packages/IPython/) in PyCharm, as annotating variables (in If we look at fperez initial post, at line 357 width has value 496.0, but on next value random large number returned by style.pixelMetric = <built-in method pixelMetric of QCommonStyle object at 0x969789c>
global QtGui.QStyle.PM_ScrollBarExtent = 9 |
OK, it's definitelly this function that return large int for some reason:
|
This fixes issue for me (line 358 in - width += style.pixelMetric(QtGui.QStyle.PM_ScrollBarExtent)
+ width += QtGui.QStyle.PM_ScrollBarExtent |
:D but it's not very good fix, as splitter now can't be adjusted. |
Note that there is a general problem with qt apps on ubuntu 11.10 |
Thanks for the info. I already downloaded tons of packages just to be able to change default fonts. |
Starting with @jenshnielsen: Are you running 11.10 also? Can you confirm this issue? Now if you excuse me I have to catch Tuxedomoon's concert ^_^ |
Yes running |
the packaged ipython 0.11 (available here: https://launchpad.net/~jtaylor/+archive/ipython-dev/+packages) works fine for me in 11.10 |
The problem that I see happens for even simple qt apps in ubuntu 11.10 #!/usr/bin/python
import sys
from PySide import QtGui
app = QtGui.QApplication(sys.argv)
a = QtGui.QTextEdit()
a.resize(250, 150)
a.setWindowTitle('simple')
a.show()
sys.exit(app.exec_()) gives the same error. It can also be fixed by changing the qt gui style |
@fperez, sorry, I've been off-line for a few days. It looks like this is an Ubuntu-specific problem, but I'll keep my eye on the issue in case there are some new developments. |
Hey, On Wed, Sep 21, 2011 at 12:36 PM, Evan Patterson
No worries, thanks for being on the ball. From the looks of the last |
@jenshnielsen: qtconfig setting solved this issue (I forgot to try LIBOVERLAY_SCROLLBAR=0). Now there is small problem with unreadable white font on pale yellow background for tooltips, but I guess I spamed enough IPython issues with irrelevant problems. Cheers and thanks |
No problem. Thanks for confirming the workaround. |
Reported by a user on-list, when starting the qt console with
--pylab
.@epatters, does the traceback ring any bells regarding possible Qt api changes you're aware of?
The text was updated successfully, but these errors were encountered: