pyqt5

pyqt5 : have multiple roots qtreeview

只谈情不闲聊 提交于 2021-02-11 13:19:43
问题 I try to create a pyqt5 window with a Qtreeview window to load certain files. I need to show multiples directories from different locations in the same Qtreeview as root folder, so it means that I need to have multiple roots (or faking it) in the same qtreeview the directory structure can't be changed I have read this thread but it does not fit my needs, as the number of folders to exclude will be enormous (more than 10 000 folders today) and will increase every days. an 'include' function is

Word Wrapped QLabel cutting off text early

人走茶凉 提交于 2021-02-11 12:40:44
问题 I'm essentially trying to just add a title to the top of a layout to give a brief description, but Qt has to get in the way already. I have word wrap enabled, and the QLabel will grow it's height dynamically based on how long the content is... but it's always too short. My code: class Window(QMainWindow): def __init__(self, qtpy): super().__init__() self.qtpy = qtpy self.setMinimumSize(250, 150) self.resize(600, 450) class ThemeTool(Window): def __init__(self, qtpy): super().__init__(qtpy)

plot doesn't update on button click but does when window resized

穿精又带淫゛_ 提交于 2021-02-11 12:35:08
问题 What's going on: Program in python3/qt5/matplotlib. I am plotting three subplots and few plots in each. I wanted to update plots if user changes any data. That proved rather complicated hence the button 'Replot'. It calls a function that clears canvas and ... reloads the entire widget. It doesn't work as expected: when I press the button nothing happens, but when window gets resized after button clicked it does update the plot. What would be a correct way to do it without having to put all

How to add a live (updating) graph to my PyQt5 Window using Serial?

我们两清 提交于 2021-02-11 12:34:52
问题 I am writting a program that's supposed to receive 4 random values from my Arduino every second and create an updating bar chart with them. I then want to create a PyQt5 Window to show that bar chart. I was sucessful at reading the values coming from my Arduino and using them to create the bar chart. However, since I'm a beginner when it comes to GUI/Arduino, I have no clue how to add that bar chart to my PyQt Window. I'd appreciate if you could help me with that. Here's my Arduino code: void

plot doesn't update on button click but does when window resized

纵饮孤独 提交于 2021-02-11 12:34:09
问题 What's going on: Program in python3/qt5/matplotlib. I am plotting three subplots and few plots in each. I wanted to update plots if user changes any data. That proved rather complicated hence the button 'Replot'. It calls a function that clears canvas and ... reloads the entire widget. It doesn't work as expected: when I press the button nothing happens, but when window gets resized after button clicked it does update the plot. What would be a correct way to do it without having to put all

How to add a live (updating) graph to my PyQt5 Window using Serial?

ぃ、小莉子 提交于 2021-02-11 12:34:07
问题 I am writting a program that's supposed to receive 4 random values from my Arduino every second and create an updating bar chart with them. I then want to create a PyQt5 Window to show that bar chart. I was sucessful at reading the values coming from my Arduino and using them to create the bar chart. However, since I'm a beginner when it comes to GUI/Arduino, I have no clue how to add that bar chart to my PyQt Window. I'd appreciate if you could help me with that. Here's my Arduino code: void

Clicking a button to create a new button using PyQt5 python [duplicate]

这一生的挚爱 提交于 2021-02-11 12:33:54
问题 This question already has answers here : QLabel does not display in QWidget (2 answers) Closed 1 year ago . I'm trying to create a window(UI) that have a button click action implemented using python and PyQt5 . But, i want my button to create a new button when i clicked it. (i.e: clicking a button to create a new button). Can some one notify me on how to do that? my sample code is as follows: from PyQt5.QtWidgets import QApplication, QWidget, QPushButton from PyQt5.QtGui import QIcon from

How to have two widgets in one Main window

孤街浪徒 提交于 2021-02-11 12:32:24
问题 I am trying the whole morning already to fix that. So I have a PyQt Main Window where I want to display two widgets. In the first widget there are articles listed (which works so far). When I click on them until now a QMessageBox is opening, but I want that a second widget is opening where I can read the RSS Feed. But this is not working. See Code below: class ArticleWidgets(QWidget): def __init__(self, *args): super().__init__(*args) self.setGeometry(610, 610, 600, 600) self.initUi() def

how to paste and copy out multiple cells values in qt table widget

萝らか妹 提交于 2021-02-11 12:31:54
问题 I am very new in programming. Please help me in this regards. Thanks in advance. Here is my code: from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def clear_table(self): self.tableWidget_2.clearContents() def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1920, 1080) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.tableWidget_2 = QtWidgets.QTableWidget(self.centralwidget) self

Ensure that view shows scrollbar and adapts

核能气质少年 提交于 2021-02-11 12:07:55
问题 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