本文整理汇总了C++中Q_FOREACH函数的典型用法代码示例。如果您正苦于以下问题:C++ Q_FOREACH函数的具体用法?C++ Q_FOREACH怎么用?C++ Q_FOREACH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Q_FOREACH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Q_FOREACH
void Export2FB2Dialog::handleChannelsSelectionChanged (const QItemSelection& selected,
const QItemSelection& deselected)
{
QStringList removedCategories;
Q_FOREACH (QModelIndex index, deselected.indexes ())
removedCategories << Core::Instance ().GetCategories (index);
removedCategories.removeDuplicates ();
Q_FOREACH (QString removed, removedCategories)
CurrentCategories_.removeAll (removed);
QStringList addedCategories;
Q_FOREACH (QModelIndex index, selected.indexes ())
addedCategories << Core::Instance ().GetCategories (index);
CurrentCategories_ << addedCategories;
CurrentCategories_.removeDuplicates ();
Selector_->setPossibleSelections (CurrentCategories_);
Selector_->selectAll ();
if (!HasBeenTextModified_ &&
Ui_.ChannelsTree_->selectionModel ()->selectedRows ().size () <= 1)
{
const QModelIndex& index = Ui_.ChannelsTree_->currentIndex ();
if (index.isValid ())
Ui_.Name_->setText (index.sibling (index.row (), 0).data ().toString ());
}
}
开发者ID:Akon32,项目名称:leechcraft,代码行数:28,代码来源:export2fb2dialog.cpp
示例2: stop
void Testbench::doStep()
{
double currentTime = m_stopWatch.elapsedTime();
double timePassed = currentTime - m_timeStamp;
m_timeStamp = currentTime;
if(currentTime / PROCESS_PERIOD >= trajectoryTicks())
{
stop();
Q_FOREACH(SingleServoTestbench* tb, m_benches)
tb->updateStatistics();
if(m_ui->learnCheckBox->isChecked())
{
Q_FOREACH(SingleServoTestbench* tb, m_benches)
tb->updateTrajectory();
m_repTimer->start();
}
return;
}
Q_FOREACH(SingleServoTestbench* tb, m_benches)
{
tb->doStep(currentTime);
}
开发者ID:NhatTanXT3,项目名称:humanoid_op_ros,代码行数:28,代码来源:testbench.cpp
示例3: Q_FOREACH
// show/hide widgets - we need this function if widget is used in creator
void QgsRasterFormatSaveOptionsWidget::setType( QgsRasterFormatSaveOptionsWidget::Type type )
{
QList< QWidget* > widgets = this->findChildren<QWidget *>();
if (( type == Table ) || ( type == LineEdit ) )
{
// hide all controls, except stacked widget
Q_FOREACH ( QWidget* widget, widgets )
widget->setVisible( false );
mOptionsStackedWidget->setVisible( true );
Q_FOREACH ( QWidget* widget, mOptionsStackedWidget->findChildren<QWidget *>() )
widget->setVisible( true );
// show relevant page
if ( type == Table )
swapOptionsUI( 0 );
else if ( type == LineEdit )
swapOptionsUI( 1 );
}
else
{
// show all widgets, except profile buttons (unless Full)
Q_FOREACH ( QWidget* widget, widgets )
widget->setVisible( true );
if ( type != Full )
mProfileButtons->setVisible( false );
// show elevant page
if ( type == ProfileLineEdit )
swapOptionsUI( 1 );
}
}
开发者ID:PeterTFS,项目名称:QGIS,代码行数:32,代码来源:qgsrasterformatsaveoptionswidget.cpp
示例4: Q_FOREACH
QgsCptCityArchive::~QgsCptCityArchive()
{
Q_FOREACH ( QgsCptCityDataItem *item, mRootItems )
delete item;
Q_FOREACH ( QgsCptCityDataItem *item, mSelectionItems )
delete item;
mRootItems.clear();
mSelectionItems.clear();
}
开发者ID:CS-SI,项目名称:QGIS,代码行数:9,代码来源:qgscptcityarchive.cpp
示例5: Q_FOREACH
void QTechniqueFilter::copy(const QNode *ref)
{
QFrameGraphNode::copy(ref);
const QTechniqueFilter *other = static_cast<const QTechniqueFilter*>(ref);
Q_FOREACH (QAnnotation *crit, other->d_func()->m_requireList)
addRequirement(qobject_cast<QAnnotation *>(QNode::clone(crit)));
Q_FOREACH (QParameter *p, other->d_func()->m_parameters)
addParameter(qobject_cast<QParameter *>(QNode::clone(p)));
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:10,代码来源:qtechniquefilter.cpp
示例6: Q_FOREACH
void QgsSnappingUtils::clearAllLocators()
{
Q_FOREACH ( QgsPointLocator* vlpl, mLocators )
delete vlpl;
mLocators.clear();
Q_FOREACH ( QgsPointLocator* vlpl, mTemporaryLocators )
delete vlpl;
mTemporaryLocators.clear();
}
开发者ID:Antoviscomi,项目名称:QGIS,代码行数:10,代码来源:qgssnappingutils.cpp
示例7: QVariant
QVariant UserFiltersModel::data (const QModelIndex& index, int role) const
{
if (role != Qt::DisplayRole ||
!index.isValid ())
return QVariant ();
int row = index.row ();
bool isException = true;
SplitRow (&row, &isException);
const auto& list = isException ?
Filter_.Exceptions_ :
Filter_.Filters_;
const auto& item = list.at (row);
switch (index.column ())
{
case 0:
return item.OrigString_;
case 1:
return isException ?
tr ("Allowed") :
tr ("Blocked");
case 2:
switch (item.Option_.MatchType_)
{
case FilterOption::MTWildcard:
case FilterOption::MTPlain:
case FilterOption::MTBegin:
case FilterOption::MTEnd:
return tr ("Wildcard");
case FilterOption::MTRegexp:
return tr ("Regexp");
}
case 3:
return item.Option_.Case_ == Qt::CaseSensitive ?
tr ("True") :
tr ("False");
case 4:
{
const auto& options = item.Option_;
QStringList result;
Q_FOREACH (QString domain, options.Domains_)
result += domain.prepend ("+");
Q_FOREACH (QString domain, options.NotDomains_)
result += domain.prepend ("-");
return result.join ("; ");
}
default:
return QVariant ();
}
}
开发者ID:SboichakovDmitriy,项目名称:leechcraft,代码行数:54,代码来源:userfiltersmodel.cpp
示例8: d_func
void QTechnique::copy(const QNode *ref)
{
QNode::copy(ref);
const QTechnique *tech = static_cast<const QTechnique*>(ref);
d_func()->m_openGLFilter.copy(tech->d_func()->m_openGLFilter);
Q_FOREACH (QAnnotation *annotation, tech->d_func()->m_annotationList)
addAnnotation(qobject_cast<QAnnotation *>(QNode::clone(annotation)));
Q_FOREACH (QRenderPass *pass, tech->d_func()->m_renderPasses)
addPass(qobject_cast<QRenderPass *>(QNode::clone(pass)));
Q_FOREACH (QParameter *p, tech->d_func()->m_parameters)
addParameter(qobject_cast<QParameter *>(QNode::clone(p)));
}
开发者ID:James-intern,项目名称:Qt,代码行数:13,代码来源:qtechnique.cpp
示例9: d_func
void QRenderPass::copy(const QNode *ref)
{
QNode::copy(ref);
const QRenderPass *other = static_cast<const QRenderPass*>(ref);
d_func()->m_shader = qobject_cast<QShaderProgram *>(QNode::clone(other->d_func()->m_shader));
Q_FOREACH (QAnnotation *crit, other->d_func()->m_annotationList)
addAnnotation(qobject_cast<QAnnotation *>(QNode::clone(crit)));
Q_FOREACH (QParameterMapping *binding, other->d_func()->m_bindings)
addBinding(qobject_cast<QParameterMapping *>(QNode::clone(binding)));
Q_FOREACH (QRenderState *renderState, other->d_func()->m_renderStates)
addRenderState(qobject_cast<QRenderState *>(QNode::clone(renderState)));
}
开发者ID:Sagaragrawal,项目名称:2gisqt5android,代码行数:13,代码来源:qrenderpass.cpp
示例10: qDeleteAll
void CVisSystemCanvasNodeLayout::layoutNodes()
{
#if 0
if(!d->canvas)
return;
// Get Root Node
QList<CVisSystemCanvasNodeItem*> rootNodes = d->getRootNodes();
if(!rootNodes.count())
return;
// Delete the old tree
qDeleteAll(TreeNode::GlobalTreeNodeList);
TreeNode::GlobalTreeNodeList.clear();
// Construct the new node tree
QList<TreeNode*> topNodes;
Q_FOREACH(CVisSystemCanvasNodeItem* rootNode, rootNodes)
topNodes.append(new TreeNode(rootNode));
// Layout the new node tree
QRectF occupiedRect;
Q_FOREACH(TreeNode* n, topNodes)
occupiedRect |= n->layout(occupiedRect);
// Delete all the tree nodes
qDeleteAll(TreeNode::GlobalTreeNodeList);
TreeNode::GlobalTreeNodeList.clear();
#endif
QList<CVisSystemCanvasNodeItem*> nodeItemList = d->canvas->nodeItemList();
if(!nodeItemList.count())
return;
d->visitedNodes.clear();
d->visitingNodes.clear();
for(int i=0; i<nodeItemList.count(); i++)
d->layoutNodeItem(nodeItemList[i]);
d->visitedNodes.clear();
d->visitingNodes.clear();
for(int i=0; i<nodeItemList.count(); i++)
d->centerNodeItem(nodeItemList[i]);
d->canvas->bringToCenter();
d->canvas->zoomFit();
}
开发者ID:banduladh,项目名称:levelfour,代码行数:50,代码来源:CVisSystemCanvasNodeLayout.cpp
示例11: Q_FOREACH
void djvViewFileMenu::menuUpdate()
{
_p->recent->clear();
Q_FOREACH(QAction * action,
actions()->group(djvViewFileActions::RECENT_GROUP)->actions())
_p->recent->addAction(action);
_p->layer->clear();
Q_FOREACH(QAction * action,
actions()->group(djvViewFileActions::LAYER_GROUP)->actions())
_p->layer->addAction(action);
}
开发者ID:triceratops1,项目名称:djv,代码行数:14,代码来源:djvViewFileMenu.cpp
示例12: horizontalViewScaleFactor
void QgsComposerNodesItem::drawNodes( QPainter *painter ) const
{
double rectSize = 3.0 / horizontalViewScaleFactor();
QgsStringMap properties;
properties.insert( "name", "cross" );
properties.insert( "color_border", "red" );
QScopedPointer<QgsMarkerSymbolV2> symbol;
symbol.reset( QgsMarkerSymbolV2::createSimple( properties ) );
symbol.data()->setSize( rectSize );
symbol.data()->setAngle( 45 );
QgsMapSettings ms = mComposition->mapSettings();
ms.setOutputDpi( painter->device()->logicalDpiX() );
QgsRenderContext context = QgsRenderContext::fromMapSettings( ms );
context.setPainter( painter );
context.setForceVectorOutput( true );
QScopedPointer<QgsExpressionContext> expressionContext;
expressionContext.reset( createExpressionContext() );
context.setExpressionContext( *expressionContext.data() );
symbol.data()->startRender( context );
Q_FOREACH ( QPointF pt, mPolygon )
symbol.data()->renderPoint( pt, nullptr, context );
symbol.data()->stopRender( context );
if ( mSelectedNode >= 0 && mSelectedNode < mPolygon.size() )
drawSelectedNode( painter );
}
开发者ID:AM7000000,项目名称:QGIS,代码行数:34,代码来源:qgscomposernodesitem.cpp
示例13: Q_FOREACH
void Properties::load(const QSettings &rSettings)
{
QStringList keys = rSettings.childKeys();
QString key;
Q_FOREACH(key, keys)
insert(key, rSettings.value(key).toString());
}
开发者ID:Akers,项目名称:Qtqq,代码行数:7,代码来源:properties.cpp
示例14: horizontalViewScaleFactor
void QgsComposerNodesItem::drawNodes( QPainter *painter ) const
{
double rectSize = 3.0 / horizontalViewScaleFactor();
QgsStringMap properties;
properties.insert( QStringLiteral( "name" ), QStringLiteral( "cross" ) );
properties.insert( QStringLiteral( "color_border" ), QStringLiteral( "red" ) );
std::unique_ptr<QgsMarkerSymbol> symbol;
symbol.reset( QgsMarkerSymbol::createSimple( properties ) );
symbol->setSize( rectSize );
symbol->setAngle( 45 );
QgsRenderContext context = QgsComposerUtils::createRenderContextForComposition( mComposition, painter );
context.setForceVectorOutput( true );
QgsExpressionContext expressionContext = createExpressionContext();
context.setExpressionContext( expressionContext );
symbol->startRender( context );
Q_FOREACH ( QPointF pt, mPolygon )
symbol->renderPoint( pt, nullptr, context );
symbol->stopRender( context );
if ( mSelectedNode >= 0 && mSelectedNode < mPolygon.size() )
drawSelectedNode( painter );
}
开发者ID:wongjimsan,项目名称:QGIS,代码行数:29,代码来源:qgscomposernodesitem.cpp
示例15: Q_FOREACH
QByteArray QgsMimeDataUtils::layerTreeNodesToUriList( const QList<QgsLayerTreeNode *> &nodes )
{
UriList uris;
Q_FOREACH ( QgsLayerTreeNode *node, nodes )
_addLayerTreeNodeToUriList( node, uris );
return uriListToByteArray( uris );
}
开发者ID:jonnyforestGIS,项目名称:QGIS,代码行数:7,代码来源:qgsmimedatautils.cpp
示例16: sender
void RoomConfigWidget::handlePermsReceived (const QList<QXmppMucItem>& perms)
{
if (qobject_cast<QXmppMucRoom*> (sender ()) &&
sender () != RoomHandler_)
return;
for (const auto& perm : perms)
{
auto parentItem = Aff2Cat_ [perm.affiliation ()];
if (!parentItem)
{
qWarning () << Q_FUNC_INFO
<< "no parent item for"
<< perm.affiliation ();
continue;
}
auto firstItem = new QStandardItem (perm.jid ());
firstItem->setData (perm.reason (), ItemRoles::Reason);
QList<QStandardItem*> items;
items << firstItem;
items << new QStandardItem (perm.reason ());
Q_FOREACH (QStandardItem *item, items)
item->setEditable (false);
parentItem->appendRow (items);
}
for (auto item : Aff2Cat_.values ())
{
item->sortChildren (0);
Ui_.PermsTree_->expand (item->index ());
}
}
开发者ID:AlexWMF,项目名称:leechcraft,代码行数:34,代码来源:roomconfigwidget.cpp
示例17: settings
void DeliciousService::RestoreAccounts ()
{
QSettings settings (QSettings::IniFormat, QSettings::UserScope,
QCoreApplication::organizationName (),
QCoreApplication::applicationName () +
"_Poshuku_OnlineBookmarks_Delicious_Accounts");
int size = settings.beginReadArray ("Accounts");
for (int i = 0; i < size; ++i)
{
settings.setArrayIndex (i);
QByteArray data = settings
.value ("SerializedData").toByteArray ();
DeliciousAccount *acc = DeliciousAccount::Deserialize (data, this);
if (!acc)
{
qWarning () << Q_FUNC_INFO
<< "undeserializable account"
<< i;
continue;
}
Accounts_ << acc;
}
if (!Accounts_.isEmpty ())
{
QObjectList list;
Q_FOREACH (DeliciousAccount *acc, Accounts_)
list << acc->GetQObject ();
emit accountAdded (list);
}
}
开发者ID:ForNeVeR,项目名称:leechcraft,代码行数:34,代码来源:deliciousservice.cpp
示例18: Q_FOREACH
QList<IAccount*> GlooxProtocol::GetRegisteredAccounts ()
{
QList<IAccount*> result;
Q_FOREACH (GlooxAccount *acc, Accounts_)
result << static_cast<IAccount*> (acc);
return result;
}
开发者ID:grio,项目名称:leechcraft,代码行数:7,代码来源:glooxprotocol.cpp
示例19: while
void PackagesDelegate::handleRowActionFinished (int row)
{
// Front — deepest proxy, back — outermost.
QList<QAbstractProxyModel*> proxyChain;
QAbstractItemModel *realModel = Model_;
QAbstractProxyModel *proxy = 0;
while ((proxy = qobject_cast<QAbstractProxyModel*> (realModel)))
{
proxyChain.push_front (proxy);
realModel = proxy->sourceModel ();
}
QModelIndex index = realModel->index (row, 0);
Q_FOREACH (QAbstractProxyModel *pm, proxyChain)
index = pm->mapFromSource (index);
row = index.row ();
if (Row2InstallRemove_.contains (row))
{
Row2InstallRemove_ [row]->setChecked (false);
Row2InstallRemove_ [row]->defaultAction ()->setChecked (false);
Row2InstallRemove_ [row]->setChecked (false);
}
if (Row2Update_.contains (row))
{
Row2Update_ [row]->defaultAction ()->setChecked (false);
}
}
开发者ID:grio,项目名称:leechcraft,代码行数:30,代码来源:packagesdelegate.cpp
示例20: disconnect
void NetworkManager::disconnectServices()
{
if (m_manager) {
disconnect(m_manager, SIGNAL(ServicesChanged(ConnmanObjectList,QList<QDBusObjectPath>)),
this, SLOT(updateServices(ConnmanObjectList,QList<QDBusObjectPath>)));
disconnect(m_manager, SIGNAL(SavedServicesChanged(ConnmanObjectList)),
this, SLOT(updateSavedServices(ConnmanObjectList)));
}
Q_FOREACH (NetworkService *service, m_servicesCache)
service->deleteLater();
m_servicesCache.clear();
if (m_defaultRoute != m_invalidDefaultRoute) {
m_defaultRoute = m_invalidDefaultRoute;
Q_EMIT defaultRouteChanged(m_defaultRoute);
}
if (!m_servicesOrder.isEmpty()) {
m_servicesOrder.clear();
Q_EMIT servicesChanged();
}
if (!m_savedServicesOrder.isEmpty()) {
m_savedServicesOrder.clear();
Q_EMIT savedServicesChanged();
}
}
开发者ID:robhemsley,项目名称:libconnman-qt,代码行数:29,代码来源:networkmanager.cpp
注:本文中的Q_FOREACH函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论