Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. The Qml taskbar is restored to the display state
Forum Updated to NodeBB v4.3 + New Features

The Qml taskbar is restored to the display state

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 133 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nan Feng
    wrote on last edited by
    #1

    Dear Qt development team and forum friends, hello. I am writing a program using Qml, and the problem I have encountered is that the program is minimized when a button is clicked. Then after minimizing, clicking the program icon in the taskbar will restore to the display state, how can I judge it is this time? Because I want to add an animation to this process. I wrote this in the Widget development method:

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

             if(stateEvent->oldState() & Qt::WindowMinimized)
             {
                // TODO: Animation
                 return true;
             }
    
         }
    

    Is there oldState in Qml?
    I wrote it like this in Qml
    onWindowStateChanged:
    {

         if (windowState === Qt.WindowMinimized)
         {
             console.log("normal")
         }
     }
    

    Obviously, the previous state should be used for judgment, so what does oldState correspond to in Qml?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved