Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. PyQt4: DirectX window
Forum Updated to NodeBB v4.3 + New Features

PyQt4: DirectX window

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sepul
    wrote on last edited by
    #1

    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 None

    def 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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved