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

Why does my pyinstaller created executable require admin privileges?

I've written a Python program which I distribute using pyinstaller. I've been using the onefile option so far to create a standalone executable. That's been great up until now, but as the application has grown the startup time is getting a bit…
Whatang
  • 9,938
  • 2
  • 22
  • 24
15
votes
3 answers

How to get the original python data from QVariant

I am just learning python and Qt these days. So please consider that this will be a newbie question, but I am stuck here. import sys from PyQt4.QtCore import * data1 = 'string' data2 = QVariant(data1) data3 = data2.toPyObject() I expected data3 is…
Jonas Hong
  • 275
  • 1
  • 2
  • 7
15
votes
3 answers

dynamically adding and removing widgets in PyQt

using PyQt, I am trying to create an interface for which I can add or remove widget dynamically. I want to define a separate class for the widget that will be added or removed. I can't seem to be able to get the widget that I instantiate to display…
boundless
  • 151
  • 1
  • 1
  • 3
15
votes
2 answers

How do you set the column width on a QTreeView?

Bear with me, I'm still new to QT and am having trouble wrapping my brain around how it does things. I've created and populated a QTreeView with two columns: class AppForm(QMainWindow): def __init__(self, parent = None): super(AppForm,…
ashground
  • 239
  • 2
  • 3
  • 10
15
votes
1 answer

PyQt: Change GUI Layout after button is clicked

Okay, I am jumping from Tkinter to PyQt, because PyQt is just so much more advanced, and nicer to work with. BUT! I am having some troubles here. I am trying to change the GUI layout after I press one of my buttons on the main screen. I press the…
Tyrell
  • 896
  • 7
  • 15
  • 26
15
votes
6 answers

PIL Image to QPixmap conversion issue

I've been struggling with this challenge for the best of today, I've managed to get a good point using previous posts and other resources. I'm trying to convert a PIL.Image to a QPixmap so that I can display using a QgraphicsScene on my PyQT GUI.…
Pys3nberg
  • 181
  • 1
  • 2
  • 9
15
votes
1 answer

Communication between threads in PySide

I have a thread which produces some data (a python list) and which shall be available for a widget that will read and display the data in the main thread. Actually, I'm using QMutex to provide access to the data, in this way: class Thread(QThread): …
AkiRoss
  • 11,745
  • 6
  • 59
  • 86
15
votes
6 answers

how code a Image button in PyQt?

Im trying to do simple audio player, but I want use a image(icon) as a pushbutton.
Alquimista
  • 862
  • 2
  • 10
  • 24
15
votes
3 answers

How can I add a Picture to a QWidget in PyQt4

How can I add or import a picture to a QWidget? I have found a clue. I can add a Label and add a Picture in that label. I need the arguments for the QPicture(). The probable I can use is, QLabel.setPicture(self.QPicture).
V.Sindhuja
  • 151
  • 1
  • 1
  • 3
14
votes
2 answers

How to get RGB values of QPixmap or QImage pixel - Qt, PyQt

Based on this answer https://stackoverflow.com/a/769221/544721 , I've made following code printing values in grabbed region: import sys from PyQt4.QtGui import QPixmap, QApplication app = QApplication(sys.argv) # img is QImage type img =…
Grzegorz Wierzowiecki
  • 10,545
  • 9
  • 50
  • 88
14
votes
2 answers

Multiple files AND folder selection in a QFileDialog?

I am using pyQt4 and want to have a Browse button in my GUI which opens up a Dialog box allowing user to select multiple files AND folders. I have researched quite a bit but din't find any way to be able to do this. The…
sahilgupta
  • 145
  • 1
  • 1
  • 8
14
votes
1 answer

Right click contextMenu on QPushButton

For my app I have created a GUI in Qt Designer and converted it into python(2.6) code. On some of the QPushButton (created with the designer) I want to add a right click context menu. The menu options depend on the application status. How to…
ArtDijk
  • 1,957
  • 6
  • 23
  • 31
14
votes
4 answers

How to align the text to center of cells in a QTableWidget

I am using PyQt based on Qt4. My Editor is PyCharm 2017.3 and my python version is 3.4. I am scraping some text from a website. I am trying to align that text to the center of the cell in a QTableWidget. item =…
royatirek
  • 2,437
  • 2
  • 20
  • 34
14
votes
7 answers

Hide PyQt app from taskbar

I'm a beginner in PyQt. I was trying to create a simple app to try some of the toolkit's many features. My question is, how can I hide the app icon from the taskbar? I don't want the user to be able to see the icon in taskbar and to minimize it…
eternalthinker
  • 532
  • 6
  • 16
14
votes
1 answer

Pyqt4-pyqtgraph application recursively opens new instances of itself

I forked BMDanalyse for my project and have modified it. Setup Instructions in case you need a hand. Actual question follows this. A 64-bit system is required due to memory requirements. Please ensure you have 64bit Python 2.7. The following setup…
Frikster
  • 2,755
  • 5
  • 37
  • 71