当前位置: 首页>>代码示例>>C++>>正文


C++ Q3ListViewItem类代码示例

本文整理汇总了C++中Q3ListViewItem的典型用法代码示例。如果您正苦于以下问题:C++ Q3ListViewItem类的具体用法?C++ Q3ListViewItem怎么用?C++ Q3ListViewItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Q3ListViewItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: slotDeleteAction

void ActionWidget::slotDeleteAction()
{
    Q3ListViewItem *item = listView->currentItem();
    if ( item && item->parent() )
        item = item->parent();
    delete item;
}
开发者ID:jschwartzenberg,项目名称:kicker,代码行数:7,代码来源:configdialog.cpp

示例2: clear

void GCUserView::clear()
{
	for (Q3ListViewItem *j = firstChild(); j; j = j->nextSibling())
		while (GCUserViewItem* i = (GCUserViewItem*) j->firstChild()) {
			delete i;
		}
}
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:7,代码来源:gcuserview.cpp

示例3: setPrimaryLogin

void Tab_Logins::setPrimaryLogin()
{
    Q3ListViewItem   *curItem;
    
    curItem = list->currentItem();
    if (curItem != NULL) {
		char    tmpSt[1024];
		sprintf(tmpSt, "Are you sure you wish to set the primary\nlogin for this account to '%s'?", (const char *) curItem->text(0));
        if (QMessageBox::warning(this, "Set Primary Login", tmpSt, "&Yes", "&No", 0, 1) == 0) {
		    CustomersDB     CDB;
		    CDB.get(myCustID);
		    if (strcmp(CDB.getStr("PrimaryLogin"), curItem->text(0))) {
		        // The logins are different.  Update it.
		        sprintf(tmpSt, "Set primary login from %s to %s", (const char *) CDB.getStr("PrimaryLogin"), (const char *) curItem->text(0));
                CDB.setValue("PrimaryLogin", curItem->text(0));
                CDB.upd();
                
		        NotesDB NDB;
                NDB.setValue("LoginID", curItem->text(0));
                NDB.setValue("CustomerID", myCustID);
                NDB.setValue("NoteType", "Operator");
                NDB.setValue("NoteText", tmpSt);
                NDB.ins();

            	refreshLoginList(1);
                emit(customerUpdated(myCustID));
		    } else {
            	QMessageBox::information(this, "Set Primary Login", "The specified login ID is\nalready the primary login ID.");
		    }
		}
    }
}
开发者ID:gottafixthat,项目名称:tacc,代码行数:32,代码来源:Tab_Logins.cpp

示例4: nextSibling

void classTable::selectionChanged( QListViewItem *p )
#endif
{
  // Determine if the selected item is a child of this table using the y coord, is there a better way?
#ifdef QT_V4LAYOUT
  Q3ListViewItem *n = nextSibling() ;
#else
  QListViewItem *n = nextSibling() ;
#endif
  int siblingPos = n ? n->itemPos() : 999999 ;
  int selectPos  = p ? p->itemPos() : 0      ;
  int thisPos    =        itemPos()          ;

  if ( thisPos <= selectPos && selectPos < siblingPos )
  {
    if ( !pBrowse )
      pBrowse = new classBrowseFrame( hDbc, qsTable, qsLibrary, pCanvas );
    pBrowse->show();
  }
  else
  {
    if ( pBrowse )
      pBrowse->hide();
  }
}
开发者ID:ystk,项目名称:debian-unixodbc,代码行数:25,代码来源:classTable.cpp

示例5: selectedFolder

