Results 1 to 8 of 8

Thread: QSplashScreen loading icon

  1. #1
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QSplashScreen loading icon

    hi,

    I am using a QSplashScreen with a loading gif icon on it..and although the splashscreen shows, the loading icon doesnt show animation..i m already using QMovie with the gif icon and have started the movie..if i place a messagebox in the processing(till the application shows), the loading icon animates..although if i stop it, there is no animation..i have also used processEvents but it still doesnt work..Could anyone please direct me to a possible solution?

    Thanks
    Amulya

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    Where did you put processEvents()? QMovie needs a running event loop to operate.

  3. #3
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    well, after i show the splash screen with the loading icon, there is a LOT of processing going on like loading plugins, certain interfaces, lots of initialization and other things..due to which the loading icon doesnt animate at all..after i put a number of processEvents() around, it did start to move intermittently..but still its not smooth..i cant show the splash screen in another thread also cuz of gui operations..i dont see any other options to show the animations on it..could u suggest anth..i cant use a QEventLoop either..doesnt make any sense..until this QMovie doesnt get its own seperate running event loop, i dont think it'll work..any directions would be helpful

    Thanks

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    all u good guys.. please direct me into solving this issue

  5. #5
    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: QSplashScreen loading icon

    Not sure if this will work,,, but you can try putting the loading logic in QSplashScreen class.

  6. #6
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    no man, thats not going to work at all...

  7. #7
    Join Date
    Apr 2008
    Location
    Karaj,Iran
    Posts
    43
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    I have created a specific class for my loading:
    workingAnimation.h file
    Qt Code:
    1. #include <QLabel>
    2. #include <QMovie>
    3. #ifndef workingIcon_CLASS
    4. #define workingIcon_CLASS
    5. class workingIcon:public QLabel
    6. {
    7. public:
    8. workingIcon(QWidget *parent=0);
    9. ~workingIcon();
    10.  
    11. private:
    12. QMovie *movie;
    13. QPixmap WinMask;
    14. };
    15. #endif
    To copy to clipboard, switch view to plain text mode 
    workingAnimation.cpp file
    Qt Code:
    1. #include "workingAnimation.h"
    2. #include <QPixmap>
    3. #include <QBitmap>
    4. #include <QDebug>
    5. #include <QDesktopWidget>
    6. #include <QApplication>
    7. workingIcon::workingIcon(QWidget *parent)
    8. :QLabel(parent)
    9. {
    10. setWindowFlags(Qt::FramelessWindowHint);
    11. setWindowModality(Qt::ApplicationModal);
    12. movie=new QMovie(":images/working.gif");
    13. movie->jumpToFrame(movie->frameCount());
    14. WinMask=movie->currentPixmap();
    15. setMask(WinMask.mask());
    16. setMovie(movie);
    17. movie->start();
    18. QDesktopWidget *desktop = QApplication::desktop();
    19. int w = desktop->width(); // returns desktop width
    20. int h = desktop->height(); // returns desktop height
    21. move(int((w/2)-(WinMask.width())),int((h/2)-(WinMask.height())));
    22. }
    23. workingIcon::~workingIcon()
    24. {
    25. qDebug()<<"clearing movie Object";
    26. //delete movie;
    27. }
    To copy to clipboard, switch view to plain text mode 
    the gif for the loading is embedded into resources , now you just have to instantiate the class and call show method and call the close method when your preferred data has been loaded,hope it works
    ---
    A situtation never gets so complicated that it can't get any more complicated!

  8. #8
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplashScreen loading icon

    i've done the same thing already man, the problem is that loading icon doesnt get events processed for it to be shown as animated..the other intensive loading work is takin all cpu cycles due to which the loading icon doesnt get animated properly..the problem is smwhere in event handling of QMovie...

Similar Threads

  1. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  2. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  3. QSplashScreen Weirdness
    By mclark in forum Qt Programming
    Replies: 11
    Last Post: 19th November 2007, 06:49
  4. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23

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.