/*! Destroys the QGraphicsAnchorLayout object. */ QGraphicsAnchorLayout::~QGraphicsAnchorLayout() { Q_D(QGraphicsAnchorLayout); for (int i = count() - 1; i >= 0; --i) { QGraphicsLayoutItem *item = d->items.at(i); removeAt(i); if (item) { if (item->ownedByLayout()) delete item; } } d->removeCenterConstraints(this, QGraphicsAnchorLayoutPrivate::Horizontal); d->removeCenterConstraints(this, QGraphicsAnchorLayoutPrivate::Vertical); d->deleteLayoutEdges(); Q_ASSERT(d->itemCenterConstraints[0].isEmpty()); Q_ASSERT(d->itemCenterConstraints[1].isEmpty()); Q_ASSERT(d->items.isEmpty()); Q_ASSERT(d->m_vertexList.isEmpty()); }
bool QTimerInfoList::unregisterTimer(int timerId) { // set timer inactive for (int i = 0; i < count(); ++i) { register QTimerInfo *t = at(i); if (t->id == timerId) { // found it removeAt(i); if (t == firstTimerInfo) firstTimerInfo = 0; if (t == currentTimerInfo) currentTimerInfo = 0; // release the timer id if (!QObjectPrivate::get(t->obj)->inThreadChangeEvent) QAbstractEventDispatcherPrivate::releaseTimerId(timerId); delete t; return true; } } // id not found return false; }
item_type* cutTop() { return removeAt(0); }
// Removes the last element from an array and returns the value of that element. frame_point_data_t* PSFramePoints::pop() { return removeAt(length-1); }
WObject* WEXPORT WVList::removeSame( WObject* obj ) { return( removeAt( indexOfSame( obj ) ) ); }
void CDeviceTypeList::deleteAt(POSITION pos) { TypeStruct* typeStruct = removeAt(pos); delete typeStruct; }
void GCompound::remove(GObject* gobj) { int index = findGObject(gobj); if (index != -1) removeAt(index); }
void Graph::erase_vertex( Vertex * v ){ int index = indexOf( v ); if( index > -1 ){ removeAt( index ); } }
void QMatList::removeMat(QMat *mat){ if ( !mat ) return; removeAt(m_list.indexOf(mat)); }
void Server_Room::removeClient(Server_ProtocolHandler *client) { removeAt(indexOf(client)); sendRoomEvent(new Event_LeaveRoom(id, client->getUserInfo()->getName())); emit roomInfoChanged(); }
void MAbstractLayoutPolicy::removeItem(const QGraphicsLayoutItem* item) { removeAt(indexOf(item)); }
// Removes the last element from an array and returns the value of that element. player_point_3d_t* PSPoints2Draw::pop() { return removeAt(length-1); }
/*! \since 4.8 Removes the layout item \a item without destroying it. Ownership of the item is transferred to the caller. \sa addItem() */ void QGraphicsGridLayout::removeItem(QGraphicsLayoutItem *item) { Q_D(QGraphicsGridLayout); int index = d->engine.indexOf(item); removeAt(index); }
void MarkerModel::removeMarker(MarkerItem* item) { auto container = item->container(); int row = container->index(); container->removeAt(item->index()); emit dataChanged(index(row, 1), index(row, 1)); }
item_type* remove(item_type* pItem) { pos_type i = pItem->getPos(); return removeAt(i); }
void SWidgetManager::remove( QWidget *widget ) { removeAt( p->widgets.indexOf(widget) ); }
void AbstractMediaList::replace(int index, const VlcMedia &new_media) { removeAt(index); insert(index, new_media); }
void MAbstractLayoutPolicy::removeItem(const QGraphicsLayoutItem *item) { int index = indexOf(item); if (index >= 0) removeAt(index); }
VlcMedia AbstractMediaList::takeAt(int index) { VlcMedia item = value(index); removeAt(index); return item; }
void ContactsKopete::updateContactData(const QString & contact) { if (d->noOnlineContacts) { load(true); return; } // Retrieving contact name QDBusReply < QString > contactName = d->interface->getDisplayName(contact); if (!contactName.isValid()) { return; } QDBusReply < QVariantMap > contactProperties = d->interface->contactProperties(contact); if (!contactProperties.isValid() || contactProperties.value().size() == 0) { return; } QDBusReply < bool > contactOnline = d->interface->isContactOnline(contact); if (!contactOnline.isValid()) { return; } QString avatarPath = contactProperties.value().value("picture").toString(); avatarPath = KUrl(avatarPath).toLocalFile(); if (avatarPath.isEmpty()) { avatarPath = "user-online"; } kDebug() << "avatarPath" << avatarPath; QString status = contactProperties.value().value("status_message").toString(); if (status.isEmpty()) { status = contactProperties.value().value("status").toString(); } int index; for (index = 0; index < size(); index++) { if (itemAt(index).data == contact) { break; } } if (index >= size()) { // we don't have this contact in the list if (contactOnline.value()) { add( contactProperties.value().value("display_name").toString(), status, KIcon(avatarPath), contact); } } else { // we already have this contact if (contactOnline.value()) { // we are updating the contact set(index, contactProperties.value().value("display_name").toString(), status, KIcon(avatarPath), contact); } else { // we are removing the contact from the list removeAt(index); if (size() == 0) { d->noOnlineContacts = true; add(i18n("No online contacts"), "", KIcon("user-offline"), QVariant()); } } } }
void AbstractMediaList::removeFirst() { removeAt(0); }
void GCompound::removeAll() { while (!contents.isEmpty()) { removeAt(0); } }
void AbstractMediaList::removeLast() { removeAt(length() - 1); }
void AbstractMediaList::removeOne(const VlcMedia &media) { removeAt(indexOf(media)); }
void KNMusicDatabase::onActionRowRemove(QModelIndex index) { removeAt(index.row()); }
/** * Removes double entries from the list. Double entries can occur * when a point is a waypoint as well as an airfield. In this case, * the one with the higher severity or longer name is preferred. * This function ASSUMES THE LIST IS SORTED! */ void ReachableList::removeDoubles() { QList<int> removeList; for (int i=count()-1; i>=1; i--) { const ReachablePoint& p1 = at(i); for (int j=0; j<i; j++) { const ReachablePoint& p2 = at(j); //qDebug("i=%d j=%d, P1=%s, P2=%s,", i, j, p1.getWaypoint()->name.toLatin1().data(), p2.getWaypoint()->name.toLatin1().data()); if ( p2.getWaypoint()->wgsPoint == p1.getWaypoint()->wgsPoint ) { //qDebug(" points are the same"); // ok, the points are the same. Now we choose which one to remove if ( p2.getWaypoint()->priority != p1.getWaypoint()->priority ) { // the waypoint with the lower priority will be removed if ( p2.getWaypoint()->priority > p1.getWaypoint()->priority ) { removeList.append(i); } else { removeList.append(j); } continue; } if ( p2.getWaypoint()->name == p1.getWaypoint()->name ) { // both name are identical. remove the one which has not set // the airfield origin flag. if( ! p1.isOrignAfl() ) { removeList.append(i); continue; } if( ! p2.isOrignAfl() ) { removeList.append(j); continue; } // both origin flags are set, remove one of the objects removeList.append(j); continue; } if ( p2.getWaypoint()->name.length() == p1.getWaypoint()->name.length() ) { // the lengths of the names are the same // remove the one with the lowest alphabetical value // (remember that A<a) if (p2.getWaypoint()->name > p1.getWaypoint()->name) { removeList.append(i); } else { removeList.append(j); } continue; } // if the names are not of equal length, remove the shortest. if ( p2.getWaypoint()->name.length() > p1.getWaypoint()->name.length() ) { removeList.append(i); } else { removeList.append(j); } continue; } // qDebug(" points are NOT the same: (%d, %d) vs (%d, %d)",p1.getWaypoint()->origP.x(),p1.getWaypoint()->origP.y(),p2.getWaypoint()->origP.x(),p2.getWaypoint()->origP.y()); } // End of for j } // End of for i // sort remove list qSort( removeList.begin(), removeList.end(), qLess<int>() ); // Start remove at the end of the list so that access index is always valid. for (int i = removeList.count()-1; i >= 0; i--) { // qDebug("Removing point %d (%s)", removeList.at(i), at(removeList.at(i)).getWaypoint()->name.toLatin1().data()); // remove doubles from global list removeAt( removeList.at(i) ); } }
void LinkedList<Item>::headRemove() { removeAt(0); }