PyQt5 focusIN/Out events

I am using Python 3.4 and Qt 5 for the first time. It's easy and I can understand most of functionality which I need. But (there is always "but") I don't understand how to use...

Cannot import QtWebKitWidgets in PyQt5

I've recently upgraded PyQt5 from 5.5.1 to 5.6.0 using the Windows 32-bit installer here: https://www.riverbankcomputing.com/software/pyqt/download5. I've also upgraded my python from 3.4 to...

PyQt5: QMessageBox vanishes after starting

When I invoke Error Message One (see comments in code) the message quickly appears and then vanishes. But if I invoke Error Message Two, it appears and only vanishes when I click on the 'OK'...

PyQt5: How to install/run Qt Designer

Feeling really stupid, right now, but the title says it all: How do you start the QtDesigner? I've installed PyQt5 via pip and I believe to have identified the directory it's been installed in...

Multi-Threading in PyQt 5

I've been learning about multi-threading, specifically in the context of a PyQt 5 application. Initially I implemented a version using 'threading', but have since learnt that I should be using...

Qt: Multiple QListWidgets and only a single entry selected

I have several QListWidgets and would like to only allow a single row to be selected for all of these lists. So for example if I select a row in one of the lists any other selection in the other...

Cannot import PyQt5 modules

I installed PyQt5 as following: pip3 install pyqt5 Nevertheless, when I run the module, the output is an error telling me that QtWidgets cannot be imported as any other Qt module. I then tried...

QPushButton with transparent background

How to do transparent background in QPushButton? I have a background picture and I want to make the button transparent. I tried to use: reg_screen_var.new_account.setStyleSheet("QPushButton...

Stop long-running process in qthread

I am trying to use youtube-dl module to download videos from youtube. I created a simple GUI to do a little job, I need when user clicks start button the thread will be called and download starts...

PyInstaller Missing Module Errors Even After Including Specifically

Pyinstaller compiles my app into an .exe on Windows fine, but I'm not able to build a working .app on Mac. I've tried --onefile and --onedir, but no dice, the app just opens and then closes...

Process finished with exit code -1073741819 (0xC0000005) Pycharm

I'm completly stuck on this. I keep getting error message Process finished with exit code -1073741819 (0xC0000005) I'm using pycharm with pyqt5.6 and qt5.6.2 and the problem started when I...

PyQt5 to PySide2, loading UI-Files in different classes

I have a python application which runs under python3.6 and is using PyQt5 for loading Ui windows. These windows were created with Qt Designer 5.9.4. The Code below shows a working example with...

How to sort QTableView and pull down list that uses QSqlRelationalTableModel, QSqlRelationalDelegate, PyQt5

I need to sort records displayed in a QTableView that uses a QSqlRelationalTableModel with QSqlRelationalDelegate. I want the values in the pull down list and the table view to be sorted. I've...

Converting QPixmap to grayscale

I'm trying to convert QPixmap image to grayscale. However, I got an error for all tried solution. The first try: def convertCv2ToQimage(self, cv2image): height, width = cv2image.shape ...

"Missing self as first argument in method". Why the need of self in this case?

I'm learning how to develop some simple GUI applications with PyQt5. I'm also learning Python because of it. There are some things about classes that I don't understand. For example, here I have a...

ImportError: Failed to import any qt binding

I am getting this error: File "/usr/local/lib/python3.7/dist-packages/matplotlib/backends/backend_qt5.py", line 15, in <module> import matplotlib.backends.qt_editor.figureoptions as...

Insert foreign key id from value

I have two tables. Table "public.part" Column | Type | -------------------+------------------------+ id | bigint | ...

Trying to get cursor with coordinate display within a pyqtgraph plotwidget in PyQt5

I'm trying to add a readout of the cursor position in a pqytplot plotwidget in PyQt5. I found this code which does what I want, but in a stand-alone window all within one program file: import...

Python Qt5 - Font awesome icons on QTextBrowser

The question is simple: How can i use fontawesome icons in QTextBrowser? What i have done: # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'untitled.ui' # # Created...

PyQt5 ComboBox dummy placeholder

I happen to have used the qcombobox, but could not find a way to add a dummy placeholder (like we have in tkinter). For example, the combobox I'd like to have is something like this: --Choose...

pyqt5_tools designer.exe does not exist

I have installed PyQT5 by command pip install pyqt5 pyqt5-tools. Then I want to show path for designer.exe. However I could not found that in...

AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel' for PyQt5 5.15.0

A program I am trying to install requires the installation of PyQt5 5.15.0 , which gives me this error. The odd thing is that the installation works fine for the latest version of PyQt5 (5.15.2),...

How do i use QComboBox.setPlaceholderText?

In Qt 5.15 the placeholderText property was introduced - link to documentation However using setPlaceholderText doesn't do anything for me. When running the code below i don't get any text in the...

How can i run pyqt5 on my mac with M1chip

now. when i run it. the error conmes ImportError: dlopen(/Users/vihanmy/Library/Python/3.8/lib/python/site-packages/PyQt5/QtWidgets.abi3.so, 2): no suitable image found. Did find: ...

Python GUI entry point not working on Bash for Windows

I have a Python GUI app (using either PyQt5 or PySide2) which I would like to start with the command mnelab. Therefore, I added the following section to...

SetText in Pyqt5

I am developing an application in pyqt5 and I ran into one problem. There is a script that receives data, and in pyqt5 in the line "main_text.setText (str (TEXT))" I output them, and in the format...

Python PyQt5 - How to rename table headers?

I have a function that adds new column to the table, hoewer I do not know how to rename the column header. What I want is for the user to either double click on the column header so that you could...

Installing PyQT in conda environment

The final goal was to have a working environment with: Tensorflow, numpy, pandas, pyqt5, psycopg2. I successfully installed TF, numpy and pandas but not pyqt5. That's what I did: Installed X-Code...

auto-py-to-exe stuck at hook-gevent.py while compiling the project

I am trying to convert the python code to exe with auto-py-to-exe. It stuck at "Loading module hook 'hook-gevent.py'...". Here is the small reproducible example: import pandas as pd from time...

How to filter items of combobox in tableview using QSqlRelationalTableModel?

I have a tableview that is set as below: self.table = QTableView() self.model = QSqlRelationalTableModel(self) ...