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
3
votes
1 answer

PySide2 composite widget Hover Effect

How to animate position,scale or any other attributes of composed elements inside custom widget, on mouse pointer enters or leaves the QListWidgetItem ? (see reference image below) And is there any better way to manage space around ListWidgetItem…
Ruchit
  • 661
  • 1
  • 6
  • 19
3
votes
2 answers

Use Qt Pyside2 with asyncio await syntax?

How to await this function (src ) in the main loop of pyside2: async def do_request(value): #asyncqt maybe possible #print("do request") await asyncio.sleep(value) #print("request finished") return value async def eventFilter(self,…
droid192
  • 2,011
  • 26
  • 43
3
votes
1 answer

Number of rows in TableView affects alternating row color unexpectedly

I have a PySide2 Qt 5.13.1 application with a TableView. I am expereiencing some weird behavior depending on the number of rows in my table. I am trying to alternate row colors. When the number of rows is even, the stripping works as expected. …
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
3
votes
2 answers

Custom object referencing in QML Python

I am trying to extend QML with qmlRegisterType. I have a python class - PyQml.py, main.qml files and boilerplate code for it. Problem is I cant reference(import) PyQml object in main.qml file, I get an error --> QML module not found (PyQml) . So…
user2727167
  • 428
  • 1
  • 3
  • 16
3
votes
1 answer

How to access QstatusBar in QMainWindows from a widget class?

I'm trying to change the text of a Qstatusbar created in a mainwindows Class from another class I've try several thing for the web but didn't find the answer ... class MainWindow(QMainWindow): def __init__(self, widget): …
Mamquam
  • 37
  • 6
3
votes
1 answer

How to add qml ScatterSeries to existing qml defined ChartView?

I am trying to add series on demand to an existing ChartView defined in qml using python. I have found an example which shows how to do this in C++ (taken from https://doc.qt.io/archives/qt-5.11/qml-qtcharts-chartview.html#createSeries-method): //…
BobbyG
  • 536
  • 1
  • 7
  • 20
3
votes
1 answer

QMetaProperty::read: Unable to handle unregistered datatype 'QAbstractListModel*'

I'm trying to create a custom QQuickItem for displaying charts in my application. My C++ version is working, but I cannot get my Python version to work. I believe this is because Q_DECLARE_METATYPE and qRegisterMetaType aren't ported to PySide2. …
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
3
votes
1 answer

QML Charts causes crash on startup

I'm trying to make an application that uses QML QCharts to visualize data. The program is crashing at startup before a window even appears. I tried on both macOS and Windows 10 with the same results. I have included a minimally working example…
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
3
votes
3 answers

How to fix PySide2 QPixmapCache.find() DeprecationWarning?

I'm currently in the process of porting a large application from Py2/PySide 1.2.4 to Py3/PySide2 5.13.0 and I'm discovering a DeprecationWarning related to the use of QPixmapCache.find(key, pixmap). c:\path\to\module.py:220: DeprecationWarning:…
timmwagener
  • 2,368
  • 2
  • 19
  • 27
3
votes
3 answers

Why is the precision of a QDoubleSpinBox sometimes higher than its decimals property allows?

In PySide2, if I create a QDoubleSpinBox and explicitly set its decimals-property to 2 and its singleStep-property to 0.1 and then change its value via the up/down buttons, the printed value sometimes has a much higher precision. Why is that…
S818
  • 391
  • 3
  • 15
3
votes
1 answer

How do you display a figure in matplotlib using PySide2?

I am trying to learn matplotlib and I tried testing the following code. import matplotlib from matplotlib.figure import Figure import matplotlib from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg…
YIBAO
  • 35
  • 3
3
votes
1 answer

QDateTimeAxis() - series are not displayed

I am building application which includes QCharts. Everything was working until I changed Value Axis to the DateTime axis. Now I don't see any series on the chart. I was trying methods which was provided in other topics on stack overflow but without…
e2p
  • 137
  • 1
  • 8
3
votes
5 answers

PySide2: DLL load failed: The specified procedure could not be found

I am trying to build a project in PySide2 with Python 3.5.1. Previously, I was developing in PySide with Python 2.7 but wanted to upgrade to Python 3. I have downloaded PySide2 (5.12.4) and I also have Qt5 (5.13.0) downloaded (if that…
papers1010
  • 135
  • 1
  • 1
  • 8
3
votes
2 answers

PySide2.QtWidgets.QxxxxLayout.addWidget called with wrong argument types

I'm trying to add FigureCanvasQTAgg argument as widget to some layout using addWidget funtion and TypeError occured. This Error appers only when trying to run my standalone appliciation that was built using pyinstaller. When running the script…
YoavShe
  • 151
  • 2
  • 3
  • 11
3
votes
2 answers

QApplication instance/qtbot fixture causes travis-ci to abort and core dump

Working on understanding how to go about automated unit testing for PySide2-based applications. However, whenever I attempt to initialize a QApplication instance within the tests, be it through PySide2 itself or through pytest-qt's qtbot fixture,…