本文整理汇总了C++中LabelList::constBegin方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelList::constBegin方法的具体用法?C++ LabelList::constBegin怎么用?C++ LabelList::constBegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelList
的用法示例。
在下文中一共展示了LabelList::constBegin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateBuddies
void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *form,
const QString &old_name,
const QString &new_name)
{
QExtensionManager* extensionManager = form->core()->extensionManager();
typedef QList<QLabel*> LabelList;
const LabelList label_list = qFindChildren<QLabel*>(form);
if (label_list.empty())
return;
const QString buddyProperty = QLatin1String("buddy");
const QByteArray oldNameU8 = old_name.toUtf8();
const QByteArray newNameU8 = new_name.toUtf8();
const LabelList::const_iterator cend = label_list.constEnd();
for (LabelList::const_iterator it = label_list.constBegin(); it != cend; ++it ) {
if (QDesignerPropertySheetExtension* sheet = qt_extension<QDesignerPropertySheetExtension*>(extensionManager, *it)) {
const int idx = sheet->indexOf(buddyProperty);
if (idx != -1) {
const QByteArray oldBuddy = sheet->property(idx).toByteArray();
if (oldBuddy == oldNameU8)
sheet->setProperty(idx, newNameU8);
}
}
}
}
示例2:
// Find the label whose buddy the widget is.
QLabel *buddyLabelOf(QDesignerFormWindowInterface *fw, QWidget *w)
{
typedef QList<QLabel*> LabelList;
const LabelList labelList = fw->findChildren<QLabel*>();
if (labelList.empty())
return 0;
const LabelList::const_iterator cend = labelList.constEnd();
for (LabelList::const_iterator it = labelList.constBegin(); it != cend; ++it )
if ( (*it)->buddy() == w)
return *it;
return 0;
}