Questions tagged [pyside2]

Questions about using PySide2, a Python Qt bindings project for Qt5.

PySide2 was released mid June 2018 as a Technical Preview (supporting Qt 5.11), and it was officially released without the Technical Preview tag, in December 2018 for Qt 5.12.

The project started in May 2015.

Wikipedia:

PySide2 is a Python binding of the cross-platform GUI toolkit Qt, currently developed by The Qt Company under the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide2 is free software. The project started out using Boost.Python from the Boost C++ Libraries for the bindings and later switched to the binding generator Shiboken to reduce the size of the binaries and the memory footprint.

PySide was released under the LGPL in August 2009 by Nokia, the former owners of the Qt toolkit, after Nokia failed to reach an agreement with PyQt developers Riverbank Computing to change its licensing terms to include LGPL as an alternative license.

Work is currently underway to officially launch PySide2 as a Qt product, after all the effort on porting PySide to work with Qt 5.

PySide2 supports Linux/X11, Mac OS X, Windows and Maemo. Support for Android is currently being added by the PySide community.

The PySide2 Homepage can be found here

1728 questions
4
votes
2 answers

How to profile PySide2 + QML in QtCreator?

I have a PySide2 application, which uses QML to display the user interface. The application works from the command line. I can also launch it as well as debug it in QtCreator. However, when I try to run QmlProfiler, I see the following error: :-1:…
WhiteStork
  • 385
  • 1
  • 15
4
votes
1 answer

'PySide2.QtWidgets.QApplication' object has no attribute 'exec'

I am reading tutorials about Tabwidgets on Python with Qt. I already do understand the basics of it. I would like to write an application that contains several tabs whereby each tabs consists of several widgets. I have found a great tutorial on…
DebianFox
  • 63
  • 2
  • 6
4
votes
2 answers

Custom widget background color in pyside2

Trying to work out how to set the background color in a QWidget. Here is my code: class ParentTester(QWidget): def __init__(self, parent=None): super().__init__(parent) left = ColorTester(self) right = QFrame(self) …
fuzzboil
  • 61
  • 1
  • 5
4
votes
1 answer

Python QT findChildren does not find any children from UI file

I have a UI file like this RoverPlanner 0 0 752
Cedric Martens
  • 1,139
  • 10
  • 23
4
votes
1 answer

QQuickFrameBufferObject causes crash in PySide2

I am trying to create a simple QQuickFrameBufferObject in order to render some custom opengl textures in Qt Quick. So I decided to test it with PySide2. Here is a simple implementation: from PySide2.QtQuick import QQuickFramebufferObject from…
reckless
  • 741
  • 12
  • 53
4
votes
1 answer

How to overwrite QDialog.accept()?

I have a Mainwindow that is opening a dialog on the press of a pushbutton. I want to override accept function of the dialog so I could implement some custom functionality that should be executed before dialog is accepted. Here is the example code of…
Karl Olufsen
  • 186
  • 1
  • 10
4
votes
1 answer

Can't create (python) QApplication in github action

I've got some unit tests for my (python) Qt gui, which require QApplication instance, but creating one always fail for me (i.e. ends in core dumped and application abort at line with QApplication()). What I've tried so far is: creation…
konserw
  • 494
  • 2
  • 10
4
votes
1 answer

How to maintain UI responsive with long-running slot

I have a python-defined worker QObject that has a slow work() slot that is called by the QML UI (in my actual UI, the method is called on each item in a FolderListModel dynamically as the user goes through the list, but for he sample code I'm just…
GPhilo
  • 18,519
  • 9
  • 63
  • 89
4
votes
1 answer

How to add a eventFilter in Maya

I'd like to create an drag'n drop functionality with a custom Qt Window and Maya. From what I could find the only solution is to add a eventFilter for a Maya Widget. So this is what I tried to test it: import maya.OpenMayaUI as omui from PySide2…
haggi krey
  • 1,885
  • 1
  • 7
  • 9
4
votes
1 answer

Selecting QListWidgetItem with qtbot.mouseClick

How can I click on a QListWidgetItem with qtbot.mouseClick? I tried it with the following code, but it fails on the final assert: from PySide2 import QtWidgets, QtCore import pytest @pytest.fixture def widget(qtbot): widget =…
rmweiss
  • 716
  • 1
  • 6
  • 16
4
votes
1 answer

Add objects asynchronously to QGraphicsScene

I develop an application where a lot of objects need to be added to a QGraphicsScene object in order to represent the diagram of an electric power system. When the grid is large this process takes a while and the main window remains unresponsive.…
Santi Peñate-Vera
  • 1,053
  • 4
  • 33
  • 68
4
votes
1 answer

QML TableView with dynamic width columns

I have created a TableView in PySide2 Qt 5.13.0. I want a TableView to fill the width of the parent item, but it will not resize the columns unless I drag the table. From the start of the program, I want the columns to be wider. main.py import…
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
4
votes
1 answer

Program randomly crash when background-color of Qwidget changes

To set the background-color is fine, but my interface has a Qwidget that changes its background-color at certain point. That will cause the program to crash, and the crash stops when I comment out the color changing code. This code below will…
Dery
  • 177
  • 1
  • 11
4
votes
2 answers

How to set window and it's graphicScene transparent(using slider) and leave only QPushButton visible

I want my window and it's QGraphicsScene to be transparent which is controlled by QSlider. I tried looking for some answers here and there, but it's mainly setting background color to 0 : self.setStyleSheet("background-color:rgba(0, 0, 0, 0);") or…
Vlad
  • 387
  • 3
  • 17
4
votes
1 answer

How to exclude unnecessary Qt *.so files when packaging an application?

After the successful packaging of my PySide app using PyInstaller, I've found lots of different *.so files in a package folder. I was surprised seeing libraries I don't use in my project, like: libQt53DAnimation.so, libQt53DCore.so,…
Artem
  • 563
  • 3
  • 17