문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top