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

Maya python commands: modelEditor (capture flag)

I want to save viewport into an image file and then use it as an icon in a PySide2.QtGui.QIcon, this is my code: path = os.path.join(DIRECTORY, "{}.jpg".format(name)) cmds.modelEditor(self.viewport, e=True, capture=path) icon =…
0
votes
2 answers

Show progressbar in Qt with computationally heavy background process

I'm building an application that let's the user export his/her work. This is a computationally heavy process, lasting for a minute or so, during which I want to show a progress bar (and make the rest of the UI unresponsive). I've tried the…
0
votes
1 answer

QListWidget item text is not returning with If statement

I have a QListWidget. I am running this function on itemClicked, and this function is also called from different part of my program. So this function has optional argument cutrrentItemText. for some reason my code is not working. Check below…
0
votes
1 answer

Calling a model method through a subclass

What I'm trying to do, is to create a subclass of QTableView that will accept a standardized model (which is the result of a mysql query), and populate it. With it, I'd like to define a custom context menu which allows me to add or remove a row.…
pepeday
  • 89
  • 5
0
votes
1 answer

Pyside2 QScrollArea QLabel not expanding to include text

Using pyside2 and PyQt and I want to be able to do label.setText() in order to set text inside the scroll area. This seems fairly simple, but the issue is that when I run this it cuts off everything other then the first letter of the string sent to…
0
votes
0 answers

Closing PySide2 application kills QProcess - not true with PyQt4

I have a simple test PyQt4 application where i'm using a QProcess to start a program (linux) and print the stdout. When I close the PyQt4 application the child process (started by QProcess) keeps running, which is what I want. However when I run the…
Michael B
  • 153
  • 4
  • 15
0
votes
1 answer

Set a qml model and attribute from a string

I want to set a model in qml from a string representing this models name and a attribute. So in my minimal example the model is otherModel with the attribute description. And this string is part of another model myModel. In my real application i…
lixe
  • 1
  • 2
0
votes
1 answer

How to display images in PySide2?

I am trying to display image in pyside2 using QLabel. I am using Qpixmap with QLable and here I am facing some problem the method I am using it works for only few .png images and it shows this error QPixmap::scaled: Pixmap is a null pixmap for the…
Haider
  • 33
  • 6
0
votes
1 answer

Floating UI in Maya, and Button clicked connect, but the event not working

In my case, I tried to float QMainWindow in Maya. In that window, there are three buttons, and I connect the event to my function. After that, I float the window and try to click but it's not working. I want to know the reason why it is not working,…
ssong.ty
  • 1
  • 2
0
votes
1 answer

Collapsible QToolButton acts weird in QScrollArea ( probably problem with stretch )

My problem is that collapsible QToolButton is acting weird in QScrollArea. It's not my first problem with collapsible QToolButton and at first it was my layout not stretching , so I added stretching(addStretch(1)) and it started working fine. Today,…
Vlad
  • 387
  • 3
  • 17
0
votes
0 answers

QProgressDialog doesn't display well

I have some issues with the QProgressDialog class from the PySide2 lib : The progress bar doesn't display well for the first 2 steps. My code is organised as below : main.py def main(): app = QApplication(sys.argv) window = MainWindow() …
0
votes
1 answer

Implement QThread with QProgressBar in PySide (or PyQt) during calculation

I would like to know how to implement QProgressBar, which shows the progress of calculation in main thread. Please refer to below codes. import sys from PySide2.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QProgressBar from…
0
votes
0 answers

fbs project structure for PySide2 projects

Working with the excellent fbs tool (great stuff Michael!). The manual has this suggestion about project structure: As your application grows in complexity, you will likely want to split its source code across multiple files. In this case, it is…
DanielMcQ
  • 37
  • 1
  • 8
0
votes
1 answer

add pyqtgraph plot to QTDesigner with pyside2

I have a QTDesigner file with a QVBoxLayout where I try to add a GLViewWidget: I used this Embed Pyqtgraph to PySide2 example to create my code. In my application all this is embedded in an ROS enviroment. The QTDesigner QVBoxLayout: ... …
p2w2_iav
  • 81
  • 1
  • 8
0
votes
1 answer

Change design with Pyside2 - Python3

I use Python 3.7 and Pyside2. I would like to change color, font, background color... but I can not ! I import QtGui for design but I have the same error 'Window' object has no attribute 'setBrush' from PySide2.QtGui import QColor, QBrush,…
Solenne Daguerre
  • 119
  • 1
  • 2
  • 8