Hi All,

I'm trying to embed an SDL_Window (SDL2) into a QT Application, my code snippet for doing it is the following:

Qt Code:
  1. auto window = QWindow::fromWinId((WId)Application::windowHandle());
  2. window->resize(width, height);
  3.  
  4. SIEGE_ASSERT(window);
  5.  
  6. mRenderSurface = QWidget::createWindowContainer(window);
  7. setCentralWidget(mRenderSurface);
To copy to clipboard, switch view to plain text mode 

Application::windowHandle() returns the correct window id, the above results in the following:

http://i.imgur.com/xnEXGtO.png

For some reason the window isn't be "implanted" correctly into the central widget of the QMainWindow. If I use the GUI to resize the window, the widget will snap to the correct place, everything becomes resizeable and everything starts to work correctly. Am I missing a step in the process here that automatically implants and resizes it? From what I can tell when I add the widget to the central widget, it doesn't seem to repaint anything. It is also NOT an option to use the SDL_CreateWindowFrom function without patching SDL itself, this functionality is supposed to be on its way.

Thanks, Brkopac

edit: Currently using Qt 5.3