pyqt5

Ensure that view shows scrollbar and adapts

杀马特。学长 韩版系。学妹 提交于 2021-02-11 12:07:52
问题 This is a follow-up question. Here is the link to my previous question. The answer there works but the problem however I faced was that in the beginning, the line would be drawn to the mouse press taking it as the endpoint instead of been drawn from the mouse press taking it as the starting point. As suggested by a user there explicitly setting the sceneRect solves the problem, but however after explicitly setting the sceneRect the view stops adapting and showing scrollbar. Here's a demo

How to execute PyQt5 application on a resful call

▼魔方 西西 提交于 2021-02-11 09:58:44
问题 Context: I have a Flask application serving a resource POST /start . The logic to be executed involves a PyQt5 QWebEnginePage loading a URL and returning certain data about it. Problem: When the QApplication is executed (calling app.exec_() ) I get the warning: WARNING: QApplication was not created in the main() thread. and then the error: 2019-07-17 13:06:19.461 Python[56513:5183122] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs

How to execute PyQt5 application on a resful call

笑着哭i 提交于 2021-02-11 09:58:16
问题 Context: I have a Flask application serving a resource POST /start . The logic to be executed involves a PyQt5 QWebEnginePage loading a URL and returning certain data about it. Problem: When the QApplication is executed (calling app.exec_() ) I get the warning: WARNING: QApplication was not created in the main() thread. and then the error: 2019-07-17 13:06:19.461 Python[56513:5183122] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs

How to execute PyQt5 application on a resful call

南笙酒味 提交于 2021-02-11 09:56:10
问题 Context: I have a Flask application serving a resource POST /start . The logic to be executed involves a PyQt5 QWebEnginePage loading a URL and returning certain data about it. Problem: When the QApplication is executed (calling app.exec_() ) I get the warning: WARNING: QApplication was not created in the main() thread. and then the error: 2019-07-17 13:06:19.461 Python[56513:5183122] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs

Running a Windows executable (calc.exe, etc) inside a PyQt Application

时光怂恿深爱的人放手 提交于 2021-02-11 06:49:08
问题 I'm trying to run a Windows executable inside my application written in Python using PyQt5. I'm fairly new to using PyQt5 but trying. The problem I'm facing is actually getting the EXE in question to run within my applications Frame, Window or QWidget. At the moment I don't need to send or get responses/results to and from the Windows executable, I only need the ability to show it within my application. class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI

Running a Windows executable (calc.exe, etc) inside a PyQt Application

▼魔方 西西 提交于 2021-02-11 06:48:39
问题 I'm trying to run a Windows executable inside my application written in Python using PyQt5. I'm fairly new to using PyQt5 but trying. The problem I'm facing is actually getting the EXE in question to run within my applications Frame, Window or QWidget. At the moment I don't need to send or get responses/results to and from the Windows executable, I only need the ability to show it within my application. class MyWindow(QWidget): def __init__(self): super().__init__() self.initUI() def initUI

How can I load a CSV file into a QTreeView?

*爱你&永不变心* 提交于 2021-02-11 06:29:29
问题 Note: I am a complete beginner. I am using a pandas dataframe to import a csv file that I converted from the following table. I need to load the csv file into a QTreeView and have been unable to do so. The output format should be: I will have to retrieve the "Scale Type" at some point, so I would like to somehow tag it to that item, but I'm not sure if that is possible. I have tried converting my data into a pandas dataframe and loading; loading the data directly with a csv; and converting it

Use a QSortFilterProxyModel from QML with PyQt5

允我心安 提交于 2021-02-10 22:24:33
问题 I try to combine a QML view with a QSortFilterProxyModel within PyQt5. Unfortunately I can't get it to work in any way. My main problem right now seems to be to pass the items back from QML. But even if this would be possible it seems that it does not work, I get TypeError: QSortFilterProxyModel.setSourceModel(QAbstractItemModel): argument 1 has unexpected type 'PyCapsule' if I set the model directly in python. Currently I have: class SortFilterProxyModel(QSortFilterProxyModel): @pyqtProperty

Notify QML for 'usb device inserted' events using PyQt5 and pyudev

有些话、适合烂在心里 提交于 2021-02-10 22:24:32
问题 I have a GUI application (made with PyQt5 and QML) and would like to get notify when a usb device is plugged or unplugged from the computer. After some investigation, I have found that pyudev could be the library to use. But I have trouble using it with PyQt5 and QML. I have succeed to use the pyudev example for MonitorObservor, and there are other example provided in the documentation, here with PySide and here with Glib. I have also found an example using PyQt5 and widgets application here.

access element from .ui

旧巷老猫 提交于 2021-02-10 20:27:26
问题 I have problem to access my button and label from my dialog.ui. I am using Python 3.x and QT Designer 5.x. from PyQt5 import uic, QtWidgets from PyQt5.QtWidgets import QApplication Form, Window = uic.loadUiType("dialog.ui") #load ui (GUI) file app = QApplication([]) #create a QApplication window = Window() form = Form() form.setupUi(window) def on_click(): # self.qlFreeText.text("hello") alert = QMessageBox() alert.setText("You clicked the button!") alert.exec_() class Ui(QtWidgets