[Kde-bindings] KDE/kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Dec 14 16:48:58 UTC 2006


SVN commit 613683 by rdale:

* Added the painting/imagecomposition example
* Added a convenience method Qt::Image.fromImage() to assign one image
  from another. This is because the C++ QImage::operator=(const QImage&)
  method isn't easily called from QtRuby
* Fixed do_method_missing() so that 'operator=' methods don't get 
  transformed into setOperator() methods

CCMAIL: kde-bindings at kde.org



 M  +6 -0      ChangeLog  
 A             rubylib/examples/painting/imagecomposition (directory)  
 A             rubylib/examples/painting/imagecomposition/imagecomposer.rb  
 A             rubylib/examples/painting/imagecomposition/imagecomposition.qrc  
 A             rubylib/examples/painting/imagecomposition/images (directory)  
 AM            rubylib/examples/painting/imagecomposition/images/background.png  
 AM            rubylib/examples/painting/imagecomposition/images/blackrectangle.png  
 AM            rubylib/examples/painting/imagecomposition/images/butterfly.png  
 AM            rubylib/examples/painting/imagecomposition/images/checker.png  
 A             rubylib/examples/painting/imagecomposition/main.rb  
 A             rubylib/examples/painting/imagecomposition/makefile  
 M  +7 -3      rubylib/qtruby/lib/Qt/qtruby4.rb  


--- trunk/KDE/kdebindings/qtruby/ChangeLog #613682:613683
@@ -1,6 +1,12 @@
 2006-12-14  Richard Dale  <rdale at foton.es>
 
 	* Added the painting/svgviewer example
+	* Added the painting/imagecomposition example
+	* Added a convenience method Qt::Image.fromImage() to assign one image
+	  from another. This is because the C++ QImage::operator=(const QImage&)
+	  method isn't easily called from QtRuby
+	* Fixed do_method_missing() so that 'operator=' methods don't get 
+	  transformed into setOperator() methods
 
 2006-12-12  Richard Dale  <rdale at foton.es>
 
** trunk/KDE/kdebindings/qtruby/rubylib/examples/painting/imagecomposition/images/background.png #property svn:mime-type
   + application/octet-stream
** trunk/KDE/kdebindings/qtruby/rubylib/examples/painting/imagecomposition/images/blackrectangle.png #property svn:mime-type
   + application/octet-stream
** trunk/KDE/kdebindings/qtruby/rubylib/examples/painting/imagecomposition/images/butterfly.png #property svn:mime-type
   + application/octet-stream
** trunk/KDE/kdebindings/qtruby/rubylib/examples/painting/imagecomposition/images/checker.png #property svn:mime-type
   + application/octet-stream
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby4.rb #613682:613683
@@ -806,6 +806,10 @@
 	end
 
 	class Image < Qt::Base
+		def fromImage(image)
+			send("operator=".to_sym, image)
+		end
+
 		def format(*args)
 			method_missing(:format, *args)
 		end
@@ -1970,9 +1974,9 @@
 		def Internal.checkarg(argtype, typename)
 			puts "      #{typename} (#{argtype})" if debug_level >= DebugLevel::High
 			if argtype == 'i'
-				if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$/
+				if typename =~ /^int&?$|^signed int&?$|^signed$|^qint32&?$|^quint32&?$/
 					return 1
-				elsif typename =~ /^(?:short|ushort|unsigned short int|uchar|uint|long|ulong|unsigned long int|unsigned|float|double|WId|Q_PID)$/
+				elsif typename =~ /^(?:short|ushort|unsigned short int|uchar|uint|long|ulong|unsigned long int|unsigned|float|double|WId|Q_PID|^quint16&?$|^qint16&?$)$/
 					return 0
 				elsif typename =~ /^(quint|qint|qulong|qlong|qreal)/
 					return 0
@@ -2105,7 +2109,7 @@
 			end
 			method = "operator" + method.sub("@","") if method !~ /[a-zA-Z]+/
 			# Change foobar= to setFoobar()					
-			method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/
+			method = 'set' + method[0,1].upcase + method[1,method.length].sub("=", "") if method =~ /.*[^-+%\/|=]=$/ && method != 'operator='
 
 			methods = []
 			methods << method.dup



More information about the Kde-bindings mailing list