qtext 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -241,13 +241,12 @@ module Qt
241
241
  # Provide a shortcut for the Qt::Key_Whatever constants. Just say event.whatever?
242
242
  def method_missing( sym, *args, &block )
243
243
  begin
244
- if sym.to_s[-1] == "?"[0]
245
- key?( sym.to_s[0..-2] )
244
+ st = sym.to_s
245
+ if st.chomp!( '?' )
246
+ key?( st )
246
247
  else
247
248
  old_method_missing( sym, *args, &block )
248
249
  end
249
- rescue Exception => e
250
- old_method_missing( sym, *args, &block )
251
250
  end
252
251
  end
253
252
 
@@ -2,7 +2,7 @@ module Qtext #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 6
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,33 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ #~ require 'active_support'
4
+
5
+ require 'sequel/core'
6
+ require 'sequel/extensions/inflector'
7
+
8
+ module Sequel; end
9
+
10
+ $app = Qt::Application.new []
11
+
12
+ class TestWidget < Test::Unit::TestCase
13
+
14
+ #~ Qt::NoModifier 0x00000000 No modifier key is pressed.
15
+ #~ Qt::ShiftModifier 0x02000000 A Shift key on the keyboard is pressed.
16
+ #~ Qt::ControlModifier 0x04000000 A Ctrl key on the keyboard is pressed.
17
+ #~ Qt::AltModifier 0x08000000 An Alt key on the keyboard is pressed.
18
+ #~ Qt::MetaModifier 0x10000000 A Meta key on the keyboard is pressed.
19
+ #~ Qt::KeypadModifier 0x20000000 A keypad button is pressed.
20
+ #~ Qt::GroupSwitchModifier
21
+ def setup
22
+ @key_event = Qt::KeyEvent.new( Qt::Event::KeyPress, Qt::Key_Down, Qt::NoModifier )
23
+ end
24
+
25
+ def test_camelize
26
+ assert "somstring".respond_to?( :camelize ), "String has no camelize method"
27
+ end
28
+
29
+ should 'have the key? methods' do
30
+ assert @key_event.key? 'down'
31
+ assert @key_event.down?, "Key is not Qt::Key_Down"
32
+ end
33
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qtext
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
5
- prerelease: false
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 6
10
- version: 0.6.6
9
+ - 7
10
+ version: 0.6.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Anderson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-20 00:00:00 +02:00
18
+ date: 2011-05-24 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -74,6 +74,7 @@ files:
74
74
  - test/test_widget.rb
75
75
  - test/test_model_index_extensions.rb
76
76
  - test/test_hash_collector.rb
77
+ - test/test_key_event.rb
77
78
  has_rdoc: true
78
79
  homepage: http://qtext.rubyforge.org
79
80
  licenses: []
@@ -105,13 +106,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  requirements: []
106
107
 
107
108
  rubyforge_project: qtext
108
- rubygems_version: 1.3.7
109
+ rubygems_version: 1.4.2
109
110
  signing_key:
110
111
  specification_version: 3
111
112
  summary: description of gem
112
113
  test_files:
113
114
  - test/test_model_index_extensions.rb
114
- - test/test_object_table.rb
115
+ - test/test_helper.rb
115
116
  - test/test_hash_collector.rb
117
+ - test/test_key_event.rb
116
118
  - test/test_widget.rb
117
- - test/test_helper.rb
119
+ - test/test_object_table.rb