Can i use QPainter/QPaintDevice for a existing native Window of a non Qt Application?
I maintain a large Win32 application and i'd like to migrate some parts of it to Qt (currently using 4.8). The first part would be to transform rendering of images and shapes to Qt. The core of the application is quite huge and can not be transformed as a whole.
I managed to compile and link using QImage.
I can start the application and load a image into the QImage object.
Then i tried to create a QWidget from my existing Win32 Window using the following code:
class MyWidget : public QWidget
void create(HWND hwnd)
This was necessary, as create is a protected member of QWidget (yes i now my approach is a little bit thoughtless...).
Then i tried:
qWin.paintEngine()->drawImage(myImage.rect(), myImage, rect);
This asserts in QWidgetPrivate::QWidgetPrivate with
@qFatal("QWidget: Must construct a QApplication before a QPaintDevice");
Is there any way to do this?
Can i somehow us a QPainter or QPaintDevice for a existing native Window of a non Qt Application?
I know that there is the possibility to create DLLs with Qt. Can this not be done without a QApplication object?