2010年10月14日木曜日

QtRuby qtbindings



qtbindings provides ruby bindings to QT4.x. It is derived from the kdebindings project.

C:\ruby>ruby -vruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
C:\ruby>gem list
*** LOCAL GEMS ***
atk (0.90.2 x86-mingw32)
cairo (1.10.0 x86-mingw32)
gdk_pixbuf2 (0.90.2 x86-mingw32)
glib2 (0.90.2 x86-mingw32)
gtk2 (0.90.2 x86-mingw32)
pango (0.90.2 x86-mingw32)
pkg-config (1.0.6)
poppler (0.90.2 x86-mingw32)
qtruby4 (2.1.0 mswin32)
rake (0.8.7)
rsvg2 (0.90.2 x86-mingw32)


-------qtruby4をgem uninstallしてもruby187\binの下のqt**のファイルがあると----
-------qtbindingsが動かなかったのでruby187を再インストールする-----

C:\ruby>rename ruby187 ruby187_old


-----rubyinstaller-1.8.7-p302.exeをインストール-----

C:\ruby>cd DevKit
C:\ruby\DevKit>ruby dk.rb init

[INFO] found RubyInstaller v1.8.7 at C:/ruby/Ruby187
[INFO] found RubyInstaller v1.9.1 at C:/ruby/Ruby191
[INFO] found RubyInstaller v1.9.2 at C:/ruby/Ruby192
Initialization complete! Please review and modify the auto-generated'config.yml' file to ensure it contains the root directories to allof the installed Rubies you want enhanced by the DevKit.
C:\ruby\DevKit>ruby dk.rb review

Based upon the settings in the 'config.yml' file generatedfrom running 'ruby dk.rb init' and any of your customizations,DevKit functionality will be injected into the following Rubieswhen you run 'ruby dk.rb install'.
C:/ruby/Ruby187

C:/ruby/Ruby191

C:/ruby/Ruby192
C:\ruby\DevKit>ruby dk.rb install

[INFO] Installing C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/defaults/operating_system.rb

[INFO] Installing C:/ruby/Ruby187/lib/ruby/site_ruby/devkit.rb

[INFO] RubyGems override already in place for C:/ruby/Ruby191, skipping.

[WARN] DevKit helper library already exists for C:/ruby/Ruby191, skipping.

[INFO] RubyGems override already in place for C:/ruby/Ruby192, skipping.

[WARN] DevKit helper library already exists for C:/ruby/Ruby192, skipping.
C:\ruby\DevKit>gem install qtbindingsTemporarily enhancing PATH to include DevKit...Successfully installed qtbindings-4.6.3.1-x86-mingw321 gem installedInstalling ri documentation for qtbindings-4.6.3.1-x86-mingw32...Installing RDoc documentation for qtbindings-4.6.3.1-x86-mingw32...
C:\ruby\DevKit>rbrcc -version

Ruby Resource Compiler for Qt version 4.6.3
C:\ruby\DevKit>rbuic4 -v

Qt User Interface Compiler version 4.6.3
C:\ruby\DevKit>rbqtapi -v

QtRuby 2.0.5 using Qt-4.6.3
C:\ruby\DevKit>gem list
*** LOCAL GEMS ***
qtbindings (4.6.3.1 x86-mingw32)
------examplesのcalculatorbuilderとcalculatorformをnmakeした------
C:\ruby\DevKit>cd C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer\calculatorbuilder
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer\calculatorbuilder>nmake
Microsoft (R) Program Maintenance Utility Version 1.50Copyright (c) Microsoft Corp 1988-94. All rights reserved.
rbrcc calculatorbuilder.qrc -o qrc_calculatorbuilder.rb
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer\calculatorbuilder>cd ..
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer>cd calculatorform
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer\calculatorform>nmake
Microsoft (R) Program Maintenance Utility Version 1.50Copyright (c) Microsoft Corp 1988-94. All rights reserved.
rbuic4 calculatorform.ui -o ui_calculatorform.rb
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer\calculatorform>cd ..
C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples\designer>cd ..


----examplesのrun_allを動かしてみる-----

C:\ruby\Ruby187\lib\ruby\gems\1.8\gems\qtbindings-4.6.3.1-x86-mingw32\examples>ruby run_all.rb

running: cd designer\calculatorbuilder && ruby -rubygems main.rbrunning: cd designer\calculatorform && ruby -rubygems main.rb
----qtruby4ではerrorだったscreenshotが動いている----

running: cd desktop\screenshot && ruby -rubygems main.rbrunning: cd desktop\systray && ruby -rubygems main.rbC:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- ./qrc_systray.rb (LoadError) from C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from main.rb:27running: cd dialogs\complexwizard && ruby -rubygems main.rb

*************************************************************************
ruby1.9.2でもgem install qtbindingsしたが漢字が化けたり,
examplesは動作したがexamples以外のdirでやるとrequire 'example.rb'などでloaderrorとなったりする。

0 件のコメント:

コメントを投稿