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

Exposing QML Components to each other in Qt Creator

I'm developing a dashboard application using Qt-Quick with PySide2 and am having trouble exposing my QML components in Qt Creator's design mode. My folder structure looks something like this: myapp/ ├── mycomponents │   ├── component1.qml │   └──…
Keli
  • 31
  • 4
3
votes
2 answers

Unable to emit signal from QtGui.QStandardItem

I'm attempting to override QTreeView to handle adjusting parents and children if the checkbox is modified. I'm not able to emit a signal however, and I'm not sure if it's because I'm trying to subclass QtGui and not QtWidgets. Here is the code that…
Peter
  • 3,186
  • 3
  • 26
  • 59
3
votes
2 answers

How to instruct PySide2 application to use qt5ct settings?

I'm experimenting with very simple PySide2 tutorial examples and noticed that the style and font size are very different from the style of "normal" Qt applications. I'm using qt5ct in Linux Mint 18 but PySide2 app ignores the settings: The…
yesint
  • 145
  • 9
3
votes
3 answers

disable wheel in QSpinBox

I have a number of spinboxes in my PySide project and I would like to change the behavior so the so user is required to click in the field to change the value and then press the enter key. I would like to disable scroll wheel behavior for the…
winteralfs
  • 459
  • 6
  • 25
3
votes
1 answer

Pyside2 How can i move box?

I want to move my SimpleItem object if I move mouse pressing left button. I have successed getting the position of mouse cursor if I press the object. but I have no idea how to move the item to that position. Could you help me? import sys from…
holahola
  • 83
  • 1
  • 8
3
votes
1 answer

Using QSignalMapper

I tried to make a simple example to help understand how the concept of QSignalMapping works in PySide. I would like to dynamically create a series of buttons by iterating through a loop, and when the user pushes one of the buttons, I can activate a…
winteralfs
  • 459
  • 6
  • 25
3
votes
2 answers

DLL load failed when importing PySide2, only while debugging

Im facing a strange issue. I have downloaded and installed the Qt for Python library (PySide2) in the virtual environment of my project in PyCharm. I have created a dummy GUI using the Qt Designer and Im loading (.ui file) and displaying the GUI…
capitan
  • 309
  • 4
  • 13
3
votes
1 answer

PySide2 and supporting addToJavaScriptWindowObject

I am trying to port PySide application version #1 to PySide2 and struggle to find the solution for porting following code snippet: class AppManager(QtCore.QObject): ''' methods of AppObject will be available from javascript ''' def…
SpanishBoy
  • 2,105
  • 6
  • 28
  • 51
3
votes
1 answer

Unable to see app windows created by PySide2 in Spyder

I'm trying to run an app with PySide2 from Spyder 3.2.8 and Python 3.6.4 in Anaconda in a macOS 10.13.4. attempt N°1 After having seen this stackoveflow page and this github page I changed my graphic backend from Inline to Automatic in Python >…
ecjb
  • 5,169
  • 12
  • 43
  • 79
3
votes
1 answer

How to load an image with QLabel in PySide2

I'm a beginner in coding and python. I read that tkinter is a bit to "basic" if you want to develop an application which is a a bit more complicated and PyQt is problematic for licencing. This is why I chose PySide2 in order to develop this kind of…
ecjb
  • 5,169
  • 12
  • 43
  • 79
3
votes
2 answers

ModuleNotFoundError: No module named 'PySide2.QtWebKitWidgets'

I have installed Anaconda environment on CentOS and Windows. And have installed PySide2 using conda. The problem is my project run well in CentOS, but in Windows, it shows "ModuleNotFoundError: No module named 'PySide2.QtWebKitWidgets'" when run…
Jayson Reyes
  • 133
  • 1
  • 2
  • 9
3
votes
1 answer

Pyside - QGridLayout addStretch option?

I have a layout that I need the widgets pushed upwards. I know I can do this layout = QtWidgets.QVBoxLayout() layout.addWidget(test_widget) layout.addStretch() and the addStretch will push all widgets to the top. However the layout that I am…
ghost654
  • 161
  • 2
  • 18
3
votes
1 answer

Numpy array via QBuffer to QGeometry

My goal is to create a numpy array and convert its bytes data to QBuffer. I am wondering how to set properly DataSize, ByteStride, and Count. See my code below: self.mesh =…
Matphy
  • 1,086
  • 13
  • 21
3
votes
1 answer

How to set data to QComboBox using QAbstractTableModel (Model/View)?

I wish to be able to set the itemData of a combobox when populated using a QAbstractTableModel. However, I can only return one string from the model's data method. Usually, when not using a model, this can be performed like so: # Set text and…
fredrik
  • 9,631
  • 16
  • 72
  • 132
2
votes
1 answer

How to make QCombobox hide popup and keep focus when a window has Escape button as shortcut key

I have a form created using Pyside2. I have a QCombobox in a form that also has a QToolbutton. The QToolbutton has a shortcut using the Escape key to close the window if triggered. When my Combobox displays its popup and I press the Escape key the…
Ongky
  • 39
  • 1
  • 4