pyqt4

No module named when using PyInstaller

No module named when using PyInstaller Question: 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 warnmain.txt file in the build …

Total answers: 12

PyQt4 QWizard: How to disable the back button on a single page?

PyQt4 QWizard: How to disable the back button on a single page? Question: I would like to disable the “Back” button on a QWizard page. My Class inherits from QWizard and from a generated file. It looks somehow like this: from PyQt4 import QtGui class WizardClass(QtGui.QWizard, file.Ui_Wizard): def __init__(self, model): # Call super constructors QtGui.QWizard.__init__(self) …

Total answers: 1

How to install PyQt4 on Windows using pip?

How to install PyQt4 on Windows using pip? Question: 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 when I …

Total answers: 14

How to install PyQt4 in anaconda?

How to install PyQt4 in anaconda? Question: From the PyQt4 website their instructions for installing the package are to download the tarball and use the config file. I have two versions of Python, one is my normal system and the other is within anaconda. I’m not sure how I get this to install within anaconda. …

Total answers: 6

Cannot send posted events for objects in another thread

Cannot send posted events for objects in another thread Question: When I try to use one QDialog object from threads I get this error. Here is the code I’m using: import threading import test_qdialog from PyQt4 import QtGui, QtCore class MyThread(threading.Thread): def __init__(self, id, window, mutex): self.id = id self.window = window self.mutex = mutex …

Total answers: 2

PyQt QLineEdit and 'paste' event?

PyQt QLineEdit and 'paste' event? Question: I searched everywhere but couldn’t find an example on triggering a slot/event when text gets pasted in an PyQt4 QLineEdit ? Asked By: Stacked || Source Answers: You will have to define it yourself by overriding “keyPressEvent”. For Example: from PyQt4 import QtGui, QtCore import sys class NoteText(QtGui.QLineEdit): def …

Total answers: 3

Example of the right way to use QThread in PyQt?

Example of the right way to use QThread in PyQt? Question: I’m trying to learn how to use QThreads in a PyQt Gui application. I have stuff that runs for a while, with (usually) points where I could update a Gui, but I would like to split the main work out to its own thread …

Total answers: 3

Injecting function call after __init__ with decorator

Injecting function call after __init__ with decorator Question: 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 off a reference to …

Total answers: 4

How to make PyQt window state to maximised in pyqt

How to make PyQt window state to maximised in pyqt Question: I am using PyQt4 for GUI in my application. I want to know how can make my window maximized by default. I goggled but did not found an alternate. I tried using below code, but its not for maximized instead it resizes the window …

Total answers: 3

How to create filters for QTableView in PyQt

How to create filters for QTableView in PyQt Question: 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 values in of …

Total answers: 4