[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebindings/qtruby
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2004-07-27 22:25:45
Message-ID: 20040727222545.723969A00 () office ! kde ! org
[Download RAW message or body]

CVS commit by rdale: 


* The recently added Qt::Integer bit operators were returning a ruby Integer
  type. When they were nested, the Integer didn't know how to convert the
  Enum it was being or'd with to an Integer.

* The solution is to add bit operators to the Enum class which return Enums
  rather than Integers.

* The following code didn't work:
    
    def initialize(message)
        super(nil, "passivedlg",
                Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop |
                Qt::WStyle_Tool | Qt::WStyle_NoBorder)


  M +16 -0     ChangeLog   1.93
  M +17 -0     rubylib/qtruby/lib/Qt/qtruby.rb   1.28


--- kdebindings/qtruby/ChangeLog  #1.92:1.93
@@ -1,4 +1,20 @@
 2004-07-27  Richard Dale  <Richard_Dale@tipitina.demon.co.uk>
 
+        * The recently added Qt::Integer bit operators were returning a ruby Integer
+          type. When they were nested, the Integer didn't know how to convert the
+          Enum it was being or'd with to an Integer.
+        
+        * The solution is to add bit operators to the Enum class which return Enums
+          rather than Integers.
+
+        * The following code didn't work:
+            
+            def initialize(message)
+                super(nil, "passivedlg",
+                        Qt::WStyle_Customize | Qt::WX11BypassWM | Qt::WStyle_StaysOnTop |
+                        Qt::WStyle_Tool | Qt::WStyle_NoBorder)
+
+2004-07-27  Richard Dale  <Richard_Dale@tipitina.demon.co.uk>
+
         * Replaced QString casts to 'const char *' with latin1() calls
 

--- kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb  #1.27:1.28
@@ -154,4 +154,21 @@
                         @type = type
                 end
+                
+                def |(n) 
+                        return Enum.new(@value | n.to_i, @type)
+                end
+                def &(n) 
+                        return Enum.new(@value & n.to_i, @type)
+                end
+                def ^(n) 
+                        return Enum.new(@value ^ n.to_i, @type)
+                end
+                def <<(n) 
+                        return Enum.new(@value << n.to_i, @type)
+                end
+                def >>(n) 
+                        return Enum.new(@value >> n.to_i, @type)
+                end
+                
                 def to_i() return @value end
         end


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic