[PyQt] adding in a QTextEdit widget as the central widget makes main window not pop up, and showMaximize causes computer crash?

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Sun Dec 13 09:21:31 GMT 2015


Le 13/12/2015 08:12, Damon Lynch a écrit :
>
> On Sun, Dec 13, 2015 at 9:16 AM, Brian Merchant <bhmerchant at gmail.com 
> <mailto:bhmerchant at gmail.com>> wrote:
>
>     Hi all,
>
>     I have some skeleton code as shown here:
>     https://gist.github.com/bmer/e4760c49d1a9c7396c33
>
>     If run this code as is (|python qt_problem.py|), then everything
>     works okay. However, if I un-comment the lines that add a
>     |QTextEdit| widget, in |initUI|, I get the following warnings
>     appearing:
>
>     |(python:1949):Gtk-CRITICAL **:IA__gtk_widget_style_get:assertion
>     'GTK_IS_WIDGET (widget)'failed
>     QWidget::setMinimumSize:(/Editor)Thelargest allowed size
>     is(16777215,16777215) |
>
>     The window that would otherwise pop-up doesn't, but I can still
>     close up the application. Instead, if in |main| I have
>     |main.showMaximized()| rather than |main.show()|, I cause my
>     computer to crash. This does not happen if I don't have a
>     |QTextEdit| widget set as the central widget, since otherwise, a
>     normal, maximized window appears.
>
>
> It works for me using Python 3.4.3+ and PyQt 5.4.2.  There might be a 
> problem in your broader environment, as evinced by the Gtk warning.
>
> On a different note, you may find the last section here to be of 
> interest: http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html
> -- 
> http://www.damonlynch.net
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt

This is an old bug, I think.

With Qt vers. 5.0.2  and PyQt5 vers. 5.0 (default on Ubuntu 12.04) you 
have to fix the size of the main window in your code before show() it.

Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151213/b5907e1c/attachment.html>


More information about the PyQt mailing list