pyqt5

Pyinstaller: Import Error: DLL load failed: The specified module could not be found

霸气de小男生 提交于 2021-02-05 05:56:07
问题 I'm trying create an executable from my code that uses PyQt5. I'm using Python 3.5.3 -64 bits, developing in Windows 10, and used pip to install pyinstaller 3.2.1. I run pyinstaller as such: pyinstaller.exe --onefile --windowed main.py I get an Import Error: File "C:\Python35\Scripts\pyinstaller-script.py", line 11, in <module> load_entry_point('PyInstaller==3.2.1', 'console_scripts', 'pyinstaller')() File "C:\Python35\lib\site-packages\pkg_resources\__init__.py", line 565, in load_entry

Window closes immediatelly after run

三世轮回 提交于 2021-02-04 21:56:12
问题 My code calls one window with a button. When the button is clicked, call another window. But the second window closes immediately "basic" and "windows_two" are .py libraries genereted by pyuic5 from .ui files import basic, windows_two from PyQt5 import QtCore, QtGui, QtWidgets if __name__ == "__main__": #Declarations import sys app = QtWidgets.QApplication(sys.argv) def Call_Second_Window(): #Second Screen Form = QtWidgets.QWidget() ui = windows_two.Ui_Form() ui.setupUi(Form) Form.show() def

Window closes immediatelly after run

爱⌒轻易说出口 提交于 2021-02-04 21:55:07
问题 My code calls one window with a button. When the button is clicked, call another window. But the second window closes immediately "basic" and "windows_two" are .py libraries genereted by pyuic5 from .ui files import basic, windows_two from PyQt5 import QtCore, QtGui, QtWidgets if __name__ == "__main__": #Declarations import sys app = QtWidgets.QApplication(sys.argv) def Call_Second_Window(): #Second Screen Form = QtWidgets.QWidget() ui = windows_two.Ui_Form() ui.setupUi(Form) Form.show() def

PyQt5: QPushButton double click?

╄→尐↘猪︶ㄣ 提交于 2021-02-04 21:22:14
问题 I can't find a good answer for this: is there a way for double click to execute a certain function, and single click one other function?? For example: def func1(self): print('First function') def func2(self): print('Second function') self.ui.button.clicked.connect(self.func1) self.ui.button.doubleClicked.connect(self.func2) I've seen double clicking is possible for the QTreeview but not a QPushButton . Thanks! 回答1: You can add the functionality easily yourself by extending QPushButton class:

PyQT5 and Filtering a Table using multiple columns

◇◆丶佛笑我妖孽 提交于 2021-02-04 21:17:31
问题 I am trying to make a PyQt5 GUI to show a Pandas dataframe in the form of a table and provide column filtering options, similar to the Microsoft Excel filters. So far I managed to adopt a similar SO answer. Here is the picture of my table in the GUI: As shown in the figure above, there are two ways to filter columns: the Regex Filter and clicking on each column. There is however a problem I need help to address: the currently applied filters (either regex filter or column click) disappear

PyQT5 and Filtering a Table using multiple columns

半世苍凉 提交于 2021-02-04 21:16:21
问题 I am trying to make a PyQt5 GUI to show a Pandas dataframe in the form of a table and provide column filtering options, similar to the Microsoft Excel filters. So far I managed to adopt a similar SO answer. Here is the picture of my table in the GUI: As shown in the figure above, there are two ways to filter columns: the Regex Filter and clicking on each column. There is however a problem I need help to address: the currently applied filters (either regex filter or column click) disappear

How to kill the QRunnable in PyQt5?

与世无争的帅哥 提交于 2021-02-04 21:05:36
问题 I have an app with two buttons start and end . The start button will start a thread, which runs the audio recording function. This function is written using sounddevice and soundfile libraries. The audio recording can take place for an arbitary duration and the user can stop anytime by pressing ctrl+c . So, now I want to implement a function for the end button to stop the thread which started by pressing start button or the function can send ctrl+c signal to the thread. So, that the current

Python PyQt5 QMessageBox not opening

家住魔仙堡 提交于 2021-02-04 19:41:46
问题 I am trying to open a Message Box when I press the infoButton. It runs the infoDialogue method because it prints "I'm here" but it doesn't open the infoBox. What I'm missing? I'm using python 3.5 with PyQt5 Thanks! Here's the code: import sys from PyQt5.QtWidgets import (QApplication, QWidget, QToolTip, QPushButton, QMessageBox) from PyQt5.QtCore import QCoreApplication from PyQt5.QtGui import QIcon, QFont class mainWindow(QWidget): def __init__(self, screenWidth, screenHeight, windowWidth

How to proportionally adjust column widths in a QTableView?

廉价感情. 提交于 2021-02-04 19:38:08
问题 I want to proportionally change the column width of all columns in a QTableView widget, so that each column has the same width regardless of the data. For example, if a table has three columns, each column should always have a width of one third of the available horizontal space - and the width should be automatically updated whenever the dialog is resized by the user. So far I've only managed to resize columns to their contents, which is not what I want. Here's the code I've got so far: main

PyQt5 module “QtQuick” is not installed

被刻印的时光 ゝ 提交于 2021-02-04 18:36:05
问题 I'm trying to get a basic PyQt5 QML project going using either Windows or Linux. I first tried Linux and with no luck am trying Windows now. My issue is whenever I try and run it via python main.py it will complain that "module "QtQuick" is not installed" and "module "QtQuick.Window" is not installed". I feel like this is a simple pointing of some path to the QT install location but don't know where to go from here. Using Qt Widgets works but not QML. My main.py file is: import sys from PyQt5