• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ endResetModel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中endResetModel函数的典型用法代码示例。如果您正苦于以下问题:C++ endResetModel函数的具体用法?C++ endResetModel怎么用?C++ endResetModel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了endResetModel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: file

bool Scene::load(const QString& fn) {
    QFile file(fn);
     if (!file.open(QIODevice::ReadOnly)) {
         return false;
     }

     QByteArray data = file.readAll();
     QDomDocument doc;
     if (!doc.setContent(data)) {
         return false;
     }

     clearSelection();
     beginResetModel();
     m_history->clear();
     if (m_static_body)
         delete m_static_body;
     m_static_body = 0;
     foreach( Body* b, m_bodys ) {
         delete b;
     }
     m_bodys.clear();

    QDomElement root = doc.documentElement();
    m_worldSize.setWidth(root.attribute("width").toInt());
    m_worldSize.setHeight(root.attribute("height").toInt());
    QDomElement node = root.firstChildElement("body");
    while (node.isElement()) {
        QString type = node.attribute("type");
        Body* b = 0;
        if (type=="StaticBody") {
            b = new StaticBody(this,"body",this);
            ReadAttributes(b,node);
            if (!m_static_body)
                m_static_body = b;
            else {
                m_bodys.push_back( b );
            }
        } else if (type=="DynamicBody") {
            b = new DynamicBody(this,"body",this);
            ReadAttributes(b,node);
            m_bodys.push_back( b );
        }
        if (b) {
            QDomElement primNode = node.firstChildElement("primitive");
            while (primNode.isElement()) {
                Primitive* p = 0;
                QString type = primNode.attribute("type");
                p = Primitive::create(type,b,this);
                if (p) {
                    ReadAttributes(p,primNode);
                    b->addPrimitive(p);
                }
                primNode = primNode.nextSiblingElement("primitive");
            }
            connect( b,SIGNAL(changed()),this,SLOT(bodyChanged()));
        }
        node = node.nextSiblingElement("body");
    }
    endResetModel();
    m_filename = fn;
    emit changed();
    return true;
}
开发者ID:chapayGhub,项目名称:Chipmunk-Sandbox,代码行数:64,代码来源:scene.cpp


示例2: beginResetModel

void DatasetItemModel::loadDatasets(const QList<Dataset> &datasetList)
{
    beginResetModel();
    m_datasets_reference = datasetList;
    endResetModel();
}
开发者ID:SpatialTranscriptomicsResearch,项目名称:st_viewer,代码行数:6,代码来源:DatasetItemModel.cpp


示例3: beginResetModel

/* Brief: Force the model to update
 */
void CDailyWeatherModel::update()
{
    beginResetModel();
    endResetModel();
}
开发者ID:westjour,项目名称:GUI_Repo,代码行数:7,代码来源:CDailyWeatherModel.cpp


示例4: beginResetModel

void TablePrintModel::callReset()
{
	beginResetModel();
	endResetModel();
}
开发者ID:ryanlerch,项目名称:subsurface,代码行数:5,代码来源:models.cpp


示例5: beginResetModel

void HistoryQueryResultsModel::setResults(const QVector<HistoryQueryResult> &results)
{
	beginResetModel();
	Results = results;
	endResetModel();
}
开发者ID:leewood,项目名称:kadu,代码行数:6,代码来源:history-query-results-model.cpp


