Results 1 to 8 of 8

Thread: qtimeline doesn't run

  1. #1
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    87
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default qtimeline doesn't run

    hi all,

    Firstly I'd like to apologize for the screenshot, rather than pasting the code. Internet went down, so I'm post from my phone.

    I'm creating a image sequence player. I've loaded the image files into an array, where I then set the value of a slider to change the index which is sent to a qlable via pixmap.

    I've created a timeline, where I set the seconds and range, and I hookup the timeline frame value, to the slider tick position.
    And I print the value of the timeline...for debug

    As you can see in the code, I call the function that creates and starts the timeline, but nothing happens. The print displays -0.0.

    What am I missing?

    Thanks All,



    image.jpg

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qtimeline doesn't run

    Are you sure that the problem is the timeline not running?
    I.e. have you verfied that the connect line is actually valid syntax?

    I am not a PythonQt user but both the (int) in the signal name and the () at the slot look wrong to me.

    Btw, load into QImage, then scale, then convert into QPixmap.

    QPixmap::load() needs to load into QImage and then convert to QPixmap. QPixmap::scaled() needs to convert to QImage, scale and convert back.
    Two unecessary conversions.

    Cheers,
    _

  3. #3
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    87
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtimeline doesn't run

    Quote Originally Posted by anda_skoa View Post
    I am not a PythonQt user but both the (int) in the signal name and the () at the slot look wrong to me.
    _
    I got the syntax from the docs here.
    http://srinikom.github.io/pyside-doc...e.frameChanged


    I'll double check the syntax again when I'm in the office.

    Thanks again for answering the call

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qtimeline doesn't run

    Quote Originally Posted by Nfrancisj View Post
    I got the syntax from the docs here.
    http://srinikom.github.io/pyside-doc...e.frameChanged
    That must lead to a different page for me than it does for you, I don't see any connect example there.

    Cheers,
    _

  5. #5
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    87
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtimeline doesn't run

    hmm...im not sure why it leads somewhere else...but here is a screenshot.

    20160328_092948000_iOS.jpg

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qtimeline doesn't run

    I see, still not what you have.
    You have parentheses at the signal and parentheses at the slot.
    The example has brackets at the signal and nothing at the slot.

    Cheers,
    _

  7. #7
    Join Date
    Feb 2016
    Location
    Venice, California
    Posts
    87
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qtimeline doesn't run

    ill check on your last post regarding [int], but here is how i got it to work

    i have to capture the value of 'currentframe' inside a function.
    it feels like a messy workaround. In Qt framework, do SIGNALS broadcast a specific value?
    for example, timeline.frameChanged, what does this signal send? is it the frame that it changed to, or just a true/false signal?
    The setup below is me assuming its not an actual value that the slider can read. maybe thats why the (int)was there?



    so it works by running the dummyFunc when the SINAL frame changed is emitted. that function gets the current frame of timeline and sets it to the slider.

    ideas why the example code (in the screenshot) doesnt work for my case?


    Qt Code:
    1. def dummyFunc():
    2. self.horizontalSlider.setValue(self.timeline.currentFrame())
    3.  
    4. self.timeline = QtCore.QTimeLine(5000)
    5. self.timeline.setFrameRange(0,100)
    6. self.timeline.frameChanged.connect(dummyFunc)
    7.  
    8.  
    9. self.pushButton.clicked.connect(self.timeline.start)
    To copy to clipboard, switch view to plain text mode 


    Added after 14 minutes:


    this works. i tried it with and without the [int]. both works.

    self.timeline = QtCore.QTimeLine(5000)
    self.timeline.setFrameRange(0,100)
    self.timeline.frameChanged.connect(self.horizontal Slider.setValue)

    self.pushButton.clicked.connect(self.timeline.star t)
    thanks again
    cheers!
    Last edited by Nfrancisj; 28th March 2016 at 11:18.

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qtimeline doesn't run

    Quote Originally Posted by Nfrancisj View Post
    In Qt framework, do SIGNALS broadcast a specific value?
    Those that have arguments do.

    Quote Originally Posted by Nfrancisj View Post
    for example, timeline.frameChanged, what does this signal send?
    The new frame number, the value "currentFrame" changed to.
    Quote Originally Posted by The QTimeLine Documentation
    frame is the current frame number.
    Cheers,
    _

Similar Threads

  1. Replies: 0
    Last Post: 24th May 2010, 08:11
  2. QTimer and QTimeLine
    By martisho in forum Qt Programming
    Replies: 3
    Last Post: 24th November 2009, 14:29
  3. discontinuous QTimeLine problem
    By yagabey in forum Qt Programming
    Replies: 0
    Last Post: 2nd December 2008, 21:20
  4. QTimeLine
    By babu198649 in forum Newbie
    Replies: 6
    Last Post: 31st January 2008, 10:32
  5. QGraphicsItemAnimation and QTimeLine
    By babu198649 in forum Newbie
    Replies: 13
    Last Post: 31st December 2007, 11:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.