pyside2

PySide2 – Widget above a widget with a shadow effect moves under the second

PySide2 – Widget above a widget with a shadow effect moves under the second Question: I am writing a virtual keyboard for an app that will be using with touch screen. If you wanna ask me, why i don’t use pyqt virtual keyboard, i’ll answer that my keyboard must have some additional buttons and function. …

Total answers: 1

Pyside/Pyqt5 dynamically adding and sorting items

Pyside/Pyqt5 dynamically adding and sorting items Question: I have a simple user interface where I want to dynamically add frames and labels in a widget (as I will use these labels to transmit a video feed from my webcams). In the following code I set a function where the user selects an integer which represents …

Total answers: 2

How to deactivate a QVideoProbe?

How to deactivate a QVideoProbe? Question: According to the docs "If source is zero, this probe will be deactivated" But calling setSource(0) gives the following exception: Exception has occurred: TypeError ‘PySide2.QtMultimedia.QVideoProbe.setSource’ called with wrong argument types: PySide2.QtMultimedia.QVideoProbe.setSource(int) Supported signatures: PySide2.QtMultimedia.QVideoProbe.setSource(PySide2.QtMultimedia.QMediaObject) PySide2.QtMultimedia.QVideoProbe.setSource(PySide2.QtMultimedia.QMediaRecorder) Im running my code on raspberry pi 4 with Rpi Os Bullseye 64bit and …

Total answers: 1

NameError: Error evaluating `PySide6.QtWidgets.QWidget.__init__`: name 'PySide6' is not defined

NameError: Error evaluating `PySide6.QtWidgets.QWidget.__init__`: name 'PySide6' is not defined Question: I am trying to run the main.py which has the following code : import os import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton from PySide6 import * ######################################################################## # IMPORT GUI FILE from ui_Dashboard_Finance import * ######################################################################## ######################################################################## # IMPORT Custom widgets from Custom_Widgets.Widgets import …

Total answers: 1

Qt – update view size on delegate sizeHint change

Qt – update view size on delegate sizeHint change Question: I have a QTreeView with a QStyledItemDelegate inside of it. When a certain action occurs to the delegate, its size is supposed to change. However I haven’t figured out how to get the QTreeView‘s rows to resize in response to the delegate’s editor size changing. …

Total answers: 2

Create a QGraphicsItem at the mouse double-click position

Create a QGraphicsItem at the mouse double-click position Question: I’m writing a program that should create a QGraphicsItem when a double-click happens (inside the scene area), and also that item must be created at double-click position. I’ve already written some code, but it doesn’t work properly. When I double-click on the scene, an item gets …

Total answers: 1

Use QEnum like a Python Enum

Use QEnum like a Python Enum Question: Let’s say I have a python enum: class UserState(Enum): OFFLINE = auto() ONLINE = auto() BUSY = auto() I can access the different options with UserState.ONLINE, UserState.OFFLINE or UserState.BUSY. If I wanted to make this a QEnum so I can use it in QML, I’d need to wrap …

Total answers: 2

Conflicting names between logging emit function and QT emit signal

Conflicting names between logging emit function and QT emit signal Question: I am trying to send a Qt signal every time the logging handler emit function is called. But I think MyLogHandler.emit and log.emit functions are conflicting. from PySide2.QtCore import QObject, Signal import logging class MyLogHandler(logging.Handler, QObject): log = Signal(str) def emit(self, record): self.log.emit(‘send’) if …

Total answers: 2

Python GUI entry point not working on Bash for Windows

Python GUI entry point not working on Bash for Windows Question: I have a Python GUI app (using either PyQt5 or PySide2) which I would like to start with the command mypackage. Therefore, I added the following section to setup.cfg: [options.entry_points] gui_scripts = mypackage = mypackage:main On Linux and macOS, installing the package with pip …

Total answers: 2