本文整理汇总了C++中QVariantList::back方法的典型用法代码示例。如果您正苦于以下问题:C++ QVariantList::back方法的具体用法?C++ QVariantList::back怎么用?C++ QVariantList::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVariantList
的用法示例。
在下文中一共展示了QVariantList::back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateFormClass
// Use the class generation utils provided by the designer plugin
static inline bool generateFormClass(const GuiAppParameters ¶ms,
const Core::GeneratedFile &uiFile,
Core::GeneratedFile *formSource,
Core::GeneratedFile *formHeader,
QString *errorMessage)
{
// Retrieve parameters from settings
Designer::FormClassWizardParameters fp;
fp.uiTemplate = uiFile.contents();
fp.uiFile = uiFile.path();
fp.className = params.className;
fp.sourceFile = params.sourceFileName;
fp.headerFile = params.headerFileName;
QString headerContents;
QString sourceContents;
// Invoke code generation service of Qt Designer plugin.
if (QObject *codeGenerator = ExtensionSystem::PluginManager::instance()->getObjectByClassName("Designer::QtDesignerFormClassCodeGenerator")) {
const QVariant code = ExtensionSystem::invoke<QVariant>(codeGenerator, "generateFormClassCode", fp);
if (code.type() == QVariant::List) {
const QVariantList vl = code.toList();
if (vl.size() == 2) {
headerContents = vl.front().toString();
sourceContents = vl.back().toString();
}
}
}
if (headerContents.isEmpty() || sourceContents.isEmpty()) {
*errorMessage = QString::fromAscii("Failed to obtain Designer plugin code generation service.");
return false;
}
formHeader->setContents(headerContents);
formSource->setContents(sourceContents);
return true;
}
示例2:
QVector<QVariantList> DebugPanel::getBreakpoints()
{
QTableWidget *table = ui->breakpointTableWidget;
QVector<QVariantList> breakpoints;
for (int row = 0; row < table->rowCount(); row++) {
QVariantList bp;
QCheckBox *cb = static_cast<QCheckBox *>(table->cellWidget(row,0));
if (cb->isChecked()) {
QTableWidgetItem *item = table->item(row,1);
bp << item->data(Qt::DisplayRole).toString();
if (bp.back().toString() == "instr" ) {
item = table->item(row,2);
bp << item->data(Qt::DisplayRole).toDouble();
item = table->item(row,3);
bp << item->data(Qt::DisplayRole).toInt();
breakpoints.append(bp);
} else {
item = table->item(row,2);
QStringList parts = item->data(Qt::DisplayRole).toString().split(":");
Q_ASSERT(parts.size() == 2);
bp << parts[0].toInt();
bp << parts[1].toInt();
item = table->item(row,3);
bp << item->data(Qt::DisplayRole).toInt();
breakpoints.append(bp);
}
}
}
return breakpoints;
}