void HierarchyList::removeTabPage() { QWidget *w = current(); if ( !w ) return; if ( w->inherits( "QTabWidget" ) ) { QTabWidget *tw = (QTabWidget*)w; if ( tw->currentPage() ) { QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; DeleteTabPageCommand *cmd = new DeleteTabPageCommand( i18n("Delete Page %1 of %2" ). arg( dtw->pageTitle() ).arg( tw->name() ), formWindow, tw, tw->currentPage() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } } else if ( w->inherits( "QWizard" ) ) { QWizard *wiz = (QWizard*)formWindow->mainContainer(); if ( wiz->currentPage() ) { QDesignerWizard *dw = (QDesignerWizard*)wiz; DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( i18n("Delete Page %1 of %2" ). arg( dw->pageTitle() ).arg( wiz->name() ), formWindow, wiz, wiz->indexOf( wiz->currentPage() ), true ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } } }
QToolButton* WizardFiller::getExpandButton(HI::GUITestOpStatus &os){ QToolButton* expandButton = NULL; QWidget* dialog = QApplication::activeModalWidget(); GT_CHECK_RESULT(dialog, "activeModalWidget is NULL",NULL); QWizard* wizard = qobject_cast<QWizard*>(dialog); GT_CHECK_RESULT(wizard, "activeModalWidget is not of wizard type",NULL); QList<QWidget*> widList = wizard->currentPage()->findChildren<QWidget*>(); QList<QToolButton*> plusList; foreach(QWidget* w, widList){ QToolButton* but = qobject_cast<QToolButton*>(w); if (but && but->text()=="+" && abs(but->rect().width()-19)<2) plusList.append(but); }