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. [Solved] Segmentation fault with dynamic property animation.
Forum Updated to NodeBB v4.3 + New Features

[Solved] Segmentation fault with dynamic property animation.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.1k 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.
  • T Offline
    T Offline
    tomi35
    wrote on 18 Mar 2014, 20:41 last edited by
    #1

    Hello!

    I am new to Qt and c++. I am writing a little program which has some fancy animated buttons. I am animating it's background with QPropertyAnimation, but let the code speak instead of me:

    @void AnimatedButton::enterEvent(QEvent *){
    QPropertyAnimation *animation = new QPropertyAnimation(this, "backgroundColor");
    animation->setDuration(500);
    animation->setStartValue(getBackgroundColor());
    animation->setEndValue(QColor(0, 153, 204));
    animation->setLoopCount(1);
    animation->start();
    }@

    The problem with it that when I use the 'backgroundColor' property dinamically (to make it editable from the QDesigner) I get a segmentation fault. If I use it as a static property, everything works fine. Here's the segmentation fault dump (or how it's called): http://pastebin.com/yU9unLF5

    Does anybody know what I'm doing wrong? I want to access that property from the Designer.

    EDIT

    I found out that I get segmentation fault whenever I use property() or setProperty() function.

    SOLVED

    Okay, I was dumb. I used property and setProperty functions in the custom widgets' class. That was a problem. I missunderstood the documentation, I thought I should use them there too, but it works as the static properties. Anyway, sorry for wasting your time for this.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jeroentjehome
      wrote on 19 Mar 2014, 08:49 last edited by
      #2

      Well, we all make dumb mistakes, learning from them is the hard part ;-)
      Please update the title of this topic to [SOLVED] <title>, that will make sure no other helpers get stuck reading a solved topic ;-)

      Greetz, Jeroen

      1 Reply Last reply
      0

      1/2

      18 Mar 2014, 20:41

      • Login

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