[SOLVED]Is there a way to unset Qt::FramelessWindowHint?
-
The QWidget::enterEvent() and QWidget::leaveEvent() functions are called when mouse either enter or leaves the window. You can try to set/unset the FramelessWindowHint for mouse enter/leave events.
[edit]
You will have to call QWidget::setMouseTracking (bool enable) with parameter enable=true in order to always receive mouse events. By default they are delivered only if mouse button is pressed. But by aware that this will make hell of events being delivered to your QWidget which can result in performance drop. -
I agree, I may have missed the essence of your question - sorry about that.
-
Have you tried this approach:
@Qt::WindowFlags flags = windowFlags();
flags &= ~Qt::FramelessWindowHint;
setWindowFlags(flags);@ -
Hi vonb,
this is also stated in the "docs":http://doc.qt.nokia.com/4.7/qwidget.html#windowFlags-prop
bq. Note: This function calls setParent() when changing the flags for a window, causing the widget to be hidden. You must call show() to make the widget visible again..
so changing the windowFlags means, you have to call show again :-(