How do I get and store the value that is written in a QLineEdit as well as close the widget after I click save? I have looked over the PyQt5 documentation and it says the function .text() will give access to the values in a QLineEdit but for some reason the value I keep getting is the default empty string.
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
PyQt5: How do I “collect” or “receive” an emitted signal?
In my code, I have 2 classes in 2 separate files. I have a signal testSignal, a button pushButton and I connected the button like this: Now what I want to do is “receive” the emitted signal in the class/file, but I’m somewhat in the dark on how emit() actually works. Does anyone have any links for guides for 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
Control display of gridlines and borders in header of QTreeView
(W10 platform) What I’m trying to get (I was asked to produce a target outcome, with Gimp): What I currently get: MRE: What I’m trying to do here is 1) change the grid lines in the horizontal header; 2) put a solid line of some kind between the header and the data rows of the table. Uncomment my attempts if