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


C++ endInsertRows函数代码示例

本文整理汇总了C++中endInsertRows函数的典型用法代码示例。如果您正苦于以下问题:C++ endInsertRows函数的具体用法?C++ endInsertRows怎么用?C++ endInsertRows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: beginInsertRows

void ItemModel::insert(const Item &item, int index)
{
    beginInsertRows(QModelIndex(), index, 0);
    m_items.insert(index, item);
    endInsertRows();
}
开发者ID:matrixx,项目名称:Cinnamon,代码行数:6,代码来源:itemmodel.cpp

示例2: endInsertRows

void PlaylistModel::endInsertItems()
{
    endInsertRows();
}
开发者ID:abie0416,项目名称:Mashup,代码行数:4,代码来源:playlistmodel.cpp

示例3: Q_UNUSED

void DescriptionModel::descriptionAdded(const QString &description)
{
	Q_UNUSED(description)

	endInsertRows();
}
开发者ID:partition,项目名称:kadu,代码行数:6,代码来源:description-model.cpp

示例4: removeDeco

int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_in, int ccpoint, bool entered)
{
	int cylinderid = 0;
	bool usePrevious = false;
	if (cylinderid_in)
		cylinderid = cylinderid_in;
	else
		usePrevious = true;
	if (recalcQ())
		removeDeco();

	int row = divepoints.count();
	if (seconds == 0 && milimeters == 0 && row != 0) {
		/* this is only possible if the user clicked on the 'plus' sign on the DivePoints Table */
		const divedatapoint t = divepoints.at(lastEnteredPoint());
		milimeters = t.depth;
		seconds = t.time + 600; // 10 minutes.
		cylinderid = t.cylinderid;
		ccpoint = t.setpoint;
	} else if (seconds == 0 && milimeters == 0 && row == 0) {
		milimeters = M_OR_FT(5, 15); // 5m / 15ft
		seconds = 600;		     // 10 min
		// Default to the first cylinder
		cylinderid = 0;
	}

	// check if there's already a new stop before this one:
	for (int i = 0; i < row; i++) {
		const divedatapoint &dp = divepoints.at(i);
		if (dp.time == seconds) {
			row = i;
			beginRemoveRows(QModelIndex(), row, row);
			divepoints.remove(row);
			endRemoveRows();
			break;
		}
		if (dp.time > seconds) {
			row = i;
			break;
		}
	}
	// Previous, actually means next as we are typically subdiving a segment and the gas for
	// the segment is determined by the waypoint at the end.
	if (usePrevious) {
		if (row  < divepoints.count()) {
			cylinderid = divepoints.at(row).cylinderid;
		} else if (row > 0) {
			cylinderid = divepoints.at(row - 1).cylinderid;
		}
	}

	// add the new stop
	beginInsertRows(QModelIndex(), row, row);
	divedatapoint point;
	point.depth = milimeters;
	point.time = seconds;
	point.cylinderid = cylinderid;
	point.setpoint = ccpoint;
	point.entered = entered;
	point.next = NULL;
	divepoints.append(point);
	std::sort(divepoints.begin(), divepoints.end(), divePointsLessThan);
	endInsertRows();
	return row;
}
开发者ID:ollie314,项目名称:subsurface,代码行数:65,代码来源:diveplannermodel.cpp

示例5: beginInsertRows

bool UdpListModel::insertRow(int row, const QModelIndex &parent)
{
    beginInsertRows(parent, row, row + 1);
    endInsertRows();
    return true;
}
开发者ID:mgandi,项目名称:SAT-IP-Tools,代码行数:6,代码来源:udplistmodel.cpp

示例6: append

 void append(const Vehicle & vehicle) {
    beginInsertRows({}, m_data.count(), m_data.count());
    m_data.append(vehicle);
    endInsertRows();
 }
开发者ID:KubaO,项目名称:stackoverflown,代码行数:5,代码来源:main.cpp

示例7: beginInsertRows

void DiveListModel::addDive(dive *d)
{
	beginInsertRows(QModelIndex(), rowCount(), rowCount());
	m_dives.append(MobileDive(d));
	endInsertRows();
}
开发者ID:CosmoGlenns,项目名称:subsurface,代码行数:6,代码来源:divelistmodel.cpp

示例8: beginInsertRows

// actually add to table in GUI
void RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient)
{
    beginInsertRows(QModelIndex(), 0, 0);
    list.prepend(recipient);
    endInsertRows();
}
开发者ID:BlameByte,项目名称:bitcoin,代码行数:7,代码来源:recentrequeststablemodel.cpp

示例9: beginInsertRows

