本文整理汇总了C++中deleteItem函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteItem函数的具体用法?C++ deleteItem怎么用?C++ deleteItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QDialog
ListDialog::ListDialog() : QDialog()
{
ui.setupUi(this);
connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addItem()));
connect(ui.editButton, SIGNAL(clicked()), this, SLOT(editItem()));
connect(ui.deleteButton, SIGNAL(clicked()), this, SLOT(deleteItem()));
}
开发者ID:embicoin,项目名称:Foundations.of.Qt.Development,代码行数:8,代码来源:listdialog.cpp
示例2: deleteItem
void TeethX::lvMain_KeyDown(Win::Event& e)
{
LPNMLVKEYDOWN p = (LPNMLVKEYDOWN) e.lParam;
if (p->wVKey == VK_DELETE)
{
deleteItem();
}
}
开发者ID:israelfloresdga,项目名称:Wintempla-Bases-de-Datos-Avanzadas,代码行数:8,代码来源:TeethX.cpp
示例3: deleteItem
void CTabbedInt::reset()
{
deleteItem(activeTab);
activeTab = createItem(activeID);
activeTab->moveTo(pos.topLeft());
if (active)
redraw();
}
开发者ID:Ed-von-Schleck,项目名称:vcmi,代码行数:9,代码来源:CIntObjectClasses.cpp
示例4: menu
void MusicSongsSummarizied::contextMenuEvent(QContextMenuEvent *event)
{
QMenu menu(this);
menu.setStyleSheet(MusicUIObject::MMenuStyle02);
menu.addAction(QIcon(":/contextMenu/delete"), tr("deleteItem"), this, SLOT(deleteItem()));
menu.addAction(QIcon(":/contextMenu/add"), tr("addNewItem"), this, SLOT(addNewItem()));
menu.addAction(tr("changItemName"), this, SLOT(changItemName()));
menu.exec(event->globalPos());
}
开发者ID:chenpusn,项目名称:Musicplayer,代码行数:9,代码来源:musicsongssummarizied.cpp
示例5: destroyKeyboardInstanceObject
void
destroyKeyboardInstanceObject (KeyboardInstanceObject *kio) {
flushKeyEvents(kio);
if (kio->events.buffer) free(kio->events.buffer);
deleteItem(kio->kmo->instanceQueue, kio);
if (kio->kix) destroyKeyboardInstanceExtension(kio->kix);
free(kio);
}
开发者ID:hinderer,项目名称:brltty,代码行数:9,代码来源:kbd.c
示例6: addItem
void JsonDbSortingListModelPrivate::sendNotifications(int partitionIndex, const QVariantMap &v, QJsonDbWatcher::Action action)
{
if (action == QJsonDbWatcher::Created) {
addItem(v, partitionIndex);
} else if (action == QJsonDbWatcher::Removed) {
deleteItem(v, partitionIndex);
} else if (action == QJsonDbWatcher::Updated) {
updateItem(v, partitionIndex);
}
}
开发者ID:Distrotech,项目名称:qtjsondb,代码行数:10,代码来源:jsondbsortinglistmodel.cpp
示例7: currentItem
/**
* Slot for deleting an item called from the popup menu.
*/
void RefactoringAssistant::deleteItem()
{
QTreeWidgetItem *item = currentItem();
if (item) {
UMLObject *o = findUMLObject(item);
if (o) {
deleteItem(item, o);
}
}
}
开发者ID:Salmista-94,项目名称:umbrello,代码行数:13,代码来源:refactoringassistant.cpp
示例8: WidgetListItem
void WidgetListEditor::addItem(QWidget *item)
{
WidgetListItem* widgetListItem = new WidgetListItem(this);
widgetListItem->setItem(item);
ui->list->addWidget(widgetListItem);
connect(widgetListItem, SIGNAL(deleteItem()), this, SLOT(on_deleteItem()));
connect(widgetListItem, SIGNAL(moveUp()), this, SLOT(on_moveUp()));
connect(widgetListItem, SIGNAL(moveDown()), this, SLOT(on_moveDown()));
}
开发者ID:Ulle84,项目名称:UllesSourceCode,代码行数:10,代码来源:WidgetListEditor.cpp
示例9: deleteAllItem
/**
* Xoa tat ca cac item co itemID thuoc list itemIDs.
* @param itemIDs
* @return bool
*/
bool ItemDB::deleteAllItem(vector<string> itemIDs, ItemTagDB& itemTagDB) {
int size = itemIDs.size();
bool result = true;
for (int i = 0; i < size; i++) {
if (!deleteItem(itemIDs[i], itemTagDB)) {
poco_error_f1(*logger, "deleteAllItem: Error to delete ItemID = %s", itemIDs[i]);
result = false;
}
}
return result;
}
开发者ID:mappcenter,项目名称:lazyboys-pro,代码行数:16,代码来源:ItemDB.cpp
示例10: throw
void BST::deleteItem(TreeNode *& treePtr,
KeyType searchKey)
throw(TreeException)
// Calls: deleteNodeItem.
{
if (treePtr == NULL)
throw TreeException("TreeException: delete failed"); // empty tree
else if (searchKey == treePtr->item.getKey())
// item is in the root of some subtree
deleteNodeItem(treePtr); // delete the item
// else search for the item
else if (searchKey < treePtr->item.getKey())
// search the left subtree
deleteItem(treePtr->leftChildPtr, searchKey);
else // search the right subtree
deleteItem(treePtr->rightChildPtr, searchKey);
} // end deleteItem
开发者ID:elisemmc,项目名称:EECS268,代码行数:20,代码来源:BST.cpp
示例11: unlink
bool Q3GList::removeRef( Q3PtrCollection::Item d )
{
if ( findRef(d) == -1 )
return false;
Q3LNode *n = unlink();
if ( !n )
return false;
deleteItem( n->data );
delete n;
return true;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:11,代码来源:q3glist.cpp
示例12: locate
/*!
Replaces the item at index \a index with \a d.
*/
bool Q3GList::replaceAt( uint index, Q3PtrCollection::Item d )
{
Q3LNode *n = locate( index );
if ( !n )
return false;
if ( n->data != d ) {
deleteItem( n->data );
n->data = newItem( d );
}
return true;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:14,代码来源:q3glist.cpp
示例13: main
int main(int argc, char *argv[])
{
FILE *file = initFile();
init(file);
if(argc == 1){
printItems();
} else {
if(!strcmp(argv[1],"add")){
if(argc<3){
printf("Usage: todo add [<priority>] <text>\n");
} else {
insertItem(argv,argc);
}
}
if(!strcmp(argv[1],"del")){
if(argc<3){
printf("Usage: todo del <id>\n");
} else {
deleteItem(atoi(argv[2]));
}
}
if(!strcmp(argv[1],"swap")){
if(argc<4){
printf("Usage: todo swap <id1> <id2>\n");
} else {
swapIDs(atoi(argv[2]), atoi(argv[3]));
}
}
/*
if(!strcmp(argv[1],"prio")){
if(argc < 4){
printf("Usage: todo prio <id> <new_prio>\n");
} else {
changePrio(atoi(argv[2]), atoi(argv[3]));
}
}
*/
}
cleanUp();
return 0;
}
开发者ID:reuteran,项目名称:todo-list,代码行数:54,代码来源:todo.c
示例14: deleteItem
void UserFunctionListWidget::keyPressEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Delete)
deleteItem();
else if (event->key() == Qt::Key_E)
editItem();
else {
QWidget::keyPressEvent(event);
return;
}
event->accept();
}
开发者ID:0pq76r,项目名称:SpeedCrunch,代码行数:12,代码来源:userfunctionlistwidget.cpp
示例15: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->progressBar->setVisible(false);
ui->widthSpinBox->setValue(Settings::instance()->width());
ui->heightSpinBox->setValue(Settings::instance()->height());
new QShortcut(QKeySequence(Qt::Key_Delete), this, SLOT(deleteItem()));
}
开发者ID:ncux,项目名称:Simple-Resize,代码行数:12,代码来源:mainwindow.cpp
示例16: setItemPosition
void LoLEngine::updateObjectFlightPosition(FlyingObject *t) {
if (t->objectType == 0) {
setItemPosition(t->item, t->x, t->y, t->flyingHeight, (t->flyingHeight == 0) ? 1 : 0);
} else if (t->objectType == 1) {
if (t->flyingHeight == 0) {
deleteItem(t->item);
checkSceneUpdateNeed(calcBlockIndex(t->x, t->y));
} else {
setItemPosition(t->item, t->x, t->y, t->flyingHeight, 0);
}
}
}
开发者ID:hchen1014,项目名称:scummvm,代码行数:12,代码来源:items_lol.cpp
示例17: deleteItem
void QGVector::clear() // clear vector
{
if ( vec ) {
for ( uint i=0; i<len; i++ ) { // delete each item
if ( vec[i] )
deleteItem( vec[i] );
}
DELETE(vec);
vec = 0;
len = numItems = 0;
}
}
开发者ID:kthxbyte,项目名称:Qt1.45-Linaro,代码行数:12,代码来源:qgvector.cpp
示例18: currentItem
void AdBlockTreeWidget::removeRule()
{
QTreeWidgetItem* item = currentItem();
if (!item || !m_subscription->canEditRules() || item == m_topItem) {
return;
}
int offset = item->data(0, Qt::UserRole + 10).toInt();
m_subscription->removeRule(offset);
deleteItem(item);
}
开发者ID:Martii,项目名称:qupzilla,代码行数:12,代码来源:adblocktreewidget.cpp
示例19: while
void ToDoPapers::cleanAndRefresh()
{
while( !p->items.isEmpty() )
deleteItem(p->items.first());
const QString & text = p->text;
int lastPos = 0;
int pos = text.indexOf("\n",lastPos);
while( pos != text.length() )
{
if( pos == -1 )
pos = text.length();
const QString & str = text.mid(lastPos,pos-lastPos);
const QString & slc = str.mid(0,2);
bool checkable = (slc=="* " || slc=="- ");
if( !checkable && !p->items.isEmpty() )
{
p->signal_blocker = true;
ToDoPapersItem *item = p->items.last();
item->setText( item->text() + "\n" + str );
p->signal_blocker = false;
}
else
{
ToDoPapersItem *item = new ToDoPapersItem(this);
item->setCheckable(checkable);
item->setText( checkable? str.mid(2) : str );
item->setChecked( slc=="* " );
connect( item, SIGNAL(textChanged()) , SLOT(refreshText()) );
connect( item, SIGNAL(checkedChanged()), SLOT(refreshText()) );
connect( item, SIGNAL(accepted(ToDoPapersItem*)) , SLOT(createItemAfter(ToDoPapersItem*)) );
connect( item, SIGNAL(removed(ToDoPapersItem*)) , SLOT(removeItem(ToDoPapersItem*)) );
connect( item, SIGNAL(removeNext(ToDoPapersItem*)), SLOT(removeNextItem(ToDoPapersItem*)) );
connect( item, SIGNAL(upPressed(ToDoPapersItem*)) , SLOT(focusOnUp(ToDoPapersItem*)) );
connect( item, SIGNAL(downPressed(ToDoPapersItem*)), SLOT(focusOnDown(ToDoPapersItem*)) );
p->items << item;
p->base_layout->insertWidget(p->base_layout->count()-1,item);
item->show();
}
lastPos = pos+1;
if( pos != text.length() )
pos = text.indexOf("\n",lastPos);
}
}
开发者ID:Aseman-Land,项目名称:Papyrus,代码行数:52,代码来源:todopapers.cpp
示例20: pos
void Column::updatePos(qreal t)
{
qreal newX = pos().x() + v * t;
qreal newY = pos().y();
if (newX + boundingRect().width() < 0)
{
emit deleteItem(this);
}
else
{
setPos(newX, newY);
}
}
开发者ID:sereja589,项目名称:flappy-bird,代码行数:13,代码来源:column.cpp
注:本文中的deleteItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论