示例6: beginResetModel

    void ScreenModel::initScreens(bool first) {
        // Clear
        beginResetModel();
        d->geometry = QRect();
        d->primary = 0;
        d->screens.clear();

#ifndef USE_QT5
        // set role names
        QHash<int, QByteArray> roleNames;
        roleNames[NameRole] = "name";
        roleNames[GeometryRole] = "geometry";
        // set role names
        setRoleNames(roleNames);
#endif

#if 0
        // fake model for testing
        d->geometry = QRect(0, 0, 1920, 1080);
        d->primary = 1;
        d->screens << ScreenPtr { new Screen { "First", QRect(0, 0, 300, 300) } }
                   << ScreenPtr { new Screen { "Second", QRect(300, 0, 1320, 742) } }
                   << ScreenPtr { new Screen { "Third", QRect(1620, 0, 300, 300) } };
        return;
#endif

#ifdef USE_QT5
        QList<QScreen *> screens = QGuiApplication::screens();
        for (int i = 0; i < screens.size(); ++i) {
            QScreen *screen = screens.at(i);
            // add to the screens list
            d->screens << ScreenPtr { new Screen { QString("Screen %1").arg(i + 1), screen->geometry() } };
            // extend available geometry
            d->geometry = d->geometry.united(screen->geometry());
            // check if primary
            if (screen == QGuiApplication::primaryScreen())
                d->primary = i;

            if (first) {
                // Recive screen updates
                connect(screen, SIGNAL(geometryChanged(const QRect &)), this, SLOT(onScreenChanged()));
            }
        }
#else
        // set primary screen
        d->primary = QApplication::desktop()->primaryScreen();
        // get screen count
        int screenCount = QApplication::desktop()->screenCount();

        for (int i = 0; i < screenCount; ++i) {
            QRect geometry = QApplication::desktop()->screenGeometry(i);
            // add to the screens list
            d->screens << ScreenPtr { new Screen { QString("Screen %1").arg(i + 1), geometry } };
            // extend available geometry
            d->geometry = d->geometry.united(geometry);
        }
#endif
        endResetModel();

        emit primaryChanged();
    }
开发者ID:Acidburn0zzz,项目名称:sddm,代码行数:61,代码来源:ScreenModel.cpp


示例7: beginResetModel

void TaskModelAdapter::resetTasks()
{
    beginResetModel();
    endResetModel();
}
开发者ID:netrunner-debian-kde-extras,项目名称:charmtimetracker,代码行数:5,代码来源:TaskModelAdapter.cpp


示例8: beginResetModel

int AbstractListModel::setItems(const QVector<Item>& items)
{
  emit beginResetModel();
  this->Items = items;
  emit endResetModel();
}
开发者ID:NahomKidane,项目名称:QtExamples,代码行数:6,代码来源:AbstractListModelFileDialog.cpp


示例9: beginResetModel

void ItemLibrarySectionModel::resetModel()
{
    beginResetModel();
    endResetModel();
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:5,代码来源:itemlibrarysectionmodel.cpp


示例10: beginResetModel

void RouteModel::refresh()
{
  beginResetModel();
  endResetModel();
}
开发者ID:bolidehi,项目名称:libosmscout,代码行数:5,代码来源:RoutingDialog.cpp


示例11: layer

void QgsAttributeTableFilterModel::setAttributeTableConfig( const QgsAttributeTableConfig& config )
{
  mConfig = config;
  mConfig.update( layer()->fields() );

  QVector<int> newColumnMapping;

  Q_FOREACH ( const QgsAttributeTableConfig::ColumnConfig& columnConfig, mConfig.columns() )
  {
    // Hidden? Forget about this column
    if ( columnConfig.hidden )
      continue;

    // The new value for the mapping (field index or -1 for action column)
    int newValue = ( columnConfig.type == QgsAttributeTableConfig::Action ) ? -1 : layer()->fields().lookupField( columnConfig.name );
    newColumnMapping << newValue;
  }

  if ( newColumnMapping != mColumnMapping )
  {
    bool requiresReset = false;
    int firstRemovedColumn = -1;
    int removedColumnCount = 0;

    // Check if there have a contiguous set of columns have been removed or if we require a full reset
    for ( int i = 0; i < qMin( newColumnMapping.size(), mColumnMapping.size() - removedColumnCount ); ++i )
    {
      if ( newColumnMapping.at( i ) == mColumnMapping.at( i + removedColumnCount ) )
        continue;

      if ( firstRemovedColumn == -1 )
      {
        firstRemovedColumn = i;

        while ( i < mColumnMapping.size() - removedColumnCount && mColumnMapping.at( i + removedColumnCount ) != newColumnMapping.at( i ) )
        {
          ++removedColumnCount;
        }
      }
      else
      {
        requiresReset = true;
        break;
      }
    }

    // No difference found so far
    if ( firstRemovedColumn == -1 )
    {
      if ( newColumnMapping.size() > mColumnMapping.size() )
      {
        // More columns: appended to the end
        beginInsertColumns( QModelIndex(), mColumnMapping.size(), newColumnMapping.size() - 1 );
        mColumnMapping = newColumnMapping;
        endInsertColumns();
      }
      else
      {
        // Less columns: removed from the end
        beginRemoveColumns( QModelIndex(), newColumnMapping.size(), mColumnMapping.size() - 1 );
        mColumnMapping = newColumnMapping;
        endRemoveColumns();
      }
    }
    else
    {
      if ( newColumnMapping.size() == mColumnMapping.size() - removedColumnCount )
      {
        beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn );
        mColumnMapping = newColumnMapping;
        endRemoveColumns();
      }
      else
      {
        requiresReset = true;
      }
    }

    if ( requiresReset )
    {
      beginResetModel();
      mColumnMapping = newColumnMapping;
      endResetModel();
    }
  }

  sort( config.sortExpression(), config.sortOrder() );
}
开发者ID:drnextgis,项目名称:QGIS,代码行数:88,代码来源:qgsattributetablefiltermodel.cpp


