pyqt

PyQt Window Focus

别说谁变了你拦得住时间么 提交于 2020-08-27 06:34:29
问题 I am trying to give focus to a window if the user clicks on another window. Right now i have two windows: Window A is behind, and Window B is in front. When Window B appears, it disables Window A. Now what i want is that whenever the user clicks outside of Window B, it should give focus back to Window B. Here is the code for Window B: class window_b(QtGui.QDialog): def __init__(self,parent=None): super(window_b, self).__init__(parent) window_a.setEnabled(False) self.ui = Ui_Form_window_b()

Setting a transparent main window

醉酒当歌 提交于 2020-08-24 07:14:17
问题 How to set main window background transparent on QT? Do I need an attribute or a style? I've tried setting the opacity, but it didn't work for me. app.setStyleSheet("QMainWindow {opacity:0}") 回答1: you must set new attribute for MainWindow object as below: class Main(QtGui.QMainWindow): def __init__(self): self.setAttribute(Qt.WA_TranslucentBackground) 回答2: Just use the windowOpacity property: http://doc.qt.io/qt-4.8/qwidget.html#windowOpacity-prop 来源: https://stackoverflow.com/questions

PyQt5 layout with frames

风流意气都作罢 提交于 2020-08-24 03:40:20
问题 Hi fellow programmers. Currently working on a graphical user interface. I am trying to make the layout out of 3 QFrames. As seen in the screenshot below, the yellow frame is on the right side. I would like that frame to be on top of the right frame . (On top of the numpad, taking the whole horizontal space) Also, for the numpad buttons on the right frame. I would like them to be as close to each other as they can be, like a numpad on a keyboard. How would I adjust the grid to do that? Thanks

Could not find QtWebEngineProcess.exe Error with PyQt5 when using pyinstaller

两盒软妹~` 提交于 2020-08-20 12:07:13
问题 I am using PyQt5 to convert a local html file into pdf. The executable was working fine before the pyqt5 module was added. However, now I get a 'could not find QtWebEngineProcess.exe' error. I've read that the issue has been resolved in the later models but I am still experiencing this error. I have the latest version of anaconda and pyqt5. I read a git thread that asked to use 5.9.2 version of pyqt but that did not solve the error either. This is the command I'm using to create an executable

PyQt5: pop-up progressbar using QThread

穿精又带淫゛_ 提交于 2020-08-20 09:00:28
问题 How can I implement a progress bar in a pop-up window that monitors the progress of a running function from a so-called Worker class (i.e. time/CPU-consuming task) by means of a QThread ? I have checked countless examples and tutorials, but the fact that the progressbar shows up in a pop-up window seems to make everything harder. I believe what I want is a rather simple thing but I keep failing at it and I ran out of ideas. I have an example of what I am trying to achieve, which is based on