Maximize/FullScreen Windows TaskbarMenu Messages



  • Hello,
    I have a custom main dialog made using QT. The problem is that minimize, maximize and restore buttons have their own logic and they work as they should. The problem came when I have added new flags for that dialog:

    @
    Qt::WindowFlags flags = windowFlags();
    flags |= Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint ;
    setWindowFlags(flags);
    @

    When i choose maximize dialog resizes to fullscreen ignoring the taskbar. A good help for me will be if i could somehow override the methods/signals/events that occur when you click on the system menu elements. I have tryed to catch WindowStateChange and call my resize methods there. After they are being called my main dialog resize again to fullscreen.

    @

    if( (event->type() == QEvent::WindowStateChange) )
    {
    QWindowStateChangeEvent * windowStateChangeEvent(static_cast<QWindowStateChangeEvent *>(event));

    if (windowState().testFlag(Qt::WindowMaximized ) )
    {
    on_maximizeButton_clicked(); //This method works ok when I click on the app's button
    }
    return QDialog::event(event);
    @

    Thank You for your help



  • :(


  • Moderators

    Why the sad face? Be patient.



  • 6 hours and you're crying for an answer? Get real! A bump of an unanswered post is acceptable after waiting for several days, not hours.

    As far as I know you will have to use native, i.e. platform dependent, code and API to intercept these events.



  • :)) at my last post someone answered in minutes. Time is not a problem :) I can wait. If I won't receive any answer I shall use WINAPI :)



  • So I think there is a bug. If I set my main app with:
    @
    ( Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint )@

    Whe I call showMaximized() i get fullscreeen.

    If I remove FramelessWindowHint flag everything works great but I get a frame and I don't want that.

    The problem is still about how to catch taskbarmenu/systemenu messages....


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.