[Kde-bindings] make Qt::Object superclass of rbuic's UI class

airh2002 airh2002 at oak.dti.ne.jp
Fri Jun 19 23:34:49 UTC 2009


My previous mail was too many fixes and changes.
It's my mistake. From now, I suggest a fix and a change one by one.

To return to the subject,
Original Qt class without explicit superclass is subclass of QObject,
that manages lifecycles of Qt application.
But, QtRuby class without explicit superclass is subclass of Ruby's
Object, not Qt::Object.

So I suggest, UI Class generated by rbuic4 should be subclass of Qt::Object.
This needs only changes in 2 sections. I write diff below:

===================================================================
--- ./kdebindings/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.cpp
+++ ./kdebindings/ruby/qtruby/tools/rbuic/ruby/rbwritedeclaration.cpp
@@ -92,7 +92,7 @@
if (namespaceList.count())
m_output << "\n";

- m_output << "class " << m_option.prefix << className << "\n";
+ m_output << "class " << m_option.prefix << className << " < Qt::Object\n";

const QStringList connections = m_uic->databaseInfo()->connections();
for (int i=0; i<connections.size(); ++i) {

===================================================================
--- ./kdebindings/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp
+++ ./kdebindings/ruby/qtruby/tools/rbuic/ruby/rbwriteinitialization.cpp
@@ -2435,7 +2435,7 @@
if (sender.isEmpty() || receiver.isEmpty())
return;

- m_output << m_option.indent << "Qt::Object.connect("
+ m_output << m_option.indent << "connect("
<< sender
<< ", "
<< "SIGNAL('" << connection->elementSignal() << "')"



More information about the Kde-bindings mailing list