Pyqt5 Center a widget on a widget

I'm trying to center a QMessageBox widget such that its center is aligned with the parent widget's center. This just aligns the top left corners: msgBox.move(parent.pos()) I did some math to try and align the centers based on the widgets' dimensions.

PyQT5 QSystemTrayIcon enabled signal does not work

I am trying to print a text when system tray icon is clicked in PyQT5 program. I tried to connect PyQT5 QSystemTrayIcon activated signal (emitted when system tray icon is clicked) to custom method, but the method is not called. Here is simple example

How to draw a correct grid on PyQt?

Let's consider this little snippet: import sys from PyQt5 import QtWidgets from PyQt5 import QtCore from PyQt5 import QtGui from PyQt5.QtWidgets import QMenu from PyQt5.QtGui import QKeySequence from PyQt5.QtCore import Qt from PyQt5.QtGui import QCu

Single workflow for all tasks or multiple specific workers?

I'm creating a simple GUI application using PyQt5 where I request some data from an API which is then used to populate various controls of the UI. The examples I was following about worker threads in PyQt all seem to sub-class QThread and then do the

PyQt: How to Keep ComboBox Open While Selecting Elements

Following the solution provided at the following link (which works nicely): PyQt: How to set Combobox Items be Checkable? How can I keep ComboBox open while selecting items? Currently, with the offered solution, on each select, the list collapses...B

Custom exit prompt dialog box in PyQt

I'm trying to create custom exit prompt dialog, which should do the following: It has Yes, No buttons along with "Save new settings" checkbox item When I click Yes, the dialog should shutdown the main program When I click No, the dialog should c

Writing a custom QPushButton class in Python

I've recently started learning PyQt on my own and I've come in some trouble trying to write a custom class that inherits from QPushButton so I can adjust its attributes. I'm trying to pass a text as an argument whenever I initialize an object of this

Display string values ​​on the x-axis in pyqtgraph

I want to display string values for ticks on x-axis in pyqtgraph. Right now I am unable to figure out how to do that. Ex: x = ['a', 'b', 'c', 'd', 'e', 'f'] y = [1, 2, 3, 4, ,5, 6] pg.plot(x, y) When I try to pass the string array to the x variable i

What design logic to use with Linked ViewLists

There is a dictionary with three keys: 'Animals', 'Birds' and 'Fish'. The main dialog has two List views. The left view viewA displays the list of the keys mentioned above. When one of its items is clicked the right view viewB displays the list of th

Configuring IPython Qtconsole with PyQt5

On an OSX 10.9, I have Qt5 installed. Later I installed Ipython, sip and PyQt5 all build from source. Now here is the problem: when I try to run ipython qtconsole, I have a bunch of errors related to the files in this directory (and its subfolders) /

Installing NodeboxOpenGL on Windows

Hello I am trying to install and make use of NodeboxOpenGL, the python library so I can create my own graphs with nodes and edges. But I am running into some trouble, starting off at NodeBox OpenGL site. I downloaded NodeBox for OpenGL and then pygle

PyQt: Registering Native QTreeWidgets Using QDataStream

I recently spent some time working out how to use a QDataStream with a QTreeWidget in PyQt. I never found specific examples for doing exactly this, and pyqt documentation for QDataStream seems to be pretty scarce in general. So I thought I'd post a q

OpenCV Video Capture with PyQt4

I have been trying to capture video using PyQt4 GUI and OpenCV. I created some buttons like "Start", "End" etc to control the capturing. Starting is fine, but I can't stop the capture. To stop the capture, I need to break the while loo

QTreeWidget setItemWidget Problem Qt

I am adding a Qwidget(QPushButton) into a QTreeWidget through setItemWidget method, but Button is not appearing as expected. Need some help in this case. Code: import sys from PyQt4 import QtGui, QtCore class Test_Ui(QtGui.QMainWindow): def __init__(

Wait a moment before capturing the image of the site with PyQt

I'm working with PyQt (as a Python beginner). I need to be able to take screenshots of a website on a headless system. I was using PhantomJS earlier for another project, but they dropped Flash support in 1.5 and I don't want to rely on a deprecated 1

Limit the number of class instances with python

Μy Mainclass creates a simple QmainWindows like this: class mcManageUiC(QtGui.QMainWindow): def __init__(self): super(mcManageUiC, self).__init__() self.initUI() def initUI(self): And at the end of my file I launch it like this: def main(

QtSql vs MySQLdb vs SQLAlchemy

I'm developing a PyQt program that will soon switch from an xml type backend to one hosted on a local MySQL server. I've been trying to read around about each of the three options, but thought it might be best to ask ye SO gods. My current experience

How to hide the console window for my application?

Possible Duplicate: How can I hide the console window in a PyQt app running on Windows? I've made a simple app that opens a QWebView but in addition to the app window Windows console window is opened to. What could be the reason for this? import sys

QSvgRenderer segmentation error

I realize specific questions like this aren't great, but I've spent several days trying to puzzle this out. Hopefully someone here can help. This python code using PyQt4 causes a segmentation fault: data = """<?xml version="1.0"

Python: OSX library for quick display in full screen jpg / png

Frustrated by lack of a simple ACDSee equivalent for OS X, I'm looking to hack one up for myself. I'm looking for a gui library that accommodates: Full screen image display High quality image fit-to-screen (for display) Low memory usage Fast display

PyQt: translate standard buttons

How can I easily translate standard buttons (Yes, No) from QMessageBox? I can't use on those arguments, so I would like to achieve it in some other simple way. Do I have to use whole translation system?Here is how I did : First you need to co

PyQt: No slot machine

I am starting to learn Qt4 and Python, following along some tutorial i found on the interwebs. I have the following two files: from PyQt4 import QtGui, QtCore class LCDRange(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.