void AddResult::finishEnable(bool state) { QWizard *w = NULL; for (QWidget *p = parentWidget(); p; p = p->parentWidget()){ if (p->inherits("QWizard")){ w = static_cast<QWizard*>(p); break; } } if (w == NULL) return; if (state != m_bConnect){ m_bConnect = state; if (m_bConnect){ connect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); }else{ disconnect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); } } w->setFinishEnabled(this, state); }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id1 = SEARCH_DONE; m_id2 = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn("", -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(i18n("Name")); tblUser->setExpandingColumn(COL_NAME); tblUser->setSorting(COL_SCREEN); tblUser->setMenu(MenuSearchResult); tblUser->header()->hide(); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged()), this, SLOT(selectChanged())); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); connect(wizard->finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked())); }