That's exactly what I tried to do.

As I said, the thing is, PerlQt is "many packages in one", so one needs to define this for, e.g. Qt.pm, Qt/Object.pm, Qt/Application.pm, and so on. Also, simple code like

use Qt; import Qt::app; $hello = Qt::PushButton->new('Hello'); $hello->resize(100, 30); $app->setMainWidget($hello); $hello->show(); exit $app->exec();

becomes

use Qt; use Qt::Object; use Qt::Application; use Qt::PushButton; use Qt::Font; import Qt::app; $hello = Qt::PushButton->new('Hello'); $hello->resize(100, 30); $app->setMainWidget($hello); $hello->show(); exit $app->exec();
and more complex examples end up having dozens of "use" statements, which is kinda inconvenient. The original piece of code was pretty inventive about this: all Qt::*::AUTOLOAD methods were directed (newXSUB'ed) to the same place, so a single "use Qt" was enough. Right now I am thinking of overloading "new" and "DESTROY" methods of each class with what used to be "AUTOLOAD". In the original code, AUTOLOAD on each object was used only once, and whan it did, it loaded (newXS'ed) the real methods (I think the guy did that for optimization). Since every object in PerlQt has both "new" and "DESTROY", the "fake new" e.g. procedure would be overriden immediately after it is called. This approach seems to work better, although there are some subtleties that I have to take care of.

This all brings me to one thing: my God, how I wish Perl5 along with perlguts soecs was standartized!

best,

Mishka


In reply to Re: (tye)Re2: Help: 5.6.1: XSUB and AUTOLOAD by Anonymous Monk
in thread Help: 5.6.1: XSUB and AUTOLOAD by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.