예제 #1
0
void GameObjectManager::removeAt(int index, bool del)
{
    if (index >= 0 && index < mGameObjects.size()) {
        GameObject* obj = takeAt(index);
        emit objectRemoved(obj, del);
        if (del && obj)
            delete obj;
    }
}
예제 #2
0
void Project::removeObject( QObject *o )
{
    bool wasModified = modified;
    objs.removeRef( o );
    MetaDataBase::removeEntry( o );
    fakeFormFiles.remove( (void*)o );
    emit objectRemoved( o );
    modified = wasModified;
}
예제 #3
0
DevicesModel::DevicesModel(QObject *parent) :
    QStandardItemModel(parent)
{
    m_client = new UDisksClient(this);
    connect(m_client, SIGNAL(objectsAvailable()),
            this, SLOT(objectsAvailable()));
    connect(m_client, SIGNAL(objectAdded(UDisksObject::Ptr)),
            this, SLOT(objectAdded(UDisksObject::Ptr)));
    connect(m_client, SIGNAL(objectRemoved(UDisksObject::Ptr)),
            this, SLOT(objectRemoved(UDisksObject::Ptr)));
    connect(m_client, SIGNAL(interfacesAdded(UDisksObject::Ptr)),
            this, SLOT(objectChanged(UDisksObject::Ptr)));
    m_client->init();

    m_roleNames.insert(RoleId, "roleId");
    m_roleNames.insert(RoleName, "roleName");
    m_roleNames.insert(RoleSize, "roleSize");
    m_roleNames.insert(RoleDevPath, "roleDevPath");
}
bool SimpleDataAccessObject<T>::remove(T *const object)
{
    resetLastError();
    QVariant key = m_metaObject.primaryKeyProperty().read(object);
    bool ok = m_objects.contains(key);
    if(ok) {
        m_objects.remove(key);
        emit objectRemoved(object);
    }
    return ok;
}
bool Workspace::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0:
        update();
        break;
    case 1:
        update((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 2:
        activeFormChanged((FormWindow*)static_QUType_ptr.get(_o+1));
        break;
    case 3:
        activeEditorChanged((SourceEditor*)static_QUType_ptr.get(_o+1));
        break;
    case 4:
        itemClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)));
        break;
    case 5:
        itemDoubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1));
        break;
    case 6:
        rmbClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)));
        break;
    case 7:
        bufferChosen((const QString&)static_QUType_QString.get(_o+1));
        break;
    case 8:
        projectDestroyed((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 9:
        sourceFileAdded((SourceFile*)static_QUType_ptr.get(_o+1));
        break;
    case 10:
        sourceFileRemoved((SourceFile*)static_QUType_ptr.get(_o+1));
        break;
    case 11:
        formFileAdded((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 12:
        formFileRemoved((FormFile*)static_QUType_ptr.get(_o+1));
        break;
    case 13:
        objectAdded((QObject*)static_QUType_ptr.get(_o+1));
        break;
    case 14:
        objectRemoved((QObject*)static_QUType_ptr.get(_o+1));
        break;
    default:
        return QListView::qt_invoke( _id, _o );
    }
    return TRUE;
}
예제 #6
0
bool QpDaoBase::removeObject(QSharedPointer<QObject> object)
{
    if(!d->sqlDataAccessObjectHelper->removeObject(d->metaObject, object.data())) {
        setLastError(d->sqlDataAccessObjectHelper->lastError());
        return false;
    }

    d->cache.remove(Qp::Private::primaryKey(object.data()));
    emit objectRemoved(object);
    object.clear();
    return true;
}
예제 #7
0
onlineJobModel::onlineJobModel(QObject *parent) :
    QAbstractTableModel(parent),
    m_jobIdList(QStringList())
{
  MyMoneyFile *file = MyMoneyFile::instance();
  connect(file, SIGNAL(objectAdded(MyMoneyFile::notificationObjectT,MyMoneyObject*const)),
          this, SLOT(slotObjectAdded(MyMoneyFile::notificationObjectT,MyMoneyObject*const)));
  connect(file, SIGNAL(objectModified(MyMoneyFile::notificationObjectT,MyMoneyObject*const)),
          this, SLOT(slotObjectModified(MyMoneyFile::notificationObjectT,MyMoneyObject*const)));
  connect(file, SIGNAL(objectRemoved(MyMoneyFile::notificationObjectT,QString)),
          this, SLOT(slotObjectRemoved(MyMoneyFile::notificationObjectT,QString)));
}
예제 #8
0
void OSLineEdit2::onItemRemoveClicked()
{
  if (m_reset)
  {
    boost::optional<model::ParentObject> parent = boost::none;
    if (m_modelObject) {
      parent = m_modelObject->parent();
    }
    (*m_reset)();
    if (m_deleteObject) {
      m_modelObject->remove();
    }
    emit objectRemoved(parent);
  }
}
예제 #9
0
/*!
  Remove a read-only object. Only the base should  make use of this function.
  @see removeObject()
  @return True if the object was deleted as requested. False otherwise.
 */
bool rtObjectManager::removeReadOnly(int objID) {
  rtRenderObject* temp;

  // Lock this function
  QMutexLocker locker(&m_objectLock);

  if (m_objectHash.contains(objID)) {
    temp = m_objectHash.value(objID);
    if (!temp || isPermanent(objID)) return false;
    m_objectHash.remove(objID);
    if (m_list2DHash.remove(objID)>0 && rtApplication::instance().getMainWinHandle()) {
      rtApplication::instance().getMainWinHandle()->update2DWindowLists(&m_list2DHash);
    }
    delete temp;
    emit objectRemoved(objID);
    return true;
  }
  return false;
}
void RKVarEditDataFrameModel::childMoved (int old_index, int new_index, RObject* parent) {
	RK_TRACE (EDITOR);

	if (parent == dataframe) {
		RObject *child = dataframe->findChildByIndex (new_index);	// it's at the new position, already
		RK_ASSERT (objects.size () > (old_index + var_col_offset));
		RK_ASSERT (child == objects[old_index + var_col_offset]);
		// if an object has changed position, there should be at least two objects left. Hence, the objectRemoved-call will never lead to editor destruction
		RK_ASSERT (objects.size () >= (var_col_offset + 2));
		objectRemoved (child);

		RK_ASSERT (child->isVariable ());
		addObject (new_index + var_col_offset, static_cast<RKVariable*> (child));
	} else {
		// even though we are listening for the child objects as well, we should see move notifications
		// only for children of the parent.
		RK_ASSERT (false);
	}
}
	void handleSourceDataUpdate(const Source<Objects>& source)
	{
		Objects::Mutex::scoped_lock lock(objects.mutex);

		objects = source.get();

		if (calibrating) {
			for (Objects::Iterator object = objects.begin(); object != objects.end(); ++object) {
				if ((*object)->isNew()) {
					objectAdded(*object);
				} else if ((*object)->isDead()) {
					objectRemoved(*object);
				} else {
					objectUpdated(*object);
				}
			}
		}

		repaint();
	}
예제 #12
0
void OSLoadNamePixmapLineEdit::createWidgets()
{
  QPixmap m_pixmap(MINI_ICON_SIZE, MINI_ICON_SIZE);

  m_label = new QLabel();
  m_label->setFixedSize(MINI_ICON_SIZE, MINI_ICON_SIZE);
  m_label->setPixmap(m_pixmap);
  
  m_lineEdit = new OSLineEdit2();

  bool isConnected = connect(m_lineEdit, SIGNAL(itemClicked(OSItem*)), this, SIGNAL(itemClicked(OSItem*)));
  OS_ASSERT(isConnected);

  isConnected = connect(m_lineEdit, SIGNAL(objectRemoved(boost::optional<model::ParentObject>)), this, SIGNAL(objectRemoved(boost::optional<model::ParentObject>)));
  OS_ASSERT(isConnected);

  auto layout = new QHBoxLayout();
  layout->setContentsMargins(0,0,0,0);
  layout->addWidget(m_label);
  layout->addWidget(m_lineEdit);
  this->setLayout(layout);
}
예제 #13
0
void CBRLocationServiceCache::replicaObjectRemoved(const UUID& uuid) {
    if (mWithReplicas)
        objectRemoved(uuid, false);
}
예제 #14
0
void CBRLocationServiceCache::localObjectRemoved(const UUID& uuid, bool agg) {
    objectRemoved(uuid, agg);
}