PyQt4: DirectX window
-
I'm trying to render into Qt widget using directx (PyQt4), but have problems :
when I create a 3d-view widget as the main window with no parents, rendering is ok :
@
class w_view(QtGui.QWidget):
def init(self, parent):
super(w_view, self).init(parent)
self.setAttribute(QtCore.Qt.WA_PaintOnScreen, True)def paintEvent(self, pe):
render()def paintEngine(self):
return Nonedef main():
app = QtGui.QApplication(sys.argv)
view_wnd = w_view(None)
#setup directx and assign winId() for device
view_wnd.show()
@But the problem is where I want to create QMainWindow and put 3d-view widget inside it (as a child window), so I change the main() function to this :
@
def main():
app = QtGui.QApplication(sys.argv)
main_wnd = QtGui.QMainWindow()
main_wnd.setMinimumSize(640, 480)
view_wnd = w_view(main_wnd)
main_wnd.setCentralWidget(view_wnd)
#setup directx and assign winId() for device
main_wnd.show()
@3D-view widget renders nothing and turns into empty (NULL) window
And I need to create QMainWindow and put some controls/toolbars/menus/... around the 3d-view. how can I solve this problem ?I'm using PyQt4.8, Python2.7 and DirectX11 API