-
Book Overview & Buying
-
Table Of Contents
Qt5 Python GUI Programming Cookbook
By :
To draw any shape with the mouse, you need to know where the mouse button is clicked, to where the mouse is dragged, and where the mouse button is released. Only after knowing the coordinates where the mouse button is clicked can you go ahead and execute commands to draw different shapes. In this recipe, we will be learning to display the x and y coordinates to which the mouse is moved on the form.
In this recipe, we will be tracking mouse movement and will be displaying the x and y coordinates which the mouse is moved on the form. So, in all, we will be using two Label widgets in this application, one for displaying a message and the other for displaying mouse coordinates. The complete steps for creating this application are shown here:
Dialog without Buttons template.QLabel widgets to the form by dragging and dropping two Label widgets on the form.text property of the first Label widget to...