本文整理汇总了C++中QProgressBar::setMinimum方法的典型用法代码示例。如果您正苦于以下问题:C++ QProgressBar::setMinimum方法的具体用法?C++ QProgressBar::setMinimum怎么用?C++ QProgressBar::setMinimum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProgressBar
的用法示例。
在下文中一共展示了QProgressBar::setMinimum方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QProgressDialog
KRPleaseWait::KRPleaseWait(QString msg, QWidget *parent, int count, bool cancel):
QProgressDialog(cancel ? 0 : parent) , inc(true)
{
setModal(!cancel);
timer = new QTimer(this);
setWindowTitle(i18n("Krusader::Wait"));
setMinimumDuration(500);
setAutoClose(false);
setAutoReset(false);
connect(timer, SIGNAL(timeout()), this, SLOT(cycleProgress()));
QProgressBar* progress = new QProgressBar(this);
progress->setMaximum(count);
progress->setMinimum(0);
setBar(progress);
QLabel* label = new QLabel(this);
setLabel(label);
QPushButton* btn = new QPushButton(i18n("&Cancel"), this);
setCancelButton(btn);
btn->setEnabled(canClose = cancel);
setLabelText(msg);
show();
}
示例2: 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;
}
示例3: fillPartialArchiveItem
void ArchiveList::fillPartialArchiveItem(PartialArchive *a, QTreeWidgetItem *item)
{
QTreeWidgetItem *subItem = new QTreeWidgetItem(item);
QPushButton *pauseButton = new QPushButton();
pauseButton->setText(a->isDownloading() ? tr("Pause") : tr("Continue"));
connect(pauseButton, SIGNAL(clicked()), a, SLOT(togglePauseDownload()));
downloadPausedMapper->setMapping(a, pauseButton);
downloadStartedMapper->setMapping(a, pauseButton);
connect(a, SIGNAL(downloadStarted()), downloadStartedMapper, SLOT(map()));
connect(a, SIGNAL(downloadPaused()), downloadPausedMapper, SLOT(map()));
int pbarColumn;
if (compactLayout) {
pbarColumn = 1;
subItem->setSizeHint(1, pauseButton->sizeHint());
setItemWidget(subItem, 1, pauseButton);
QPushButton *detailsButton = new QPushButton(tr("Details"));
showDetailsMapper->setMapping(detailsButton, a);
connect(detailsButton, SIGNAL(clicked()), showDetailsMapper, SLOT(map()));
subItem->setSizeHint(0, detailsButton->sizeHint());
setItemWidget(subItem, 0, detailsButton);
} else {
pbarColumn = 2;
item->setSizeHint(3, pauseButton->sizeHint());
setItemWidget(item, 3, pauseButton);
item->setText(1, a->getSizeMB());
QLabel *peerInfo = new QLabel();
subItem->setSizeHint(1, peerInfo->sizeHint());
setItemWidget(subItem, 1, peerInfo);
connect(a, SIGNAL(peerInfoUpdated(QString)), peerInfo, SLOT(setText(QString)));
QLabel *speedText = new QLabel();
subItem->setSizeHint(2, speedText->sizeHint());
setItemWidget(subItem, 2, speedText);
connect(a, SIGNAL(speedTextUpdated(QString)), speedText, SLOT(setText(QString)));
QLabel *statusText = new QLabel();
subItem->setSizeHint(3, statusText->sizeHint());
setItemWidget(subItem, 3, statusText);
connect(a, SIGNAL(statusTextUpdated(QString)), statusText, SLOT(setText(QString)));
}
QProgressBar *pbar = new QProgressBar();
pbar->setMinimum(0);
pbar->setMaximum(100);
item->setSizeHint(pbarColumn, pbar->sizeHint());
setItemWidget(item, pbarColumn, pbar);
connect(a, SIGNAL(progressUpdated(int)), pbar, SLOT(setValue(int)));
a->emitStatusEvents();
}
示例4: queryFile
void FtpSessionDialog::queryFile(int id, QString& name)
{
int rowCount = progressTable->rowCount();
progressTable->setRowCount(rowCount + 1);
progressTable->setItem(rowCount, 0, new QTableWidgetItem(name));
QProgressBar *progressBar = new QProgressBar;
progressBar->setMinimum(0);
progressBar->setValue(0);
progressBars->insert(id, progressBar);
progressTable->setCellWidget(rowCount, 1, progressBar);
}
示例5: buildProgressBar
QProgressBar* medDoubleParameterPresenter::buildProgressBar()
{
QProgressBar *progressBar = new QProgressBar;
progressBar->setValue(_percentFromValue(d->parameter->value()));
connect(this, &medDoubleParameterPresenter::valueChanged,progressBar, &QProgressBar::setValue);
progressBar->setToolTip(d->parameter->description());
this->_connectWidget(progressBar);
progressBar->setMinimum(0);
progressBar->setMaximum(100);
return progressBar;
}
示例6: slot_showUpdatesTable
void UUpdateWidget::slot_showUpdatesTable(UUpdatesModel *model)
{
if (model->rowCount() == 0) {
qDebug() << "there is no updates";
QMessageBox::information(this, tr("Nanomite updater"),
tr("There is no updates"));
m_stackedWidget->setCurrentIndex(0);
m_toolBarActions.at(eINSTALL_UPDATES_ACTION)->setEnabled(false);
m_toolBarActions.at(eCHECK_UPDATES_ACTION)->setEnabled(true);
return;
}
// create folder for updates
QDir currDir(QDir::currentPath());
QString createdFolder = currDir.currentPath() + "/updates";
currDir.mkdir(createdFolder);
currDir.setCurrent(createdFolder);
// end of creating folder for updates
m_updatesTableView->setModel(model);
m_progressBarList.clear();
QProgressBar *progressBar;
for (int i = 0; i < model->rowCount(); i++) {
progressBar = new QProgressBar(m_updatesTableView);
progressBar->setTextVisible(false);
progressBar->setMinimum(0);
progressBar->setMaximum(0);
m_progressBarList.append(progressBar);
m_updatesTableView->setIndexWidget(model->index(i, UUpdatesModel::eSTATUS), m_progressBarList.last());
}
m_updatesTableView->resizeColumnsToContents();
m_stackedWidget->setCurrentIndex(2);
m_toolBarActions.at(eINSTALL_UPDATES_ACTION)->setEnabled(true);
m_toolBarActions.at(eCHECK_UPDATES_ACTION)->setEnabled(false);
}
示例7: setupIndicators
void Joysticks::setupIndicators (int row) {
/* Remove all joystick indicators in the widget */
foreach (QSpinBox * b, findChildren<QSpinBox*>()) delete b;
foreach (QPushButton * c, findChildren<QPushButton*>()) delete c;
foreach (QProgressBar * p, findChildren<QProgressBar*>()) delete p;
/* Clear joystick data */
m_axes.clear();
m_povs.clear();
m_buttons.clear();
/* Avoid crashing the application when there are no joysticks */
if (row < 0)
return;
/* Get joystick information */
int povCount = JOYSTICK_MANAGER()->getInputDevice (row).numPOVs;
int axisCount = JOYSTICK_MANAGER()->getInputDevice (row).numAxes;
int buttonCount = JOYSTICK_MANAGER()->getInputDevice (row).numButtons;
/* Make the indicator containers visible */
m_POVIndicators->setVisible (povCount > 0);
m_axisIndicators->setVisible (axisCount > 0);
m_buttonIndicators->setVisible (buttonCount > 0);
/* Create a progress bar for each axis */
for (int i = 0; i < axisCount; ++i) {
QProgressBar* bar = new QProgressBar (this);
bar->setFixedHeight (DPI_SCALE (19));
bar->setValue (0);
bar->setMaximum (100);
bar->setMinimum (-100);
bar->setFormat (tr ("Axis %1").arg (i));
m_axes.append (bar);
m_axesBox->addWidget (bar);
}
/* Create a button for each joystick button */
for (int i = 0; i < buttonCount; ++i) {
QPushButton* button = new QPushButton (this);
button->setEnabled (false);
button->setCheckable (true);
button->setFixedSize (DPI_SCALE (18), DPI_SCALE (12));
button->setToolTip (tr ("Button %1").arg (i));
/* Distribute the button items in a nice layout */
int row = (i <= 7) ? i : i - 8;
int column = (i <= 7) ? 0 : (i / 8);
m_buttons.append (button);
m_buttonsBox->addWidget (button, row, column);
}
/* Create a spinbox for each joystick hat */
for (int i = 0; i < povCount; ++i) {
QSpinBox* box = new QSpinBox (this);
box->setRange (0, 360);
box->setEnabled (false);
m_povs.append (box);
m_povsBox->addWidget (box);
}
}
示例8: QWidget
AppBarExamples::AppBarExamples(QWidget *parent)
: QWidget(parent)
{
Progress *p = new Progress;
p->setProgressType(Material::IndeterminateProgress);
p->setMinimum(0);
p->setMaximum(99);
p->setValue(22);
QVBoxLayout *l = new QVBoxLayout;
setLayout(l);
l->addStretch(1);
l->addWidget(p);
CircularProgress *cp = new CircularProgress;
cp->setProgressType(Material::IndeterminateProgress);
cp->setMinimum(0);
cp->setMaximum(99);
cp->setValue(90);
l->addWidget(cp);
QProgressBar *pb = new QProgressBar;
pb->setMinimum(0);
pb->setMaximum(99);
pb->setValue(50);
QPushButton *b = new QPushButton;
l->addWidget(b);
l->addWidget(pb);
/*
QLayout *mainLayout = widget()->layout();
{
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
widget->setLayout(layout);
AppBar *appBar = new AppBar;
layout->addWidget(appBar);
layout->addStretch();
layout->setContentsMargins(0, 0, 0, 0);
QScrollArea *area = new QScrollArea;
area->setWidget(widget);
area->setWidgetResizable(true);
area->setBackgroundRole(QPalette::Base);
Frame *frame = new Frame;
frame->setCodeSnippet(
"QVBoxLayout *layout = new QVBoxLayout;\n"
"AppBar *appBar = new AppBar;\n"
"layout->addWidget(appBar);\n"
"layout->addStretch();\n"
"layout->setContentsMargins(0, 0, 0, 0);"
);
frame->setWidget(area);
mainLayout->addWidget(frame);
}
{
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
widget->setLayout(layout);
Progress *p = new Progress;
Frame *frame = new Frame;
frame->setCodeSnippet(
""
);
frame->setWidget(p);
mainLayout->addWidget(frame);
}
*/
}
示例9: rasterRender
void RenderCommand::rasterRender(bool isPreview)
{
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
if (isPreview) {
//Let the PreviewFxManager own the rest. Just pass him the current output node.
PreviewFxManager::instance()->showNewPreview((TFx *)scene->getXsheet()->getFxDag()->getCurrentOutputFx());
return;
}
string ext = m_fp.getType();
#ifdef WIN32
if (ext == "avi" && !isPreview) {
TPropertyGroup *props = scene->getProperties()->getOutputProperties()->getFileFormatProperties(ext);
string codecName = props->getProperty(0)->getValueAsString();
TDimension res = scene->getCurrentCamera()->getRes();
if (!AviCodecRestrictions::canWriteMovie(toWideString(codecName), res)) {
QString msg(QObject::tr("The resolution of the output camera does not fit with the options chosen for the output file format."));
MsgBox(WARNING, msg);
return;
}
}
#endif;
//Extract output properties
TOutputProperties *prop = isPreview ? scene->getProperties()->getPreviewProperties() : scene->getProperties()->getOutputProperties();
//Build thread count
/*-- Dedicated CPUs のコンボボックス (Single, Half, All) --*/
int index = prop->getThreadIndex();
const int procCount = TSystem::getProcessorCount();
const int threadCounts[3] = {1, procCount / 2, procCount};
int threadCount = threadCounts[index];
/*-- MovieRendererを作る。Previewの場合はファイルパスは空 --*/
MovieRenderer movieRenderer(scene, isPreview ? TFilePath() : m_fp, threadCount, isPreview);
TRenderSettings rs = prop->getRenderSettings();
//Build raster granularity size
index = prop->getMaxTileSizeIndex();
const int maxTileSizes[4] = {
(std::numeric_limits<int>::max)(),
TOutputProperties::LargeVal,
TOutputProperties::MediumVal,
TOutputProperties::SmallVal};
rs.m_maxTileSize = maxTileSizes[index];
//Build
#ifdef BRAVODEMO
rs.m_mark = loadBravo(scene->getCurrentCamera()->getRes());
#endif
/*-- RenderSettingsをセット --*/
movieRenderer.setRenderSettings(rs);
/*-- カメラDPIの取得、セット --*/
TPointD cameraDpi = isPreview ? scene->getCurrentPreviewCamera()->getDpi() : scene->getCurrentCamera()->getDpi();
movieRenderer.setDpi(cameraDpi.x, cameraDpi.y);
movieRenderer.enablePrecomputing(true);
/*-- プログレス ダイアログの作成 --*/
RenderListener *listener =
new RenderListener(movieRenderer.getTRenderer(), m_fp, ((m_numFrames - 1) / m_step) + 1, isPreview);
QObject::connect(listener, SIGNAL(canceled()), &movieRenderer, SLOT(onCanceled()));
movieRenderer.addListener(listener);
bool fieldRendering = rs.m_fieldPrevalence != TRenderSettings::NoField;
/*-- buildSceneFxの進行状況を表示するプログレスバー --*/
QProgressBar *buildSceneProgressBar = new QProgressBar(TApp::instance()->getMainWindow());
buildSceneProgressBar->setAttribute(Qt::WA_DeleteOnClose);
buildSceneProgressBar->setWindowFlags(Qt::SubWindow | Qt::Dialog | Qt::WindowStaysOnTopHint);
buildSceneProgressBar->setMinimum(0);
buildSceneProgressBar->setMaximum(m_numFrames - 1);
buildSceneProgressBar->setValue(0);
buildSceneProgressBar->move(600, 500);
buildSceneProgressBar->setWindowTitle("Building Schematic...");
buildSceneProgressBar->show();
for (int i = 0; i < m_numFrames; ++i, m_r += m_stepd) {
buildSceneProgressBar->setValue(i);
if (rs.m_stereoscopic)
scene->shiftCameraX(-rs.m_stereoscopicShift / 2);
TFxPair fx;
fx.m_frameA = buildSceneFx(scene, m_r, rs.m_shrinkX, isPreview);
if (fieldRendering && !isPreview)
fx.m_frameB = buildSceneFx(scene, m_r + 0.5 / m_timeStretchFactor, rs.m_shrinkX, isPreview);
else if (rs.m_stereoscopic) {
scene->shiftCameraX(rs.m_stereoscopicShift);
fx.m_frameB = buildSceneFx(scene, m_r + 0.5 / m_timeStretchFactor, rs.m_shrinkX, isPreview);
scene->shiftCameraX(-rs.m_stereoscopicShift / 2);
} else
fx.m_frameB = TRasterFxP();
/*-- movieRendererにフレーム毎のFxを登録 --*/
//.........这里部分代码省略.........
示例10: setupDisplay
void WifiWidget::setupDisplay()
{
const int numRowsPerInterface = 6;
const int numDigits = 4;
QGridLayout *globalLayout = new QGridLayout(this);
globalLayout->setColumnStretch(0,0);
globalLayout->setColumnStretch(1,1);
globalLayout->setColumnStretch(2,1);
for (unsigned int i=0; i<numInterfaces_; i++)
{
QLabel *interfaceLabel = new QLabel;
interfaceLabel->setFont(QFont("Helvetica", 12, QFont::Bold));
globalLayout->addWidget(interfaceLabel,numRowsPerInterface*i,0);
interfaceLabels_.push_back( interfaceLabel );
QLabel *accessPointLabel = new QLabel;
accessPointLabel->setFont(QFont("Helvetica", 12, QFont::Bold));
globalLayout->addWidget(accessPointLabel,numRowsPerInterface*i,1);
accessPointLabels_.push_back( accessPointLabel );
QLCDNumber *lcdSignalLevel = new QLCDNumber(numDigits, this);
lcdSignalLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsSignal_.push_back(lcdSignalLevel);
QLCDNumber *lcdMaxSignalLevel = new QLCDNumber(numDigits, this);
lcdMaxSignalLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsMaxSignal_.push_back(lcdMaxSignalLevel);
QLabel *signalLabel = new QLabel("Signal: ");
globalLayout->addWidget( signalLabel,numRowsPerInterface*i+1,0);
globalLayout->addWidget( lcdSignalLevel,numRowsPerInterface*i+1,1);
globalLayout->addWidget( lcdMaxSignalLevel,numRowsPerInterface*i+1,2);
QLCDNumber *lcdNoiseLevel = new QLCDNumber(numDigits, this);
lcdNoiseLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsNoise_.push_back(lcdNoiseLevel);
QLCDNumber *lcdMaxNoiseLevel = new QLCDNumber(numDigits, this);
lcdMaxNoiseLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsMaxNoise_.push_back(lcdMaxNoiseLevel);
QLabel *noiseLabel = new QLabel("Noise: ");
globalLayout->addWidget( noiseLabel,numRowsPerInterface*i+2,0);
globalLayout->addWidget( lcdNoiseLevel,numRowsPerInterface*i+2,1);
globalLayout->addWidget( lcdMaxNoiseLevel,numRowsPerInterface*i+2,2);
QLCDNumber *lcdLinkLevel = new QLCDNumber(numDigits, this);
lcdLinkLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsLink_.push_back(lcdLinkLevel);
QLCDNumber *lcdMaxLinkLevel = new QLCDNumber(numDigits, this);
lcdMaxLinkLevel->setSegmentStyle(QLCDNumber::Filled);
lcdsMaxLink_.push_back(lcdMaxLinkLevel);
QLabel *linkLabel = new QLabel("Link quality: ");
globalLayout->addWidget( linkLabel,numRowsPerInterface*i+3,0);
globalLayout->addWidget( lcdLinkLevel,numRowsPerInterface*i+3,1);
globalLayout->addWidget( lcdMaxLinkLevel,numRowsPerInterface*i+3,2);
QLCDNumber *lcdBitrate = new QLCDNumber(numDigits, this);
lcdBitrate->setSegmentStyle(QLCDNumber::Filled);
lcdsBitrate_.push_back(lcdBitrate);
QLabel *bitRateLabel = new QLabel("Bit rate (Mb/s): ");
globalLayout->addWidget( bitRateLabel,numRowsPerInterface*i+4,0);
globalLayout->addWidget( lcdBitrate,numRowsPerInterface*i+4,1);
QProgressBar *overall = new QProgressBar;
overall->setMinimum(0);
overall->setMaximum(MAXIMUM_SNR);
progressBars_.push_back(overall);
QLabel *progressLabel = new QLabel("Overall signal level: ");
QLabel *overallSigLabel = new QLabel;
overallSigLabel->setFont(QFont("Helvetica", 12, QFont::Bold));
overallSigLabels_.push_back( overallSigLabel );
globalLayout->addWidget( progressLabel,numRowsPerInterface*i+5,0);
globalLayout->addWidget( overall,numRowsPerInterface*i+5,1);
globalLayout->addWidget( overallSigLabel,numRowsPerInterface*i+5,2);
}
setLayout(globalLayout);
}