You are not logged in.
Hi,
I developped a pyqt-5 application with different QMainWindows.
On closing, I intercept the close envent with the following code:
def closeEvent(self, event):
self.closed.emit()
event.accept()The creation of the QMainWindows is handled that way :
if self.win is None:
self.win = Ui_MyWindow(self)
win.show()However when I close then reopen the window, only the decorative part (window buttons ..) is displayed.
I installed PyQt5 from pip (with fusion theme) and I can close/reopen as many time as I want, the windows are displayed as excpected.
I hence try with ArchLinux PyQt and fusion theme (should the Breeze theme have something todo with that behaviour) however it still doesn't work.
Furetheremore, if I close the window with a self defined push_button (calling self.close() ) I don't have this bug, only while closing the window with the decorative button.
I can't reproduce this bug on other systems (eg Ubuntu) and since it work with pip my first guess is that there could be a bug within ArchLinux's PyQt package.
I'm not sure if I should field a bug since I didn't manage to get more accurate informations ?
Offline
It could be the issue with Qt 5.12.4 as per this thread which is reportedly already resolved with Qt 5.13, so you could try with that (it's in the testing repo atm) and see if you get the expected result.
Last edited by Nocifer (2019-06-29 09:24:33)
Offline
Thank you for your response, I'll try that
Offline
I installed PyQt5 from pip
Why, how? PyQt5 is in the repo. Installing with pip is problematic unless you install it to a directory in $HOME. Does the pacman database have a record of everything that pip has installed. If not then you are one upgrade away from problems. If the python module is not in the repo, or in the aur, you are better off making a PKGBUILD for it, building it, then let pacman install it.
Then you are problem free, even if the module doesn't work. At least you haven't messed up your whole python database of installed files/libraries/modules.
You would be better off downgrading to the last version in /var/cache/pacman/pkg with pacman -U, if it will run. And maybe hold the package in /etc/pacman.conf until the bug is fixed.
I've had a few core dumps on my PyQt5 scripts of late. It hasn't stopped them from running.
Also, you can make yourself a theme for your PyQt5 scripts.
Something like:
#! /usb/bin/env python
from PyQt5.QtGui import QPalette, QColor
app.setStyle("Fusion")
dark_palette = QPalette()
dark_palette.setColor(QPalette.Window, QColor(53, 53, 53))
dark_palette.setColor(QPalette.WindowText, Qt.white)
dark_palette.setColor(QPalette.Base, QColor(25, 25, 25))
dark_palette.setColor(QPalette.AlternateBase, QColor(53, 53, 53))
dark_palette.setColor(QPalette.ToolTipBase, Qt.white)
dark_palette.setColor(QPalette.ToolTipText, Qt.white)
dark_palette.setColor(QPalette.Text, Qt.white)
dark_palette.setColor(QPalette.Button, QColor(53, 53, 53))
dark_palette.setColor(QPalette.ButtonText, Qt.white)
dark_palette.setColor(QPalette.BrightText, Qt.red)
dark_palette.setColor(QPalette.Link, QColor(42, 130, 218))
dark_palette.setColor(QPalette.Highlight, QColor(42, 130, 218))
dark_palette.setColor(QPalette.HighlightedText, Qt.black)
app.setPalette(dark_palette)
app.setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }")Offline
Actually I asked PyCharm to install PyQt5-stubs (as advised) which apparently installed PyQt5.
Yes thanks for the advice, I already once have a similar problem ![]()
The main reason I don't use custom theme is to have a "native look" for the user but it could be an option.
Offline