Embed Navit in Qt Screen

When trying to build my own GUI with Navit in center, I tried now a few different ways. The only working way seems to be Qt, but I´m still having problems with using it.

The following code can start Navit and my main window, but they are both independet from each other. I´m not sure how to change the size of the self.navit window and how to change position. At last I want to delete the window frame to, but this flag is the second step.

Maybe somebody can tell what I´m doing wrong. I just want navit in my main window, just like parented with the navit window in the foreground permanent.

      import sys
import os
from PyQt5 import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

class embedNavit(QWidget):
    def __init__(self):
        QWidget.__init__(self)
        self.process = QProcess(self)
        self.setGeometry(100,100,1024,768)
        win = QWidget() 
        winId = int(win.winId())
        sub_win = QWindow.fromWinId(winId)
        self.navit = QWidget.createWindowContainer(sub_win)
        winId = self.navit.winId()
        os.putenv('NAVIT_XID',str(winId))
        #layout = QVBoxLayout(self)
        #self.addWidget(self.navit)
        self.process.start('navit')
        #self.navit.setGeometry(0,0,1024,768)
        #self.b = QtGui.QPushButton("exit", self, clicked=self.close)
        #layout.addWidget(self.navit)

if __name__ == "__main__":
    app = QApplication(sys.argv)
    main = embedNavit()
    main.show()
    sys.exit(app.exec_())
   

This short code shows my actual step.

0 ответов

Другие вопросы по тегам