本文整理汇总了C++中changeItem函数的典型用法代码示例。如果您正苦于以下问题:C++ changeItem函数的具体用法?C++ changeItem怎么用?C++ changeItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了changeItem函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setItemEnabled
void SpawnListMenu::setCurrentItem(const Item* item)
{
// set the current item
m_currentItem = item;
// enable/disable item depending on if there is one
setItemEnabled(m_id_filterMenu, (item != NULL));
if (item != NULL)
changeItem(m_id_filterMenu,
"Add '" + item->name() + "' &Filter");
else
changeItem(m_id_filterMenu,
"Add &Filter");
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:15,代码来源:spawnlistcommon.cpp
示例2: changeItem
void EditFunctions::currentReturnTypeChanged( const QString &type )
{
if ( !functionListView->currentItem() )
return;
changeItem( functionListView->currentItem(), ReturnType, type );
functionListView->currentItem()->setText( 1, type );
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:7,代码来源:editfunctionsimpl.cpp
示例3: if
void ClsQHarborImpl::slotChangeValue(int iItemType, string strItemID, int iIndex, string strParamName, double fValue){
// cout << "ClsQHarborImpl::slotChangeValue()" << endl;
#ifndef _WINDOWS // cannot get this to work under minGW at the moment...
QString qstr;
qstr.setNum(fValue);
string strParamValue = qstr.toStdString();
if(iItemType == ClsFESystemManager::ITEM_GROUP){
ClsFEGroup* clsFEGroup = ClsFESystemManager::Instance()->getFEGroup( strItemID );
if(clsFEGroup!=NULL){
clsFEGroup->setNeuronParameter(strParamName, strParamValue);
} else {
cerr << "ClsQHarborImpl::slotChangeValue: group not found" << endl;
}
} else if (iItemType == ClsFESystemManager::ITEM_CONNECTION){
ClsFEConnection* clsFEConnection = ClsFESystemManager::Instance()->getFEConnection( strItemID );
if(clsFEConnection!=NULL){
clsFEConnection->setSynapseParameter(strParamName, strParamValue);
} else {
cerr << "ClsQHarborImpl::slotChangeValue: connection not found" << endl;
}
}
changeItem(iIndex, COL_VALUE, strParamValue.c_str());
#endif
}
开发者ID:jeez,项目名称:iqr,代码行数:29,代码来源:ClsQHarborImpl.cpp
示例4: printf
void SpawnShell::newDoorSpawn(const doorStruct* d, uint32_t len, uint8_t dir)
{
#ifdef SPAWNSHELL_DIAG
printf("SpawnShell::newDoorSpawn(doorStruct*)\n");
#endif
Item* item = m_doors.find(d->doorId);
if (item != NULL)
{
Door* door = (Door*)item;
door->update(d);
if (!showeq_params->fast_machine)
item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
else
item->setDistanceToPlayer(m_player->calcDist(*item));
updateFilterFlags(door);
item->updateLastChanged();
emit changeItem(door, tSpawnChangedALL);
}
else
{
item = (Item*)new Door(d);
if (!showeq_params->fast_machine)
item->setDistanceToPlayer(m_player->calcDist2DInt(*item));
else
item->setDistanceToPlayer(m_player->calcDist(*item));
updateFilterFlags(item);
m_doors.insert(d->doorId, item);
emit addItem(item);
}
if (item->filterFlags() & FILTER_FLAG_ALERT)
emit handleAlert(item, tNewSpawn);
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:33,代码来源:spawnshell.cpp
示例5: switch
/**
* Sets the pixmap showing the linetype of the "By Layer" item.
*
* @todo needs an update, but not used currently
*/
void QG_LineTypeBox::setLayerLineType(RS2::LineType t) {
if (showByLayer) {
QPixmap pixmap;
switch(t) {
case RS2::NoPen:
pixmap = QPixmap(linetype00_xpm);
break;
default:
case RS2::SolidLine:
pixmap = QPixmap(linetype01_xpm);
break;
case RS2::DashLine:
pixmap = QPixmap(linetype02_xpm);
break;
case RS2::DotLine:
pixmap = QPixmap(linetype03_xpm);
break;
case RS2::DashDotLine:
pixmap = QPixmap(linetype04_xpm);
break;
case RS2::DivideLine:
pixmap = QPixmap(linetype05_xpm);
break;
}
changeItem(pixmap, tr("By Layer"), 0);
// needed for the first time a layer is added:
slotLineTypeChanged(currentItem());
}
}
开发者ID:jacklibj,项目名称:2.0.5.0-1-community.src,代码行数:36,代码来源:qg_linetypebox.cpp
示例6: changeItem
void MyMenuBar::setToggleButtonState(const ZLToolbar::ToggleButtonItem &button) {
const std::string &actionId = button.actionId();
ToolBarButton *tbButton = myButtons[actionId];
if ((tbButton != 0) && (tbButton->toggle())) {
changeItem(myActionIndices[actionId], tbButton->pixmap());
}
}
开发者ID:TodorGrin,项目名称:boox-opensource,代码行数:7,代码来源:ZLQtApplicationWindow.cpp
示例7: QWidget
CustomItemWidget::CustomItemWidget(QListWidgetItem *item,QWidget *parent) :
QWidget(parent),
item(item)
{
plusBtn = new QPushButton();
plusBtn->setMaximumSize(24,24);
plusBtn->setIcon(QIcon(":/icons/select"));
minusBtn = new QPushButton();
minusBtn->setMaximumSize(24,24);
minusBtn->setIcon(QIcon(":/icons/delete"));
lineEdit = new QLineEdit();
lineEdit->setMaxLength(512);
QHBoxLayout *layout= new QHBoxLayout();
layout->setSpacing(1);
layout->setContentsMargins(0,0,0,0);
layout->addWidget(lineEdit);
layout->addWidget(plusBtn);
layout->addWidget(minusBtn);
setLayout(layout);
// 控件相关响应
connect(plusBtn, SIGNAL(clicked()), this, SLOT(changeItem()));
connect(minusBtn, SIGNAL(clicked()), this, SLOT(removeItem()));
}
开发者ID:chonghwashao,项目名称:QtDev,代码行数:25,代码来源:customitemwidget.cpp
示例8: tag
void KLanguageCombo::changeLanguage(const QString &name, int i)
{
if(i < 0 || i >= count())
return;
QString output = name + QString::fromLatin1(" (") + tag(i) + QString::fromLatin1(")");
changeItem(output, i);
}
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:7,代码来源:klangcombo.cpp
示例9: seqDebug
void SpawnShell::zoneEntry(const uint8_t* data)
{
const spawnStruct* spawn = (const spawnStruct*)data;
#ifdef SPAWNSHELL_DIAG
seqDebug("SpawnShell::zoneEntry(spawnStruct *(name='%s'))", spawn->name);
#endif
// Zone Entry. This is a semi-filled in spawnStruct that we
// see for ourself when entering a zone. We also get sent this
// when shrouding and when respawning from corpse hover mode. Auras
// also get sent this sometimes.
if (spawn->NPC == 0)
{
// Align the player instance with these values
m_player->update(spawn);
emit changeItem(m_player, tSpawnChangedALL);
}
else
{
// Auras.
newSpawn(data);
}
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:25,代码来源:spawnshell.cpp
示例10: changeItem
/*! mouseMoveEvent - mouse move on the list box */
void DDListBox::mouseMoveEvent( QMouseEvent * )
{
if (count() == max_items && max_items != 0 && flag)
{
for (unsigned int i = 0; i < count(); i++)
changeItem( QPixmap( green_icon ) , text(i) , i);
flag = false;
}
if ( dragging && item(currentItem())->isSelectable() )
{
QDragObject *d = new QTextDrag( currentText() , this );
d->dragCopy(); // do NOT delete d.
dragging = FALSE;
unsigned int current = currentItem();
if (count() == max_items && max_items != 0)
{
char s[100];
strcpy(s, currentText());
char * traits;
traits = strtok(s," ");
traits = strtok(NULL, " ");
traits = strtok(NULL, " ");
traits = strtok(NULL, " ");
for (unsigned int i = 0; i < max_items; i++)
{
char s_i[100];
strcpy(s_i, text(i));
char * traits_i;
traits_i = strtok(s_i," ");
traits_i = strtok(NULL, " ");
traits_i = strtok(NULL, " ");
traits_i = strtok(NULL, " ");
bool b = (strcmp(traits,traits_i) == 0);
if (!b && i != current )
{
changeItem( QPixmap( white_icon ) , text(i) , i);
item(i)->setSelectable( b );
}
}
}
removeItem ( current );
}
}
开发者ID:FMX,项目名称:CGAL,代码行数:47,代码来源:forms.cpp
示例11: setCurrentItem
void KCombo::setText( const char *text)
{
setCurrentItem(0);
if (!set_text_called) {
set_text_called = true;
insertItem(text, 0);
}
changeItem(text, 0);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:9,代码来源:kcombo.cpp
示例12: changeItem
void World::changeQuality(ScriptItem item, short int amount) {
short int tmpQuality = ((amount+item.getDurability())<100) ? (amount + item.getQuality()) : (item.getQuality() - item.getDurability() + 99);
if (tmpQuality%100 > 0) {
item.setQuality(tmpQuality);
changeItem(item);
} else {
erase(item, item.getNumber());
}
}
开发者ID:Illarion-eV,项目名称:Illarion-Server,代码行数:10,代码来源:WorldIMPLScriptHelp.cpp
示例13: clear_interior_next_hops
void clear_interior_next_hops(node *tree)
{
if(tree->left != NULL)
{
changeItem(tree->interface_list, DISCARD_VAL);
clear_interior_next_hops(tree->left);
clear_interior_next_hops(tree->right);
}
}
开发者ID:goncalor,项目名称:ADRC,代码行数:10,代码来源:ORTC.c
示例14: path
void PanelBrowserMenu::slotMimeCheck()
{
// get the first map entry
QMap<int, bool>::Iterator it = _mimemap.begin();
// no mime types left to check -> stop timer
if(it == _mimemap.end()) {
_mimecheckTimer->stop();
return;
}
int id = it.key();
QString file = _filemap[id];
_mimemap.erase(it);
KUrl url;
url.setPath( path() + '/' + file );
// KMimeType::Ptr mt = KMimeType::findByURL(url, 0, true, false);
// QString icon(mt->icon(url, true));
QString icon = KMimeType::iconNameForUrl( url );
// kDebug() << url.url() << ": " << icon;
file = fontMetrics().elidedText( file, Qt::ElideMiddle, fontMetrics().maxWidth() * 20 );
file.replace("&", "&&");
if(!_icons->contains(icon)) {
QPixmap pm = SmallIcon(icon);
if( pm.height() > 16 )
{
QPixmap cropped( 16, 16 );
QPainter p(&cropped);
p.drawPixmap(0, 0, pm, 0, 0, 16, 16);
pm = cropped;
}
_icons->insert(icon, pm);
changeItem(id, pm, file);
}
else
changeItem(id, CICON(icon), file);
}
开发者ID:jschwartzenberg,项目名称:kicker,代码行数:42,代码来源:browser_mnu.cpp
示例15: changeItem
void MIPSmemview::updateList(void)
{
unsigned int i;
int top=topItem();
for(i=0;i<mem.size();i+=4) {
changeItem(MemItem(i),i/4);
}
setCurrentItem(current());
setTopItem(top);
}
开发者ID:bsilvr,项目名称:ACA_MIPSSystemC,代码行数:11,代码来源:MIPSmemview.cpp
示例16: count
void MessageOutput::addToLastItem(const QString& s)
{
int ind = count() - 1;
if ( ind != -1 ) {
MessageItem *it = dynamic_cast<MessageItem*>( item(ind) );
if ( it )
it->addText( s );
else
changeItem( text( ind )+ s, ind );
}
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:11,代码来源:messageoutput.cpp
示例17: path
void PanelBrowserMenu::slotMimeCheck()
{
// get the first map entry
QMap<int, bool>::Iterator it = _mimemap.begin();
// no mime types left to check -> stop timer
if(it == _mimemap.end()) {
_mimecheckTimer->stop();
return;
}
int id = it.key();
QString file = _filemap[id];
_mimemap.remove(it);
KURL url;
url.setPath( path() + '/' + file );
// KMimeType::Ptr mt = KMimeType::findByURL(url, 0, true, false);
// QString icon(mt->icon(url, true));
QString icon = KMimeType::iconForURL( url );
// kdDebug() << url.url() << ": " << icon << endl;
file = KStringHandler::cEmSqueeze( file, fontMetrics(), 20 );
file.replace("&", "&&");
if(!_icons->contains(icon)) {
QPixmap pm = SmallIcon(icon);
if( pm.height() > 16 )
{
QPixmap cropped( 16, 16 );
copyBlt( &cropped, 0, 0, &pm, 0, 0, 16, 16 );
pm = cropped;
}
_icons->insert(icon, pm);
changeItem(id, pm, file);
}
else
changeItem(id, CICON(icon), file);
}
开发者ID:fuji7l,项目名称:KDesktop-Menu,代码行数:41,代码来源:browser_mnu.cpp
示例18: changeItem
void TListPanel::S_SelectItem(TFrameItem ¤tItem)
{
frameItems->at(currentIndex)->deSelect();
/*QMessageBox msgBox;
QPushButton *connectButton = msgBox.addButton(QString::number(currentIndex), QMessageBox::ActionRole);
QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort);
msgBox.exec();*/
currentIndex = frameItems->indexOf(¤tItem);
emit changeItem(currentIndex);
}
开发者ID:maschmidt,项目名称:VideoCutTest,代码行数:12,代码来源:TListPanel.cpp
示例19: changeItem
void SpawnListMenu::setCurrentCategory(const Category* cat)
{
// set the current category
m_currentCategory = cat;
// update the menu item names
if (cat != NULL)
{
changeItem(m_id_edit_category,
"&Edit '" + cat->name() + "' Category...");
setItemEnabled(m_id_edit_category, true);
changeItem(m_id_delete_category,
"&Delete '" + cat->name() + "' Category...");
setItemEnabled(m_id_delete_category, true);
}
else
{
changeItem(m_id_edit_category, "&Edit Category...");
setItemEnabled(m_id_edit_category, false);
changeItem(m_id_delete_category, "&Delete Category...");
setItemEnabled(m_id_delete_category, false);
}
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:23,代码来源:spawnlistcommon.cpp
注:本文中的changeItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论