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

PyQt4: Difference between QWidget and QMainWindow

When reading through a PyQt4 tutorial, sometimes the examples uses QtGui.QMainWindow, sometimes it uses QtGui.QWidget. Question: How do you tell when to use which? import sys from PyQt4 import QtGui class Example(QtGui.QMainWindow): def…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
19
votes
1 answer

What is the easiest way to achieve realtime plotting in pyqtgraph

I do not get how to achieve realtime plotting in pyqtgraph. The realisation of that is not implemented in the documentation yet. Could anyone please provide an easy example ?
dan_0
  • 599
  • 1
  • 5
  • 17
18
votes
5 answers

Get active window title in X

I'm trying to get the title of the active window. The application is a background task so if the user has Eclipse open the function returns "Eclipse - blabla", so it's not getting the window title of my own window. I'm developing this in Python 2.6…
dutt
  • 7,909
  • 11
  • 52
  • 85
18
votes
1 answer

How to use Qt Model/View framework with the Graphics View framework

I am working on a mapping application and need to display the data objects using a table, a form and as graphical objects in the map. I'm using PyQt, but that's not really important as this is a Qt question not a Python question. If I only needed…
Simon Hibbs
  • 5,941
  • 5
  • 26
  • 32
18
votes
7 answers

How to place an icon onto a QLineEdit?

There is a Search field with the magnification-lens and a greyed out "search" keyword at the top right corner of stackoverflow.com web site: I wonder if it is possible to achieve a same appearance with QLineEdit. If so then how?
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
18
votes
2 answers

Add QWidget to QListWidget

I am trying to make a QListWidget in which each item is a simple widget that contains text and a pushbutton. I use the following: itemN = QtGui.QListWidgetItem() #Create widget widget = QtGui.QWidget() widgetText = QtGui.QLabel("I love…
eric
  • 7,142
  • 12
  • 72
  • 138
18
votes
8 answers

PyQt4 center window on active screen

How I can center window on active screen but not on general screen? This code moves window to center on general screen, not active screen: import sys from PyQt4 import QtGui class MainWindow(QtGui.QWidget): def __init__(self): …
Applejohn
  • 315
  • 1
  • 2
  • 5
18
votes
3 answers

QT4: Is it possible to make a QListView scroll smoothly?

I have a QListView in Icon mode with lots of icons, so that a scrollbar appears, but the scrolling is not smooth and this IMHO confuses the user since it jumps abruptly from one point to another at each scroll. I would like to make the scrolling…
Massimiliano Torromeo
  • 1,801
  • 1
  • 15
  • 17
18
votes
4 answers

Injecting function call after __init__ with decorator

I'm trying to find the best way to create a class decorator that does the following: Injects a few functions into the decorated class Forces a call to one of these functions AFTER the decorated class' __init__ is called Currently, I'm just saving…
durden2.0
  • 9,222
  • 9
  • 44
  • 57
18
votes
4 answers

How to create filters for QTableView in PyQt

I am using QTableView to display data retrieved from QtSql.QSqlQuery I want to know how can i create filters for it like in excel. In the above image i need to get the filters for All heders (Sh_Code,SH_Seq,Stage) The filters will have unique…
Rao
  • 2,902
  • 14
  • 52
  • 70
18
votes
5 answers

simple IPython example raises exception on sys.exit()

I'm doing some very simple PySide (and PyQt) tutorials in IPython. One tutorial just creates a window with some sliders to demonstrate slots and signals. When I close the window of the running demo application, I see this error: An exception has…
MountainX
  • 6,217
  • 8
  • 52
  • 83
17
votes
1 answer

Adding items to QlistView

I'm using pyqt4 with python 2.7 and I have a list view widget that I can't add items to it # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'add_category.ui' # # Created: Mon Mar 19 23:22:30 2018 # by: PyQt4 UI…
Ahmed Wagdi
  • 3,913
  • 10
  • 50
  • 116
17
votes
0 answers

Using PyQt for Front End Web Development

I have written a single-script (i.e. full-stack) GUI in PyQT which queries an SQL database, performs some functions with the query outputs and then displays these outputs graphically in a QtGui.QApplication. However, I have decided that I would like…
Sadie LaBounty
  • 379
  • 1
  • 5
  • 23
17
votes
6 answers

pyinstaller error: OSError: Python library not found: libpython3.4mu.so.1.0, libpython3.4m.so.1.0, libpython3.4.so.1.0

I'm using Python 3.4.4 on Centos7. I've created a python program on my local machine that makes use of qt modules. The program is running fine on my local machine. I'm now trying to create an executable with pyinstaller. I'm using the…
neilH
  • 3,320
  • 1
  • 17
  • 38
17
votes
1 answer

How to connect pyqtSignal between classes in PyQT

How to connect pyqtSignal between two different objects (classes) PROPERLY? I mean best practice. Look what I have done to achieve the goal: The Thermometer class is notified when Pot increases its temperature: from PyQt4 import QtCore class…
Ondrej Vencovsky
  • 3,188
  • 9
  • 28
  • 34