本文整理汇总了C++中QStatusBar::removeWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QStatusBar::removeWidget方法的具体用法?C++ QStatusBar::removeWidget怎么用?C++ QStatusBar::removeWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStatusBar
的用法示例。
在下文中一共展示了QStatusBar::removeWidget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeWidget
int StatusBar::removeWidget(lua_State * L) // ( QWidget * widget )
{
QStatusBar* obj = ObjectHelper<QStatusBar>::check( L, 1);
QWidget* widget = ObjectHelper<QWidget>::check( L, 2);
obj->removeWidget( widget ) ;
return 0;
}
示例2: newItem
void db_key::newItem(QString name)
{
NewKey *dlg = new NewKey(qApp->activeWindow(), name);
QProgressBar *bar;
QStatusBar *status = mainwin->statusBar();
pki_evp *nkey = NULL;
pki_scard *cardkey = NULL;
pki_key *key = NULL;
if (!dlg->exec()) {
delete dlg;
return;
}
int ksize = dlg->getKeysize();
if (ksize > 0) {
if (ksize < 32) {
QMessageBox::warning(NULL, XCA_TITLE,
tr("Key size too small !"));
delete dlg;
return;
}
if (ksize < 1024 || ksize > 8192)
if (QMessageBox::warning(NULL, XCA_TITLE,
tr("You are sure to create a key of the size: %1 ?").arg(ksize),
QMessageBox::Yes | QMessageBox::No) !=
QMessageBox::Yes)
{
delete dlg;
return;
}
}
mainwin->repaint();
bar = new QProgressBar();
status->addPermanentWidget(bar, 1);
try {
if (dlg->isToken()) {
key = cardkey = new pki_scard(dlg->keyDesc->text());
cardkey->generateKey_card(dlg->getKeyCardSlot(),
ksize, bar);
} else {
key = nkey = new pki_evp(dlg->keyDesc->text());
nkey->generate(ksize, dlg->getKeytype(), bar,
dlg->getKeyCurve_nid());
}
key = (pki_key*)insert(key);
emit keyDone(key->getIntNameWithType());
createSuccess(key);
} catch (errorEx &err) {
delete key;
mainwin->Error(err);
}
status->removeWidget(bar);
delete bar;
delete dlg;
}
示例3: preProcess
/** Preprocess the whole sound file,
by looping through and processing every chunk in the file.
A progress bar is displayed in the toolbar, because this can
be time consuming.
*/
void SoundFile::preProcess()
{
//jumpToChunk(0);
gdata->setDoingActiveAnalysis(true);
myassert(firstTimeThrough == true);
readChunk(bufferSize() - offset());
//readChunk(framesPerChunk());
//processNewChunk();
//printf("preProcessing\n");
//for(int j=0; j<numChannels(); j++)
// channels(j)->setframesPerChunk(toRead);
// Create a progress bar in the status bar to tell the user we're preprocessing
MainWindow *theMainWindow = (MainWindow*) qApp->mainWidget();
QStatusBar *theStatusBar = theMainWindow->statusBar();
QLabel *message = new QLabel("Preprocessing data:", theStatusBar, "message");
//QLabel *message = new QLabel("Preprocessing data:", theMainWindow, "message");
//QProgressBar *progress = new QProgressBar(stream->totalFrames() / framesPerChunk(), theMainWindow, "progress bar");
Q3ProgressBar *progress = new Q3ProgressBar(stream->totalFrames() / framesPerChunk(), theStatusBar, "progress bar");
progress->setProgress(0);
progress->setMaximumHeight(16);
theStatusBar->addWidget(message);
theStatusBar->addWidget(progress);
message->show();
progress->show();
int frameCount = 1;
int updateInterval = MAX(1, progress->totalSteps() / 50); // We'll update 50 times only
//while(read_n(toRead, stream) == toRead) { // put data in channels
while(readChunk(framesPerChunk()) == framesPerChunk()) { // put data in channels
//printf("pos = %d\n", stream->pos);
//processNewChunk();
//incrementChunkNum();
frameCount++;
if (frameCount % updateInterval == 0) {
progress->setProgress(progress->progress() + updateInterval);
qApp->processEvents();
frameCount = 1;
}
}
//printf("totalChunks=%d\n", totalChunks());
//printf("currentChunks=%d\n", currentChunk());
filteredStream->close();
filteredStream->open_read(filteredFilename);
jumpToChunk(0);
progress->setProgress(progress->totalSteps());
theStatusBar->removeWidget(progress);
theStatusBar->removeWidget(message);
delete progress;
delete message;
gdata->setDoingActiveAnalysis(false);
firstTimeThrough = false;
//printf("freqLookup.size()=%d\n", channels(0)->freqLookup.size());
}