pyqt5

Python using variable outside of a function (and class)

Python using variable outside of a function (and class) Question: i am using PyQt5 to open a browser to get a folder and assign it to a variable folder_path, if i print it inside the function it works: def browse_folder(self): global folder_path options = QtWidgets.QFileDialog.Options() options |= QtWidgets.QFileDialog.ReadOnly folder_path = QtWidgets.QFileDialog.getExistingDirectory( self, "Select Folder", options=options) …

Total answers: 2

How can I reuse my function without any error?

How can I reuse my function without any error? Question: I want to make my lineEdits turn red if they are empty when I click submit button. After adding something back I want to make my lineEdit turn back to white. from PyQt5 import QtWidgets from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog …

Total answers: 1

(PyQt5) How can I apply blur effect only on the background of my mainwindow?

How can I apply blur effect only on the background of my mainwindow? Question: what i want to achieve I am learning how to use pyqt5 with this project of mine. I tried downloading something called BlurWindow but it kept giving me a parameter error so switched back to trying to use QGraphicBlurEffect but it …

Total answers: 1

Start a process on click

Start a process on click Question: I am trying to add multiprocessing to my project. To exemplify, I made a little project with just a button, and when the button is pressed, I want to start a process with a method, but the method is never called. How could I call the method within a …

Total answers: 1

How does PyQt5's QGraphicsColorizeEffect() affect the color of a pixel exactly?

How does PyQt5's QGraphicsColorizeEffect() affect the color of a pixel exactly? Question: I’m using QGraphicsColorizeEffect() in a python program to colorize a QGraphicsPixmapItem. I’m happy with how it works, as it’s meant to highlight that the item has been "selected" by the user, however it made me wonder what is the exact logic or math …

Total answers: 1

How to change alignment of PyQtGraph legend?

How to change alignment of PyQtGraph legend? Question: I am trying to make a good-looking graph inside my interface and due to this, the legend has to be on a right side of the widget. Is it possible to do this? As a default, the legend appears sticking to the left axis and only way …

Total answers: 1

Why Does My GUI Keep Crashing when I Press the RadioButton (PYQT5)

Why Does My GUI Keep Crashing when I Press the RadioButton (PYQT5) Question: I created a GUI (below) where it prints out a dataframe, I want the user to be able to filter the view of the dataframe based on the button they press. For example, if the user presses the Filter radio button (which …

Total answers: 1

How to prioritize main pyqt5 thread in python3?

How to prioritize main pyqt5 thread in python3? Question: I have made a gui application with PyQt5 in python 3.8. But when I order from my GUI to perform heavy multithreaded CPU-intensive task (the gui thread isn’t engaged), the GUI becomes very non-responsive (most likely due to CPU being concentrated on worker tasks). My question …

Total answers: 1

Optimizing the speed of a python program that uses PyQt5 and images

Optimizing the speed of a python program that uses PyQt5 and images Question: I’m trying to create a python program that let me visualize a stylized fictional political map where each country is represented by pixel of a specific color. I’m using PyQt5 to create some kind of simple GUI that let me open the …

Total answers: 1

PyQt5 Python Scroll area can't scroll it's content

PyQt5 Python Scroll area can't scroll it's content Question: I can’t make scroll area scrolling. Added into it QLabel and grid with 100 lines. You can see code and screenshot bellow. Does someone know how to add grid into scrolling area? import sys from PyQt5 import QtWidgets from PyQt5.QtGui import * from PyQt5.QtWidgets import * …

Total answers: 1