示例#1
0
QListViewItem *MdsEditView::findFirst()
{
  MdsFindDialog findDlg(this);

  findDlg.m_searchString->setText(m_find.m_strFind);
  findDlg.m_useAttrName->setChecked(m_find.m_bExamineAttrName);
  findDlg.m_useAttrValue->setChecked(m_find.m_bExamineAttrValue);
  findDlg.m_matchCase->setChecked(m_find.m_bMatchCase);
  findDlg.m_matchWholeString->setChecked(m_find.m_bMatchWholeStringOnly);
  
  if ( findDlg.exec() != QDialog::Accepted )
  {
    return NULL;
  }

  m_find.m_strFind		 = findDlg.m_searchString->text();
  m_find.m_bExamineAttrName	 = findDlg.m_useAttrName->isChecked();
  m_find.m_bExamineAttrValue	 = findDlg.m_useAttrValue->isChecked();
  m_find.m_bMatchCase	         = findDlg.m_matchCase->isChecked();
  m_find.m_bMatchWholeStringOnly = findDlg.m_matchWholeString->isChecked();

  // First determine the root for the search
  invalidateFind();
  m_searchRoot = m_treeView->selectedItem();
  if (!m_searchRoot)
  {
    m_searchRoot = m_treeView->firstChild();
  }

  // Next create an iterator starting at the search root

  m_searchIterator = new QListViewItemIterator(m_searchRoot);

  if ( isRecord(m_searchRoot) )
  {
    QRec * pRec =	((QRecordViewItem *)m_searchRoot)->rec();
    ASSERT( pRec );
    
    m_iMatch = pRec->FindStringInRecord(m_find.m_strFind,
					m_find.m_bMatchWholeStringOnly,
					m_find.m_bMatchCase,
					m_find.m_bExamineAttrName,
					m_find.m_bExamineAttrValue);
    if ( m_iMatch != -1 )
    {
      m_treeView->setSelected(m_searchRoot, TRUE);
      expandTreeToShowItem(m_searchRoot);
      
      shiftFocusToListView(m_iMatch);
      return m_searchRoot;
    }
  }

  return findNext();
}
示例#2
0
void MainWindow::findSlot(){
    /*
    FindDialog *findDlg=new FindDialog(this);
    findDlg->raise();
    findDlg->show();
    findDlg->activateWindow();
    findDlg->setModal(true);
    */
    FindDialog findDlg(this);
    findDlg.exec();
}
示例#3
0
文件: pwizfovsh.cpp 项目: KDE/kstars
void PWizFovShUI::slotSelectFromList()
{
    QPointer<FindDialog> findDlg( new FindDialog( this ) );
    if(findDlg->exec() == QDialog::Accepted && findDlg)
    {
        SkyObject *obj = findDlg->targetObject();
        if(obj)
        {
            setBeginObject(obj);
        }
    }
    delete findDlg;
}