From: Stefano Crocco Date: 2008-12-09T16:22:11+09:00 Subject: Re: Ruby QT Hiding the mouse Alle Tuesday 09 December 2008, Michael Pope ha scritto: > I'm currently trying to build an application using Ruby with QT which > just shows output from a log with colors and logos etc. I would like to > hide the mouse cursor if possible. > > I have managed to hide the cursor on the application using: > > # Start GUI > app = Qt::Application.new(ARGV) > > widget = MyWidget.new(nil) > widget.show() > > # set the cursor for the main area to blank. > widget.cursor = Qt::Cursor.new(Qt::BlankCursor) > > # Start the app > app.exec() > > > > But I cannot do the same for a TextEdit Widget. > > How do I go about hiding the cursor on a TextEdit widget? > Or is it possible to say hide the cursor for every widget in my > application? Qt::Widget#cursor= changes the cursor only for the receiver widget (in your case, the instance of MyWidget), but not for its children or other widget. To change the cursor for all widget, you can use Qt::Application.override_cursor=. This is the method which you use, for example, to display a busy cursor (which, of course, should affect all the widget in the application, not just one). However, in my opinion, hiding the cursor in a GUI application produces an unexpected behaviour for the user who is quite likely to spend some time looking around the screen to find out where the arrow has gone. Are you sure this is what you want? I hope this helps Stefano