How to set application’s taskbar icon in Windows 7

I’ve found the answer, after some digging. In Windows 7, the taskbar is not for “Application Windows” per se, it’s for “Application User Models”. For example, if you have several different instances of your application running, and each instance has its own icon, then they will all be grouped under a single taskbar icon. Windows … Read more

PyQt4.QtCore.pyqtSignal object has no attribute ‘connect’

I had the same exact problem as you. Try moving self.parse_triggered = QtCore.pyqtSignal() out of your constructor but inside your class declaration. So instead of it looking like this: class Worker(QtCore.QThread): def __init__(self, parent = None): super(Worker, self).__init__(parent) self.parse_triggered = QtCore.pyqtSignal() It should look like this: class Worker(QtCore.QThread): parse_triggered = QtCore.pyqtSignal() def __init__(self, parent = … Read more

PyQt or PySide – which one to use [closed]

Both toolkits are actively maintained, and by now more or less equal in features and quality. There are only few, rather unimportant differences. Still, I’d recommend PySide for Python 2. It has a more reasonable API, mainly it doesn’t expose Qt types, which have a direct equivalent in Python (e.g. QString, QList, etc.) or which … Read more

What is the correct way to make my PyQt application quit when killed from the console (Ctrl-C)?

17.4. signal — Set handlers for asynchronous events Although Python signal handlers are called asynchronously as far as the Python user is concerned, they can only occur between the “atomic” instructions of the Python interpreter. This means that signals arriving during long calculations implemented purely in C (such as regular expression matches on large bodies … Read more

Linking a qtDesigner .ui file to python/pyqt?

Another way to use .ui in your code is: from PyQt4 import QtCore, QtGui, uic class MyWidget(QtGui.QWidget) … #somewhere in constructor: uic.loadUi(‘MyWidget.ui’, self) both approaches are good. Do not forget, that if you use Qt resource files (extremely useful) for icons and so on, you must compile it too: pyrcc4.exe -o ui/images_rc.py ui/images/images.qrc Note, when … Read more

Background thread with QThread in PyQt

I created a little example that shows 3 different and simple ways of dealing with threads. I hope it will help you find the right approach to your problem. import sys import time from PyQt5.QtCore import (QCoreApplication, QObject, QRunnable, QThread, QThreadPool, pyqtSignal) # Subclassing QThread # http://qt-project.org/doc/latest/qthread.html class AThread(QThread): def run(self): count = 0 while … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)