Results 1 to 4 of 4

Thread: setCursor & a disabled Widget

  1. #1
    Join Date
    Sep 2008
    Location
    Paris
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default setCursor & a disabled Widget

    Hello !
    I'ld like to set a cursor when a widget is disabled :

    Qt Code:
    1. QPushButton *mywidget= new QPushButton();
    2. mywidget -> setEnabled(false);
    3. mywidget -> setCursor(Qt::ForbiddenCursor);
    To copy to clipboard, switch view to plain text mode 

    It doesn't work. Qt permit that or not ?

  2. #2
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setCursor & a disabled Widget

    Have you tried to set the cursor first then disable the push button?

  3. #3
    Join Date
    Sep 2008
    Location
    Paris
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setCursor & a disabled Widget

    yes i tried.
    But it cant be the problem, we should set a property whenever we want for a simple case like that.

  4. #4
    Join Date
    Sep 2008
    Location
    Paris
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setCursor & a disabled Widget

    ok i've got it, we can do that :

    http://doc.trolltech.com/4.4/qwidget.html#enabled-prop

    Citation:
    An enabled widget handles keyboard and mouse events; a disabled widget does not.

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Widget Focus
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2008, 10:22
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.