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

How to make QTableWidget's columns assume the maximum space?

The columns of my QTableWidget do not fill in the space of the table, so that an empty space is left on the right hand-side. How to make the columns of my QTableWidget assume the maximum space so as to fill in this space?
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
12
votes
5 answers

PyQt: how to handle auto-resize of widgets when their content changes

I am having some issues with the size of qt4 widgets when their content changes. I will illustrate my problems with two simple scenarios: Scenario 1: I have a QLineEdit widget. Sometimes, when I'm changing its content using QLineEdit.setText(), the…
PyCoder
12
votes
4 answers

PyInstaller won't load the PyQt's images to the GUI

I've been having some complications to pass my script into an executable, but I finally managed to. The main problem is that PyInstaller doesn't load the images to the GUI. This is how it should look like: This is how it looks like: And I can't…
Leandro Poblet
  • 369
  • 1
  • 2
  • 11
12
votes
5 answers

What are the advantages of PyQt over PyGTK and vice-versa?

I have an application whose GUI is to be remade for ergonomic reasons. It was written in PyGTK and I am wondering if I should switch to PyQt to ease future developments or not. This application has a mostly classical UI with buttons, toolbars,…
Xion345
  • 1,627
  • 12
  • 26
12
votes
3 answers

Showing a .gif animation in QLabel

I would like to show a .gif animation in a QLabel widget, alongside text. The following code won't work: self.status_txt = QtGui.QLabel('Loading... ') as the image won't animate. I tried achiving it by using a QMovie…
iTayb
  • 12,373
  • 24
  • 81
  • 135
11
votes
4 answers

argument 1 has unexpected type 'Ui_mainWindow'

I'm trying to make a GUI for a small program I wrote with the help of some people from here, anyway, I made the GUI in PyQt and it looks fine. I added a button called dirButton that says "Choose Directory" self.dirButton =…
Anteara
  • 729
  • 3
  • 14
  • 33
11
votes
2 answers

PyQt4 names showing as undefined in eclipse, but it runs fine

I am using Eclipse 3.7.1 with the latest PyDev add-in for Python coding. I am using PyQt4. At the top of my file I have: from PyQt4.QtCore import * from PyQt4.QtGui import * In addition, I have the PyQt4 tree included in the Project Explorer…
Kevin Buchs
  • 2,520
  • 4
  • 36
  • 55
11
votes
2 answers

How to install Qt documentation for PyQt demo and Qt tools

I installed PyQt on windows 7 with python 2.6 and when trying to execute the demo I got the following warning: After some research I could obtain a copy of the Qt4 documentation in .qch format that works with Qt Assistant. How documentation has…
joaquin
  • 82,968
  • 29
  • 138
  • 152
11
votes
3 answers

PyQt: Changing cursor when hovering a button

I'm trying to make a button (or any other Qwidget), That will change users cursor when hovered. So for instance, when i hover QPushButton, it will change cursor from Arrow to Pointing Hand. I am using Qt Style Sheet, so i'm not entirely sure, but…
ShellRox
  • 2,532
  • 6
  • 42
  • 90
11
votes
3 answers

Matplotlib animation inside your own GUI

I'm writing software in Python. I need to embed a Matplotlib time-animation into a self-made GUI. Here are some more details about them: 1. The GUI The GUI is written in Python as well, using the PyQt4 library. My GUI is not very different from…
K.Mulier
  • 8,069
  • 15
  • 79
  • 141
11
votes
2 answers

Bold font in Label with setBold method

Can't make Bold font for label. What is wrong with my code? self.label = QtGui.QLabel('Bla', self) self.label.setFont(QtGui.QFont.setBold(True))
D.Sokolov
  • 113
  • 1
  • 1
  • 4
11
votes
4 answers

PyQt4: How to pause a Thread until a signal is emitted?

I have the following pyqtmain.py: #!/usr/bin/python3 import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from pyqtMeasThread import * class MainWindow(QMainWindow): def __init__(self, parent=None): self.qt_app =…
2342G456DI8
  • 1,819
  • 3
  • 16
  • 29
11
votes
1 answer

PyQt progress bar not updating or appearing until 100%

EDIT: There are a number of similar posts on PyQt4 progress bars not updating. They all focus on the issue of threads & where the program actually updates the window. Although helpful, my code was so structured that the replies were not practical.…
DrBwts
  • 3,470
  • 6
  • 38
  • 62
11
votes
2 answers

How to hide a layout in PyQt?

My code contains a vertical box layout which is a combination of a vertical box layout in left and one at right. I was wondering if there is a way to hide the left layout with all its widgets when a certain signal is emitted.
sparrow
  • 297
  • 1
  • 5
  • 16
11
votes
1 answer

pyqt qt4 How to add a tiny arrow/collapse button to QSplitter

You can customize the thickness and background image of the splitter handle http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qsplitter But is there a way to add a small graphical arrow button so when the user clicks on it, I can…
user178047
  • 1,264
  • 15
  • 20