本文整理汇总了C++中stringmap::const_iterator::key方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::key方法的具体用法?C++ const_iterator::key怎么用?C++ const_iterator::key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stringmap::const_iterator
的用法示例。
在下文中一共展示了const_iterator::key方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finalizeJob
//! The Job options are synchronised using the widgetChanged slot, but we still
//! need to determine if the options should be printed as part of the job. This
//! is based on whether or not the associated control is enabled or not.
void InputDialog::finalizeJob(Job* job)
{
if (!job) return;
QWidget* w;
QString name;
StringMap::const_iterator iter;
StringMap s = job->getOptions();
for (iter = s.begin(); iter != s.end(); ++iter) {
name = iter.key();
w = findChild<QWidget*>(name.toLower());
// If there is no widget of this name, then we are probably dealing
// with something the user wrote into the preview box, so we just
// leave things alone.
if (w) job->printOption(name, w->isEnabled());
}
// Special case code to avoid writing the method keyword when custom is
// chosen (for backward compatibility)
QComboBox* method(findChild<QComboBox*>("method"));
QString m(method->currentText());
if (method && (m == "Custom" || m == "TD-DFT")) {
job->printOption("METHOD", false);
job->printOption("EXCHANGE", true);
}
}
示例2: BaseJob
PostJob::PostJob(PlatformDependent *internals, const QNetworkRequest &request, const StringMap ¶meters)
: BaseJob(internals), m_ioDevice(0), m_request(request)
{
// Create post data
int j = 0;
for (StringMap::const_iterator i = parameters.begin(); i != parameters.end(); ++i) {
if (j++ > 0) {
m_byteArray.append('&');
}
m_byteArray.append(QUrl::toPercentEncoding(i.key()));
m_byteArray.append('=');
m_byteArray.append(QUrl::toPercentEncoding(i.value()));
}
}
示例3: mesg
void ImageScanThread<DBFS>::run()
{
RunProlog();
setPriority(QThread::LowPriority);
do
{
// Process all clears before scanning
while (ClearsPending())
{
m_mutexQueue.lock();
if (m_clearQueue.isEmpty())
break;
ClearTask task = m_clearQueue.takeFirst();
m_mutexQueue.unlock();
int devId = task.first;
QString action = task.second;
LOG(VB_GENERAL, LOG_INFO,
QString("Clearing Filesystem: %1 %2").arg(action).arg(devId));
// Clear Db
m_dbfs.ClearDb(devId, action);
// Pass on to thumb generator now scanning has stopped
m_thumb.ClearThumbs(devId, action);
}
// Scan requested ?
if (IsScanning())
{
LOG(VB_GENERAL, LOG_INFO, "Starting scan");
// Load known directories and files from the database
if (!m_dbfs.ReadAllImages(m_dbFileMap, m_dbDirMap))
// Abort on any Db error
break;
bool firstScan = m_dbFileMap.isEmpty();
// Pause thumb generator so that scans are fast as possible
m_thumb.PauseBackground(true);
// Adapter determines list of dirs to scan
StringMap paths = m_dbfs.GetScanDirs();
CountFiles(paths.values());
// Now start the actual syncronization
m_seenFile.clear();
m_changedImages.clear();
StringMap::const_iterator i = paths.constBegin();
while (i != paths.constEnd() && IsScanning())
{
SyncSubTree(QFileInfo(i.value()), GALLERY_DB_ID, i.key(), i.value());
++i;
}
// Release thumb generator asap
m_thumb.PauseBackground(false);
// Adding or updating directories has been completed.
// The maps now only contain old directories & files that are not
// in the filesystem anymore. Remove them from the database
m_dbfs.RemoveFromDB(m_dbDirMap.values());
m_dbfs.RemoveFromDB(m_dbFileMap.values());
// Cleanup thumbnails
QStringList mesg(m_thumb.DeleteThumbs(m_dbFileMap.values()));
mesg << m_changedImages.join(",");
// Cleanup dirs
m_dbFileMap.clear();
m_dbDirMap.clear();
m_seenDir.clear();
m_mutexProgress.lock();
// (count == total) signals scan end
Broadcast(m_progressTotalCount);
// Must reset counts for scan queries
m_progressCount = m_progressTotalCount = 0;
m_mutexProgress.unlock();
LOG(VB_GENERAL, LOG_INFO, "Finished scan");
// For initial scans pause briefly to give thumb generator a headstart
// before being deluged by client requests
if (firstScan)
msleep(1000);
// Notify clients of completion with removed & changed images
m_dbfs.Notify("IMAGE_DB_CHANGED", mesg);
ChangeState(false);
}
}
while (ClearsPending());
//.........这里部分代码省略.........