I can't recieve the changeEvent(QEvent* e) when I change the window state such as Qt::WindowMinimized and Qt::WindowMaximized.
-
I have a custom widget that inherits from
QMenuBar
, and I have overridden thevoid changeEvent(QEvent* e)
function. When I change the window state, such as maximizing or minimizing, thechangeEvent(QEvent* e)
is not being called. I believe this is not the expected behavior. Does anyone know why this is happening? -
I don't see why change event should handle the window state according the doc: https://doc.qt.io/qt-6/qwidget.html#changeEvent
-
I don't see why change event should handle the window state according the doc: https://doc.qt.io/qt-6/qwidget.html#changeEvent
Because the change events include
QEvent::WindowStateChange
and others. The window's states include minimized, maximized, or full-screen. -
You are right - it's not sorted alphabetically.
But QMenuBar will never be maximized - only your main window. -
You are right - it's not sorted alphabetically.
But QMenuBar will never be maximized - only your main window.I originally intended to change some of the icons on the menu bar when the window was maximized or minimized...
I have now achieved this through other means. -
I originally intended to change some of the icons on the menu bar when the window was maximized or minimized...
I have now achieved this through other means.@Paul-Xu said in I can't recieve the changeEvent(QEvent* e) when I change the window state such as Qt::WindowMinimized and Qt::WindowMaximized.:
change some of the icons on the menu bar when the window was maximized or minimized
But you can do that by listening to change event on your main window like @Christian-Ehrlicher wrote.
-
@Paul-Xu said in I can't recieve the changeEvent(QEvent* e) when I change the window state such as Qt::WindowMinimized and Qt::WindowMaximized.:
change some of the icons on the menu bar when the window was maximized or minimized
But you can do that by listening to change event on your main window like @Christian-Ehrlicher wrote.
-