python - Mouse Clickevents are not registering after embedding Navit -


i trying develop board computer old audi a4. writing full screen app using python qt , in application want embed navit (an opensource gps navigation system navit homepage) software. on wiki page there example of how embed navit:

container = new qx11embedcontainer(this); qstring wid = qstring::number(container->winid()); setenv("navit_xid", wid.toascii(), 1); process = new qprocess(container); process->start("navit"); 

since developing project in python code anologous

def initnavit( self ):         container = qtguit.qx11embedcontainer( self )         container.setgeometry( 100, 20, 800, 480 )         container.show()         winid = container.winid()         process = qtcore.qprocess(container)         os.environ['navit_xid'] = str( winid )         process.startdetached( "navit" ) 

the project runs fine , embedding works when click on navit app, mouse click events seem destroyed. is, can still move mouse pointer cannot click -> nothing. nothing in os nor application.

to elaborate has worked @ times before (maybe 5 times out of 100 test runs - seemingly no changes) once close application alt+f4 mouse works again perfectly. when click around application without clicking on navit still works fine too. running navit seperatly works without flaws well. furthermore, when use keyboard control navit works (even after clicks don't work anymore).

it important able control via mouse, because in car supposed controlled using touch screen.

i running on ubuntu testing should work rasbian entire project supposed run on raspberry pi 2.

so actual question, why mouse clicks being ignored after running program, how 1 fix it.

here example not work me.

import sys import os pyqt4 import qtgui pyqt4 import qtcore  def main():     app = qtgui.qapplication( sys.argv )     w = qtgui.qwidget()     w.resize( 1024, 800 )     w.move( 0, 0 )     w.setwindowtitle( 'simple embedding test' )     w.show()      container = qtgui.qx11embedcontainer( w )     container.resize( 800, 600 )     container.move( 0, 0 )     container.show()     winid = container.winid()     process = qtcore.qprocess(container)     os.environ['navit_xid'] = str( winid )     process.startdetached("navit")       sys.exit( app.exec_() )   if __name__ == '__main__':     main() 

thank help


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -