I am a beginner in QT. I want to create a simple GUI to load an image from a file. That’s Why I create a button in my GUI, named pushButton (I designed the GUI by QT Creator). Now how can I access the pushButton from my python file? Here is my XML Code (from ui file) Here is My
Tag: qt
ImportError while importing PySide2
I installed PySide2 using pip install PySide2 But i got this error when i tried to import it: Answer Have a look at the PyPI documentation here. If that doesn’t help try to use Make sure it is installede in your virtual environtment if you are using that and you are using the correct version of pip(3). Here is a
how to select a particlular portion of a window’s client area to display in window’s thumbnail in the taskbar in Python/PyQt5/PySide2/Tkinter?
I want to set a particular portion(like only a frame or widget) of my application window to taskbar thumbnail.I found one windows API that is ITaskbarList3::SetThumbnailClip here but this is in C++.I want to do this in python.However PyQt5 contains one class that is Qt Windows Extras which doesnot include this function.I have also found something that show one example
This application failed to start because no Qt platform plugin could be initialized
I am stuck trying to run a very simple Python script, getting this error: The script code is: However this Notebook code works in JupyterLab: I am on macOS, using Anaconda and JupyterLab. I would appreciate any help with this issue. Thanks! Answer For me, it worked by using a opencv-python version prior to 4.2 version that just got released.
Post request by QWebEngineHttpRequest (PyQt5)
I have a question about making POST request in PyQt5. Unfortunately official documentation for this framework for Python doesen’t exist. I have to translate docs from C++ to Python. I have a problem with handle it. To make POST request I have to create instance of class QWebEngineHttpRequest (docs), and then add POST data by setPostData(), it looks to be
How to inject widgets between QHeaderView and QTableView?
I would like to display widgets between the QHeaderView and the rest of the QTableView, like in the example picture below (created with Photoshop), as this seems like a natural way to enable input for filtering columns. Does anybody have any ideas of how to inject widgets inbetween? Answer Below is a demo of a FilterHeader class that I wrote
Is it possible to paint a QGraphicsItem inside the paint() method?
I’m creating a subclass of QGraphicsItem, and this subclass has different places that the user can click. My idea is for each component clicked to create a subclass of QGraphicsItem with mousePressEvent replaced. The problem is how can I merge this component into a subclass of QGraphicItem. Here’s the code I’m trying, but I do not know how to show
How to delete row/rows from a qtableview in pyqt?
I am using QStandardItemModel for my qtableview. here when I am trying to delete the row selected(i.e. model.removeRow() ) I am getting a error” TypeError: argument 1 of QAbstractItemModel.removeRow() has an invalid type”. I have searched a lot for the correct way of deleting a selected row/rows in qtableview of pyqt. However, I am not able to delete the selected
How to hide checkboxes in a QTableView using python?
I’m quite new to python as well as to Qt. I would like to use the QTableView without checkboxes appearing in the tableview’s cells, but as it seems they just appear there by default. As I’ve found out so far, you just have to deactivate the Qt.ItemIsUserCheckable flag. But how am I supposed to do this? I tried to use
Resize QMainWindow to minimal size after content of layout changes
I’m using a subclass of QMainWindow, in which I declared a central widget. This widget contains, among other things, a QGridLayout, which holds a set of buttons. The amount of buttons can grow or shrink, depending on the user’s input. The spacing is set to zero, so that all buttons are clumped together. By default, it looks like this: If