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

PyQt - Reducing margins and spacing in widget *expands* layout

Consider the case of a QMainWindow with a QWidget as central widget. This widget has a QHBoxLayout. I add two other widgets to it, each with a QVBoxLayout. I now want to bring the Widgets inside QVBoxLayout closer to each other. The attempt is to…
ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
10
votes
2 answers

PyQt_PyObject equivalent when using new-style signals/slots?

So I have a need to pass around a numpy array in my PyQt Application. I first tried using the new-style signals/slots, defining my signal with: newChunkToProcess = pyqtSignal(np.array()), however this gives the error: TypeError: Required argument…
Jords
  • 1,855
  • 3
  • 18
  • 28
10
votes
2 answers

pyqt4: Open website in standard browser on button click

I would like to open website in standard browser of operating system when user clicks a button in my pyqt4 application. How can I do this?
PocketSam
  • 368
  • 4
  • 14
10
votes
1 answer

PyQt4 Wait in thread for user input from GUI

I have a thread class "MyThread" and my main application which is simply called "Gui". I want to create a few objects from the thread class but for this example I created only one object. The thread class does some work, then emits a signal to the…
Maecky
  • 1,988
  • 2
  • 27
  • 41
10
votes
1 answer

PyQt application with sqlalchemy database

I tried to create a PyQt application, and the data is stored into a database. I want to use sqlachemy to access my data and show the data with a model in PyQt. In this example, I used a combobox to show my data. My code "works" bad, because the…
culturoeil
  • 117
  • 1
  • 8
10
votes
2 answers

How to hide a tab in QTabWidget and show it when a button is pressed

I have already created the tabs in QtabWidget. My main purpose is to hide tabs and show it when a button is pressed. I don't want to remove and add tabs every time. I want to hide it and show when required. I have tried to do…
Leo
  • 436
  • 1
  • 3
  • 14
10
votes
2 answers

PyQt OpenGL: drawing simple scenes

Recently I have drawn simple scenes like triangles and polygon using PyOpenGL. The code was pretty straightforward, and use of different GL_TRIANGLES and GL_POLYGON didn't raise any questions. After that I've decided to add GUI to my app and…
a-a
  • 472
  • 2
  • 6
  • 20
10
votes
4 answers

Show string values on x-axis in pyqtgraph

I want to display string values for ticks on x-axis in pyqtgraph. Right now I am unable to figure out how to do that. Ex: x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, ,5, 6] pg.plot(x, y) When I try to pass the string array to the x…
coder006
  • 525
  • 1
  • 6
  • 15
10
votes
3 answers

Disable or lock text edit PyQT

I want to disable a text edit (when a button is clicked), so the user can no longer be able to add text in there. Is there any way to do that? Thanks for your help!!
HaTiMuX
  • 621
  • 2
  • 10
  • 22
10
votes
3 answers

How to Drag and Drop from One QListWidget to Another

There are two QListWIdgets sitting in a same dialog window. The DragDrop functionality has been enabled for both. If I drag and drop a file to any of two ListWidges the program recognizes it and prints out the list of the files dropped. But aside…
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
10
votes
4 answers

Busy indication with PyQt progress bar

I'm trying to write a script which will display a busy indication while performing the task. And when the task is over, the progress bar will fill to the end showing that 100% task has been completed. I just want the progress bar to show a task is…
user2420437
  • 207
  • 1
  • 2
  • 13
10
votes
2 answers

OSError: [Errno 22] Invalid argument in python3 socket

I have a problem with socket programming in Python 3. I get an exception that is not making the program crash, but is just shown in terminal. Here is my code: from PyQt4 import QtCore, QtGui from imigui import Ui_MainWindow class…
alireza
  • 1,173
  • 4
  • 19
  • 40
10
votes
5 answers

how do i place QTableWidgetItem Icon in center of cell

i want a table cell to have just an icon without any text. i see the QTableWidgetItem class has a method to align the text (int QTableWidgetItem::textAlignment () const) i find no way to adjust the placement of the icon (which seems to get stuck on…
random guy
  • 2,225
  • 6
  • 24
  • 24
10
votes
3 answers

How to remove/exclude modules and files from pyInstaller?

I'm trying to shrink the size of my python exe file, I've been looking around but I can't seem to find a good answer for removing extra modules. At the moment, I'm discovering that it's deleting modules I need instead of the ones I'm telling it to. …
ooklah
  • 491
  • 1
  • 5
  • 16
10
votes
2 answers

Widget's "destroyed" signal is not fired (PyQT)

I have a widget which would have to do some manual cleanup after it's destroyed (stop some threads). However for some reason the "destroyed" signal of the widget is not firing. I have made this small example that demonstrates the problem. import…
Scintillo
  • 1,634
  • 1
  • 15
  • 29