开发者

Create a desktop widget (like Yahoo Widgets or Google Gadgets) with Qt 4

How do I create with Qt 4 a window that remains anchored to the开发者_JAVA技巧 desktop as a widget ? (e.g. like Yahoo Widgets or Google Gadgets).

I intend to give the same characteristics of a widget to a normal window:

  1. Remove the edges (easy to do)
  2. The window must not move (how ?)
  3. Must be displayed only when other windows are minimized (how ?)


I think setting these flags will do what you are looking for:

setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint);
  1. Remove the edges ---> Qt::FramelessWindowHint will remove the edges
  2. The window must not move ---> (AFAIK) you can't move window when Qt::FramelessWindowHint flag is set
  3. Must be displayed only when other windows are minimized ---> Qt::WindowStaysOnBottomHint will keep the application window below all other windows


I don't think Qt provides anything specific to do this. You will need to create and manage your own window but you can use QDesktopWidget to help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