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

Creating pyinstaller from my script, missing PySide2.QtXml in the result

What I did was call pyinstaller example.py the pyinstaller gets all the important libraries for my script. I might be worth mentioning that I am working on a Windows machine. But when i run the result it tells me: λ .\example.exe Traceback (most…
msfriese
  • 111
  • 3
  • 9
7
votes
3 answers

Pyside Remove window flags

Im designing a Pyside Qt application and I want to toggle the QtCore.Qt.WindowStaysOnTopHint window flag in my main window. Setting this hint using this code works fine: self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.show() but I can't…
jonathan topf
  • 7,897
  • 17
  • 55
  • 85
6
votes
1 answer

Metaclass conflict when trying to create a Python abstract class that also subclasses a PySide6 class

I'm trying to create an abstract base class that also inherits an arbitrary PySide6 class. However, the following produces the error TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses…
physhics
  • 61
  • 4
6
votes
1 answer

PySide2 Qt3D mesh does not show up

I'm diving into Qt3D framework and have decided to replicate a simplified version of this c++ example Unfortunately, I don't see a torus mesh on application start. I've created all required entities and enabled a mesh in SceneModifier class. What…
Artem
  • 563
  • 3
  • 17
6
votes
2 answers

QFileDialog always opens behind main window

I'm trying to open a file in my PySide2 application, but the file dialog always opens below the main window and appears as another application in the launcher. The application's name is "Portal". I see other answers where the solution is to pass the…
Don Kirkby
  • 53,582
  • 27
  • 205
  • 286
6
votes
0 answers

PySide2 cannot find a Qt dependency while building a PyInstaller

While building my PySide2 project a Qt error occurs, but I already have installed Qt in my system. I tried building the project in Windows, which occurs just fine, giving it a Dll error -- because my project use one --; but the code itself run just…
6
votes
3 answers

PySide2 QUiLoader returns an empty window

PySide2(5.6.0~a1) Qt UI file loader returns an empty window whereare PyQt5 loader works fine. Could you explained to me where I am wrong. Non Working PySide2 version: import sys from PySide2.QtWidgets import QDialog, QApplication from PySide2…
u2gilles
  • 6,888
  • 7
  • 51
  • 75
6
votes
3 answers

PySide Signal argument can't be retrieved from QML

I've noticed that QML can receive a signal emitted from Python by using the Connections object. Unfortunately, I can't figure out how to get that object to receive the arguments of that signal. I've created a minimal test case that demonstrates what…
Thane Brimhall
  • 9,256
  • 7
  • 36
  • 50
5
votes
2 answers

Using GraphicalEffects in PySide6

I am using PySide6 and am trying to use the GraphicalEffects module. As per documentation here: https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html I am doing: import Qt5Compat.QtGraphicalEffects The error I am…
Aaron
  • 759
  • 1
  • 7
  • 15
5
votes
3 answers

How to properly setup vscode with pyside? Missing suggestions

I'm very new to pyside, qt and python. I managed to setup a project with a basic window and a push button which closes the app. My problem is, that somehow vscode won't show all properties available, even though the code runs with them fine. Note…
Sewbacca
  • 576
  • 6
  • 17
5
votes
1 answer

Big sur QT is not showing widgets

Since today's release of Big Sur, my QT application stopped working, no any errors, project runs, just Windows are not shown. using Python with a Pyside2, writing, and launching with a Pycharms. Was fully functional yesterday - before…
Kamornik Cola
  • 644
  • 8
  • 20
5
votes
4 answers

pyside2 installation problem on ubuntu18.04, python 3.8.3 on anaconda

After installing anaconda3, I began to install pyside2. I directly typed pip install pyside2, and successfully installed pyside2 5.15. But when I ran the toy example, an error occurred: Traceback (most recent call last): File "test.py", line 2, in…
Chuang Men
  • 371
  • 3
  • 10
5
votes
1 answer

Mouse position on mouse move event is set on parent instead of child

I'm learning python and PySide2 and following up some tutorials from learnpytq, specifically https://www.learnpyqt.com/courses/custom-widgets/bitmap-graphics/ and I'm stuck at a point. Down the line, after creating the pixmap canvas, we move the…
pepeday
  • 89
  • 5
5
votes
2 answers

PySide2 equivalent of PyQt5's loadUiType() to dynamically mix in UI designs

TL;DR: I want a drop-in replacement for PyQt5's loadUiType() function from its uic module that works with PySide2 and Python 3.6+. I want to migrate a PyQt5 application to PySide2. A common pattern I use is, I create the user-interface design in Qt…
john-hen
  • 4,410
  • 2
  • 23
  • 40
5
votes
1 answer

How to convert a python list to a QVariantList in PySide2

So, PySide2 has removed the QVariant* types. However, QtQuick expose a great deal of QVariant API. More specifically, i want to use the very handy feature to pass a QVariantList as a model of ListView without having to implement a fully blown…
Pa_
  • 641
  • 1
  • 5
  • 17