Pergunta

QImage doesn't seem to subclass from QObject. How can I invoke QObject methods on QImage? I'm interested in QObject::thread() method to invoke deletion in the appropriate thread.

Foi útil?

Solução

That's wholly unnecessary. Either:

  1. Pass the image around as a value, it's cheap.

  2. Use QSharedPointer<QImage> and pass that around. It's entirely unnecessary.

Internally a QImage is what amounts to a shared pointer to image data. That's why passing it by value is cheap, and that's why using a shared pointer to it is pointless.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top