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

How to embed matplotlib canvases in a PySide2 application

I am trying to embed a matplotlib canvas into a PySide2 application. I have tried to use this example: https://matplotlib.org/examples/user_interfaces/embedding_in_qt5.html The example runs fine using PyQt5. However, if I change line 19 from from…
user1919235
  • 470
  • 7
  • 17
3
votes
1 answer

Why I can not Install PySide2?

I want to Install PySide 2 library But apparently this library is not found. I tried this to install PySide2: pip3 install PySide2 But after executing this command, I encountered the same problem: ERROR: Could not find a version that satisfies…
3
votes
1 answer

Communicate between two widgets not directly related

I have a GUI with widgets that has multiple child widgets inside, as you can see in the image: I want to communicate "Widget 2-2" with "Widget 1-1". I have different options, but I don't know which is better. 1. Propagate signal My first idea was…
3
votes
1 answer

How to draw custom oval shape in PyQt?

So I have been trying to make a custom oval shape using QGraphicsEllipseItem. Upon reading the Qt's official documentation regarding QGraphicsEllipseItem, I didn't seem to find out how to manage it. Here is the custom oval shape:
jon_bovi
  • 71
  • 3
  • 11
3
votes
2 answers

Changed Properties do not trigger signal

For a subclass of QObject I'd like to define a property. On change, a signal should be emitted. According to the documentation, something like this: p = Property(int, _get_p, _set_p, notify=p_changed) should work, but the signal is not emitted by…
zeeMonkeez
  • 5,057
  • 3
  • 33
  • 56
3
votes
1 answer

Pyinstaller - pack into onefile as a second step after generating multi-file dist to reduce size

I'm using Pyinstaller to generate an executable of a Python3 application that includes a UI made with PySide2. Using using the --onefile flag the resulting .exe is huge,140 MB. I tried generating without --onefile flag and take a look what was…
3
votes
2 answers

Qt error: qt.qpa.fonts: Unable to open default EUDC font: "C:\\WINDOWS\\FONTS\\EUDC.TTE"

Every time I run a PySide2/6 app I get the following error printed in terminal: qt.qpa.fonts: Unable to open default EUDC font: "C:\\WINDOWS\\FONTS\\EUDC.TTE"
Jaime02
  • 299
  • 7
  • 21
3
votes
1 answer

Get mouse press event from ANY widget

I have a QMainWindow application that has multiple widgets (buttons, labels, etc.) inside it. How can I get an event when the user presses ANYWHERE of the app? I tried to customize mousePressEvent() function, but this doesn't accept the event when…
rpi_guru
  • 299
  • 2
  • 18
3
votes
1 answer

ImportError while importing PySide2

I installed PySide2 using pip install PySide2 But i got this error when i tried to import it: >>> import PySide2 PySide2/__init__.py: Unable to import shiboken2 from , C:\Users\ilia\AppData\Local\Programs\Python\Python38\Lib\idlelib,…
ilia_rr
  • 45
  • 1
  • 10
3
votes
1 answer

Error lambda missing 1 required positional argument when using with QPushButton

This is entire my code: import sys from PySide2.QtCore import Qt from PySide2.QtWidgets import ( QApplication, QHBoxLayout, QLabel, QMainWindow, QPushButton, QVBoxLayout, QWidget, ) class MainWindow(QMainWindow): …
3
votes
1 answer

How to get cursor location within window in PyQt5/PySide2?

Questions and Briefing Hello. I am trying to fix a problem with my PyQt5 window which has a custom Title Bar. If you maximize the window and you hover over the title bar with the cursor and drag the window to move it, the window will resize and you…
Kevin A.
  • 99
  • 2
  • 2
  • 10
3
votes
1 answer

Importing QML from a Resource (QRC) file with PySide2

I have added a simple QML component ("qml/MyButton") to my "resource.qrc" file: qml/MyButton.qml I then compiled the QRC to a python module with: pyside2-rcc -o resource.py…
Aaron
  • 759
  • 1
  • 7
  • 15
3
votes
2 answers

Integrating two Python scripts into one?

I have two Python scripts that i need to communicate with each another. The first is a GUI made in PySide2. The GUI consists of simple controls for controlling a bluetooth audio device (play, pause, next, previous, etc...). These commands operate…
Welshhobo
  • 115
  • 11
3
votes
1 answer

QThread closes whenever QFileDialog Called After Migrating from PyQt5 to Pyside2

First of all, I'm currently migrating my source code from PyQt5 to PySide2 which requires me to change some of the syntaxes. As this site said that it only needs 3 things to do migrate from PyQt to Pyside2. 1.app.exec_. exec_ was used as exec is a…
greendino
  • 416
  • 3
  • 17
3
votes
1 answer

QtableView placeholder text before table appears

I have a very simple QtableView like which is populated after the program runs. The program takes a few seconds before it populates the table like so.. I am wondering how to enable a placeholder text "No data" on the QTableView before the program…
Sam
  • 350
  • 5
  • 18