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
12
votes
3 answers

How can I get QListWidget item by name?

I have a QListWidget which displays a list of names using PyQt in Python. How can I get the QListWidgetItem for a given name? For example, if I have the following QListWidget with 4 items, how can I get the item which contains text = dan?
panofish
  • 7,578
  • 13
  • 55
  • 96
12
votes
1 answer

Placeholder text not showing (pyside/pyqt)

Learning PySide, I'm tweaking a text edit widget (QLineEdit) and trying to set the placeholder text using setPlaceHolderText as in the code snippet below (which I invoke from main). Unfortunately, it is not working as I expected. The code runs, but…
eric
  • 7,142
  • 12
  • 72
  • 138
12
votes
4 answers

Why won't QToolTips appear on QActions within a QMenu

I'm doing an app with in GUI written with PySide. I set a QMenu on a QPushButton, added several QActions via QMenu.addAction. To further explain these actions to the user I added QToolTip's to these with QAction.setToolTip. When I run the GUI now my…
Max Belli
  • 167
  • 2
  • 7
12
votes
2 answers

Autocomplete and suggesstion in QML textInput element

I have a QML textInput element like this: TextBox.qml FocusScope { id: focusScope property int fontSize: focusScope.height -30 property int textBoxWidth: parent.width * 0.8 property int textBoxHeight: 45 property string…
Vahid Kharazi
  • 5,723
  • 17
  • 60
  • 103
12
votes
4 answers

How to delete QTreeWidgetItem

Several webpages say that QTreeWidgetItem can be deleted by deleting or QTreeWidget.clearing. But my code sample below doesn't seem to do so. Am I doing anything wrong? #!/usr/bin/python import sys from PySide.QtGui import QApplication, QWidget,…
IsaacS
  • 3,551
  • 6
  • 39
  • 61
12
votes
3 answers

Elegant command line argument parsing for PyQt

I'm writing a new PyQt app. I'm trying to do everything related to the program and ui using as much of the PyQt APIs as possible as a means to improve my knowledge of PyQt and Qt in general. The question I have is, is there an API within PyQt/Qt to…
troy.unrau
  • 1,142
  • 2
  • 12
  • 26
11
votes
1 answer

PyQt (PySide), WebKit and exposing methods from/to Javascript

I am planning to use PyQt to control an embedded WebKit browser on the server side. I have some inherit application logic in Javascript in the HTML page running inside WebKit. How could I communicate from the host process (Python, PyQt) with…
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
11
votes
1 answer

How to change the window title in pyside?

I have read the documentation on the following matter, but Qt is so overwhelmingly complex I might have missed the piece. I have created a QMainWindow and set a title using self.setWindowTitle. Later in the code I want to simply change this title…
Alex
  • 41,580
  • 88
  • 260
  • 469
11
votes
3 answers

How to install Pyside for Python 2.7?

Hey I am pretty new to Pyside and am not sure how to download it or Qt? I have a 64-bit Windows computer and am wondering what I need to download once I have downloaded Qt because there is a checklist for like Qt 5.3, Qt 5.2.1, etc. and I am not…
zzirrgrizz
  • 133
  • 1
  • 1
  • 8
11
votes
3 answers

QImage to Numpy Array using PySide

I am currently switching from PyQt to PySide. With PyQt I converted QImage to a Numpy.Array using this code that I found on SO: def convertQImageToMat(incomingImage): ''' Converts a QImage into an opencv MAT format ''' incomingImage =…
Mailerdaimon
  • 6,003
  • 3
  • 35
  • 46
11
votes
1 answer

PySide: set width of QVBoxLayout

With PySide, I have a set of QWidget in a QVBoxLayout vlayout = QVBoxLayout() vlayout.addWidget(self.a_label) vlayout.addWidget(self.a) I can set the width of widget with self.a.setFixedWidth(60) but If I try set the width of QVBoxLayout with…
JuanPablo
  • 23,792
  • 39
  • 118
  • 164
11
votes
2 answers

PySide Import Error on Ubuntu 13.04

while trying just to import from PySide import QtGui I'm getting the following error: ImportError: libpyside-python2.7.so.1.2: cannot open shared object file: No such file or directory ls …
Moonwalker
  • 2,180
  • 1
  • 29
  • 48
11
votes
1 answer

How QApplication() and QWidget() objects are connected in PySide/PyQt?

How QApplication() and QWidget() are connected? This is an example code that I copied, it creates QApplication object and QWidget object, but there is no link between the two objects. I expected something like app.setWidget(did) to teach PySide/PyQt…
prosseek
  • 182,215
  • 215
  • 566
  • 871
11
votes
4 answers

Application icon in PySide GUI

I have a PySide GUI app (written in Python 3, running on Windows 7 Pro) in which I’m setting the application icon as follows: class MyGui(QtGui.QWidget): def __init__(self): super(MyGui, self).__init__() ... …
Praetorian
  • 106,671
  • 19
  • 240
  • 328
11
votes
1 answer

reading pyqt stylesheet from external qss file

I have made a qss file of pyqt stylsheet and how am i supposed to call the file content and fed to self.setStylesheet(..) from PyQt4 import QtCore s = QtCore.QString('c:\myProject\darkFantasy.stylesheet') the above code loads the path string rather…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197