开发者

Qt Custom Window

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