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


C++ QStringListModel::rowCount方法代码示例

本文整理汇总了C++中QStringListModel::rowCount方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringListModel::rowCount方法的具体用法?C++ QStringListModel::rowCount怎么用?C++ QStringListModel::rowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QStringListModel的用法示例。


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

示例1: cleanListViewING

void MainWindowMenuPlan::cleanListViewING()                 //Se borra el listview con los ingredientes mostrados en el apartado Ingredientes
{
    QStringListModel *model = new QStringListModel();
    model->removeRows(0, model->rowCount());
    ui->listView_Ingredientes->setModel(model);
    delete model;
}
开发者ID:JuanManuelRamos,项目名称:Trabajo-Fin-de-Grado,代码行数:7,代码来源:ingredientes.cpp

示例2: addBouchot

void QQBoardsSettings::addBouchot()
{
	QQBouchotSettingsDialog bouchotSettingsDialog(this);
	bouchotSettingsDialog.setGroups(m_listGroups);
	bouchotSettingsDialog.setNames(m_listNames);

	if(bouchotSettingsDialog.exec() == QDialog::Accepted)
	{
		QQBouchot::QQBouchotSettings bSettings = bouchotSettingsDialog.bouchotSettings();
		QString bouchotName = bouchotSettingsDialog.bouchotName();

		if(m_listNames.contains(bouchotName))
		{
			qWarning() << "Trying to insert a bouchot with an already existing name, that's forbidden";
		}
		else
		{
			m_listNames.append(bouchotName);

			if(! m_listGroups.contains(bSettings.group()))
				m_listGroups.append(bSettings.group());

			QStringListModel *model = (QStringListModel *) ui->bouchotListView->model();
			int numRow = model->rowCount();
			model->insertRows(numRow,1);
			model->setData(model->index(numRow), QVariant(bouchotName));
			m_newBouchots.insert(bouchotName, bSettings);
			m_oldBouchots.removeAll(bouchotName);
		}
	}
}
开发者ID:claudex,项目名称:quteqoin,代码行数:31,代码来源:qqboardssettings.cpp

示例3: olccsAddBouchot

void QQBoardsSettings::olccsAddBouchot()
{
	QQBoardWizard wizard(this);
	if(wizard.exec() == QDialog::Accepted)
	{
		QQBouchot::QQBouchotSettings bSettings = wizard.bouchotSettings();
		QString bouchotName = wizard.bouchotName();

		if(m_listNames.contains(bouchotName))
		{
			qWarning() << "Trying to insert a bouchot with an already existing name, that's forbidden";
		}
		else
		{
			m_listNames.append(bouchotName);

			if(! m_listGroups.contains(bSettings.group()))
				m_listGroups.append(bSettings.group());

			QStringListModel *model = (QStringListModel *) ui->bouchotListView->model();
			int numRow = model->rowCount();
			model->insertRows(numRow, 1);
			model->setData(model->index(numRow), QVariant(bouchotName));
			m_newBouchots.insert(bouchotName, bSettings);
			m_oldBouchots.removeAll(bouchotName);
		}

		if(wizard.showAdvanced())
		{
			QStringListModel *model = (QStringListModel *) ui->bouchotListView->model();
			QItemSelectionModel *selModel = ui->bouchotListView->selectionModel();
			for(int i = 0; i < model->rowCount(); i++)
			{
				QModelIndex mIndex = model->index(i);
				if(model->data(mIndex, Qt::EditRole).toString() == bouchotName)
				{
					selModel->select(mIndex, QItemSelectionModel::ClearAndSelect);
					editBouchot();
				}
			}
		}
	}
}
开发者ID:claudex,项目名称:quteqoin,代码行数:43,代码来源:qqboardssettings.cpp

示例4: QWidget

