/*! * remove */ void TTCutList::remove(const TTCutItem& cItem) { int index = data.indexOf(cItem); TTCutItem item = data.takeAt(index); emit itemRemoved(item); emit itemRemoved(index); }
/*! * clear */ void TTCutList::clear() { for (int i = data.count()-1; i >= 0; i--) { TTCutItem item = data.takeAt(i); emit itemRemoved(item); emit itemRemoved(i); } data.clear(); }
QgsAppLegendInterface::QgsAppLegendInterface( QgsLegend * legend ) : mLegend( legend ) { connect( legend, SIGNAL( itemAdded( QModelIndex ) ), this, SIGNAL( itemAdded( QModelIndex ) ) ); connect( legend, SIGNAL( itemMoved( QModelIndex, QModelIndex ) ), this, SLOT( updateIndex( QModelIndex, QModelIndex ) ) ); connect( legend, SIGNAL( itemMoved( QModelIndex, QModelIndex ) ), this, SIGNAL( groupRelationsChanged( ) ) ); connect( legend, SIGNAL( itemMovedGroup( QgsLegendItem *, int ) ), this, SIGNAL( groupRelationsChanged() ) ); // connect( legend, SIGNAL( itemChanged( QTreeWidgetItem*, int ) ), this, SIGNAL( groupRelationsChanged() ) ); connect( legend, SIGNAL( itemRemoved() ), this, SIGNAL( itemRemoved() ) ); }
void MyXmppClient::initRosterManager() { rosterManager = &xmppClient->rosterManager(); qDebug() << "MyXmppClient::clientStateChanged(): initializing roster manager"; QObject::connect( rosterManager, SIGNAL(presenceChanged(QString,QString)), this, SLOT(initPresence(const QString, const QString)), Qt::UniqueConnection ); QObject::connect( rosterManager, SIGNAL(rosterReceived()), this, SLOT(initRoster()), Qt::UniqueConnection ); QObject::connect( rosterManager, SIGNAL(subscriptionReceived(QString)), this, SLOT(notifyNewSubscription(QString)), Qt::UniqueConnection ); QObject::connect( rosterManager, SIGNAL(itemAdded(QString)), this, SLOT(itemAdded(QString)), Qt::UniqueConnection ); QObject::connect( rosterManager, SIGNAL(itemRemoved(QString)), this, SLOT(itemRemoved(QString)), Qt::UniqueConnection ); QObject::connect( rosterManager, SIGNAL(itemChanged(QString)), this, SLOT(itemChanged(QString)), Qt::UniqueConnection ); }
void XMLDB::XMLCategoryCollection::addCategory( DB::CategoryPtr category ) { m_categories.append( category ); if (category->isSpecialCategory()) { m_specialCategories[category->type()] = category; } connect( category.data(), SIGNAL(changed()), this, SIGNAL(categoryCollectionChanged()) ); connect( category.data(), SIGNAL(itemRemoved(QString)), this, SLOT(itemRemoved(QString)) ); connect( category.data(), SIGNAL(itemRenamed(QString,QString)), this, SLOT(itemRenamed(QString,QString)) ); emit categoryCollectionChanged(); }
void QgsAddRemoveItemCommand::switchState() { if ( mState == Added ) { // Remove if ( mComposition ) { mComposition->itemsModel()->setItemRemoved( mItem ); mComposition->removeItem( mItem ); } emit itemRemoved( mItem ); mState = Removed; } else //Removed { // Add if ( mComposition ) { mComposition->itemsModel()->setItemRestored( mItem ); mComposition->addItem( mItem ); } emit itemAdded( mItem ); mState = Added; } mComposition->project()->setDirty( true ); }
void ToolBarChanger::removeItem(QAction *AHandle) { QWidget *widget = FHandles.key(AHandle, NULL); if (widget && AHandle!=FAllignChange) { AHandle->deleteLater(); FToolBar->removeAction(AHandle); disconnect(widget,SIGNAL(destroyed(QObject *)),this,SLOT(onWidgetDestroyed(QObject *))); Action *action = FButtons.key(qobject_cast<QToolButton *>(widget), NULL); if (action) FButtons.take(action)->deleteLater(); int group = FWidgets.key(widget); FWidgets.remove(group,widget); if (!FWidgets.contains(group)) { QAction *separator = FSeparators.take(group); FToolBar->removeAction(separator); delete separator; updateSeparatorVisible(); } if (FWidgets.keys().last()<=TBG_ALLIGN_CHANGE) { FAllignChange->setVisible(false); } FHandles.remove(widget); emit itemRemoved(AHandle); updateVisible(); }
void NodeAnim::initializeTableItems() { NodeGuiPtr nodeGui = _imp->nodeGui.lock(); KnobItemsTableGuiPtr table = nodeGui->getKnobItemsTable(); if (!table) { return; } KnobItemsTablePtr internalTable = table->getInternalTable(); if (!internalTable) { return; } connect(internalTable.get(), SIGNAL(itemRemoved(KnobTableItemPtr,TableChangeReasonEnum)), this, SLOT(onTableItemRemoved(KnobTableItemPtr,TableChangeReasonEnum))); connect(internalTable.get(), SIGNAL(itemInserted(int,KnobTableItemPtr,TableChangeReasonEnum)), this, SLOT(onTableItemInserted(int,KnobTableItemPtr,TableChangeReasonEnum))); NodeAnimPtr thisShared = shared_from_this(); std::vector<KnobTableItemPtr> allItems = internalTable->getTopLevelItems(); for (std::size_t i = 0; i < allItems.size(); ++i) { TableItemAnimPtr anim(TableItemAnim::create(getModel(), table, thisShared, allItems[i], _imp->nameItem)); _imp->topLevelTableItems.push_back(anim); } } // initializeTableItems
bool MountTray::addDevice(QString dev, QString label, QString type, QString filesys){ if(!dev.startsWith(DEVICEDIR)){ dev.prepend(DEVICEDIR); } //Check if the device is already in the list int tot=0; for(int i=0; i<deviceList.length(); i++){ if( deviceList[i]->device == dev ){ return false; } //already exists, do nothing if( deviceList[i]->getDeviceName().startsWith(label) ){ tot++; } } //See if the label is unique as well, otherwise add a number to the end to make it unique if(tot > 0 && !label.isEmpty()){ label.append("-"+QString::number(tot)); } qDebug() << "Valid Device Connection:" << dev << type << label << filesys; //Create the menu item (will automount if necessary) MenuItem *tmp = new MenuItem(this, DCheck, dev, label, type, filesys); //connect the signals/slots connect(tmp, SIGNAL(itemMounted(QString)), this, SLOT(openMediaDir(QString)) ); connect(tmp, SIGNAL(newMessage(QString,QString)), this, SLOT(slotDisplayPopup(QString,QString)) ); connect(tmp, SIGNAL(itemRemoved(QString)), this, SLOT(removeDevice(QString)) ); connect(tmp, SIGNAL(itemWorking()), this, SLOT(slotCloseMenu()) ); connect(tmp, SIGNAL(openAVDisk(QString)), this, SLOT(slotOpenAVDisk(QString)) ); deviceList << tmp; //Update the menu updateMenu(); return true; }
void DownloadsDataModel::removeItem( QVariantList const & indexPath ) { if( indexPath.size() == 2 ){ m_downloadList.removeAt( indexPath.at(1).toInt() ); emit itemRemoved( indexPath ); } }
void QKeyList::contextMenuEvent(QContextMenuEvent* evt) { QMenu menu(this); QAction* addObjItem = menu.addAction(tr("Add Object")); QAction* delObjItem = menu.addAction(tr("Remove Object")); if (currentItem() == NULL) delObjItem->setEnabled(false); QAction* sel = menu.exec(evt->globalPos()); if (sel == addObjItem) { QFindKeyDialog dlg(this); if (fKeys.size() > 0) dlg.init(PrpShopMain::ResManager(), fKeys.back()->getLocation(), fKeys.back()->getType()); else dlg.init(PrpShopMain::ResManager(), fContainer->getLocation()); if (dlg.exec() == QDialog::Accepted) { addKey(dlg.selection()); emit itemAdded(dlg.selection()); } } else if (sel == delObjItem) { int idx = indexOfTopLevelItem(currentItem()); delItem(idx); emit itemRemoved(idx); } }
void MenuItem::updateItem(){ //Update the item visuals, based upon current device status if( isConnected() ){ if( isMounted() ){ if(mountpoint.isEmpty()){ //detect the current mountpoint QString output = pcbsd::Utils::runShellCommandSearch("mount",device); mountpoint = output.section(" on ",1,1).section(" (",0,0).replace(" ","-"); } devIcon->setEnabled(TRUE); //Make the icon full color devIcon->setToolTip(device+"\n"+QString(tr("Mounted at %1")).arg(mountpoint)); pushMount->setText(tr("Eject")); pushMount->setIcon(QIcon(":icons/eject.png")); if(devType != "ISO"){ checkAutomount->setVisible(TRUE); } else{ checkAutomount->setVisible(FALSE); } }else{ devIcon->setEnabled(FALSE); //Grey out the icon if not mounted devIcon->setToolTip(device); pushMount->setText(tr("Mount")); pushMount->setIcon(QIcon(":icons/mount.png")); checkAutomount->setVisible(FALSE); } }else{ emit itemRemoved(device); return; } //Set visibility and sizes on progressbar updateSizes(); }
void QToolBox_QtDShell::__override_itemRemoved(int index0, bool static_call) { if (static_call) { QToolBox::itemRemoved((int )index0); } else { itemRemoved((int )index0); } }
void RefrigerationSystemListController::removeSystem(model::RefrigerationSystem & refrigerationSystem) { int i = systemIndex(refrigerationSystem); refrigerationSystem.remove(); emit itemRemoved(i); }
void ItemList::remove(Item* item) { CHECK_PARAM_RET(item != NULL); CHECK_PARAM_RET(contains(item)); m_items.remove(item); m_map.remove(item->itemId()); emit itemRemoved(item->itemId()); }
void DockItemController::pluginItemRemoved(PluginsItem *item) { if (m_containerItem->contains(item)) m_containerItem->removeItem(item); else emit itemRemoved(item); m_itemList.removeOne(item); }
void OSObjectListCBDS::onObjectWillBeRemoved(const WorkspaceObject & workspaceObject) { if(std::find(m_types.begin(),m_types.end(),workspaceObject.cast<model::ModelObject>().iddObjectType()) != m_types.end()) { int i = m_workspaceObjects.indexOf(workspaceObject); m_workspaceObjects.removeAt(i); if( m_allowEmptySelection ) { emit itemRemoved(i + 1); } else { emit itemRemoved(i); } } }
void ComboBox::onRemoveItem(int index) { if (index < 0) return; emit itemRemoved(index); emit itemRemoved(itemText(index)); /*QVariant data = itemData(index); QObject* obj = data.value<QObject*>(); if (obj) obj->deleteLater();*/ removeItem(index); if (count() == 1) { insertItem(0, tr("None"), QString("NOT_VALID")); } mHidePopup = false; }
void LiveListWidget::keyPressEvent(QKeyEvent *event) { temp_item = currentItem(); if(event->key()==Qt::Key_Delete) { emit itemRemoved(this->row(temp_item)); this->takeItem(this->row(temp_item)); delete temp_item; } }
void MenuItem::slotAutoMount(){ //Just like slotMountClicked, but will only mount the device if appropriate (no removals); if( isConnected() ){ if( !isMounted() ){ mountItem(); } }else{ emit itemRemoved(device); } updateItem(); }
void ComboBox::onRemoveItem(int index) { if (index < 0) return; QString text = itemText(index); removeItem(index); emit itemRemoved(index); emit itemRemoved(text); if (count() == 1) clear(); if (currentIndex() == count()-1) setCurrentIndex(count()-2); hidePopup(); showPopup(); }
WidgetBoxCategoryListView *WidgetBoxTreeWidget::addCategoryView(QTreeWidgetItem *parent, bool iconMode) { QTreeWidgetItem *embed_item = new QTreeWidgetItem(parent); embed_item->setFlags(Qt::ItemIsEnabled); WidgetBoxCategoryListView *categoryView = new WidgetBoxCategoryListView(m_core, this); categoryView->setViewMode(iconMode ? QListView::IconMode : QListView::ListMode); connect(categoryView, SIGNAL(scratchPadChanged()), this, SLOT(slotSave())); connect(categoryView, SIGNAL(pressed(QString,QString,QPoint)), this, SIGNAL(pressed(QString,QString,QPoint))); connect(categoryView, SIGNAL(itemRemoved()), this, SLOT(slotScratchPadItemDeleted())); connect(categoryView, SIGNAL(lastItemRemoved()), this, SLOT(slotLastScratchPadItemDeleted())); setItemWidget(embed_item, 0, categoryView); return categoryView; }
const QHash<QString, QMPointer<QMJsonValue> >::iterator QMJsonObject::erase(const QHash<QString, QMPointer<QMJsonValue> >::iterator &iter) { if (iter == mHash.end()) return mHash.end(); auto key = iter.key(); auto value = iter.value(); auto niter = mHash.erase(iter); emit itemRemoved(key, value); return niter; }
void WidgetBoxCategoryListView::removeCurrentItem() { const QModelIndex index = currentIndex(); if (!index.isValid() || !m_proxyModel->removeRow(index.row())) return; // We check the unfiltered item count here, we don't want to get removed if the // filtered view is empty if (m_model->rowCount()) { emit itemRemoved(); } else { emit lastItemRemoved(); } }
/* PRIVATE FUNCTIONS */ void MenuItem::slotMountClicked(){ //Hide the parent menu emit itemWorking(); //Now if( isConnected() ){ if( !isMounted() ){ mountItem(); }else{ unmountItem(); } }else{ emit itemRemoved(device); } updateItem(); }
std::unique_ptr<WLayoutItem> WBorderLayout::removeItem(WLayoutItem *item) { std::unique_ptr<WLayoutItem> result; for (int i = 0; i < 5; ++i) { Impl::Grid::Item& gridItem = itemAtPosition((LayoutPosition)i); if (gridItem.item_.get() == item) { result = std::move(gridItem.item_); itemRemoved(item); break; } } return result; }
void VRFSystemListController::removeSystem(model::AirConditionerVariableRefrigerantFlow & vrfSystem) { std::vector<model::ZoneHVACTerminalUnitVariableRefrigerantFlow> terminals = vrfSystem.terminals(); if( ! terminals.empty() ) { QMessageBox message(m_vrfController->vrfView()); QString text; int size = terminals.size(); if( size == 1 ) { text.append("There is "); text.append(QString::number(size)); text.append( " terminal "); } else { text.append("There are "); text.append(QString::number(size)); text.append( " terminals "); } text.append("attached to this system which will be removed if you continue."); message.setText(text); message.addButton(QMessageBox::Cancel); message.addButton(QMessageBox::Ok); int response = message.exec(); if( response != QMessageBox::Ok ) { return; } } int i = systemIndex(vrfSystem); for(std::vector<model::ZoneHVACTerminalUnitVariableRefrigerantFlow>::iterator it = terminals.begin(); it != terminals.end(); ++it) { it->remove(); } vrfSystem.remove(); emit itemRemoved(i); }
int Velasquez::EditorScene::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QGraphicsScene::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: cleared(); break; case 1: backgroundColorChanged((*reinterpret_cast< const QColor(*)>(_a[1]))); break; case 2: itemAdded((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break; case 3: itemRemoved((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break; case 4: onSelectionChanged(); break; default: ; } _id -= 5; } return _id; }
// PUBLIC SLOTS void Browser::loadDirectory(QString dir){ //qDebug() << "Load Directory" << dir; if(dir.isEmpty()){ dir = currentDir; } //reload current directory if(dir.isEmpty()){ return; } //nothing to do - nothing previously loaded if(currentDir != dir){ //let the main widget know to clear all current items (completely different dir) oldFiles.clear(); emit clearItems(); } currentDir = dir; //save this for later //clean up the watcher first QStringList watched; watched << watcher->files() << watcher->directories(); if(!watched.isEmpty()){ watcher->removePaths(watched); } QStringList old = oldFiles; //copy this over for the moment (both lists will change in a moment) oldFiles.clear(); //get ready for re-creating this list // read the given directory QDir directory(dir); if(directory.exists()){ QStringList files; if(showHidden){ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot, QDir::NoSort); } else{ files = directory.entryList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::NoSort); } emit itemsLoading(files.length()); QCoreApplication::processEvents(); for(int i=0; i<files.length(); i++){ watcher->addPath(directory.absoluteFilePath(files[i])); //qDebug() << "Future Starting:" << files[i]; QString path = directory.absoluteFilePath(files[i]); if(old.contains(path)){ old.removeAll(path); } oldFiles << path; //add to list for next time QtConcurrent::run(this, &Browser::loadItem, path ); QCoreApplication::sendPostedEvents(); } watcher->addPath(directory.absolutePath()); if(!old.isEmpty()){ old.removeAll(directory.absolutePath()); for(int i=0; i<old.length(); i++){ emit itemRemoved(old[i]); } } }else{ emit itemsLoading(0); //nothing to load } }
void QgsComposerView::ungroupItems() { if ( !composition() ) { return; } QList<QgsComposerItem*> selectionList = composition()->selectedComposerItems(); QList<QgsComposerItem*>::iterator itemIter = selectionList.begin(); for ( ; itemIter != selectionList.end(); ++itemIter ) { QgsComposerItemGroup* itemGroup = dynamic_cast<QgsComposerItemGroup *>( *itemIter ); if ( itemGroup ) { itemGroup->removeItems(); composition()->removeItem( *itemIter ); delete( *itemIter ); emit itemRemoved( *itemIter ); } } }