Hi folks,
I am developing an application using Qt/embedded 4.8.
At runtime, depending on various events, widgets of type MainView (see simplified example code below) needs to be created and displayed in a tab view.
The situation I am now facing is, that the creation of an instance for MainView lasts approx. 1 second.
Because widgets may only be created in the GUI thread, this causes the thread to 'hang' for this second and the GUI is not responsive.
Qt Code:
MainView() { a = new MyWidgetA(); b = new MyWidgetB(); c = new MyKeyboard(); layout.add(a); layout.add(b); layout.add(c); setLayout(&layout); } MyWidgetA* a; MyWidgetB* b; MyKeyboard* c; QStackedLayout layout; };To copy to clipboard, switch view to plain text mode
The widgets which are created are e.g. a virtual keyboard which again consists of approx. 120 child widgets of type QPushButton....
Does anyone know a 'typical' pattern to avoid this problem? Or are there any other solutions - maybe 'speed-up widget creation'?
Thanks in advance, mike
Bookmarks