Forum: Ruby Ruby QT Hiding the mouse

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Michael P. (Guest)
on 2008-12-09 05:00
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 =

widget =

# set the cursor for the main area to blank.
widget.cursor =

# Start the app

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
Stefano C. (Guest)
on 2008-12-09 09:29
(Received via mailing list)
Alle Tuesday 09 December 2008, Michael Pope ha scritto:
> 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
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
widget in the application, not just one).

However, in my opinion, hiding the cursor in a GUI application produces
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
this is what you want?

I hope this helps

Erika (Guest)
on 2008-12-09 11:14
(Received via mailing list)

I have to check the body of the email which is a html code, like the
<tr><td>Text1: </td>


I have to check that for "Text1" what "Text2" is shown, which can vary
for different reasons.

I managed to get the emails, to check the subject of the email to
identify the correct email, but I can't get to resolve this problem
which I mentioned previously.

Thank you,

    require 'net/pop'

    pop ='smtp server name')
    pop.start('user', 'parola')
    if pop.mails.empty?
      puts 'No mail.'
      i = 0
      pop.each_mail do |m|
        puts sbj
        puts m.pop
        i += 1
      puts "#{pop.mails.size} mails popped."
Erika (Guest)
on 2008-12-09 11:30
(Received via mailing list)
Sorry, I wanted to create a new post only by mistake I gave reply to
your post.
Sorry again.
Robert D. (Guest)
on 2008-12-09 17:40
(Received via mailing list)
On Tue, Dec 9, 2008 at 10:05 AM, Erika <removed_email_address@domain.invalid> 

assuming that you have managed to pop your body into one string, what
about the following

   ary = mail.scan( %r{<tr>(.*?)</tr>} ).
   map{ |ttext| ttext.scan( %r{<td>(.*?)</td>} )[0..1] }

And if you want to have a hash

   Hash[ *ary.flatten ]

and if Text2 happens to be the key

   Hash[ *{|x| x.reverse}.flatten ]

It would be a nice exercise for you to optimize the solution for that
last case ;)


Il computer non è una macchina intelligente che aiuta le persone
stupide, anzi, è una macchina stupida che funziona solo nelle mani
delle persone intelligenti.
Computers are not smart to help stupid people, rather they are stupid
and will work only if taken care of by smart people.

Umberto Eco
mutati0n mutati0n (Guest)
on 2008-12-10 01:06
(Received via mailing list)
not at all
This topic is locked and can not be replied to.