Skip to content
Advertisement

Tag: pyqt5

Drawing straight line between two points using QPainterPath

I have a scene where I would like to draw a line between two points(mouse press should be the start point and mouse release as the endpoint) using the QPainterpath. Here is a demonstration of how I want it to be. Here is what’s happening with my current code. Below is the code I have tried Answer Every time lineTo

PyQt5 – fromIccProfile: failed minimal tag size sanity error

I’m using latest PyQt5 5.12.2 and I’m getting a weird message for every JPG picture that I’m showing in my script using QPixmap or QIcon. It isn’t causing anything and the script works as it should. The problem is that I’m trying to display a huge amount of jpg pictures at the same time (as a photo gallery) so the

How to move rect in pyqtgraph

I try to have a rect which moves with the mouse pointer. However, I seem to have a problem with calling the paint method. It either doesn’t draw or creates artifacts. The only clean picture I get is with a forced redraw (zoom the graph). Here’s my mwe Answer Just redrawing the contents of an internal QPicture doesn’t affect the

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

Transformation of coordinates between PyQt and matplotlib

I would like to show a context menu on the position of mouse click and then create a new line on that position in the graph. For that I need both the PyQt position and the graph data position. I thought that I could use the matplotlib transformation functions, but somehow when clicking the lower left and upper right corners

Determine the element which previously had focus?

In Java a FocusEvent has a method getOppositeComponent() which is where the focus came from or went to. In PyQt5 is there any way to find what previously had focus when overriding focusInEvent? As explained in a note, I want to be able to start an edit session automatically when the table view gets focus, end an edit session by

Create a dependent window?

I want to create a secondary window which is free-floating in relation to the main window. But I also want it to close when the main window closes. Indeed, I want the application to end completely when the main window closes, and assumed this would be default behaviour. MRE: As the code is, closing the main window does not close

Advertisement