pyqt

The PyQt button does not show up

随声附和 提交于 2021-02-05 11:25:42
问题 So....I am using the PyQt lib for python to make a Graphics class which abstracts away most of the features of the QtGui class.I"ll be using it later for my other projects.This seems to be working fine,except that the button and the other widgets do not show up,although the window gets created. import sys from PyQt4 import QtGui class Graphics: def __init__(self): self.app=QtGui.QApplication(sys.argv) self.widgets={} self.labels={} self.buttons={} def getApp(self): return self.app def

Cannot redirect Pyinstaller single executable output while running it in subprocess

笑着哭i 提交于 2021-02-05 11:21:06
问题 I've been struggling with this for quite a while. I've managed to write a code that can capture STDOUT of .py files, however when I run the exact same code with executable generated from Pyinstaller (doesn't matter whether it's windowed or not) the readyReadStandardOutput signal doesn't ever come up. From my tests it occurs that any signal at all is emitted only when the app crashes, however I need a live communication between the GUI and the executable. Here's my code for reference: def

Picture not showing on my loading screen in QLabel

ε祈祈猫儿з 提交于 2021-02-05 11:12:28
问题 I'm currently using QT designer to show a picture on my loading screen. It should look like this: However, it looks like this: This is because for some reason its not showing my picture, when it registers in my IDE that the filepath is correct as seen here: The only time the picture actually shows in my loading GUI is when I use the FULL file path which is: C:\Users\myalt\OneDrive\Desktop\GUINEW\assets\PostmonkeyLogo.png But of course, this is not viable when this software will be used on

Picture not showing on my loading screen in QLabel

只谈情不闲聊 提交于 2021-02-05 11:12:13
问题 I'm currently using QT designer to show a picture on my loading screen. It should look like this: However, it looks like this: This is because for some reason its not showing my picture, when it registers in my IDE that the filepath is correct as seen here: The only time the picture actually shows in my loading GUI is when I use the FULL file path which is: C:\Users\myalt\OneDrive\Desktop\GUINEW\assets\PostmonkeyLogo.png But of course, this is not viable when this software will be used on

I want to put the text in pyqt QCalendarWidget

谁说胖子不能爱 提交于 2021-02-05 08:31:15
问题 I would like to put the text of p.drawText (r.x () + 10, r.y () + 33, '{} / {}'. Format ('tset1', 'test2') condition on the selected QCalendarWidget date. But it is not good. import sys from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class main_window(QWidget): def __init__(self): super(main_window, self).__init__() self.resize(1280, 900) self.Calendar() def Calendar(self): self.cal = QCalendarWidget(self) self.cal.resize(500, 500) self.cal.clicked.connect

I want to put the text in pyqt QCalendarWidget

最后都变了- 提交于 2021-02-05 08:31:01
问题 I would like to put the text of p.drawText (r.x () + 10, r.y () + 33, '{} / {}'. Format ('tset1', 'test2') condition on the selected QCalendarWidget date. But it is not good. import sys from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class main_window(QWidget): def __init__(self): super(main_window, self).__init__() self.resize(1280, 900) self.Calendar() def Calendar(self): self.cal = QCalendarWidget(self) self.cal.resize(500, 500) self.cal.clicked.connect

I want to put the text in pyqt QCalendarWidget

佐手、 提交于 2021-02-05 08:30:07
问题 I would like to put the text of p.drawText (r.x () + 10, r.y () + 33, '{} / {}'. Format ('tset1', 'test2') condition on the selected QCalendarWidget date. But it is not good. import sys from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * class main_window(QWidget): def __init__(self): super(main_window, self).__init__() self.resize(1280, 900) self.Calendar() def Calendar(self): self.cal = QCalendarWidget(self) self.cal.resize(500, 500) self.cal.clicked.connect

Plotting with pyqtgraph without displaying

。_饼干妹妹 提交于 2021-02-05 08:09:10
问题 I am trying to move from matplotlib to plotting with pyqtgraph because of its touted capabilities to render and save images faster. In my attempts to do this on a cluster with multiprocessors, I run into the following trouble: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. How do I obviate displaying a plot, and save it directly to file? Here's my attempt at the code:

embed a aiohttp server in a PyQt application

戏子无情 提交于 2021-02-05 08:08:47
问题 I am going to embed a aiohttp server in a PyQt application, but when I run the code below , the Qt window couldn't show, I know it was caused by web.run_app(app) , I've tried to move it into a thread , but then I got RuntimeError: There is no current event loop in thread 'Dummy-1' , so what should I do ? I've found asyncqt which might help ,but I don't know how to use it to deal with a aiohttp server. from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from

Plotting with pyqtgraph without displaying

有些话、适合烂在心里 提交于 2021-02-05 08:08:30
问题 I am trying to move from matplotlib to plotting with pyqtgraph because of its touted capabilities to render and save images faster. In my attempts to do this on a cluster with multiprocessors, I run into the following trouble: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-user' qt.qpa.screen: QXcbConnection: Could not connect to display Could not connect to any X display. How do I obviate displaying a plot, and save it directly to file? Here's my attempt at the code: