List Info

Thread: Qt::QEvent.type conflict with Object.type




Qt::QEvent.type conflict with Object.type
country flaguser name
China
2007-10-30 01:20:58
Dear all,
    Something like "if event.type ==
Qt::Event::KeyPress" only gives 
"warning: Object#type is deprecated; use
Object#class", and does not 
work as expected.
    How to resolve this?

Thanks.

_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

Re: Qt::QEvent.type conflict with Object.type
user name
2007-10-30 02:56:26
On Tuesday 30 October 2007 06:20:58 Magicloud Magiclouds
wrote:
> Dear all,
>     Something like "if event.type ==
Qt::Event::KeyPress" only gives
> "warning: Object#type is deprecated; use
Object#class", and does not
> work as expected.
>     How to resolve this?
That should work, but the type() method needs to be special
cased for each 
Qt::Event class. Which version of QtRuby and which Qt::Event
class is it?

-- Richard
_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

Re: Qt::QEvent.type conflict with Object.type
country flaguser name
China
2007-10-30 04:23:00
Dear,
	My qtruby is 1.4.9, ruby is 1.8.6.111.
	I also tried "if event.type() ==
Qt::Event::KeyPress", same warning....

Thanks.

Richard Dale wrote:
> On Tuesday 30 October 2007 06:20:58 Magicloud
Magiclouds wrote:
>> Dear all,
>>     Something like "if event.type ==
Qt::Event::KeyPress" only gives
>> "warning: Object#type is deprecated; use
Object#class", and does not
>> work as expected.
>>     How to resolve this?
> That should work, but the type() method needs to be
special cased for each 
> Qt::Event class. Which version of QtRuby and which
Qt::Event class is it?
> 
> -- Richard
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindingskde.org
> ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
> 
_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

Re: Qt::QEvent.type conflict with Object.type
user name
2007-10-30 04:29:48
On Tuesday 30 October 2007 09:23:00 Magicloud Magiclouds
wrote:
> Dear,
> 	My qtruby is 1.4.9, ruby is 1.8.6.111.
> 	I also tried "if event.type() ==
Qt::Event::KeyPress", same warning....
Thanks, but what sort of event is it?

>
> Richard Dale wrote:
> > On Tuesday 30 October 2007 06:20:58 Magicloud
Magiclouds wrote:
> >> Dear all,
> >>     Something like "if event.type ==
Qt::Event::KeyPress" only gives
> >> "warning: Object#type is deprecated; use
Object#class", and does not
> >> work as expected.
> >>     How to resolve this?
> >
> > That should work, but the type() method needs to
be special cased for
> > each Qt::Event class. Which version of QtRuby and
which Qt::Event class
> > is it?
> >
> > -- Richard
> > _______________________________________________
> > Kde-bindings mailing list
> > Kde-bindingskde.org
> > ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
>
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindingskde.org
> ht
tps://mail.kde.org/mailman/listinfo/kde-bindings


_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

Re: Qt::QEvent.type conflict with Object.type
country flaguser name
China
2007-10-30 05:26:06
Dear,
	This is it.
app = Qt::Application.new(ARGV)
app.installEventFilter(Yak::KeyDispatcher.new)
...
module Yak
   class KeyDispatcher < Qt::Object
     def initialize
       super
     end
     def eventFilter(object, event)
       if event.type() == Qt::Event::KeyPress # Here, if I 
puts(event.type()), it does output integers which are the
values of 
event consts. But in '==' operation, it warns and never
equals.
# deal with all key input.
         return true
       else
         return super(object, event)
       end
     end
     protected(:eventFilter)
   end
end
	


Richard Dale wrote:
> On Tuesday 30 October 2007 09:23:00 Magicloud
Magiclouds wrote:
>> Dear,
>> 	My qtruby is 1.4.9, ruby is 1.8.6.111.
>> 	I also tried "if event.type() ==
Qt::Event::KeyPress", same warning....
> Thanks, but what sort of event is it?
> 
>> Richard Dale wrote:
>>> On Tuesday 30 October 2007 06:20:58 Magicloud
Magiclouds wrote:
>>>> Dear all,
>>>>     Something like "if event.type ==
Qt::Event::KeyPress" only gives
>>>> "warning: Object#type is deprecated;
use Object#class", and does not
>>>> work as expected.
>>>>     How to resolve this?
>>> That should work, but the type() method needs
to be special cased for
>>> each Qt::Event class. Which version of QtRuby
and which Qt::Event class
>>> is it?
>>>
>>> -- Richard
>>>
_______________________________________________
>>> Kde-bindings mailing list
>>> Kde-bindingskde.org
>>> ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
>> _______________________________________________
>> Kde-bindings mailing list
>> Kde-bindingskde.org
>> ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
> 
> 
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindingskde.org
> ht
tps://mail.kde.org/mailman/listinfo/kde-bindings
> 
_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

Re: Qt::QEvent.type conflict with Object.type
country flaguser name
China
2007-10-30 21:21:01
Dear,
	It is interesting that eventFilter in the examples go with
qtruby 
source work.
	While I looked into the killerfilter and calculator source,
I found no 
difference comparing to my code....

Thanks.
_______________________________________________
Kde-bindings mailing list
Kde-bindingskde.org
ht
tps://mail.kde.org/mailman/listinfo/kde-bindings

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )