本文整理汇总了C++中endInsertRows函数的典型用法代码示例。如果您正苦于以下问题:C++ endInsertRows函数的具体用法?C++ endInsertRows怎么用?C++ endInsertRows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了endInsertRows函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: beginInsertRows
bool CPlaylistModel::insertItem(CPlaylistItem* item, int pos)
{
beginInsertRows(QModelIndex(), pos, pos);
m_playlistPtr->insertItem(item, pos);
endInsertRows();
}
开发者ID:BackupTheBerlios,项目名称:muroa-svn,代码行数:6,代码来源:CPlaylistModel.cpp
示例17: beginInsertRows
void ConsoleLineBuffer::createNewLine()
{
beginInsertRows(QModelIndex(), list_.count(), list_.count());
list_.append(ConsoleLine());
endInsertRows();
}
开发者ID:solaristhesun,项目名称:superterm,代码行数:6,代码来源:consolelinebuffer.cpp
示例18: beginInsertRows
void SelectionModel::append(const QString &name, const QVariant &value) {
beginInsertRows(QModelIndex(), m_items.size(), m_items.size());
m_items << QPair<QString, QVariant>(name, value);
endInsertRows();
emit countChanged(rowCount());
}
开发者ID:marxoft,项目名称:cuteradio,代码行数:6,代码来源:selectionmodel.cpp
示例19: endInsertRows
void MergedProxyModel::RowsInserted(const QModelIndex&, int, int) {
endInsertRows();
}
开发者ID:schalkpd,项目名称:clementine-subsonic,代码行数:3,代码来源:mergedproxymodel.cpp
示例20: endInsertRows
void PlayListModel::endInsertItems()
{
endInsertRows();
qDebug("endInsertItems");
}
开发者ID:77ilike77,项目名称:MusicPlayer,代码行数:5,代码来源:playlistmodel.cpp
注:本文中的endInsertRows函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论