本文整理汇总了C++中countChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ countChanged函数的具体用法?C++ countChanged怎么用?C++ countChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了countChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: connect
//private
void ReversiGame::setBoard(QSharedPointer<ReversiBoard> nBoard)
{
if (nBoard.isNull())
return;
ReversiBoard * raw = nBoard.data();
connect(raw,
SIGNAL(moveMade(CELL_STATE,CELL_STATE)),
this,
SLOT(handleTurnTaken(CELL_STATE,CELL_STATE)));
connect(raw,
SIGNAL(moveMade(CELL_STATE,CELL_STATE)),
this,
SIGNAL(turnTaken(CELL_STATE,CELL_STATE)));
connect(raw,
SIGNAL(gameOver(CELL_STATE)),
this,
SLOT(handleGameOver(CELL_STATE)));
connect(raw,
SIGNAL(gameOver(CELL_STATE)),
this,
SIGNAL(gameOver(CELL_STATE)));
connect(raw,
SIGNAL(countChanged(quint16,quint16)),
this,
SLOT(handleScoreChanged(quint16,quint16)));
connect(raw,
SIGNAL(countChanged(quint16,quint16)),
this,
SIGNAL(scoreChanged(quint16,quint16)));
this->board = nBoard;
}
开发者ID:raptorswing,项目名称:Death-Reversi,代码行数:34,代码来源:ReversiGame.cpp
示例2: countChanged
void PlaylistHistory::deleteCurrentPlaylist()
{
if (!inRange(m_currentIndex))
return;
int count = m_playlists->count();
if (count == 1) {
delete m_playlists->takeAt(m_currentIndex);
m_currentIndex = -1;
emit countChanged();
return;
}
// current playlist is the last one in list
if (m_currentIndex == count - 1) {
delete m_playlists->takeAt(m_currentIndex);
m_currentIndex--;
emit currentChanged(m_playlists->at(m_currentIndex));
emit countChanged();
return;
}
// current playlist is in the middle
if ((m_currentIndex >= 0) && (m_currentIndex < (count - 1))) {
delete m_playlists->takeAt(m_currentIndex);
emit currentChanged(m_playlists->at(m_currentIndex));
emit countChanged();
return;
}
}
开发者ID:Okspen,项目名称:okPlayer,代码行数:29,代码来源:playlisthistory.cpp
示例3: QIdentityProxyModel
SailorgramContactsModel::SailorgramContactsModel(QObject *parent) : QIdentityProxyModel(parent)
{
this->_telegramcontactsmodel = new TelegramContactsModel(this);
this->setSourceModel(this->_telegramcontactsmodel);
connect(this->_telegramcontactsmodel, SIGNAL(telegramChanged()), this, SIGNAL(telegramChanged()));
connect(this->_telegramcontactsmodel, SIGNAL(countChanged()), this, SIGNAL(countChanged()));
connect(this->_telegramcontactsmodel, SIGNAL(initializingChanged()), this, SIGNAL(initializingChanged()));
}
开发者ID:alinelena,项目名称:harbour-sailorgram,代码行数:9,代码来源:sailorgramcontactsmodel.cpp
示例4: sourceModel
void BooksCoverModel::setSource(QObject* aSrc)
{
QAbstractItemModel* oldM = sourceModel();
if (aSrc != oldM) {
const int oldCount = count();
if (oldM) {
BooksShelf* oldShelf = qobject_cast<BooksShelf*>(oldM);
if (oldShelf) {
const int n = oldShelf->count();
for (int i=0; i<n; i++) {
onBookRemoved(oldShelf->bookAt(i));
}
}
oldM->disconnect(this);
}
if (aSrc) {
QAbstractItemModel* newM = qobject_cast<QAbstractItemModel*>(aSrc);
if (newM) {
setSourceModel(newM);
BooksShelf* newShelf = qobject_cast<BooksShelf*>(newM);
if (newShelf) {
const int n = newShelf->count();
for (int i=0; i<n; i++) {
onBookAdded(newShelf->bookAt(i));
}
connect(newShelf,
SIGNAL(bookAdded(BooksBook*)),
SLOT(onBookAdded(BooksBook*)));
connect(newShelf,
SIGNAL(bookRemoved(BooksBook*)),
SLOT(onBookRemoved(BooksBook*)));
}
connect(newM,
SIGNAL(rowsInserted(QModelIndex,int,int)),
SIGNAL(countChanged()));
connect(newM,
SIGNAL(rowsRemoved(QModelIndex,int,int)),
SIGNAL(countChanged()));
connect(newM,
SIGNAL(modelReset()),
SIGNAL(countChanged()));
} else {
HDEBUG("unexpected source" << aSrc);
setSourceModel(NULL);
}
} else {
setSourceModel(NULL);
}
if (oldCount != count()) {
Q_EMIT countChanged();
}
}
}
开发者ID:alinelena,项目名称:harbour-books,代码行数:53,代码来源:BooksCoverModel.cpp
示例5: QSortFilterProxyModel
SortFilterModel::SortFilterModel(QObject *parent)
: QSortFilterProxyModel(parent)
{
setObjectName(QStringLiteral("SortFilterModel"));
setDynamicSortFilter(true);
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(modelReset()),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(countChanged()), this, SLOT(syncRoleNames()));
}
开发者ID:KDE,项目名称:plasma-framework,代码行数:13,代码来源:datamodel.cpp
示例6: countChanged
void StatusSummaryItem::setCount(uint count) {
if (m_count != count)
emit countChanged();
m_count = count;
updateLabel();
}
开发者ID:Jellofishi,项目名称:Desktop,代码行数:7,代码来源:statussummaryitem.cpp
示例7: clear
void ComicsModel::loadAll()
{
clear();
QStringList comicsList = idLoadList();
Comic *comic;
beginInsertRows(QModelIndex(), 0, comicsList.count() - 1);
for (int i = 0; i < comicsList.size(); ++i) {
comic = factory->create(comicsList.at(i), this);
if (comic == NULL)
return;
comic->load();
connect(comic, SIGNAL(favoriteChanged(Comic*)), this, SLOT(emitFavoriteChanged(Comic*)));
connect(comic, SIGNAL(newStripChanged(Comic*)), this, SLOT(emitNewStripChanged(Comic*)));
connect(comic, SIGNAL(errorChanged(Comic*)), this, SLOT(emitErrorChanged(Comic*)));
connect(comic, SIGNAL(fetchingChanged(Comic*)), this, SLOT(emitFetchingChanged(Comic*)));
connect(comic, SIGNAL(fetchingProgressChanged(Comic*)), this, SLOT(emitFetchingProgressChanged(Comic*)));
m_list.append(comic);
}
endInsertRows();
// hack to fix the initialization of the cover...
emit countChanged();
}
开发者ID:Maledictus,项目名称:sailfishos-daily-comics,代码行数:32,代码来源:ComicsModel.cpp
示例8: userIdField
bool DailymotionAccountModel::addAccount(const QString &userId, const QString &username, const QString &accessToken,
const QString &refreshToken, const QString &scopes) {
QSqlField userIdField("userId", QVariant::String);
userIdField.setValue(userId);
QSqlField usernameField("username", QVariant::String);
usernameField.setValue(username);
QSqlField accessTokenField("accessToken", QVariant::String);
accessTokenField.setValue(accessToken);
QSqlField refreshTokenField("refreshToken", QVariant::String);
refreshTokenField.setValue(refreshToken);
QSqlField scopesField("scopes", QVariant::String);
scopesField.setValue(scopes);
QSqlRecord record;
record.append(userIdField);
record.append(usernameField);
record.append(accessTokenField);
record.append(refreshTokenField);
record.append(scopesField);
if (insertRecord(-1, record)) {
Dailymotion::instance()->setUserId(userId);
const int count = rowCount();
emit dataChanged(index(0, 0), index(count - 1, columnCount() - 1));
emit countChanged(count);
return true;
}
return false;
}
开发者ID:freemangordon,项目名称:cutetube2,代码行数:35,代码来源:dailymotionaccountmodel.cpp
示例9: Q_ASSERT
void GameMovesRegistry::push(IMoveCommand::UPtr newMove)
{
Q_ASSERT(newMove != nullptr && "Null pointer is not allowed");
m_undoneCmnds.push_back(std::move(newMove));
redo();
emit countChanged(count());
}
开发者ID:yudjin87,项目名称:qml_chess,代码行数:7,代码来源:GameMovesRegistry.cpp
示例10: beginInsertRows
void ApplicationManager::add(ApplicationInfo *application) {
if (!application || m_runningApplications.contains(application)) {
return;
}
beginInsertRows(QModelIndex(), m_runningApplications.size(), m_runningApplications.size());
m_runningApplications.append(application);
endInsertRows();
Q_EMIT applicationAdded(application->appId());
Q_EMIT countChanged();
if (count() == 1) Q_EMIT emptyChanged(isEmpty()); // was empty but not anymore
connect(application, &ApplicationInfo::sessionChanged, this, [application, this]() {
QModelIndex appIndex = findIndex(application);
if (!appIndex.isValid()) return;
Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleSession);
});
connect(application, &ApplicationInfo::focusedChanged, this, [application, this]() {
QModelIndex appIndex = findIndex(application);
if (!appIndex.isValid()) return;
Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleFocused);
});
connect(application, &ApplicationInfo::stateChanged, this, [application, this]() {
QModelIndex appIndex = findIndex(application);
if (!appIndex.isValid()) return;
Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
});
}
开发者ID:jonjahren,项目名称:unity8,代码行数:28,代码来源:ApplicationManager.cpp
示例11: countChanged
void LauncherItem::setCount(int count)
{
if (m_count != count) {
m_count = count;
Q_EMIT countChanged(count);
}
}
开发者ID:jonjahren,项目名称:unity8,代码行数:7,代码来源:launcheritem.cpp
示例12: serviceIdFromFavoriteId
void FavoriteAppsModel::addFavorite(const QString &favoriteId)
{
QString serviceId = serviceIdFromFavoriteId(favoriteId);
if (serviceId.isEmpty()) {
return;
}
KService::Ptr service = KService::serviceByStorageId(serviceId);
if (service.isNull()) {
kWarning() << "Could not find a service for" << serviceId;
return;
}
int rank;
if (!m_favoriteList.isEmpty()) {
rank = m_favoriteList.last().rank + 1;
} else {
rank = 0;
}
FavoriteInfo info = { rank, service };
int row = m_favoriteList.count();
beginInsertRows(QModelIndex(), row, row);
m_favoriteList << info;
endInsertRows();
countChanged();
KConfigGroup baseGroup(m_config, "favorites");
KConfigGroup group(&baseGroup, QString("favorite-%1").arg(rank));
group.writeEntry("serviceId", serviceId);
baseGroup.sync();
}
开发者ID:kursusHC,项目名称:homerun,代码行数:30,代码来源:favoriteappsmodel.cpp
示例13: beginResetModel
void EntryListModel::clear(){
beginResetModel();
m_entries.clear();
m_deleted.clear();
endResetModel();
emit countChanged(rowCount());
}
开发者ID:ruedigergad,项目名称:meepasswords,代码行数:7,代码来源:entrylistmodel.cpp
示例14: createTransfer
void Transfers::addDownloadTransfer(const QString &service, const QString &trackId, const QString &streamId,
const QUrl &streamUrl, const QString &title, const QString &category,
const QString &customCommand, bool customCommandOverrideEnabled) {
Logger::log(QString("Transfers::addDownloadTransfer(). Service: %1, Track ID: %2, Stream ID: %3, Stream URL: %4, Title: %5, Category: %6, Command: %7").arg(service).arg(trackId).arg(streamId).arg(streamUrl.toString())
.arg(title).arg(category).arg(customCommand));
Transfer *transfer = createTransfer(service, this);
transfer->setNetworkAccessManager(m_nam);
transfer->setId(Utils::createId());
transfer->setDownloadPath(Settings::downloadPath() + ".incomplete/" + transfer->id());
transfer->setFileName(title);
transfer->setCategory(category);
transfer->setTrackId(trackId);
transfer->setStreamId(streamId);
transfer->setStreamUrl(streamUrl);
transfer->setTitle(title);
transfer->setCustomCommand(customCommand);
transfer->setCustomCommandOverrideEnabled(customCommandOverrideEnabled);
connect(transfer, SIGNAL(statusChanged()), this, SLOT(onTransferStatusChanged()));
m_transfers << transfer;
emit countChanged(count());
emit transferAdded(transfer);
if (Settings::startTransfersAutomatically()) {
transfer->queue();
}
}
开发者ID:marxoft,项目名称:musikloud2,代码行数:28,代码来源:transfers.cpp
示例15: baseGroup
void FavoriteAppsModel::setConfig(const KSharedConfig::Ptr &ptr)
{
m_config = ptr;
KConfigGroup baseGroup(m_config, "favorites");
// get all the favorites
QMap<int, KService::Ptr> favoriteMap;
foreach (const QString &favoriteGroup, baseGroup.groupList()) {
if (favoriteGroup.startsWith("favorite-")) {
KConfigGroup favoriteConfig(&baseGroup, favoriteGroup);
int rank = favoriteGroup.split("-").last().toInt();
QString id = favoriteConfig.readEntry("serviceId");
KService::Ptr service = KService::serviceByStorageId(id);
if (!service.isNull()) {
favoriteMap.insert(rank, service);
}
}
}
beginResetModel();
m_favoriteList.clear();
auto it = favoriteMap.constBegin(), end = favoriteMap.constEnd();
for (; it != end; ++it) {
FavoriteInfo info = { it.key(), it.value() };
m_favoriteList << info;
}
endResetModel();
countChanged();
}
开发者ID:kursusHC,项目名称:homerun,代码行数:30,代码来源:favoriteappsmodel.cpp
示例16: countChanged
/*!
\qmlproperty int Ratings::count
This property holds the total number of individual user ratings
used in determining the overall ratings \l average.
*/
void QDeclarativeRatings::setCount(int count)
{
if (m_ratings.count() != count) {
m_ratings.setCount(count);
emit countChanged();
}
}
开发者ID:amccarthy,项目名称:qtlocation,代码行数:13,代码来源:qdeclarativeratings.cpp
示例17: beginInsertRows
// insert value at row
void ValueModel::insert(int row, const QJSValue &value)
{
beginInsertRows(QModelIndex(), row, row);
m_data.insert(row, value);
endInsertRows();
emit countChanged(m_data.count());
}
开发者ID:4lenz1,项目名称:qmlbook,代码行数:8,代码来源:valuemodel.cpp
示例18: removeCommand
void CUndoRedoStack::remove(QUndoCommand* cmd)
{
if(!cmd)
return;
int inUndo = d->undoStack.indexOf(cmd);
int inRedo = inUndo >= 0 ? -1 : d->redoStack.indexOf(cmd);
CUndoRedoCmdBase* cmd2 = dynamic_cast<CUndoRedoCmdBase*>(cmd);
if(cmd2)
removeCommand(cmd2);
if(inUndo >= 0)
{
d->undoStack.remove(inUndo);
emit canUndoChanged(d->undoStack.count());
}
else if(inRedo >= 0)
{
d->redoStack.remove(inRedo);
emit canRedoChanged(d->redoStack.count());
}
emit countChanged(count());
}
开发者ID:banduladh,项目名称:levelfour,代码行数:25,代码来源:CUndoRedo.cpp
示例19: while
void TrackerDocumentProvider::searchFinished()
{
QSparqlResult *r = qobject_cast<QSparqlResult*>(sender());
if (!r->hasError()) {
// d->model->clear();
// Mark all current entries in the model dirty.
d->model->setAllItemsDirty(true);
while (r->next()) {
// This will remove the dirty flag for already
// existing entries.
d->model->addItem(
r->binding(0).value().toString(),
r->binding(1).value().toString(),
r->binding(1).value().toString().split('.').last(),
r->binding(2).value().toInt(),
r->binding(3).value().toDateTime(),
r->binding(4).value().toString()
);
}
// Remove all entries with the dirty mark.
d->model->removeItemsDirty();
if (!d->ready) {
d->ready = true;
emit readyChanged();
}
}
emit countChanged();
}
开发者ID:sailfishos,项目名称:sailfish-office,代码行数:29,代码来源:trackerdocumentprovider.cpp
示例20: beginRemoveRows
void BackgroundListModel::reload(const QStringList &selected)
{
if (!m_packages.isEmpty()) {
beginRemoveRows(QModelIndex(), 0, m_packages.count() - 1);
m_packages.clear();
endRemoveRows();
emit countChanged();
}
if (!m_wallpaper) {
return;
}
if (!selected.isEmpty()) {
qDebug() << "selected" << selected;
processPaths(selected);
}
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("wallpapers/"), QStandardPaths::LocateDirectory);
qDebug() << " WP : -------" << dirs;
BackgroundFinder *finder = new BackgroundFinder(m_wallpaper.data(), dirs);
connect(finder, &BackgroundFinder::backgroundsFound, this, &BackgroundListModel::backgroundsFound);
m_findToken = finder->token();
finder->start();
m_removableWallpapers = QSet<QString>::fromList(selected);
}
开发者ID:cmacq2,项目名称:plasma-workspace,代码行数:27,代码来源:backgroundlistmodel.cpp
注:本文中的countChanged函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论