本文整理汇总了C++中FileSource::status方法的典型用法代码示例。如果您正苦于以下问题:C++ FileSource::status方法的具体用法?C++ FileSource::status怎么用?C++ FileSource::status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSource
的用法示例。
在下文中一共展示了FileSource::status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateInformationLabel
/******************************************************************************
* Updates the displayed status informations.
******************************************************************************/
void FileSourceEditor::updateInformationLabel()
{
FileSource* obj = static_object_cast<FileSource>(editObject());
if(!obj) {
_wildcardPatternTextbox->clear();
_wildcardPatternTextbox->setEnabled(false);
_sourcePathLabel->setText(QString());
_filenameLabel->setText(QString());
_statusLabel->clearStatus();
_framesListBox->clear();
_framesListBox->setEnabled(false);
_fileSeriesLabel->setText(QString());
return;
}
QString wildcardPattern;
if(obj->sourceUrl().isLocalFile()) {
QFileInfo fileInfo(obj->sourceUrl().toLocalFile());
_sourcePathLabel->setText(fileInfo.dir().path());
wildcardPattern = fileInfo.fileName();
}
else {
QFileInfo fileInfo(obj->sourceUrl().path());
QUrl url = obj->sourceUrl();
url.setPath(fileInfo.path());
_sourcePathLabel->setText(url.toString(QUrl::RemovePassword | QUrl::PreferLocalFile | QUrl::PrettyDecoded));
wildcardPattern = fileInfo.fileName();
}
_wildcardPatternTextbox->setText(wildcardPattern);
_wildcardPatternTextbox->setEnabled(true);
int frameIndex = obj->loadedFrameIndex();
if(frameIndex >= 0) {
const FileSourceImporter::Frame& frameInfo = obj->frames()[frameIndex];
if(frameInfo.sourceFile.isLocalFile()) {
_filenameLabel->setText(QFileInfo(frameInfo.sourceFile.toLocalFile()).fileName());
}
else {
_filenameLabel->setText(QFileInfo(frameInfo.sourceFile.path()).fileName());
}
}
else {
_filenameLabel->setText(QString());
}
// Count the number of files matching the wildcard pattern.
int fileSeriesCount = 0;
QUrl lastUrl;
for(const FileSourceImporter::Frame& frame : obj->frames()) {
if(frame.sourceFile != lastUrl) {
fileSeriesCount++;
lastUrl = frame.sourceFile;
}
}
if(fileSeriesCount == 0)
_fileSeriesLabel->setText(tr("Found no matching file"));
else if(fileSeriesCount == 1)
_fileSeriesLabel->setText(tr("Found %1 matching file").arg(fileSeriesCount));
else
_fileSeriesLabel->setText(tr("Found %1 matching files").arg(fileSeriesCount));
if(!obj->frames().empty())
_timeSeriesLabel->setText(tr("Showing frame %1 of %2").arg(obj->loadedFrameIndex()+1).arg(obj->frames().count()));
else
_timeSeriesLabel->setText(tr("No frames available"));
for(int index = 0; index < obj->frames().size(); index++) {
if(_framesListBox->count() <= index) {
_framesListBox->addItem(obj->frames()[index].label);
}
else {
if(_framesListBox->itemText(index) != obj->frames()[index].label)
_framesListBox->setItemText(index, obj->frames()[index].label);
}
}
for(int index = _framesListBox->count() - 1; index >= obj->frames().size(); index--) {
_framesListBox->removeItem(index);
}
_framesListBox->setCurrentIndex(frameIndex);
_framesListBox->setEnabled(_framesListBox->count() > 1);
_statusLabel->setStatus(obj->status());
}