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. An error occurs when using animation effects.
Forum Updated to NodeBB v4.3 + New Features

An error occurs when using animation effects.

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 3 Posters 850 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    An error occurs when using animation effects.

    • Error Message
      QPropertyAnimation: you're trying to animate a non-existing property AnmOuterBoundary of your QObject
    Q_OBJECT
    		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
    
    public:
    	qreal	AnmFrameAlpha() const;
    public slots:
    	void SetAnmFrameAlpha(qreal rAlpha);
    
    qreal usrCntrListItem::AnmFrameAlpha() const
    {
    	return this->windowOpacity();
    }
    void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
    {
    	this->setWindowOpacity(rAlpha);
    	this->update();
    }
    
    void usrCntrListItem::SetCheckVisible(bool bShow)
    {
    	//this->ui.frame->setVisible(bShow);
    	this->ui.chk_Enable->setVisible(bShow);
    
    	auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
    	anim->setDuration(1500);
    	//anim->setStartValue(bShow ? 1.0 : 0.0);
    	//anim->setEndValue(!bShow ? 1.0 : 0.0);
    	anim->setStartValue(bShow ? 0.0 : 1.0);
    	anim->setEndValue(bShow ? 1.0 : 0.0);
    	anim->start();		
    }
    
    
    Pl45m4P jsulmJ 2 Replies Last reply
    0
    • I IknowQT

      @jsulm

      QPropertyAnimation: you're trying to animate a non-existing property AnmFrameAlpha of your QObject

      void usrCntrListItem::SetCheckVisible(bool bShow)
      {
      	if (bShow)
      	{
      		QSize s = this->ui.frame->size();
      
      		auto anim =  new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
      		anim->setDuration(1500);
      		anim->setStartValue(0.0);
      		anim->setEndValue(1.0);
      		anim->start(QAbstractAnimation::DeleteWhenStopped);
      	}
      	else
      	{
      		auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
      		anim->setDuration(500);
      		anim->setStartValue(1.0);
      		anim->setEndValue(0.0);
      		anim->start(QAbstractAnimation::DeleteWhenStopped);		
      	}
      }
      
      qreal usrCntrListItem::AnmFrameAlpha() const
      {
      	return this->windowOpacity();
      }
      
      void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
      {
      	this->setWindowOpacity(rAlpha);
      	this->update();
      }
      
      ## Header
      	Q_OBJECT
      		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
      public:
      qreal	AnmFrameAlpha() const;
      
      public slots:
      	void SetAnmFrameAlpha(qreal rAlpha);
      
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #7

      @IknowQT said in An error occurs when using animation effects.:

      auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);

      This can't work: AnmFrameAlpha is a property of your usrCntrListItem class, not frame.
      Should be:

      auto anim =  new QPropertyAnimation(this, "AnmFrameAlpha", this);
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      2
      • I IknowQT

        An error occurs when using animation effects.

        • Error Message
          QPropertyAnimation: you're trying to animate a non-existing property AnmOuterBoundary of your QObject
        Q_OBJECT
        		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
        
        public:
        	qreal	AnmFrameAlpha() const;
        public slots:
        	void SetAnmFrameAlpha(qreal rAlpha);
        
        qreal usrCntrListItem::AnmFrameAlpha() const
        {
        	return this->windowOpacity();
        }
        void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
        {
        	this->setWindowOpacity(rAlpha);
        	this->update();
        }
        
        void usrCntrListItem::SetCheckVisible(bool bShow)
        {
        	//this->ui.frame->setVisible(bShow);
        	this->ui.chk_Enable->setVisible(bShow);
        
        	auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
        	anim->setDuration(1500);
        	//anim->setStartValue(bShow ? 1.0 : 0.0);
        	//anim->setEndValue(!bShow ? 1.0 : 0.0);
        	anim->setStartValue(bShow ? 0.0 : 1.0);
        	anim->setEndValue(bShow ? 1.0 : 0.0);
        	anim->start();		
        }
        
        
        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by Pl45m4
        #2

        @IknowQT

        It says that you dont have AnmOuterBoundary property. The weird thing is, that the property name in your animation is correct.
        I've noticed that your proptery name and your property READ have the exact same name... Could be the issue here.
        (Edit: Is possible)

        Since it seems like your are trying to animate the opacity, you could also do it this way:

        • https://stackoverflow.com/a/32985126

        Maybe it works for you.

        Edit:

        Another thought: Have you done a clean & rebuild and re-run qmake / cmake already?
        If there was a property with the name, the error msg states, there could be some junk temp files from former builds laying around.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        1
        • I IknowQT

          An error occurs when using animation effects.

          • Error Message
            QPropertyAnimation: you're trying to animate a non-existing property AnmOuterBoundary of your QObject
          Q_OBJECT
          		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
          
          public:
          	qreal	AnmFrameAlpha() const;
          public slots:
          	void SetAnmFrameAlpha(qreal rAlpha);
          
          qreal usrCntrListItem::AnmFrameAlpha() const
          {
          	return this->windowOpacity();
          }
          void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
          {
          	this->setWindowOpacity(rAlpha);
          	this->update();
          }
          
          void usrCntrListItem::SetCheckVisible(bool bShow)
          {
          	//this->ui.frame->setVisible(bShow);
          	this->ui.chk_Enable->setVisible(bShow);
          
          	auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
          	anim->setDuration(1500);
          	//anim->setStartValue(bShow ? 1.0 : 0.0);
          	//anim->setEndValue(!bShow ? 1.0 : 0.0);
          	anim->setStartValue(bShow ? 0.0 : 1.0);
          	anim->setEndValue(bShow ? 1.0 : 0.0);
          	anim->start();		
          }
          
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #3

          @IknowQT said in An error occurs when using animation effects.:

          you're trying to animate a non-existing property AnmOuterBoundary of your QObject

          Do you have another animation trying to animate AnmOuterBoundary property?
          In the code you posted you only have property AnmFrameAlpha.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          1
          • jsulmJ jsulm

            @IknowQT said in An error occurs when using animation effects.:

            you're trying to animate a non-existing property AnmOuterBoundary of your QObject

            Do you have another animation trying to animate AnmOuterBoundary property?
            In the code you posted you only have property AnmFrameAlpha.

            I Offline
            I Offline
            IknowQT
            wrote on last edited by
            #4

            @jsulm

            Although I did not capture well, an error message is displayed even if I change to AnyFrame Alpha.

            jsulmJ 1 Reply Last reply
            0
            • I IknowQT

              @jsulm

              Although I did not capture well, an error message is displayed even if I change to AnyFrame Alpha.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #5

              @IknowQT said in An error occurs when using animation effects.:

              an error message

              Would be nice to see it...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              I 1 Reply Last reply
              0
              • jsulmJ jsulm

                @IknowQT said in An error occurs when using animation effects.:

                an error message

                Would be nice to see it...

                I Offline
                I Offline
                IknowQT
                wrote on last edited by IknowQT
                #6

                @jsulm

                QPropertyAnimation: you're trying to animate a non-existing property AnmFrameAlpha of your QObject

                void usrCntrListItem::SetCheckVisible(bool bShow)
                {
                	if (bShow)
                	{
                		QSize s = this->ui.frame->size();
                
                		auto anim =  new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
                		anim->setDuration(1500);
                		anim->setStartValue(0.0);
                		anim->setEndValue(1.0);
                		anim->start(QAbstractAnimation::DeleteWhenStopped);
                	}
                	else
                	{
                		auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
                		anim->setDuration(500);
                		anim->setStartValue(1.0);
                		anim->setEndValue(0.0);
                		anim->start(QAbstractAnimation::DeleteWhenStopped);		
                	}
                }
                
                qreal usrCntrListItem::AnmFrameAlpha() const
                {
                	return this->windowOpacity();
                }
                
                void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
                {
                	this->setWindowOpacity(rAlpha);
                	this->update();
                }
                
                ## Header
                	Q_OBJECT
                		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
                public:
                qreal	AnmFrameAlpha() const;
                
                public slots:
                	void SetAnmFrameAlpha(qreal rAlpha);
                
                
                jsulmJ 1 Reply Last reply
                0
                • I IknowQT

                  @jsulm

                  QPropertyAnimation: you're trying to animate a non-existing property AnmFrameAlpha of your QObject

                  void usrCntrListItem::SetCheckVisible(bool bShow)
                  {
                  	if (bShow)
                  	{
                  		QSize s = this->ui.frame->size();
                  
                  		auto anim =  new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
                  		anim->setDuration(1500);
                  		anim->setStartValue(0.0);
                  		anim->setEndValue(1.0);
                  		anim->start(QAbstractAnimation::DeleteWhenStopped);
                  	}
                  	else
                  	{
                  		auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);
                  		anim->setDuration(500);
                  		anim->setStartValue(1.0);
                  		anim->setEndValue(0.0);
                  		anim->start(QAbstractAnimation::DeleteWhenStopped);		
                  	}
                  }
                  
                  qreal usrCntrListItem::AnmFrameAlpha() const
                  {
                  	return this->windowOpacity();
                  }
                  
                  void usrCntrListItem::SetAnmFrameAlpha(qreal rAlpha)
                  {
                  	this->setWindowOpacity(rAlpha);
                  	this->update();
                  }
                  
                  ## Header
                  	Q_OBJECT
                  		Q_PROPERTY(qreal AnmFrameAlpha READ AnmFrameAlpha WRITE SetAnmFrameAlpha)
                  public:
                  qreal	AnmFrameAlpha() const;
                  
                  public slots:
                  	void SetAnmFrameAlpha(qreal rAlpha);
                  
                  
                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  @IknowQT said in An error occurs when using animation effects.:

                  auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);

                  This can't work: AnmFrameAlpha is a property of your usrCntrListItem class, not frame.
                  Should be:

                  auto anim =  new QPropertyAnimation(this, "AnmFrameAlpha", this);
                  

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  I 1 Reply Last reply
                  2
                  • jsulmJ jsulm

                    @IknowQT said in An error occurs when using animation effects.:

                    auto anim = new QPropertyAnimation(this->ui.frame, "AnmFrameAlpha", this);

                    This can't work: AnmFrameAlpha is a property of your usrCntrListItem class, not frame.
                    Should be:

                    auto anim =  new QPropertyAnimation(this, "AnmFrameAlpha", this);
                    
                    I Offline
                    I Offline
                    IknowQT
                    wrote on last edited by
                    #8

                    @jsulm

                    Does this mean that the custom class that inherits Qframe class should apply it?

                    Pl45m4P jsulmJ 2 Replies Last reply
                    0
                    • I IknowQT

                      @jsulm

                      Does this mean that the custom class that inherits Qframe class should apply it?

                      Pl45m4P Offline
                      Pl45m4P Offline
                      Pl45m4
                      wrote on last edited by Pl45m4
                      #9

                      @IknowQT

                      He wrote the solution.

                      You need to assign the property to the item you want to animate.

                      What do you really want to animate? Your frame or this , where the property is (the userListItem)?


                      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                      ~E. W. Dijkstra

                      1 Reply Last reply
                      0
                      • I IknowQT

                        @jsulm

                        Does this mean that the custom class that inherits Qframe class should apply it?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        @IknowQT said in An error occurs when using animation effects.:

                        Does this mean that the custom class that inherits Qframe class should apply it?

                        Yes, because this property is a property of that custom class. There is no such property in QFrame, so how should it work?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        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