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:
  1. class MainView : public QWidget {
  2. MainView() {
  3. a = new MyWidgetA(); b = new MyWidgetB(); c = new MyKeyboard();
  4. layout.add(a); layout.add(b); layout.add(c);
  5. setLayout(&layout);
  6. }
  7. MyWidgetA* a;
  8. MyWidgetB* b;
  9. MyKeyboard* c;
  10. };
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