Questions tagged [pyqt6]

Qt6 bindings for Python programming language. This allows programmers to make Qt6 graphical user interfaces using Python syntax.

739 questions
0
votes
1 answer

Move focus to another widget when the return or right arrow key is pressed?

I have a Qt widget that looks like this: class launchiiwidget(QtWidgets.QWidget): def __init__(self): super().__init__() layout = QtWidgets.QVBoxLayout(self) self.textbox = QtWidgets.QTextEdit(self) …
WoaItsBren
  • 97
  • 1
  • 1
  • 8
0
votes
1 answer

How do I change the color of a link temporarily when hovered in a QLabel?

I want the following behavior: I've tried this, but it makes the link unusable and the color change only occurs if the mouse is in a very specific spot: from PyQt6.QtWidgets import QLabel, QApplication from PyQt6.QtGui import QMouseEvent import…
Andres
  • 21
  • 4
0
votes
1 answer

Trying update QTableView after closing child window Python PyQt6

I need automatically trigger refresh QTableView with setModel method in parent window after close child window. Child window insert data into sqlite database. Fragment of code from child window: class addClientWindow(QtWidgets.QWidget): def…
0
votes
1 answer

Trying to use SCN_MODIFIED with pyqt6 generates a TypeError crash

I've got a simple editor that I'm trying to port to PyQt6, but have run into a problem with the document modified message. It works fine in PyQt5 but generates 'TypeError: unable to convert a QVariant back to a Python object' message in PyQt6. #…
shao.lo
  • 4,387
  • 2
  • 33
  • 47
0
votes
1 answer

model for QTreeView crashes when layoutChanged is emitted

I'm trying to write a model (QAbstractItemModel child class) to populate data into a QTreeView. I need the items to be checkable and want to later filter out everything that is not checked. To achieve correct hiding of items that have been unchecked…
TilmanK
  • 103
  • 3
0
votes
0 answers

Why is my QThread signal not being emitted when reading values from pyserial?

I am trying to create a pyqtgraph that updates real time based on the values it receives from a pyserial connection. Currently I have two files: one that reads data from a pyserial connection and emits a signal when two values have changed, and a…
0
votes
1 answer

PyQt6 get the parent window of QTreeWidgetItem?

I am using PyQt6 6.1.0 on Python 3.9.6 and I would like to get the parent QMainWindow of the parent QTreeWidget of parents QTreeWidgetItems of a QTreeWidgetItem, because I need to modify the window from within the QTreeWidgetItem. The full code is…
Ξένη Γήινος
  • 2,181
  • 1
  • 9
  • 35
0
votes
1 answer

How to get a boundingRect of a QGraphicsItem based on arbitrary text length

I am subclassing QGraphicsItem in order to create a map marker which draws an icon (based on a constant dictionary of polygon points) and a text label. The boundingRect method below defines a fixed bounding box rectangle. But since the text label…
Cirrocumulus
  • 520
  • 3
  • 15
0
votes
1 answer

How to keep everything in the correct position after having hidden widget shown?

I am making a small music player using PyQt6. I want to have the QListWidget hidden before I click on any of the four genre buttons and shown up after the click. You may check the below pictures. (before): (what I expected to see after the button…
Adi_Hsiao_0410
  • 111
  • 2
  • 9
0
votes
1 answer

pyinstaller gives error while forming python exe

File "c:\users\\anaconda3\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py", line 11, in from PyInstaller.utils.hooks.qt import pyqt5_library_info, \ File "c:\users\\anaconda3\lib\site-packages\PyInstaller\utils\hooks\qt.py", line…
vinsent paramanantham
  • 953
  • 3
  • 15
  • 34
0
votes
1 answer

Getting value from a QSpinBox from one class to another

I designed a ui with qt designer, I have a QSpinBox in a class that I need to get its value from another class but instead, I get this when I print it. When I try to print in the same class it works, please…
Ayan Adel
  • 29
  • 6
0
votes
1 answer

PyQt6: redraw the bottom border of QTextEdit after it shrunk in height?

I have a class of textboxs subclassed from QTextEdit, it automatically resizes to its content and it also resizes when the window is resized. The texts can be very long, and the textboxs automatically line-wrap the texts, so when the horizontal…
Ξένη Γήινος
  • 2,181
  • 1
  • 9
  • 35
0
votes
1 answer

PyQt6 how to dynamically resize QGroupBox to fit content?

I am using Python 3.9.5 and PyQt6. Following my previous questions, I want to ask about how to dynamically how to resize QGroupBox to fit its contents. I have a QScrollArea, its layout is a QVBoxLayout, and a bunch of QGroupBoxs will be added to the…
Ξένη Γήινος
  • 2,181
  • 1
  • 9
  • 35
0
votes
1 answer

PyQt6 deleting custom widget with nested class causes the program to crash

I am using Python 3.9.5. I have encountered some serious problem in my project and here is a minimum reproducible example code, along with some descriptions. from PyQt6.QtCore import * from PyQt6.QtGui import * from PyQt6.QtWidgets import * class…
Ξένη Γήινος
  • 2,181
  • 1
  • 9
  • 35
0
votes
1 answer

I want to change the sound that plays every time a button is pressed depending on a checked actiion in a QMenu

I have a QMainWindow, inside there is a QMenu, QLineEdit, and one QPushButton. Every time I click the button, it plays a sound and then adds a text to the QLineEdit. In my QMenu the user must be able to choose which sound plays by checking it. I…
JA23Z
  • 25
  • 5