qt4

How can I intercept when a widget loses its focus

How can I intercept when a widget loses its focus Question: I have a QPlainTextEdit and want to process the content when it loses focus. I’ve seen that I can either do this with the focusChanged event or with the focusOutEvent virtual function. I don’t know how to pass parameters with the new syntax (i.e. …

Total answers: 1

sphinx – how to change documentation style sheet

sphinx – how to change documentation style sheet Question: I generated the Python documentation with sphinx to view it on Qt Assistant, but the theme used by the Python developers for their documentation seems to have some problems on Qt Assistant, Is there a way to override/change the theme before generating the documentation? Thanks! P.S.: …

Total answers: 2

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

How to display PDF with python-poppler-qt4?

How to display PDF with python-poppler-qt4? Question: I have downloaded and installed python-poppler-qt4 and I am now trying out a simple Qt application to display a PDF page. I’ve followed what I’ve been able to get from the web, i.e. convert the PDF to a QImage, then to a QPixMap, but it doesn’t work (all …

Total answers: 2

Triple inheritance causes metaclass conflict… Sometimes

Triple inheritance causes metaclass conflict… Sometimes Question: Looks like I stumbled upon a metaclass hell even when I didn’t wanted anything to do with it. I’m writing an app in Qt4 using PySide. I want to separate event-driven part from UI definition, which is generated from Qt Designer files. Hence I create a “controller” classes, …

Total answers: 2

How can I move file into Recycle Bin / trash on different platforms using PyQt4?

How can I move file into Recycle Bin / trash on different platforms using PyQt4? Question: I would like to add the next feature to my cross-platform PyQt4 application: when user selects some file and select “remove” action on it that file will be moved to Recycle Bin folder instead of being permantly removed. I …

Total answers: 3

PyQt sending parameter to slot when connecting to a signal

PyQt sending parameter to slot when connecting to a signal Question: I have a taskbar menu that when clicked is connected to a slot that gets the trigger event. Now the problem is that I want to know which menu item was clicked, but I don’t know how to send that information to the function …

Total answers: 6