Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Block user input for the time of animation
Qt 6.11 is out! See what's new in the release blog

Block user input for the time of animation

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.0k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi there!
    In my application I have to block user input in the scene for the time of an animation. What is the best way to do that?
    Thanks in advance!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Hello

      You should handle end of animation, like:
      @
      void animationStarted()
      {
      widget->setEnabled(false);
      }

      void animationFinished()
      {
      widget->setEnabled(true);
      }
      @

      I hope your animation widget have appropriate signals :)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        it says i cannot redefine these signals, where exactly should i put these?

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tucnak
          wrote on last edited by
          #4

          [quote author="zurbek" date="1367224315"]it says i cannot redefine these signals, where exactly should i put these?[/quote]

          You don't need to overload them, you just can connect them to your slots. Wide example:
          @
          ..
          connect(animatiorInstance, &AnimationClass::animationStarted,
          this, &MainWindow::animationStarted);
          connect(animatiorInstance, &AnimationClass::animationFinished,
          this, &MainWindow::animationFinished);
          ..

          void MainWindow::animationStarted()
          {
          ;
          }

          void MainWindow::animationFinished()
          {
          ;
          }
          @

          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