Questions tagged [pyqt4]

PyQt is a set of Python bindings for Qt application framework and runs on all platforms supported by Qt including Windows, MacOS/X and Linux.

PyQt is developed by Riverbank Computing.

It is available on all platforms under a variety of licenses including the GNU GPL (v2 and v3) and a commercial license.

Unlike Qt, PyQt v4 is not available under the LGPL.

5631 questions
121
votes
14 answers

How to install PyQt4 on Windows using pip?

I'm using Python 3.4 on Windows. When I run a script, it complains ImportError: No Module named 'PyQt4' So I tried to install it, but pip install PyQt4 gives Could not find any downloads that satisfy the requirement PyQt4 although it does show up…
Anna
  • 2,645
  • 5
  • 25
  • 34
97
votes
7 answers

Background thread with QThread in PyQt

I have a program which interfaces with a radio I am using via a gui I wrote in PyQt. Obviously one of the main functions of the radio is to transmit data, but to do this continuously, I have to loop the writes, which causes the gui to hang. Since I…
gwenger
  • 1,211
  • 3
  • 12
  • 11
86
votes
3 answers

How to embed matplotlib in pyqt - for Dummies

I am currently trying to embed a graph I want to plot in a pyqt4 user interface I designed. As I am almost completely new to programming - I do not get how people did the embedding in the examples I found - this one (at the bottom) and that one. It…
ari
  • 1,122
  • 1
  • 9
  • 15
82
votes
5 answers

Unable to load files using pickle and multiple modules

I'm trying to create a user system, which uses a setting and Gui module, and when the GUI module requests for the file to load up using pickle, I keep getting an attribute error. this is from the settings module: import pickle import hashlib class…
Inthu
  • 1,009
  • 1
  • 8
  • 16
69
votes
6 answers

Should wildcard import be avoided?

I'm using PyQt and am running into this issue. If my import statements are: from PyQt4.QtCore import * from PyQt4.QtGui import * then pylint gives hundreds of "Unused import" warnings. I'm hesitant to just turn them off, because there might be…
Colin
  • 10,447
  • 11
  • 46
  • 54
67
votes
5 answers

How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux?

I started to fiddle with PyQt, and made a "beautiful" script from the pyqt whitepaper example app (pastebin) It works perfectly in Windows and Linux (with qt environment already installed on both). Now my question is: Since I am trying to use Qt…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252
66
votes
6 answers

PyQt4.QtCore.pyqtSignal object has no attribute 'connect'

I'm having issues with a custom signal in a class I made. Relevant code: self.parse_triggered = QtCore.pyqtSignal() def parseFile(self): self.emit(self.parse_triggered) Both of those belong to the class: RefreshWidget. In its parent class I…
Dane Larsen
  • 1,534
  • 2
  • 18
  • 27
64
votes
13 answers

Clear all widgets in a layout in pyqt

Is there a way to clear (delete) all the widgets in a layout? self.plot_layout = QtGui.QGridLayout() self.plot_layout.setGeometry(QtCore.QRect(200,200,200,200)) self.root_layout.addLayout(self.plot_layout) self.plot_layout.addWidget(MyWidget()) Now…
Falmarri
  • 47,727
  • 41
  • 151
  • 191
64
votes
2 answers

how to have a directory dialog

In PyQt, how does one display a file browser that shows and selects only directories (not files)? And how does one retrieve the name of the selected directory?
Moayyad Yaghi
  • 3,622
  • 13
  • 51
  • 67
63
votes
7 answers

How to pass arguments to functions by the click of button in PyQt?

I want to pass the arguments to a function when I click the button. What should I add to this line button.connect(button, QtCore.SIGNAL('clicked()'), calluser(name)) so it will pass the value to the function: def calluser(name): print name def…
uahmed
  • 631
  • 1
  • 6
  • 3
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
56
votes
4 answers

How to get text in QlineEdit when QpushButton is pressed in a string?

I am trying to implement a function. My code is given below. I want to get the text in lineedit with objectname 'host' in a string say 'shost' when the user clicks the pushbutton with name 'connect'. How can I do this? I tried and failed. How do I…
esafwan
  • 17,311
  • 33
  • 107
  • 166
50
votes
3 answers

Debugging a pyQT4 app?

I have a fairly simple app built with pyqt4. I wanted to debug one of the functions connected to one of the buttons in my app. However, when I do the following python -m pdb app.pyw > break app.pyw:55 # This is where the signal handling function…
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
47
votes
13 answers

No module named when using PyInstaller

I try to compile a Python project under Windows 7 using PyInstaller. The project works fine, there are no issues, however when I try to compile it the result doesn't work. Though I get no warnings during compilation there are many in the…
a_guest
  • 34,165
  • 12
  • 64
  • 118
45
votes
4 answers

How do you get the current text contents of a QComboBox?

Using pyqt4 and python 2.6, I am using a qcombobox to provide a list of options. I am having problems with using the selected option. I have been able to use a signal to trigger a method when the option is selected, but the problem is that when the…
Ben
  • 5,525
  • 8
  • 42
  • 66
1
2 3
99 100