示例12: beginResetModel

//------------------------------------------------------------------------------
// Name: update
// Desc:
//------------------------------------------------------------------------------
void ResultViewModel::update() {
	if(updates_enabled_) {
		beginResetModel();
		endResetModel();
	}
}
开发者ID:beans365,项目名称:edb-debugger,代码行数:10,代码来源:ResultViewModel.cpp


示例13: beginResetModel

void QgsWelcomePageItemsModel::setRecentProjects( const QList<RecentProjectData>& recentProjects )
{
  beginResetModel();
  mRecentProjects = recentProjects;
  endResetModel();
}
开发者ID:chhao91,项目名称:QGIS,代码行数:6,代码来源:qgswelcomepageitemsmodel.cpp


示例14: beginResetModel

void View::Management::CategoryModel::setCategories(QList<Model::Domain::Category *> *categories)
{
    beginResetModel();
    _categories = categories;
    endResetModel();
}
开发者ID:j2sg,项目名称:JIM,代码行数:6,代码来源:categorymodel.cpp


示例15: setColorSchemes

 void setColorSchemes(const QList<ColorSchemeEntry> &colorSchemes)
 {
     beginResetModel();
     m_colorSchemes = colorSchemes;
     endResetModel();
 }
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:6,代码来源:fontsettingspage.cpp


示例16: beginResetModel

/*!
    \reimp
 */
