+ connect(panel, SIGNAL(destroyed(QObject *)), this, SLOT(panelDestroyed(QObject*)));
+ mPanels.append(panel);
+ mPanelNames.insert(name, panel);
+
+ // If this is the predefined main panel, add it to this window
+ if (!mMainPanelName.isEmpty()) {
+ if (name == mMainPanelName) {
+ mMainPanel = panel;
+ mLayout->addWidget(panel);
+ }
+ }
+
+ // If the predefined main panel name is not set, use the first panel
+ else {
+ if (!mMainPanel) {
+ mMainPanel = panel;
+ mLayout->addWidget(panel);
+ }
+ }