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
5
votes
0 answers

How ensure QWebEngineView is fully rendered before taking screenshot?

I want to take a screenshot of QWebEngineView for a page with a large image. When running code below red background is rendered correctly but the image is not. How can I ensure the page is fully rendered before taking a screenshot? from PySide2…
5
votes
4 answers

FigureCanvas not interpreted as QtWidget after using PyInstaller

I have a slight modified version of this example from matplotlib: https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html The only thing changed is the imports since I am using PySide2, so the imports looks like this: from PySide2…
boking
  • 145
  • 1
  • 12
5
votes
1 answer

Understanding inconsistent cythonized code behavior - PyQt5 vs. PySide2

While cythonizing some PyQt5 code, I was encountering TypeError: method() takes exactly 1 positional argument (2 given). Strangely, replacing PyQt5 with PySide2 seems to not cause this behavior. I was hoping someone could help me understand why this…
Soham Patel
  • 53
  • 1
  • 3
5
votes
3 answers

PyQt5 to PySide2, loading UI-Files in different classes

I have a python application which runs under python3.6 and is using PyQt5 for loading Ui windows. These windows were created with Qt Designer 5.9.4. The Code below shows a working example with PyQt5. Now i want to have exactly the same functionality…
Michael
  • 53
  • 2
  • 6
5
votes
1 answer

How can I send a python dictionary to a QML interface with a Signal?

I want to send dictionaries, containing data that I need to use to dynamically create qml objects, from a PySide2 class to a QML interface and since I need to do it in response to certain events, I need to use signals and slots. Since I've just…
Lando1784
  • 426
  • 1
  • 4
  • 12
5
votes
3 answers

Is it possible to expand the drawable area around the QSlider

My aim is to have a custom QSlider with tickmarks and tick labels in Python 3 using PySide2 module. In order to do so I edit the default paintEvent of the QSlider class in a derived class. However, it turns out that that the printable area is…
Vesnog
  • 773
  • 2
  • 16
  • 33
5
votes
1 answer

PySide How to see QML errors in python console?

I have the following code: if __name__ == '__main__': os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load('./QML/main.qml') if not…
Curtwagner1984
  • 1,908
  • 4
  • 30
  • 48
5
votes
2 answers

Set Vertical and Horizontal alignment in PySide2

The QSplashScreen.showMessage()method accepts an alignment flag i.e Qt.AlignLeft. What is the syntax for setting both a horizontal and vertical alignment flag? All attempts yields "too many variables" error.
user6190168
5
votes
1 answer

return python dict to QML (PySide2)

I'm trying to find a way to return a python dictionary from a PySide2.QtCore.Slot. main.py import sys from PySide2.QtCore import QObject, Slot from PySide2.QtGui import QGuiApplication, QQmlApplicationEngine class Backend(QObject): def…
Stephan
  • 143
  • 1
  • 8
5
votes
1 answer

How to detect button click inside Qwebengine in pyside2

I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is…
5
votes
1 answer

Using a custom PySide2 widget in Qt Designer

I'm searching for a way to use custom widgets in Qt Designer written with Qt for Python (PySide2) effectively. I found out, that it is possible to design the GUI with the base widget, then just swap out the class to my custom widget in the UI File…
Michael K.
  • 2,392
  • 4
  • 22
  • 35
5
votes
3 answers

PySide2 application failed to start

I just tried to test the newly released version of PySide2 (5.11) on Windows 10, 64 bit version. But the "Hello World" example does not work. I am using Python 3.6 with PyCharm. The interpreter I use is from Anaconda. So I pip installed the PySide2…
5
votes
1 answer

Shiboken2 and custom Qt widget

On Windows, I need to use in Python a few custom Qt5 widgets written in C++, and I have to use pyside2 because of its license. I have been able to compile the pyside2 library from source (together with the shiboken2 examples), but I am not able to…
gmas80
  • 1,218
  • 1
  • 14
  • 44
4
votes
1 answer

Unable to import QtGui, QtWidgets modules of PyQt5/PySide in WinPE

I'm developing a tool to be used in WinPE and have been facing an issue while using PySide2/PyQt5 in WinPE environment. While importing QtGui, it says ImportError: DLL load failed while importing QtGui: The specified module could not be found. But…
RohitM
  • 41
  • 1
4
votes
1 answer

Overriding QCompleter popup position

There have been similar questions asked about overriding the QCompleter popup position but i'll still not found a working solution. I simply want to move the popup down around 5px (I have some specific styling requirements) I've tried subclassing a…
Michael B
  • 153
  • 4
  • 15