I know this is maybe silly, but I have a widget which should only show its borders (WindowSystemMenuHint;//only a close button) when entered. The user should then be able to use the title bar to move the widget (or close it). However, when the user moves the mouse away from the widget, the border should disappear.

sounds easy, doesn't it - just re-implemented the enter and leave events!
Here's my attempt:
Qt Code:
  1. void BuddyFramedLabel::enterEvent (QEvent* event)
  2. {
  3. Qt::WindowFlags flags = 0;
  4. flags = Qt::Window;//normal window
  5.  
  6. //need to show the window frame
  7. flags |= Qt::WindowSystemMenuHint;//only a close button
  8. setWindowFlags(flags);
  9.  
  10. QWidget::show();//need this, otherwise the widget disappears!
  11. }
  12. void BuddyFramedLabel::leaveEvent (QEvent* event)
  13. {
  14. Qt::WindowFlags flags = 0;
  15. flags = Qt::Window;//normal window
  16.  
  17. //need to hide the window frame
  18. flags |= Qt::FramelessWindowHint;//Qt::Tool;
  19. setWindowFlags(flags);
  20.  
  21. QWidget::show();//need this, otherwise the widget disappears!
  22. }
To copy to clipboard, switch view to plain text mode 

The problem as soon as you want to use the title bar, you leave the widget and the title bar disappears.
So, is there a leaveEvent() or something similar for a whole window (incl. title bars)?
Any other solution would also be greatly appreciated. I'm sure there's something obvious.
thanks
K