当前位置: 首页>>代码示例>>C++>>正文


C++ QVariantList::back方法代码示例

本文整理汇总了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 &params,
                                     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;
}
开发者ID:,项目名称:,代码行数:36,代码来源:

示例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;
}
开发者ID:Ali-I,项目名称:CsoundQt,代码行数:30,代码来源:debugpanel.cpp


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