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]How can I change the mouse cursor to busy state ?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 19.4k Views
  • 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.
  • K Offline
    K Offline
    KA51O
    wrote on 25 Nov 2011, 13:16 last edited by
    #1

    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)
    {
    switch(a_pageId)
    {
    case WIZARD_PAGE::Page_Intro: break;
    case WIZARD_PAGE::Page_Table: QApplication::overrideCursor()->setShape(Qt::WaitCursor);
    fillTableItemsList();
    m_pTable->setModel(m_pFilterProxy);
    QApplication::overrideCursor()->setShape(Qt::ArrowCursor);
    break;
    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?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on 25 Nov 2011, 13:33 last edited by
      #2

      Another way setting cursor
      @this->setCursor(QCursor(Qt::WaitCursor));@

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on 25 Nov 2011, 13:35 last edited by
        #3

        Well you can animate manually
        @QCursor::QCursor ( const QPixmap & pixmap, int X, int Y)
        ...
        QWidget::setCursor(...);
        @

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 25 Nov 2011, 23:15 last edited by
          #4

          please....

          QApplication::setOverrideCursor is the API to choose here.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qxoz
            wrote on 28 Nov 2011, 05:09 last edited by
            #5

            Is there simpler(standard) way to animate cursor?

            1 Reply Last reply
            0

            1/5

            25 Nov 2011, 13:16

            • Login

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