void PgnDatabaseModel::onDatabaseAdded(int index)
{
	beginInsertRows(QModelIndex(), index, index);
	endInsertRows();
}
开发者ID:Hasimir,项目名称:cutechess,代码行数:5,代码来源:pgndatabasemodel.cpp

示例10: beginInsertRows

void PluginModel::addPlugin(PluginInterface *plugin)
{
    beginInsertRows(QModelIndex(), m_plugins.count(), m_plugins.count());
    m_plugins.append(plugin);
    endInsertRows();
}
开发者ID:flowlikeh2o,项目名称:flow-pomodoro,代码行数:6,代码来源:pluginmodel.cpp

示例11: f

LogMonitorFileModel::LogMonitorFileModel(const QString &dbPath, QObject *parent)
    :AbstractLogModel(parent)
{
    m_statistics.error = 0;
    m_statistics.warning = 0;
    m_statistics.notice = 0;
    m_statistics.info = 0;
    m_statistics.clients = 0;

    QFile f(dbPath);
    if (!f.exists())
    {
        QMessageBox msg;
        msg.setIcon(QMessageBox::Warning);
        msg.setText("File not found");
        msg.setInformativeText(QString("Could not find file %1").arg(dbPath));
        msg.exec();
        return;
    }

    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName(dbPath);
    auto success = db.open();
    if (!success)
    {
        auto e = db.lastError();

        QMessageBox msg;
        msg.setIcon(QMessageBox::Warning);
        msg.setText("Open failed");
        msg.setInformativeText(QString("Failed to open the file %1.\nError message: %2").arg(dbPath, e.text()));
        msg.exec();
        return;
    }
    QSqlQuery query("SELECT m.time, m.pid, m.level, h.name, c.facility, c.object, m.message, p.process"
                    " FROM messages AS m INNER JOIN hosts AS h ON m.host=h.id INNER JOIN channels AS c ON m.channel=c.id INNER JOIN processes AS p ON m.pid=p.id",
                    db);
    query.setForwardOnly(true);
    success = query.exec();
    if (!success)
    {
        auto e = db.lastError();

        QMessageBox msg;
        msg.setIcon(QMessageBox::Warning);
        msg.setText("Open failed");
        msg.setInformativeText(QString("Failed to open the file %1.\nError message: %2").arg(dbPath, e.text()));
        msg.exec();
        return;
    }
    while (query.next())
    {
        auto message = new LogMessage;
        message->timestamp.setMSecsSinceEpoch(qint64(query.value(0).toDouble() * 1000));
        message->pid = query.value(1).toULongLong();
        message->severity = LogSeverity(query.value(2).toInt());
        message->machineName = query.value(3).toString();
        message->module = query.value(4).toString();
        message->channel = query.value(5).toString();
        message->message = query.value(6).toString();
        message->executablePath = query.value(7).toString();
        switch (message->severity)
        {
        case SEVERITY_ERR:
            m_statistics.error++;
            break;
        case SEVERITY_WARN:
            m_statistics.warning++;
            break;
        case SEVERITY_NOTICE:
            m_statistics.notice++;
            break;
        case SEVERITY_INFO:
            m_statistics.info++;
            break;
        default:
            break;
        }
        addMessage(message);
    }
    if (m_messages.size())
    {
        beginInsertRows(QModelIndex(), 0, m_messages.size() - 1);
        endInsertRows();
    }
    db.close();
}
开发者ID:DestroyFX,项目名称:EveLogLite,代码行数:87,代码来源:logmonitorfilemodel.cpp

示例12: beginInsertRows

void InterfaceTreeCacheModel::addDevice(interface_t * newDevice)
{
    emit beginInsertRows(QModelIndex(), rowCount(), rowCount());
    newDevices << newDevice;
    emit endInsertRows();
}
开发者ID:crondaemon,项目名称:wireshark,代码行数:6,代码来源:interface_tree_cache_model.cpp

示例13: beginInsertRows

void FavoriteTagsModel::appendTag(const ItemFavoriteTagItem &item)
{
    beginInsertRows(QModelIndex(), m_tags.size(), m_tags.size());
    m_tags << item;
    endInsertRows();
}
开发者ID:jktjkt,项目名称:trojita,代码行数:6,代码来源:FavoriteTagsModel.cpp

示例14: beginInsertRows

bool TutorModel::insertRows(int row, int count, const QModelIndex &parent)
{
    beginInsertRows(QModelIndex(), row, row+count-1);
    endInsertRows();
    return true;
}
开发者ID:flylokj,项目名称:AndroidScada,代码行数:6,代码来源:TutorPage.cpp

示例15: endInsertRows

void TaskModelAdapter::taskAdded( TaskId id )
{
    endInsertRows();
}
开发者ID:NicholasVanSickle,项目名称:Charm,代码行数:4,代码来源:TaskModelAdapter.cpp


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