c++ - Using Qt user interface in a host application -
i extending commercial application, running on windows. can extended plug-ins, application ordinary dlls. free functions exported plug-in dlls can hooked host application ui, forms commands, , these commands can used based on user interaction host application ui. additionally, looks plug-ins run in same thread host application, or @ least plug-ins run in same thread.
it possible write user interface these plug-ins. host application ported platform, user interface using windows main container main window , dialog panels, window content , controls owner-drawn.
example plug-ins, shipped application, use old fashioned way of writing windows user interface - have standard resource file, standard window procedure, standard dialog box procedure, standard event loop using getmessage(), translatemessage(), dispatchmessage().
windows in these example plug-ins created in 1 of plug-in dll functions. event loop running there.
in examples possible create modal , modeless windows , integration seems working fine. visual style 'a bit' mixed.
it possible, or better, due simple example design not disallowed invoke command multiple times, opens multiple windows of same kind , still looks works.
i use qt ui of plug-ins. when it, however, host user interface stops reacting. not repainting.
initially used qapplication.exec(), blocked everything, enough learned not call it. instead keep original message loop example application , inside call qapplication.processevent(). still not work.
i wondering, happening there, when qt application behaves differently? qt blocking messages or going on?
i tried integrate qwinwidget, has similar effect.
one solution comes mind invoke plugins in separate threads using qtconcurrent::run(). returns qfuture object used waiting thread qfuture::waitforfinished() , using qt application's event loop. template parameter of qfuture can used return result function. hope helps
Comments
Post a Comment