本文整理汇总了C++中QProgressBar::setVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ QProgressBar::setVisible方法的具体用法?C++ QProgressBar::setVisible怎么用?C++ QProgressBar::setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProgressBar
的用法示例。
在下文中一共展示了QProgressBar::setVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateRangeMeter
QProgressBar* USNavigation::CreateRangeMeter(int i)
{
mitk::DataNode::Pointer zone = m_Zones.at(i);
float zoneColor[3];
bool success = m_Zones.at(i)->GetColor(zoneColor);
QString zoneColorString = "#555555";
if (success)
{
QString zoneColorString = QString("#%1%2%3").arg(static_cast<unsigned int>(zoneColor[0]*255), 2, 16, QChar('0'))
.arg(static_cast<unsigned int>(zoneColor[1]*255), 2, 16, QChar('0')).arg(static_cast<unsigned int>(zoneColor[2]*255), 2, 16, QChar('0'));
}
QProgressBar* meter = new QProgressBar();
meter->setMinimum(0);
meter->setMaximum(100);
meter->setValue(0);
QString zoneName = zone->GetName().c_str();
meter->setFormat(zoneName + ": No Data");
QString style = m_RangeMeterStyle;
style = style.replace("#StartColor#", zoneColorString);
style = style.replace("#StopColor#", zoneColorString);
meter->setStyleSheet(style);
meter->setVisible(true);
return meter;
}
示例2: slotUpdateProgressAndStatus
void RenderWindow::slotUpdateProgressAndStatus(const QString &text, const QString &progressText,
double progress, cProgressText::enumProgressType progressType)
{
ui->statusbar->showMessage(text, 0);
QProgressBar *progressBar = NULL;
bool isQueue = this->sender() && this->sender()->objectName() == "Queue";
switch (progressType)
{
case cProgressText::progress_IMAGE:
if (isQueue) progressBar = gMainInterface->progressBarQueueImage;
else progressBar = gMainInterface->progressBar;
break;
case cProgressText::progress_ANIMATION:
if (isQueue) progressBar = gMainInterface->progressBarQueueAnimation;
else progressBar = gMainInterface->progressBarAnimation;
break;
case cProgressText::progress_QUEUE:
// nothing to be done, no progress bar for queue in GUI
break;
}
if (progressBar)
{
if (!progressBar->isVisible())
{
progressBar->setVisible(true);
}
progressBar->setValue(progress * 1000.0);
progressBar->setTextVisible(true);
progressBar->setFormat(progressText);
}
}
示例3: slotUpdateProgressHide
void RenderWindow::slotUpdateProgressHide(cProgressText::enumProgressType progressType)
{
QProgressBar *progressBar = NULL;
switch (progressType)
{
case cProgressText::progress_IMAGE: progressBar = gMainInterface->progressBar; break;
case cProgressText::progress_ANIMATION:
progressBar = gMainInterface->progressBarAnimation;
break;
case cProgressText::progress_QUEUE:
// nothing to be done, no progress bar for queue in GUI
break;
}
if (progressBar)
{
if (progressBar->isVisible()) progressBar->setVisible(false);
}
}
示例4: QByteArray
void
MolTableView::setMol( adchem::SDFile& file, QProgressBar& progressBar )
{
if ( file ) {
adcontrols::ChemicalFormula cformula;
qtwrapper::waitCursor wait;
//RDKit::SDMolSupplier& supplier = file.molSupplier();
model_->setRowCount( file.size() );
progressBar.setRange( 0, file.size() );
progressBar.setVisible( true );
progressBar.setTextVisible( true );
size_t idx = 0;
for ( auto mol: file ) {
progressBar.setValue( idx + 1 );
try {
size_t col = 0;
std::string smiles = RDKit::MolToSmiles( mol );
if ( ! smiles.empty() ) {
model_->setData( model_->index( idx, col++ ), smiles.c_str() );
// SVG
std::string svg = adchem::drawing::toSVG( mol );
model_->setData( model_->index( idx, col ), QByteArray( svg.data(), svg.size() ) );
model_->item( idx, col )->setEditable( false );
}
col = 2;
try {
mol.updatePropertyCache( false );
std::string formula = RDKit::Descriptors::calcMolFormula( mol, true, false );
model_->setData( model_->index( idx, col++ ), QString::fromStdString( formula) );
model_->setData( model_->index( idx, col++), cformula.getMonoIsotopicMass( formula ) );
} catch ( std::exception& ex ) {
ADDEBUG() << ex.what();
}
col = 4;
// associated data
std::map< std::string, std::string > data;
adchem::SDFile::iterator it = file.begin() + idx;
if ( adchem::SDFile::parseItemText( it.itemText(), data ) ) {
for ( auto tag: tags ) {
auto it = data.find( tag );
if ( it != data.end() )
model_->setData( model_->index( idx, col ), it->second.c_str() );
++col;
}
}
if ( idx == 10 )
this->update();
} catch ( std::exception& ex ) {
ADDEBUG() << boost::current_exception_diagnostic_information() << ex.what();
} catch ( ... ) {
ADDEBUG() << boost::current_exception_diagnostic_information();
}
++idx;
}
progressBar.setVisible( false );
}
}