Results 1 to 8 of 8

Thread: Some questions about QT animation?

  1. #1
    Join Date
    Oct 2009
    Posts
    32
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Some questions about QT animation?

    I'm a freshman for QT, and I like it very much. Now I have some questions about QT, Hope you can give me some advice. thanks.

    1) How to do a opacity animation for Widget, I notice the widget's property windowsOpacity, but it is all apply for the top-level window, not
    for the child widget. and I notice that there is a new animation framework(QtPropertyAnimation), but I still haven't find how to do a opacity animation for child widget
    using it. Can you give me some advice? or where I can find the simple sample for it? thanks.

    2) In Windows platform, If use WPF(Windows Presentation Foundation), the designer and developer use the same XAML file, so they can collaborate with a seamless mode.
    What's the collaborate mode in QT between with designer and developer? Such as control style, control template and so on. thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Some questions about QT animation?

    Quote Originally Posted by tszzp View Post
    1) How to do a opacity animation for Widget, I notice the widget's property windowsOpacity, but it is all apply for the top-level window, not
    for the child widget. and I notice that there is a new animation framework(QtPropertyAnimation), but I still haven't find how to do a opacity animation for child widget
    using it. Can you give me some advice? or where I can find the simple sample for it? thanks.
    Without subclassing it won't be possible. You have to subclass each widget and introduce the opacity there. Alternatively with Qt 4.6+ you can use the new QGraphicsEffect class that you can apply on graphics items and widgets. It copes well with the animation framework you mentioned.

    2) In Windows platform, If use WPF(Windows Presentation Foundation), the designer and developer use the same XAML file, so they can collaborate with a seamless mode.
    What's the collaborate mode in QT between with designer and developer? Such as control style, control template and so on. thanks.
    Currently we have stylesheets and Qt Designer for collaboration between des and dev. Later on (probably since Qt 4.7) we'll also have the so called "Declarative UI" (QML) language.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2009
    Posts
    32
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Some questions about QT animation?

    wysota,thank you for your reply. I still have some problems about it.
    1) subclass each widget and introduce the opacity there, can you give me more explain or give me a simple sample? thanks. and I think if subclass each widget and introduce the opacity, it is a big task to develop if need do opacity animation for many widget. if have the simple method to do it like WPF.
    2) Where I can find the QGraphicsEffect sample to do graphic item or widget's opacity animation?
    thanks again.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Some questions about QT animation?

    Quote Originally Posted by tszzp View Post
    1) subclass each widget and introduce the opacity there, can you give me more explain or give me a simple sample? thanks.
    You need to call QPainter::setOpacity() for every first non-opaque widget in the hierarchy. Opacity is propagated so you don't need to do it for its children.

    and I think if subclass each widget and introduce the opacity, it is a big task to develop if need do opacity animation for many widget.
    Yes, that's true.

    if have the simple method to do it like WPF.
    You can put everything into QGraphicsView and handle it there with one call but obviously this won't work for top-level widgets.

    2) Where I can find the QGraphicsEffect sample to do graphic item or widget's opacity animation?
    In Qt 4.6 docs.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2009
    Posts
    32
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Some questions about QT animation?

    Thank wysota, I already know how to do the opacity animation by subclass each widget and introduce the opacity there. but I still can't find the QGraphicsEffect in my document and source code of qtanimationframework-2.3-opensource. the qtanimationframework-2.3-opensource is download from http://qt.nokia.com/products/appdev/...ationframework, the real link is ftp://ftp.trolltech.com/qt/solutions...opensource.zip.

    As I know, the qt4.6 isn't release now, it is only beta version. So my questions are as below:
    1) now I use the qt version is qt 2009.03 open source version, I integrate it with VS2008, and compile the animation framework 2.3 opensource code, but I can't find the QGraphicsEffect in the document and source code of animation framework 2.3 opensource. so if I can find the new animation framework code to support the QGraphicEffect? If can, can you give me the link for download.

    2) If I download the qt4.6 beta version, Can I integrate it in VS2008, not MinGW in Windows platform? now I try the opensource version,not the commercial version.

    3) If use the QGraphicEffect to do widget's opacity animation, Is it write the less code than using the subclass each widget and introduce the opacity?

    thank you very much.

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Some questions about QT animation?

    2) If I download the qt4.6 beta version, Can I integrate it in VS2008, not MinGW in Windows platform? now I try the opensource version,not the commercial version.
    I guess you can

    I am using 4.6.0-beta1 with Visual Studio 2005. I had built Qt with VS 2005. I dont have Qt designer integrated into Visual Studio, but I guess thers some add in for that. But basic things I can do easily.
    To install Qt -
    1) Download Qt source code.
    2) Open Visual Studio command prompt in the extracted folder and run configure.exe -platform msvc-2008 ( chk the proper name with configure.exe -help)
    3) follow the steps and finally after configure is done, u will need to run nmake

    Thats to build Qt

    To make project -
    1) qmake -project
    2) qmake -tp vc // will generate .vcproj
    3) open the .vcproj in Visual studio

    hope this helps

  7. #7
    Join Date
    Oct 2009
    Posts
    32
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Some questions about QT animation?

    thanks you for your reply. I want to know if there is QGraphicsEffect in qt4.6 beta 1. thanks.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Some questions about QT animation?

    Quote Originally Posted by tszzp View Post
    but I still can't find the QGraphicsEffect in my document and source code of qtanimationframework-2.3-opensource.
    Probably because it's not there. It's not part of the animation framework.

    If can, can you give me the link for download.
    Again, it's not part of the animation framework so obviously you won't find it there.

    2) If I download the qt4.6 beta version, Can I integrate it in VS2008, not MinGW in Windows platform?
    Yes.

    3) If use the QGraphicEffect to do widget's opacity animation, Is it write the less code than using the subclass each widget and introduce the opacity?
    I'd say so. It's two lines of code against at least 6 lines of code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Animation and QGraphics
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2009, 00:31
  2. Who gets questions answered and who doesn't?
    By gjshannon in forum General Discussion
    Replies: 15
    Last Post: 19th March 2009, 21:02
  3. Animation while connecting on a tcpsocket
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 26th December 2007, 10:34
  4. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  5. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

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.