Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top