QString SloxFolderDialog::selectedFolder() const
{
  Q3ListViewItem *item = mListView->selectedItem();
  if ( item )
    return item->text( 1 );
  return "-1"; // OX default folder
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:7,代码来源:sloxfolderdialog.cpp

示例6: Refresh

void CatalogForm::Refresh( qulonglong id )
{
	Q3ListViewItem * item;
	if( map_el.contains( id ))
	{
		item = map_el[id];
		cat->select( id );
		for(uint i=0; i<fieldList.count(); i++)
		{

			item->setText(i,cat->sysValue(fieldList[i]).toString());
			ListView->setFocus();
		}
	}
	else
	{
		if( map_gr.contains( id ) )
		{
			item = map_gr[id];
			cat->groupSelect( id );
			item->setText(0,cat->GroupSysValue(fieldListGroup[0]).toString());
			ListView->setFocus();
		}
	}
}
开发者ID:heiheshang,项目名称:ananas-labs-qt4,代码行数:25,代码来源:catalogform.cpp

示例7: eDef

void MouseConfig::loadMenu(unsigned id)
{
    Event eDef(EventGetMenuDef, (void*)id);
    CommandsDef *def = (CommandsDef*)(eDef.process());
    if (def){
        CommandsList list(*def, true);
        CommandDef *s;
        while ((s = ++list) != NULL){
            if ((s->id == 0) || (s->popup_id == 0))
                continue;
            QString title = i18n(s->text);
            if (title == "_")
                continue;
            Q3ListViewItem *item;
            for (item = lstCmd->firstChild(); item; item = item->nextSibling()){
                if (QString::number(s->popup_id) == item->text(3))
                    break;
            }
            if (item)
                continue;
            title = title.replace(QRegExp("&"), "");
            new Q3ListViewItem(lstCmd, title, m_plugin->getMouse(s->id), QString::number(s->id), QString::number(s->popup_id));
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:25,代码来源:mousecfg.cpp

示例8: SelectCategoriesDialog

void RecipeActionsHandler::categorize()
{
	QList<Q3ListViewItem*> items = parentListView->selectedItems();
	if ( items.count() > 0 ) {
		ElementList categoryList;
		QPointer<SelectCategoriesDialog> editCategoriesDialog = new SelectCategoriesDialog( parentListView, categoryList, database );
	
		if ( editCategoriesDialog->exec() == QDialog::Accepted ) { // user presses Ok
			editCategoriesDialog->getSelectedCategories( &categoryList ); // get the category list chosen
			
			QListIterator<Q3ListViewItem *> it(items);
			Q3ListViewItem *item;
			while ( it.hasNext() ) {
				item = it.next();
				if ( item->parent() != 0 ) {
					RecipeListItem * recipe_it = ( RecipeListItem* ) item;
					int recipe_id = recipe_it->recipeID();
	
					database->categorizeRecipe( recipe_id, categoryList );
				}
			}
		}

		delete editCategoriesDialog;
	}
}
开发者ID:eliovir,项目名称:krecipes,代码行数:26,代码来源:recipeactionshandler.cpp

示例9: get_data

void BrowserNode::update_stereotype(bool rec) {
  BasicData * data = get_data();
  
  if (data != 0) {
    const char * stereotype = data->get_stereotype();
    
    if (show_stereotypes && stereotype[0]) {
      QString s = toUnicode(stereotype);
      int index = s.find(':');
      
      setText(0,
	      "<<" + ((index == -1) ? s : s.mid(index + 1))
	      + ">> " + name);
    }
    else
      setText(0, (const char *) name);
  }
  
  if (rec) {
    Q3ListViewItem * child;
    
    for (child = firstChild(); child != 0; child = child->nextSibling())
      ((BrowserNode *) child)->update_stereotype(TRUE);
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:25,代码来源:BrowserNode.cpp

示例10: may_contains

bool BrowserNode::may_contains(BrowserNode * bn, bool rec) const {
  // for the type point of view bn is legal for 'this'
  if (((BrowserNode *) bn->parent()) == this)
    return TRUE;
  
  QString s = (const char *) bn->name;
  
  if (! s.isEmpty()) {
    UmlCode type = bn->get_type();
    
    for (Q3ListViewItem * child = firstChild(); child; child = child->nextSibling()) {
      if (!((BrowserNode *) child)->deletedp() &&
	  // case already check : (child != bn) &&
	  ((BrowserNode *) child)->same_name(s, type))
	return FALSE;
    }
  }
    
  if (!rec)
    return TRUE;
  
  const BrowserNode * pa = this;
  
  for (;;) {
    if (pa == 0)
      return TRUE;
    else if (pa == bn)
      // cannot move a parent in a child !
      return FALSE;
    
    pa = ((BrowserNode *) pa->parent());
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:33,代码来源:BrowserNode.cpp

示例11: search

void BrowserNodeList::search(BrowserNode * bn, UmlCode k, const QString & s,
			     bool cs, bool even_deleted, bool for_name,
			     bool for_stereotype)
{
  Q3ListViewItem * child;
    
  for (child = bn->firstChild(); child != 0; child = child->nextSibling()) {
    if (even_deleted || !((BrowserNode *) child)->deletedp()) {
      BrowserNode * ch = (BrowserNode *) child;
      
      if (((k == UmlCodeSup) ||
	   ((k == UmlRelations)
	    ? IsaRelation(ch->get_type())
	    : (ch->get_type() == k))) &&
	  (s.isEmpty() ||
	   (QString((for_name)
		    ? ch->get_name()
		    : ((for_stereotype) ? ch->get_stereotype()
					: ch->get_comment()))
	    .find(s, 0, cs) != -1)))
	append((BrowserNode *) child);
      
      search((BrowserNode *) child, k, s, cs, even_deleted,
	     for_name, for_stereotype);
    }
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:27,代码来源:BrowserNode.cpp

示例12: text

void CustomCheckListItem::stateChange( bool on )
{
    if ( !m_locked ) {
        for ( Q3CheckListItem * it = static_cast<Q3CheckListItem*>( firstChild() ); it; it = static_cast<Q3CheckListItem*>( it->nextSibling() ) ) {
            it->setOn( on );
        }
    }

    if ( !on ) {
        Q3ListViewItem * parent = this->parent();
        if ( parent && ( parent->rtti() == 1 ) ) {
            CustomCheckListItem * item = static_cast<CustomCheckListItem*>( parent );
            item->setLocked( true );
            item->setOn( on );
            item->setLocked( false );
        }
    }

    QString thisText = text(0);
    Q3ListViewItemIterator it( listView() );
    while ( it.current() ) {
        if ( it.current()->rtti() == 1 && it.current()->text(0) == thisText ) {
            CustomCheckListItem * item = static_cast<CustomCheckListItem*>( it.current() );
            item->setOn( on );
        }
        ++it;
    }
}
开发者ID:nasenbaer89,项目名称:KRecipes,代码行数:28,代码来源:recipeimportdialog.cpp

示例13: updateListViewItem

void QDisplayPropertyWidget::updateListViewItem()
{
    std::map<QTreeWidgetItem*, std::pair<core::objectmodel::Base*, Q3ListViewItem*> >::iterator objectIterator;
    for(objectIterator = objects.begin(); objectIterator != objects.end(); ++objectIterator)
    {
        core::objectmodel::Base* object = objectIterator->second.first;
        Q3ListViewItem* item = objectIterator->second.second;

        if (/*simulation::Node *node=*/dynamic_cast< simulation::Node *>(object))
        {
            item->setText(0,object->getName().c_str());
            //emit nodeNameModification(node);
        }
        else
        {
            QString currentName = item->text(0);

            std::string name=item->text(0).ascii();
            std::string::size_type pos = name.find(' ');
            if(pos != std::string::npos)
                name = name.substr(0,pos);
            name += "  ";
            name += object->getName();
            QString newName(name.c_str());
            if(newName != currentName)
                item->setText(0,newName);
        }
    }
}
开发者ID:mhdsedighi,项目名称:SOFA,代码行数:29,代码来源:QDisplayPropertyWidget.cpp

示例14: mouseButtonClickedData

void RDListView::mouseButtonClickedData(int button,Q3ListViewItem *item,
					const QPoint &pt,int col)
{
  Q3ListViewItem *l;
  bool contiguous;

  if((list_contiguous==false)||(selectionMode()!=Q3ListView::Extended)||(item==NULL)||(button!=1)) {
    return;
  }

  //
  // Get Selected Range
  //
  l=item;
  contiguous=true;
  while((l=l->itemAbove())!=NULL) {
    if(!l->isSelected()) {
      contiguous=false;
    }
    if(!contiguous) {
      setSelected(l,false);
    }
  }
  l=item;
  contiguous=true;
  while((l=l->itemBelow())!=NULL) {
    if(!l->isSelected()) {
      contiguous=false;
    }
    if(!contiguous) {
      setSelected(l,false);
    }
  }
}
开发者ID:ElvishArtisan,项目名称:rivendell,代码行数:34,代码来源:rdlistview.cpp

示例15: get_config_filename

void oprof_start::read_set_events()
{
	string name = get_config_filename(".oprofile/daemonrc");

	ifstream in(name.c_str());

	if (!in) {
		setup_default_event();
		return;
	}

	string str;

	bool one_enabled = false;

	while (getline(in, str)) {
		string const val = split(str, '=');
		string const name = str;

		if (!is_prefix(name, "CHOSEN_EVENTS_"))
			continue;

		one_enabled = true;

		// CHOSEN_EVENTS_#nr=CPU_CLK_UNHALTED:10000:0:1:1
		vector<string> parts = separate_token(val, ':');

		if (parts.size() != 5 && parts.size() != 2) {
			cerr << "invalid configuration file\n";
			// FIXME
			exit(EXIT_FAILURE);
		}

		string ev_name = parts[0];
		event_cfgs[ev_name].count =
			op_lexical_cast<unsigned int>(parts[1]);

		// CPU_CLK_UNHALTED:10000 is also valid
		if (parts.size() == 5) {
			event_cfgs[ev_name].umask =
				op_lexical_cast<unsigned int>(parts[2]);
			event_cfgs[ev_name].user_ring_count =
				op_lexical_cast<unsigned int>(parts[3]);
			event_cfgs[ev_name].os_ring_count =
				op_lexical_cast<unsigned int>(parts[4]);
		} else {
			event_cfgs[ev_name].umask = 0;
			event_cfgs[ev_name].user_ring_count = 1;
			event_cfgs[ev_name].os_ring_count = 1;
		}

		Q3ListViewItem * item = findItem(events_list, ev_name.c_str());
		if (item)
			item->setSelected(true);
	}

	// use default event if none set
	if (!one_enabled)
		setup_default_event();
}
开发者ID:jacob-zhoupeng,项目名称:oprofile,代码行数:60,代码来源:oprof_start.cpp


注:本文中的Q3ListViewItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。