Question

Pardon me, I am a newbie :)

Is it possible in Qt to create a custom window without borders but still draggable without holding down the Alt Key? I created a borderless window but in order to be able to drag it (on Linux) you have to hold down the alt key.

I was planning to create a window with rounded corners. Any one have any idea how to make this possible? Although, I think implementing the mouseMove, mousePress or something is a possible solution but I need some other solution.

Thanks

Was it helpful?

Solution

There is just one way to make the window manager move the window: Add a drag bar. If there is no drag bar, then your app must move the window itself by setting the new position (i.e. you must handle the mouse click+move events yourself).

The feature to move the window by pressing Alt is also a function of your window manager, not Qt.

OTHER TIPS

Yes, there is a rounded window example somewhere using a clock which does this. Basically, you need to manage the mouse clicks yourself as Aaron says.

You may use QDecoration (for Embedded Linux) to make it: here is the example.

Detect that the mouse is held down on your window, then grab the events for the mouse moving around so you can move your window in sync with it. When user releases mouse button your task is over.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top