Results 1 to 8 of 8

Thread: WaitCursor is ignored

  1. #1
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default WaitCursor is ignored

    Hey,

    I want to display a widget as disabled (setEnabled(false)) with its cursor set to Qt::WaitCursor. Disabling the widget, however, always display the widget with a normal Qt::ArrowCursor. How do I obtain a disabled widget with a Qt::WaitCursor. Code that reproduces the problem is shown below.

    Best regards,

    Mads

    Qt Code:
    1. #include <QWidget>
    2. #include <QApplication>
    3. #include <QCursor>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8.  
    9. QWidget *widget = new QWidget;
    10. widget->show();
    11.  
    12. QCursor cursor(Qt::WaitCursor);
    13. widget->setCursor(cursor);
    14. widget->setDisabled(true);
    15.  
    16. return app.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    the code you posted works perfectly for me, I get the wait cursor over the widget, if I comment out the wait cursor in your code the cursor gets to be the normal arrow.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    mpi (3rd November 2009)

  4. #3
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    I was expecting something like this. What system are you on?

    Mine is:

    Ubuntu 8.04
    qt-x11-opensource-src-4.5.2
    Gnome 2.22.3

  5. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    At the moment I am on XPSP3, I ran this example on Creator but with MS compiler, Qt4.4.3 commercial.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #5
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    Some more info:

    Fails on: KUbuntu 9.04 and Ubuntu 9.04, Qt 4.5.2
    Works on Mac OS X 10.6.2, Qt 4.6.0-beta1

  7. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    Have a look at the bug tracker... maybe its a known issue.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  8. #7
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    Where do I find the bug tracker?

    Mads

  9. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: WaitCursor is ignored

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. The following user says thank you to high_flyer for this useful post:

    mpi (3rd November 2009)

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.