Should be pretty simple. First you need the line itself - you can start with QFrame in horizontal line mode. Then you need to pass appropriate window flags (or attributes) to make it translucent and without window decorations. Finally you need it to follow the mouse - and this is the hard part as there are two choices - either you have to grab the mouse which will make your widget receive all mouse events (meaning you won't be able to click on the desktop or anywhere else until you release the mouse) or use polling of QCursor::pos() every now and then and update position of your item accordingly which will make your line follow the movement of the cursor with a bit of delay.