void uoDbGuiFactory::showForm(QString tabNameIntern, uoFormType fType, int IDElem, QString urlstr, int parent){ uoDbRefTable* refTable = m_dbMan->findTable(tabNameIntern); if (refTable){ QString data = refTable->getUrlByForm(fType); QWidget* wi = m_mainWnd->findByDbURL(urlstr); if (!wi){ if (fType == uoFormT_List){ uoDbRefTableListIface* iFace = new uoDbRefTableListIface(this, refTable); uoDbFormList* form = new uoDbFormList(0,iFace); form->setObjectName(urlstr); m_mainWnd->addTabDb( form , refTable->m_descr); } else if (fType == uoFormT_Group || fType == uoFormT_Elem){ uoDbRefTableIface* iFace = new uoDbRefTableIface(this, refTable,"*", urlstr); iFace->setCurentsElement(IDElem, parent); uoDbFormElement* form = new uoDbFormElement(0,iFace); form->setObjectName(urlstr); m_mainWnd->addTabDb( form , refTable->m_descr); } } }}
void uoMDITabWidget::addTabDb(uoDbForm *widget, QString name){ if (!m_mdiArea) return; qmdiClient *client = dynamic_cast<qmdiClient*>(widget); if (client) client->mdiServer = this; widget->setAttribute( Qt::WA_DeleteOnClose, true ); QMdiSubWindow *subWindow = m_mdiArea->addSubWindow( widget ); m_tabBar->addTab( name ); widget->m_mdiParent =subWindow; widget->show();// subWindow->show();// widget->activateWindow();// widget->raise(); //http://www.qtcentre.org/archive/index.php/t-30647.html subWindow->raise(); //http://www.qtcentre.org/archive/index.php/t-30647.html m_widgetList.append( subWindow ); connect( subWindow, SIGNAL(destroyed(QObject*)), this, SLOT(windowDeleted(QObject*)));// m_activeWidget = subWindow;}
QMdiSubWindow *QMdiArea::currentSubWindow() const{ Q_D(const QMdiArea); if (d->childWindows.isEmpty()) return 0; if (d->active) return d->active; if (d->isActivated && !window()->isMinimized()) return 0; Q_ASSERT(d->indicesToActivatedChildren.count() > 0); int index = d->indicesToActivatedChildren.at(0); Q_ASSERT(index >= 0 && index < d->childWindows.size()); QMdiSubWindow *current = d->childWindows.at(index); Q_ASSERT(current); return current;}
void QMdiAreaPrivate::activateCurrentWindow(){ QMdiSubWindow *current = q_func()->currentSubWindow(); if (current && !isExplicitlyDeactivated(current)) { current->d_func()->activationEnabled = true; current->d_func()->setActive(true, /*changeFocus=*/false); }}