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

Is it possible to change the height of a QProgressBar?

I'm trying to change the height of the inner bar. I already tried to change the height of the chunk, but the hole bar just vanished. I also tried to change the chunks padding, but nothing happend. from PySide2 import QtWidgets class…
leon52
  • 99
  • 11
3
votes
1 answer

How to reference custom role indices between Python and QML

I am implementing a QAbstractListModel in class in python for use in QML. I've defined two custom roles in the model. In the model I've also implemented a Slot function 'get' to return data from a specified index and role. When I pass the role back…
Matt Brauer
  • 211
  • 4
  • 13
3
votes
1 answer

Pyinstaller error after updating latest PySide

I have a working python(3.6.8) and Pyside(5.12.0) application. Previously I was able to create one file exe and its run fine. But after updating Pyside to 5.12.2 I am not able to run app. there is ModuleNotFoundError: No module named…
Rajiv Sharma
  • 6,746
  • 1
  • 52
  • 54
3
votes
1 answer

Register Enums for QML in PySide2

I'd like to export enums from Python to QML using PySide2. It is possible using PyQt5 see PyQt5 && QML exporting enum However the required Q_ENUMS does not exist in PySide2. Is there another way in PySide2?
oversize
  • 51
  • 4
3
votes
1 answer

PySide2 with Pyinstaller: Failed to execute script pyi_rth_pkgres

so I have been using Pyinstaller the last couple of months to package and distribute my applications as single exe files, however I recently made the switch from using Tkinter in my GUI apps to using PySide2 (QT5 Wrapper). The thing is, I'm not able…
3
votes
0 answers

AttributeError: 'PySide2.QtCore.Qt.Alignment' object has no attribute 'testFlag'

I am using Pyside2. I get the error AttributeError: 'PySide2.QtCore.Qt.Alignment' object has no attribute 'testFlag' for this piece of code if (self.m_alignment.testFlag(Qt.AlignTop)): The alignment is defined thus: m_alignment = Qt.AlignTop |…
nwagu
  • 532
  • 3
  • 17
3
votes
1 answer

Adding and removing dynamically generated QLineEdit widgets based off of user input from a QComboBox

I'm building an app to 'roll' multiple die of the same face, so if I need to roll 5 8 sided die I select 5 in the QComboBox under the label D8, then 5 QLineEdit widgets pop up with the values of the 5 'die rolls' displayed. Currently I'm able to…
3
votes
1 answer

PySide2 drag & drop functionality does not work

I have this simple script which uses PySide2 although I tried the same script with PyQt5 with the same result. I am trying to drag & drop files onto my window and get their file path: import sys from PySide2.QtWidgets import QApplication,…
Canol Gökel
  • 1,168
  • 2
  • 13
  • 29
3
votes
1 answer

Using the automatic connect slots by name

A while ago, I had been using (in a given framework at work) the automatic connect slots by name feature in Qt4, with a decorator. Something like this: self.button1 = QtWidgets.QPushButton("Click me!") ... @QtCore.Slot() def…
eddy2k
  • 119
  • 1
  • 12
3
votes
1 answer

How to load a Qt Designer file (.ui) in a QWizardPage using PySide2

I want to design my QWizardPages in Qt Designer and I want to load them into my Python program with PySide2. Previously I have been using PyQt5 without any problems but making the switch to PySide2 seems harder then expected. The problem I am facing…
Enzo
  • 81
  • 7
3
votes
1 answer

How to center widgets on scene QGraphicsScene

I want to align the scene in the middle. My problem is that when you open an application, widgets are aligned somehow below the middle, but after hovering over buttons or a label, the widgets are aligned in the middle. Can I fix this somehow? Is…
3
votes
1 answer

Internationalization (translation) of dialog and the main window in a pyqt5 application

I am trying to translate my small application written in pyside2/pyqt5 to several languages, for example, Chinese. After googling, I managed to change the main window to Chinese after select from the menu -> language -> Chinese. However, the pop up…
3
votes
0 answers

Usage of QGenericArgument / Q_ARG when using invokeMethod in PySide2

I'm trying to port a code from PyQt5 to PySide2. At a certain point, I'm using: QMetaObject.invokeMethod(dialog, "my_function", Qt.QueuedConnection, QGenericArgument.Q_ARG(str, filepath)) Nevertheless, Q_ARG is not into QGenericArgument in PySide2.…
Roman Rdgz
  • 12,836
  • 41
  • 131
  • 207
3
votes
2 answers

pyside2 connect close by Window "X" to custom exit method

I am using Qt Designer for the GUI layout and do load the .ui file into python with the help of QUILoader. I managed to connect a 'Quit' Button to my 'quit_app' method. My question is how to connect this method in the event that the user tries to…
Fab
  • 213
  • 3
  • 15
3
votes
1 answer

Pyside2 signal slots 2d array signature definition, equivalent for list of list

I am trying to connect a signal that emits a 2D array to a slot that processes that list of list. I am using @Slot(list) in my slot definition and SIGNAL("slot_method(QList>)") but that doesn't seem to work. I would like to know what…
bardao
  • 914
  • 12
  • 23