Questions tagged [pyqt]

PyQt is a collection of Python v2 and v3 interfaces for The Qt Company's Qt application system that functions across all platforms compatible with Qt, such as Windows, macOS, Linux, iOS, and Android.

Efficiently handling a group of buttons in PyQt5 without the need to manually assign specific actions to each button

I'm currently working on designing a user interface layout that involves multiple buttons where clicking each button will toggle between adding 1 or 0 to a specific position in a list. However, I am facing challenges in managing a cluster of 48 buttons as ...

Tips for adjusting QTextTable to span the entire width of the document

I'm seeking a way to make the QTextTable within QTextDocument take up 100% or full width of the document. Unfortunately, there doesn't seem to be a method in the QTextTableFormat class that allows for formatting the QTextTable to have 100% width. ...

What are the steps for adjusting the size of a frame using the cursor located inside it?

Is there a way to dynamically change the size of a QFrame based on the cursor position? For example: If the default width is set to 50, when the cursor hovers over the frame, the width should increase to 100. When the cursor moves outside of the frame, t ...

Using Ctrl-C in combination with PyQt does not function as expected

How come pressing Ctrl+C doesn't stop a Python program using PyQt? I need to debug it and retrieve a stack trace, but for some reason it's more complicated than with C++! ...

Understanding PyQt Documentation

After installing PyQt GPL v4.6.2 for Python v3.1 and Qt by Nokia v4.6.0 (OpenSource), I noticed that the documentation in PyQt is not displaying properly. Even the example docs are blank. I am seeking a step-by-step guide from someone on how to access the ...

Is there a way to identify when a mouse button is activated on a QWebView?

Currently working on a project to develop my own Web Browser using PyQt4, and this portion of the code focuses on creating QWebViews: def create_tab(self, index): self.tabs[index].append(QtWebKit.QWebView()) self.tabs[index][0].setLayout(s ...

Tips for adjusting window size based on screen resolution

I am experiencing an issue with window size based on the display resolution. In order to dynamically control the window size, I have set the size policy to Preferred At a resolution of 1280 X 1024, the auto-adjusting window size function works perfectly ...

Possible Segmentation Fault Issue with QtWebEngine in PyQT on MacOS - Seeking Solutions

I created a simple application to test the functionality of QtWebEngine on MacOS, as my more complex app that also uses WebEngine is not working on MacOS. Both apps work fine on Windows. Code: import sys from PyQt5.QtCore import * from PyQt5.QtWidgets im ...

What is the best method for converting a QImage into a pixel list within PyQt?

I am a bit confused about the QImage.bits() and QImage.constBits() functions in Python. Both return a voidptr, but I'm unsure how to work with that data type in Python since I'm more used to working with C++. When it comes to the data type, I mean somethi ...

Using Python with PyQt5, create a QTableWidget that incorporates LineWrap functionality for wrapping

Is it possible to enable line wrap on a QTabelWidget in PyQt5 when trying to display long strings from an Excel document? I have attempted using the QTextDocument class without success. Below is a simple example with two constant strings to be displayed in ...

The PyQt progress soars to 100% as soon as it begins

Running the code in the doWork method and clicking on button1 makes the progress bar function correctly. However, if I pass the list to the doWork method from other methods like btn2 or btn3, the progress bar suddenly jumps to 100% as soon as it starts. ...

Pause and anticipate the setting of an object property in Squish

In my current testing environment with Squish 6.3 Qt, I have encountered an application that includes a QLabel element with constantly changing content. Is there a way to pause execution until the label displays a specific value? The usual method of usin ...

Tips on concealing QComboBox elements instead of removing them completely

Is there a way to temporarily hide QComboBox items without deleting them? Currently, the only method seems to be clearing all existing items with .clear() and then adding them back one by one using .addItem(). I prefer a solution where I can hide and unhi ...

To avoid errors, ensure that a QApplication is created before using a QPaintDevice with a QWidget

Currently, I'm in the process of converting an IRC client from Python 2.6 to 3.3 and have encountered a problem related to PyQt. Initially, the application used PyQt4, but now I am transitioning it to work with PyQt5. However, I am facing an error that doe ...

Discovering the clickable widget index in pyqt4: A beginner's guide

In my application, I am working on creating multiple widget orders using a list of dictionaries to create a list of widgets. I have implemented a mouse release event for clickable widgets, but I am facing issues in identifying the clicked widget index. C ...

Incorporating Radar Visuals into a Customized Widget

I have been attempting to incorporate the Radar chart code (found at this link) into a GUI that includes a widget. Instead of simply plotting x and y values on the widget, my goal is to display a radar chart, but I'm facing difficulties in achieving this. ...

How to ensure a QWidget stays on top using PyQt5

Is there a way to make a child widget stay on top when created inside the main window init function? I've only been able to get it working when the widget is created in app scope, as seen here: PyQt4 How keep a QWidget always on top?. (Tested on Ras ...

The fusion style in Qt does not support the setMaxVisible() function in QComboBox

Recently, I've been delving into self-teaching myself how to utilize python and PyQt5 in order to create a user interface. The sleek appearance of the Fusion style caught my eye, but upon applying it to an app, I discovered that the QComboBox command setMa ...

TableView fails to reflect changes made in TableModel following sorting operation

Utilizing the PyQt5 MV programming pattern, the goal is to showcase a dataframe and execute basic sorting and filtering operations on it. Although displaying the dataframe was successful, I encountered a challenge with the sorting functionality. Despite v ...

I am facing an issue with the vtkTimerCallback when used together with the QVTKRenderWindowInter

Having an issue with vtk (8.1) and pyqt5 (5.10.1). When using the vtkCallBackTimer with the original vtk.vtkRenderWindowInteractor(), everything works correctly. However, when attempting to use the vtk.qt.QVTKRenderWindowInteractor.QVTKRenderWindowInteract ...

PyQt4 Error: The 'self' attribute is not recognized in the function object

I am facing an issue where I cannot change the values in the GUI table from the main program, resulting in an error. AttributeError: 'function' object has no attribute 'commandTable' Despite attempting the solution provided in this ...

Single-line ELLIDED QLabel

Currently, I am working on creating a Qlabel in Qt (specifically in PyQt) that will dynamically adjust to the available space. This label is intended to display file paths, which can sometimes be quite lengthy. However, the current setup causes the label t ...

Adjusting the size of a dialog box using PyQt4

Check out this code sample: import sys from PyQt4.QtGui import (QApplication, QHBoxLayout, QVBoxLayout, QDialog, QFrame, QPushButton, QComboBox) class Widget(QDialog): def __init__(self, parent=None): ...

Automatically installing packages in Python

Currently, I am encountering an issue with Python. After creating my script, I downloaded a library and installed it on my Ubuntu system to use in the script. However, when giving the script to a client or another user, they may not know which libraries ar ...

Insert a vertical divider to separate icons and text within a menu

I'm seeking guidance on how to implement separators between icons and text in a menu. Any suggestions would be greatly appreciated. The specific task I am looking to accomplish is: . Open a menu from a button and incorporate separators as shown in the im ...

Interfacing PyZMQ with the Qt event loop

Currently, I have integrated pyzmq into my qt application. I came across a solution on a mailing list in the first link. Therefore, here is my code with the provided link. import zmq from PyQt5.QtCore import QSocketNotifier from PyQt5.QtWidgets import QA ...