void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
{
    beginResetModel();

    if (sourceModel()) {
        disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
                   this, SLOT(_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
                   this, SLOT(_q_sourceRowsInserted(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
                   this, SLOT(_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
                   this, SLOT(_q_sourceRowsRemoved(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
                   this, SLOT(_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
        disconnect(sourceModel(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
                   this, SLOT(_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
        disconnect(sourceModel(), SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
                   this, SLOT(_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(columnsInserted(QModelIndex,int,int)),
                   this, SLOT(_q_sourceColumnsInserted(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
                   this, SLOT(_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(columnsRemoved(QModelIndex,int,int)),
                   this, SLOT(_q_sourceColumnsRemoved(QModelIndex,int,int)));
        disconnect(sourceModel(), SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
                   this, SLOT(_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
        disconnect(sourceModel(), SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
                   this, SLOT(_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)));
        disconnect(sourceModel(), SIGNAL(modelAboutToBeReset()),
                   this, SLOT(_q_sourceModelAboutToBeReset()));
        disconnect(sourceModel(), SIGNAL(modelReset()),
                   this, SLOT(_q_sourceModelReset()));
        disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
                   this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
        disconnect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
                   this, SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
        disconnect(sourceModel(), SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
                   this, SLOT(_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
        disconnect(sourceModel(), SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
                   this, SLOT(_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
    }

    QAbstractProxyModel::setSourceModel(newSourceModel);

    if (sourceModel()) {
        connect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
                SLOT(_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
                SLOT(_q_sourceRowsInserted(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
                SLOT(_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
                SLOT(_q_sourceRowsRemoved(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
                SLOT(_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
        connect(sourceModel(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
                SLOT(_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)));
        connect(sourceModel(), SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
                SLOT(_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(columnsInserted(QModelIndex,int,int)),
                SLOT(_q_sourceColumnsInserted(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
                SLOT(_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(columnsRemoved(QModelIndex,int,int)),
                SLOT(_q_sourceColumnsRemoved(QModelIndex,int,int)));
        connect(sourceModel(), SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
                SLOT(_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
        connect(sourceModel(), SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
                SLOT(_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)));
        connect(sourceModel(), SIGNAL(modelAboutToBeReset()),
                SLOT(_q_sourceModelAboutToBeReset()));
        connect(sourceModel(), SIGNAL(modelReset()),
                SLOT(_q_sourceModelReset()));
        connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
                SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
        connect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
                SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
        connect(sourceModel(), SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
                SLOT(_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
        connect(sourceModel(), SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
                SLOT(_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
    }

    endResetModel();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:89,代码来源:qidentityproxymodel.cpp


示例17: beginResetModel

void
QvisPluginManagerAttributesDataModel::Update(Subject *)
{
    beginResetModel();
    endResetModel();
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:6,代码来源:QvisPluginManagerAttributesDataModel.C


示例18: beginResetModel

void MusicLibraryModel::clear()
{
    beginResetModel();
    rootItem->clear();
    endResetModel();
}
开发者ID:padertux,项目名称:cantata,代码行数:6,代码来源:musiclibrarymodel.cpp


示例19: loadGroupList

InstanceList::InstListError InstanceList::loadList()
{
	// load the instance groups
	QMap<QString, QString> groupMap;
	loadGroupList(groupMap);
	
	beginResetModel();
	
	m_instances.clear();
	QDir dir(m_instDir);
	QDirIterator iter(dir);
	while (iter.hasNext())
	{
		QString subDir = iter.next();
		if (!QFileInfo(PathCombine(subDir, "instance.cfg")).exists())
			continue;
		
		BaseInstance *instPtr = NULL;
		auto &loader = InstanceFactory::get();
		auto error = loader.loadInstance(instPtr, subDir);
		
		switch(error)
		{
			case InstanceFactory::NoLoadError:
				break;
			case InstanceFactory::NotAnInstance:
				break;
		}
		
		if (error != InstanceFactory::NoLoadError &&
			error != InstanceFactory::NotAnInstance)
		{
			QString errorMsg = QString("Failed to load instance %1: ").
					arg(QFileInfo(subDir).baseName()).toUtf8();
			
			switch (error)
			{
			default:
				errorMsg += QString("Unknown instance loader error %1").
						arg(error);
				break;
			}
			qDebug(errorMsg.toUtf8());
		}
		else if (!instPtr)
		{
			qDebug(QString("Error loading instance %1. Instance loader returned null.").
					arg(QFileInfo(subDir).baseName()).toUtf8());
		}
		else
		{
			QSharedPointer<BaseInstance> inst(instPtr);
			auto iter = groupMap.find(inst->id());
			if(iter != groupMap.end())
			{
				inst->setGroupInitial((*iter));
			}
			qDebug(QString("Loaded instance %1").arg(inst->name()).toUtf8());
			inst->setParent(this);
			m_instances.append(inst);
			connect(instPtr, SIGNAL(propertiesChanged(BaseInstance*)),this, SLOT(propertiesChanged(BaseInstance*)));
			connect(instPtr, SIGNAL(groupChanged()),this, SLOT(groupChanged()));
			connect(instPtr, SIGNAL(nuked(BaseInstance*)), this, SLOT(instanceNuked(BaseInstance*)));
		}
	}
	endResetModel();
	emit dataIsInvalid();
	return NoError;
}
开发者ID:Apocalypsing,项目名称:MultiMC5,代码行数:69,代码来源:InstanceList.cpp


示例20: beginResetModel

void QxrdMaskStackModel::onMaskChanged()
{
  emit beginResetModel();

  emit endResetModel();
}
开发者ID:guyjennings,项目名称:qxrd,代码行数:6,代码来源:qxrdmaskstackmodel.cpp



注:本文中的endResetModel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ endTag函数代码示例发布时间:2022-05-30
下一篇:
C++ endRemoveRows函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap