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.

3112 questions
70
votes
6 answers

PyQt or PySide - which one to use

I started learning a bit of python and would now like to toy around a bit with gui-building. Qt seems to be a good choice because of its cross-platformishness. Now there seem to be two bindings available: PyQt by Riverbank Computing and PySide,…
shutefan
  • 4,106
  • 5
  • 19
  • 23
59
votes
13 answers

Is it possible to add PyQt4/PySide packages on a Virtualenv sandbox?

I'm using Virtualenv with profit on my development environment with web.py, simplejson and other web oriented packages. I'm going to develop a simple python client using Qt to reuse some Api developed with web.py. Does anybody here had succesfully…
systempuntoout
  • 65,753
  • 43
  • 162
  • 239
41
votes
3 answers

Is the PySide Slot Decorator Necessary?

I've seen some example code for PySide slots that uses the @QtCore.Slot decorator, and some that does not. Testing it myself, it doesn't seem to make a difference. Is there a reason I should or should not use it? For example, in the following…
JasonFruit
  • 7,283
  • 4
  • 42
  • 60
34
votes
1 answer

How to set QComboBox to item from item's text in PyQt/PySide

Is it possible to set QComboBox to an item knowing only an item's text value? I am trying to avoid looping through for i in range(myCombobox.count()) just to find an item's index so it could be used to set the current index.
alphanumeric
  • 13,847
  • 39
  • 164
  • 305
33
votes
1 answer

MVC design with Qt Designer and PyQt / PySide

Python newbie coming from Java (+SWT/Windowbuilder) and am having difficulty working out how to properly code a large desktop app in Python/Qt4(QtDesigner)/PySide. I would like to keep any view logic in a controller class outside the .ui file (and…
Don Smythe
  • 6,656
  • 13
  • 50
  • 90
29
votes
4 answers

Loading QtDesigner's .ui files in PySide

I am looking for a simple example of how to directly load a QtDesigner generated .ui file into a Python application. I simply would like to avoid using pyuic4.
denysonique
  • 14,089
  • 6
  • 34
  • 39
27
votes
2 answers

PySide / PyQt detect if user trying to close window

is there a way to detect if user trying to close window? For example, in Tkinter we can do something like this: def exit_dialog(): #do stuff pass root = Tk() root.protocol("WM_DELETE_WINDOW", exit_dialog) root.mainloop() Thanks.
SaulTigh
  • 763
  • 2
  • 13
  • 27
27
votes
3 answers

How do i resize the contents of a QScrollArea as more widgets are placed inside

I have a QScrollArea Widget, which starts empty; It has a vertical layout, with a QGridLayout, and a vertical spacer to keep it at the top, and prevent it from stretching over the whole scroll area; Elsewhere in the program, there is a QTextEdit,…
will
  • 8,940
  • 6
  • 40
  • 63
26
votes
3 answers

How to add items to a QComboBox in PyQt/PySide

I need some help adding some items to a QComboBox. So I have two comboboxes, and one populates the other depending on the item selected. My question is that, using additem for new items, it works, but if I choose another option for the combobox, it…
IordanouGiannis
  • 3,541
  • 12
  • 52
  • 87
26
votes
7 answers

Are there default icons in PyQt/PySide?

I'm reading a tutorial on PySide and I was thinking , do I need to find my own icons for every thing or is there some way to use some built in icons . That way I wouldn't need to find an entire new set of icons if I want my little gui to run on…
user1155844
  • 521
  • 1
  • 5
  • 10
25
votes
3 answers

Prototyping Qt/C++ in Python

I want to write a C++ application with Qt, but build a prototype first using Python and then gradually replace the Python code with C++. Is this the right approach, and what tools (bindings, binding generators, IDE) should I use? Ideally, everything…
tstenner
  • 9,119
  • 10
  • 48
  • 83
24
votes
1 answer

PySide: Removing a widget from a layout

I'm trying to remove a Qt widget from a layout in a PySide application. Here is a minimal example. It is a widget with 5 buttons in it, and the middle one is supposed to remove itself when clicked: import sys from PySide import QtGui app =…
Etienne Perot
  • 4,174
  • 7
  • 34
  • 50
24
votes
6 answers

PySide - PyQt : How to make set QTableWidget column width as proportion of the available space?

I'm developing a computer application with PySide and I'm using the QTableWidget. Let's say my table has 3 columns, but the data they contain is very different, like (for each row) a long sentence in the first column, then 3-digit numbers in the two…
AdrienW
  • 1,951
  • 2
  • 18
  • 42
24
votes
1 answer

QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout

I want to create some tabs, and I read this answer: How to add a tab in PySide I use the code in the answer and made some changes. Cause my code has to read some files and get the name of my tabs from those file, so that I add a for loop in my code.…
EricBkc
  • 279
  • 1
  • 3
  • 10
23
votes
3 answers

Getting PySide to work with matplotlib

I have tried running the example code on the SciPy website, but I get this error: Traceback (most recent call last): File ".\matplotlibPySide.py", line 24, in win.setCentralWidget(canvas) TypeError:…
jbbiomed
  • 7,081
  • 5
  • 19
  • 24
1
2 3
99 100