My application contained several functions like this:
void SomeClass::set_data_provider(DataProvider *data_provider)
{
connect(data_provider, SIGNAL(data_ava
You can create a custom connect function:
template bool
my_connect(const QSharedPointer &sender,
const char *signal,
const QObject *receiver,
const char *method,
Qt::ConnectionType type = Qt::AutoConnection)
{
return QObject::connect(sender.data(), signal, receiver, method, type);
}
And use it like this:
QSharedPointer shared(new MyObject);
my_connect(shared, SIGNAL(my_signal()), this, SLOT(my_slot()));
The only problem is that in both yours and mine solutions you will lose Qt Creator autocomplete for the native connect function.
P.S. As for me, I wouldn't change your code. I think it's fine :)