Login::Login(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Login)
{
    ui->setupUi(this);
    QIcon icon;
    icon.addFile(QString::fromUtf8(":image/icon.png"), QSize(), QIcon::Normal, QIcon::Off);
    this->setWindowIcon(icon);

    group = new QButtonGroup(this);

    QStringListModel * model = AdminDAO::getAdminDAOInstance()->getUsernames();
    
    QString img = ":/users/0.jpg";
    QRadioButton * tmpbutton = ui->userButton_0;

    for (int i = 0; i < model->rowCount(); i++)
    {
        img = QString(":/users/%1.jpg").arg(i); 
        switch (i)
        {
        case 0: tmpbutton = ui->userButton_0; break;
        case 1: tmpbutton = ui->userButton_1; break;
        case 2: tmpbutton = ui->userButton_2; break;
        case 3: tmpbutton = ui->userButton_3; break;
        case 4: tmpbutton = ui->userButton_4; break;
        case 5: tmpbutton = ui->userButton_5; break;
        default: tmpbutton = ui->userButton_0; break;
        }
        tmpbutton->setIcon(QPixmap(img));
        tmpbutton->setIconSize(QSize(40,40));
    }

    group->addButton(ui->userButton_0);
    group->addButton(ui->userButton_1);
    group->addButton(ui->userButton_2);
    group->addButton(ui->userButton_3);
    group->addButton(ui->userButton_4);
    group->addButton(ui->userButton_5);

    group->setId(ui->userButton_0, 0);
    group->setId(ui->userButton_1, 1);
    group->setId(ui->userButton_2, 2);
    group->setId(ui->userButton_3, 3);
    group->setId(ui->userButton_4, 4);
    group->setId(ui->userButton_5, 5);

    connect(ui->userButton_0, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
    connect(ui->userButton_1, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
    connect(ui->userButton_2, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
    connect(ui->userButton_3, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
    connect(ui->userButton_4, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
    connect(ui->userButton_5, SIGNAL(clicked()), this, SLOT(sellectOneUser()));
}
开发者ID:fanxiang090909,项目名称:Railway-Tunnel-Construction-Dlearance-Measure-LanZhou,代码行数:54,代码来源:login.cpp

示例5: setBouchots

void QQBoardsSettings::setBouchots(const QMap<QString, QQBouchot::QQBouchotSettings> currentListBouchot)
{
	m_bouchots = currentListBouchot;

	QStringListModel *model = (QStringListModel *) ui->bouchotListView->model();
	model->removeRows(0, model->rowCount());
	model->insertRows(0, m_bouchots.size());

	m_listNames = currentListBouchot.keys();

	QMapIterator<QString, QQBouchot::QQBouchotSettings> i(m_bouchots);
	int index = 0;
	while(i.hasNext())
	{
		i.next();
		QQBouchot::QQBouchotSettings settings = i.value();
		if(! m_listGroups.contains(settings.group()))
			m_listGroups.append(settings.group());

		model->setData(model->index(index++), QVariant(i.key()));
	}
}
开发者ID:claudex,项目名称:quteqoin,代码行数:22,代码来源:qqboardssettings.cpp

示例6: outputMultiTunnels

int LzExcelOutput::outputMultiTunnels(ClearanceMultiTunnels * inputdata, QString templatepath, QString outputfile, QString insertimgpath) 
{
    QString templatename = "MultiTunnelsTemplate.xls";
    int ret = copy(templatepath, templatename, outputfile);
    if (ret != 0)
        return ret;

    // 插入图片路径不存在
    if (!QFile(insertimgpath).exists())
        return 3;

    //操作已经存在的excel,生成限界尺寸表
    ExcelEngine excel;

    excel.Open(outputfile, 1, false);
    
    QString linename = inputdata->getLineName(); 
    // 限界表名称
    excel.SetCellData(1,1,QObject::tr("%1-区段桥隧综合最小建筑限界尺寸表").arg(linename));
    excel.SetCellData(52,1,QObject::tr("%1-区段桥隧综合最小建筑限界尺寸图").arg(linename));

    // 线路名称
    excel.SetCellData(3,3,linename);
    excel.SetCellData(54,2,linename);
    excel.SetCellData(54,5,linename);

    // 区段
    excel.SetCellData(3,9,linename);

    QString endStationName = inputdata->getEndStationName();
    // 面向站名
    excel.SetCellData(3,15,endStationName);
    excel.SetCellData(54,13,endStationName);

    QStringListModel * tunnelsmodel = inputdata->getTunnelsNames();

    // 桥隧总数
    excel.SetCellData(4,4,tunnelsmodel->rowCount());
    // 桥梁数
    excel.SetCellData(4,11,inputdata->getNumOfOutOfClearanceBridges());
    // 隧道数
    excel.SetCellData(4,14,inputdata->getNumOfOutOfClearanceTunnels());

    // 时间
    // 采集日期
    QModelIndex index = tunnelsmodel->index(0,0);
    QString tunnelinfo = index.data().toString();//这两行代码获取QStringListModel中第一行的值
    QStringList strlist = tunnelinfo.split("-");
    if (strlist.length() < 3)
        return -1;
    QString collectdate = strlist.at(2);
    excel.SetCellData(49,15,collectdate);
    excel.SetCellData(54,16,collectdate);

    // 最小曲线半径

    int minRadius = inputdata->getMinRadius();
    excel.SetCellData(5,5,minRadius);
    // 最大外轨超高
    excel.SetCellData(5,10,inputdata->getWaiGuiChaoGao()); 
    // 最低接触网高度
    excel.SetCellData(5,16,inputdata->getJieChuWangGaoDu()); 

    ClearanceData * data = &inputdata->getClearanceStraightData();
    int rowcount = data->getMaps().size();
    
    // Excel模板从第10行开始为高度限界数据,前面几行为表头或空格
    int startrownum = 10;
    int startcolumnnumdef = 1;
    
    // 临时变量
    int startcolumnnum = startcolumnnumdef;
    float tmpval;
    _int64 tmppos;
    int tmpradius;
    float minHeight;

    for (int i = 0; i < 3; i++)
    {
        startcolumnnum = startcolumnnumdef;
        
        switch(i)
        {
            case Curve_Straight:
                if (inputdata->getNumOfStraight())
                {
                    data = &inputdata->getClearanceStraightData();
                    startcolumnnum += LzOutputTableColumn::Straight_Left_Val;
                }
                else
                    continue;
                break;
            case Curve_Left:
                if (inputdata->getNumOfLeft())
                {
                    data = &inputdata->getClearanceLeftData();
                    startcolumnnum += LzOutputTableColumn::LeftCurve_Left_Val;
                }
                else
                    continue;
//.........这里部分代码省略.........
开发者ID:fanxiang090909,项目名称:Railway-Tunnel-Construction-Dlearance-Measure-LanZhou,代码行数:101,代码来源:lz_excel_output.cpp


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