Qt World Summit: Register Today!

[Solved]How can I change the mouse cursor to busy state ?

  • Hi,

    Its quite simple, I got a settings dialog using a QWizard. When changing from the first page to the second, building the second page might take some time. Displaying a status bar is not possible because I don't know beforehand how long it might take, so I was thinking to change the mouse cursor to Qt::WaitCursor like this:
    @void MyWizard::handlePageChanged(int a_pageId)
    case WIZARD_PAGE::Page_Intro: break;
    case WIZARD_PAGE::Page_Table: QApplication::overrideCursor()->setShape(Qt::WaitCursor);
    case WIZARD_PAGE::Page_Result: break;
    But that didn't work. Has anyone got an idea how to achieve this, maybe an event I can post or a static call?

    EDIT: Kind of solved it myself. I'm now using @QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));@
    and @QApplication::restoreOverrideCursor();@

    But the cursor isn't spinning. Does anyone know how to achieve this?

  • Another way setting cursor

  • Well you can animate manually
    @QCursor::QCursor ( const QPixmap & pixmap, int X, int Y)

  • please....

    QApplication::setOverrideCursor is the API to choose here.

  • Is there simpler(standard) way to animate cursor?

Log in to reply