I have released libIceAMI2QtCallbacks to https://sourceforge.net/projects/libiceami2qtcal/. This is a followup to Ice 3.4.0 AMI and Qt 4.5.

This is a header only library that depends on Ice-3.4, Qt-4.5.0, and Boost >= 1.39. There is a Test directory with a simple Ice library, and a client and server directory.

The library provides a set of generic AMI callback classes that allow the programmer to emit Qt signals on either successful completion of a remote operation, or on an exception.

The slice file for the test is:

Code:
#ifndef _TEST_ICE_
#define _TEST_ICE_

module TestAMI2Qt
{
    exception HitTheNumberException {};

    interface Test
    {
        void voidFunc0();
        void voidFunc1(out int p1);

        int func0() throws HitTheNumberException;
        int func1(out int p1) throws HitTheNumberException;
    };
};

#endif
Let's say we have a QObject with a slot "success1(int,int)". This will receive the result of the "func1" method from the slice file. The first parameter is the return value of the function, the second is the new value of the out parameter. The exception is thrown when the returned value hits %4.

We set up the callback and invoke the begin_func1 method as follows:

Code:
Ice::CallbackPtr d1 = IceAMI2Qt1<int,int>::createCallback(
        AMI_END_FN(TestAMI2Qt::Test, testProxy, func1, _1, _2),
        this, SLOT(success1(int,int)),
        this, FAILSLOT(fail1));

    testProxy->begin_func1(d1);
This results in the "success1" slot being invoked.

There are classes for up to five out parameters (in IceAMI2Qt1, the "1" refers to the number of out parameters). There are template specializations for each class to handle void returns.

AMI_END_FN is a macro that makes it easier to specify the boost::bind to "end_func1", and FAILSLOT results in "SLOT(fail1(QSharedPointer<Ice::Exception>))" being emitted.

I hope you find this library useful...