pyqt5

How to update a plot in pyqtgraph?

我只是一个虾纸丫 提交于 2021-02-07 10:09:04
问题 I am trying to have a user interface using PyQt5 and pyqtgraph. I made two checkboxes and whenever I select them I want to plot one of the two data sets available in the code and whenever I deselect a button I want it to clear the corresponding curve. There are two checkboxes with texts A1 and A2 and each of them plot one set of data. I have two issues: 1- If I select A1 it plots the data associated with A1 and as long as I do not select A2 , by deselecting A1 I can clear the data associated

PySide2 QThread Error: QThread: Destroyed while thread is still running

旧街凉风 提交于 2021-02-07 10:07:21
问题 I am new to PySide2. I am just trying to launch a sample application and start a thread as the application starts and want to stop the thread as the application closes. When I am closing the application I am getting the following error: QThread: Destroyed while the thread is still running. The sample_ui.py is a python file that I converted from sample_ui.ui Code: import time import sys import sample_ui from PySide2 import QtWidgets from PySide2 import QtCore class MainWindow(QtWidgets

PySide2 QThread Error: QThread: Destroyed while thread is still running

浪尽此生 提交于 2021-02-07 10:04:32
问题 I am new to PySide2. I am just trying to launch a sample application and start a thread as the application starts and want to stop the thread as the application closes. When I am closing the application I am getting the following error: QThread: Destroyed while the thread is still running. The sample_ui.py is a python file that I converted from sample_ui.ui Code: import time import sys import sample_ui from PySide2 import QtWidgets from PySide2 import QtCore class MainWindow(QtWidgets

Real-Time-Plotting using pyqtgraph and threading

…衆ロ難τιáo~ 提交于 2021-02-06 12:53:06
问题 this is a bit longer, the first part is just a description of the problem, the second one the question if my "fix" is correct. I started with python programming. I created a program that communicates with an Arduino that reads the temperature of a furnace of our melting lab. The temperature is then used in a PID algorithm and an output is set to the Arduino. The communication is done via pyserial. So far, everthing works, including live plotting of the temperature signals, PID-variables and

How to convert QTableWidget data to PDF using PyQt5 Python

荒凉一梦 提交于 2021-02-05 12:13:29
问题 I am working on a python project where I have data stored in QTableWidget . I have to export this data into excel sheet and PDF . I have been able to export data to excel sheet using below code. But unable to understand how can I convert it to PDF . filename, _ = QFileDialog.getSaveFileName(self, 'Save File', '', ".xls(*.xls)") wbk = xlwt.Workbook() sheet = wbk.add_sheet("sheet", cell_overwrite_ok=True) style = xlwt.XFStyle() font = xlwt.Font() font.bold = True style.font = font model = self

How to have a scrollable context menu in PyQt

别说谁变了你拦得住时间么 提交于 2021-02-05 11:51:25
问题 I would like to have a scrollable context menu so that I can place many Actions in it. I saw an answer from another post that setting menu.setStyleSheet('QMenu{menu-scrollable: 1;}') will enable scroll Bar but it doesn't seem to do the job. Here is a demonstration of the context menu of the blender software. How can this be achieved? 回答1: Dealing with menu customization (with any framework) is not an easy task, and from experience I can telly you that trying to use simple approaches such as

Display data from list in label Python

假装没事ソ 提交于 2021-02-05 11:48:26
问题 I have a list of data and the size of list is not fix. I want to display each item of this list in a label(Textview). self.valueT.append(value) for i in self.valueT: // print(i) self.result.setText(i) here in this code the print(i) work that display everything in console mean that it display the result but when I do self.result.setText(i) this one not working mean it did't display anything in the Label. and the second thing i want to display each value after 1sec. self.valueT is a list 回答1: A

Calling a function and having it call multiple times

ⅰ亾dé卋堺 提交于 2021-02-05 11:31:03
问题 I'm having an issue in PyQt5 where if I some of my functions, it calls it however many times I've called it so far. I'll try to water down to relevant code. class MainWindow(QtWidgets.QMainWindow, UI.MainUI.Ui_MainWindow): """The Main Window where everything happens""" def __init__(self, parent=None): """Initializes (Don't use partial as most of the variables aren't created yet)""" super(MainWindow, self).__init__(parent) self.setupUi(self) self.btn_buy_ship.clicked.connect( lambda: self.game

PyQt5 buttons not connecting

孤街浪徒 提交于 2021-02-05 11:27:25
问题 I am trying to build a simple GUI using PyQT5, with 3 buttons to open file browsers and one more to run processing with the selected files, but I can't get my buttons to connect to the functions needed to carry this out. In the Ctrl class, the _connect_signals function doesn't seem to be calling _input_select . Can anyone help me figure out why? import sys # Import QApplication and the required widgets from PyQt5.QtWidgets from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import

PyQt5 buttons not connecting

房东的猫 提交于 2021-02-05 11:27:12
问题 I am trying to build a simple GUI using PyQT5, with 3 buttons to open file browsers and one more to run processing with the selected files, but I can't get my buttons to connect to the functions needed to carry this out. In the Ctrl class, the _connect_signals function doesn't seem to be calling _input_select . Can anyone help me figure out why? import sys # Import QApplication and the required widgets from PyQt5.QtWidgets from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import