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

Problem between Matplotlib figure & the PyQt5/PySide2 QSplitter Widget

I am trying to create 2 plot figures that can be auto-resized with the PyQt5/PySide2 QSplitter Widget. However, when I shrink the plots, their title and x-axis labels get overlapped, as shown below. It looks broken. Does anyone know better tricks to…
Scoodood
  • 583
  • 1
  • 5
  • 13
3
votes
2 answers

Unable to load QMYSQL Driver on PySide2

How can i install and load the Qmysql driver using Pyside2 (pip) with python3.8? I've already tried to download git:qtbase and compiled the driver from there but I had any luck.
nfnvsc
  • 49
  • 4
3
votes
1 answer

Using QThread to display QProgressDialog in PyQt5

I am using PyQt5 to write an app that manages Sales Orders. When creating an Order or deleting itI want to display a marqee style progress dialog to indicate that the app is working. I have visited a lot of posts where the answer involved using…
ahendawy
  • 79
  • 7
3
votes
1 answer

Graphing dynamically with python and QML Oscilloscope works great, but the same program doesn't work in raspberry pi, replace function don't work

I am running a Qt QML application with Python. I am graphing values using qt charts dynamically. To do this I made a similar code as in the oscilloscope example from Qt documentation, except that instead of C++ I used Python. I first created a line…
3
votes
1 answer

Can't import PySide2

Version: Python:3.6.8 (32 bit) PySide2: 5.15.0 my code: import PySide2.QtCore print(PySide2.__version__) but got error: Traceback (most recent call last): File "E:/7-Pycharm/contrl_sys_ui/test/qt_test.py", line 1, in import…
Jelly Lemon
  • 67
  • 1
  • 6
3
votes
2 answers

Python crashes when running a log streamer using Qt

Goal I have a process that logs on a file (realtime.log) while running and I want to print every new line of that file in my application in realtime. In other words I want to redirect the output from the process to the GUI. This means that I have…
John Reds
  • 117
  • 14
3
votes
2 answers

QTableWidget and setCellWidget: resize problem

I tried to insert some QRadioButton inside some cell of a QTableWidget. The situation is similar to the one of this post. In particular, the solution by @eyllanesc, with PySide2 is the following import sys from PySide2.QtWidgets import…
MaPo
  • 613
  • 4
  • 9
3
votes
1 answer

Event leave on QLineEdit

I want to do some action if the user typed text into the QLineEdit and left the QLineEdit entry field. There is not a lot of explanation about focusInEvent available. I'm using Python and PySide2. But all information is helping. def…
BenjaminK
  • 653
  • 1
  • 9
  • 26
3
votes
2 answers

Different colours in an arc

Consider the following toy example: from PyQt5 import QtWidgets, QtGui, QtCore class MainWindow(QtWidgets.QMainWindow): def __init__(self): super(MainWindow, self).__init__() w = QtWidgets.QWidget() layout =…
Giuseppe
  • 143
  • 1
  • 10
3
votes
1 answer

Opening new window while out of focus using "keyboard"

I am trying to track my keypresses, using the module "keyboard" while a PySide2 Widget is not in focus, which works fine. However when I try to create a new Widget using a "keyboard" shortcut the program crashes. Opening a window on a button press…
encror
  • 80
  • 6
3
votes
1 answer

Using QFrames in QT for Python?

how to place objects within the confines of a QFrame as i can't get my head around it. I've read the documentation on https://doc.qt.io/qtforpython/PySide2/QtWidgets/QFrame.html but its just not sinking in for me. I've also looked at various code…
Welshhobo
  • 115
  • 11
3
votes
1 answer

Why can I emit dataChanged(), but not layoutChanged() in a PySide2 table model?

I am new to Qt. Currently I am trying to learn how to update a table model from a different thread and then how to get an immediate display update for it. I read the documentation and found the dataChanged() and layoutChanged() signals. While…
3
votes
0 answers

PySide2 signal instances and emit function as regular python function arguments

I have a PySide2 application that runs mostly well. However, from time to time, it exits itself without any error (stdout, stderr are empty, even when run from terminal - tried everything) while a worker thread sends updates to the GUI thread via…
3
votes
1 answer

How do I go about creating a Ribbon component in QT?

A Ribbon is the following component: I would like to build the component using QtQuick (QML) and PySide2 as backend. Current Solutions I have taught: I know I can build the buttons using a TopBar, i.e: I can create three different delegates for…
3
votes
2 answers

Benefits of using pyuic vs uic.loadUi

I am currently working with python and Qt which is kind of new for me coming from the C++ version and I realised that in the oficial documentation it says that an UI file can be loaded both from .ui or creating a python class and transforming the…
Juanjo
  • 79
  • 1
  • 8