Questions tagged [pyside]

Questions about using PySide, a Python Qt bindings project.

The PySide project provides LGPL-licensed Python bindings for the Qt cross-platform application and UI framework. PySide Qt bindings allow both free open source and proprietary software development and ultimately aim to support all of the platforms as Qt itself.

3517 questions
1
vote
1 answer

How to change current color group for QPalette

I'm trying to change the current color group fora QPalette, but it seems that the setCurrentColorGroup method of QPalette simply does not work. I'm running this code: app = QtGui.QApplication(sys.argv) button = QPushButton() svgWidget =…
Guillermo Ares
  • 197
  • 1
  • 12
1
vote
0 answers

PySide2 QtGui.QDesktopServices.openUrl() Error on macOS Seirra

I am Following the steps from PySide2 with Qt5.6 to install PySide2 on macOS sierra 10.12.2. because installing PySide2 through Home-brew is failing. Building and installing the PySide2 works fine. The problem is while importing the class…
Rahul.Shikhare
  • 179
  • 1
  • 16
1
vote
1 answer

QTreeView calls QAbstractItemModel::hasChildren() even for invisible items

I have a custom tree model with many items. It has more than 1000000 items at the first level below the top level. When I expand this level in a QTreeView it calls model.hasChildren() for each of these items even though the items are not visible…
1
vote
1 answer

Add child with multiple columns to qtreeview in pyside

How do I add children nodes as seen in the image below. I know how to add a single row and a child. However I get stuck when trying to add a child node that has a checkbox in the second column. import sys import os from PySide import QtGui,…
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
1
vote
1 answer

PySide2 new Signal and Slot connection

There was a recent update in PySide2 and now all of my apps are broken. I have code like this... from PySide2.QtCore import * class Saver(QObject): …
noel
  • 2,257
  • 3
  • 24
  • 39
1
vote
1 answer

Why does shiboken2 ignore C++11 style callback?

I have a C++ library that uses C++11 style callback for functions. The callback definition inside a class is like this: template using Callback = std::function; I am trying to create a Python wrapper via…
Mohsen
  • 661
  • 1
  • 6
  • 10
1
vote
1 answer

Text in QTextEdit is distorted

I have a QTextEdit in which I want to set some text (unicode) that has been generated by an ASCII Art text renderer. Everything works fine, except that the QTextEdit is distorting the text. The screenshot shows the same unicode text variable set in…
timmwagener
  • 2,368
  • 2
  • 19
  • 27
1
vote
1 answer

How do I add a layout to a Qtablewidget in pyqt?

I have my qtablewidget defined like this: def __init__(self, parent = None): super(Window, self).__init__(parent) QtGui.QWidget.__init__(self) QtGui.QTableWidget.setMinimumSize(self, 500, 500) …
answerSeeker
  • 2,692
  • 4
  • 38
  • 76
1
vote
3 answers

How can I display json data in a qtextbox

For example I have this json data which is read in from a file: {"name": "Gilbert", "wins": [["straight", "7"], ["one pair", "10"]]} How can I then display this in an edit text box with formatted indentations { "name":"Gilbert", "wins":[ …
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
1
vote
2 answers

How to set checked/unchecked multiple selected rows of a QTableView

I'm attempting to apply the principle outlined in the following post, but for the CheckStateRole of my model (which is defined both in the data/setData methods of my model): how can i achieve to update multiple rows in a qtableview However, I…
Klaudikus
  • 382
  • 3
  • 12
1
vote
1 answer

Stay window on the top with PySide

I have got an app which is written in Pyside. I would like to use a checkbox to my app window show always on the top. class RemoteWindow(QtGui.QMainWindow): """ This is the main window for the capacitiveRemote which contains the remote itself for…
pylearner
  • 537
  • 2
  • 8
  • 26
1
vote
1 answer

PySide connecting to Signal right after initialisation

Problem I have a class with a signal which is emitted during initialisation from PySide.QtCore import * class Example(QObject): signal = Signal() def __init__(self): super().__init__() self.signal.emit() now i want to…
johnson
  • 3,729
  • 3
  • 31
  • 32
1
vote
1 answer

Should I use a single database connection for my PySIde application?

I am writing a GUI application with PySide. It has a few tables that get populated with data from a database, by pushing the corresponding buttons. I thought of using a single database connection when the application starts and pass conn and cursor…
IordanouGiannis
  • 4,149
  • 16
  • 65
  • 99
1
vote
0 answers

Memory leak with PySide QGraphicsPixmapItem in Python 3.4

In my PySide app I repeatedly update a QGraphicsPixmapItem with a new pixmap that I create from a (always differently scaled) numpy array: # Once: from PySide import QtGui self._image_pixmap_item = self._scene.addPixmap(QtGui.QPixmap(width,…
Alex SR
  • 11
  • 3
1
vote
1 answer

Reliable QWidget to QImage coordinate transformation?

Mouse click events include click coordinates that are relative to the QWidget window in which the click occurred. Assuming that the widget is displaying an image (i.e. the QWidget contains a QLabel whose QPixmap was built from a QImage), how can the…
MWB
  • 11,740
  • 6
  • 46
  • 91