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
77
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
  • 6,156
  • 8
  • 23
  • 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
  • 71,966
  • 47
  • 171
  • 241
50
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,764
  • 5
  • 46
  • 61
42
votes
11 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
  • 3,092
  • 6
  • 29
  • 59
40
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
  • 913
  • 2
  • 14
  • 27
38
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
  • 17,967
  • 64
  • 244
  • 392
37
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
  • 9,234
  • 14
  • 62
  • 105
35
votes
4 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
  • 10,260
  • 6
  • 46
  • 69
34
votes
5 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
  • 16,235
  • 6
  • 37
  • 40
32
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
  • 369
  • 2
  • 4
  • 12
32
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
  • 581
  • 1
  • 5
  • 10
30
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
  • 4,149
  • 16
  • 65
  • 99
30
votes
2 answers

How to set QWidget background color?

The line w.setBackgroundRole(QPalette.Base) in the code below has no effect. Why? How do I fix that? import sys from PySide.QtCore import * from PySide.QtGui import * app = QApplication(sys.argv) w =…
Johan Råde
  • 20,480
  • 21
  • 73
  • 110
27
votes
2 answers

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,764
  • 7
  • 40
  • 50
26
votes
2 answers

Unit and functional testing a PySide-based application?

I'm building a PySide 1.1.0-based application, and have been looking for good examples to look at for unit and functional testing my application. I want to be able to do functional testing of the UI (simulating clicks, key presses, etc), unit…
Kris Hardy
  • 548
  • 4
  • 12
1
2 3
99 100