本文整理汇总了C++中ProgressDialog类的典型用法代码示例。如果您正苦于以下问题:C++ ProgressDialog类的具体用法?C++ ProgressDialog怎么用?C++ ProgressDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProgressDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: it
QScriptValue ProgressDialog::constructor(QScriptContext *context, QScriptEngine *engine)
{
ProgressDialog *progressDialog = new ProgressDialog;
progressDialog->setupConstructorParameters(context, engine, context->argument(0));
QScriptValueIterator it(context->argument(0));
while(it.hasNext())
{
it.next();
if(it.name() == "value")
progressDialog->mProgressDialog->setValue(it.value().toInt32());
else if(it.name() == "labelText")
progressDialog->mProgressDialog->setLabelText(it.value().toString());
else if(it.name() == "minimum")
progressDialog->mProgressDialog->setMinimum(it.value().toInt32());
else if(it.name() == "maximum")
progressDialog->mProgressDialog->setMaximum(it.value().toInt32());
else if(it.name() == "range")
{
progressDialog->mProgressDialog->setMinimum(it.value().property("minimum").toInt32());
progressDialog->mProgressDialog->setMaximum(it.value().property("maximum").toInt32());
}
else if(it.name() == "onCanceled")
progressDialog->mOnCanceled = it.value();
}
return CodeClass::constructor(progressDialog, context, engine);
}
示例2: ProgressDialog
void VersionSelectDialog::loadList()
{
ProgressDialog *taskDlg = new ProgressDialog(this);
Task *loadTask = m_vlist->getLoadTask();
loadTask->setParent(taskDlg);
taskDlg->exec(loadTask);
}
示例3: OnFileDefrag
void CMainFrame::OnFileDefrag()
{
CzpEditorDoc* document = (CzpEditorDoc*)GetActiveDocument();
ZpExplorer& explorer = document->GetZpExplorer();
if (!explorer.isOpen())
{
return;
}
//zp::u64 fragSize = explorer.getPack()->countFragmentSize();
//if (fragSize == 0)
//{
// ::MessageBox(NULL, _T("No fragment found in package."), _T("Note"), MB_OK | MB_ICONINFORMATION);
// return;
//}
//StringStream tip;
//tip << _T("You can save ") << fragSize << _T(" bytes, continue?");
if (::MessageBox(NULL, _T("It will take minutes for large package, continue?"), _T("Note"), MB_YESNO | MB_ICONQUESTION) != IDYES)
{
return;
}
ProgressDialog progressDlg;
progressDlg.m_explorer = &(document->GetZpExplorer());
progressDlg.m_running = true;
progressDlg.m_params = NULL;
progressDlg.m_operation = ProgressDialog::OP_DEFRAG;
progressDlg.m_totalFileSize = explorer.countNodeFileSize(explorer.rootNode());
progressDlg.DoModal();
}
示例4: ProgressDialog
void MainWindow::on_pushButton_clicked()
{
ProgressDialog* progressDialog = new ProgressDialog(nullptr, new DriveTransfer(nullptr, ".", "./Test"));
progressDialog->show();
//Console* console = new Console(this);
//console->show();
}
示例5: switch
BOOL CALLBACK ProgressDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
{
::SetWindowLongPtr(hWnd, GWL_USERDATA, lParam);
ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(lParam);
return dlg->runDlgProc(hWnd, message, wParam, lParam);
}
case WM_COMMAND:
{
if (IDCANCEL == wParam) {
int mbResult = MessageBox(hWnd, _T("Are you sure you wish to abort the current installation/removal?"), _T("Cancel installation / removal?"), MB_YESNO | MB_ICONQUESTION);
if (IDYES == mbResult) {
ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(::GetWindowLongPtr(hWnd, GWL_USERDATA));
dlg->_cancelToken.triggerCancel();
}
}
return FALSE;
}
default:
{
ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(::GetWindowLongPtr(hWnd, GWL_USERDATA));
return dlg->runDlgProc(hWnd, message, wParam, lParam);
}
}
}
示例6: startOperation
void CzpEditorView::startOperation(ProgressDialog::Operation op, zp::u64 totalFileSize,
const std::vector<std::pair<zp::String, zp::String>>* params)
{
ProgressDialog progressDlg;
progressDlg.m_explorer = &(GetDocument()->GetZpExplorer());
progressDlg.m_running = true;
progressDlg.m_params = params;
progressDlg.m_operation = op;
progressDlg.m_totalFileSize = totalFileSize;
progressDlg.DoModal();
}
示例7: ProgressDialog
void LocalView::slot_local_new_download_requested(const TaskPackage &local_pkg, const TaskPackage &remote_pkg)
{
ProgressDialog *pdlg = new ProgressDialog(0);
// src is remote file , dest if localfile
pdlg->set_transfer_info(remote_pkg, local_pkg);
QObject::connect(pdlg, SIGNAL(transfer_finished(int, QString)),
this, SLOT(slot_transfer_finished(int, QString)));
this->main_mdi_area->addSubWindow(pdlg);
pdlg->show();
this->own_progress_dialog = pdlg;
}
示例8: SetWindowLong
// ----------------------------------------------------------------------------
// dialogProc
// ----------------------------------------------------------------------------
// the message procedure for the cgp dialog procedure, a dummy procedure
INT_PTR CALLBACK ProgressDialog::progDialogProc(HWND hWndDlg, UINT msg,
WPARAM wParam, LPARAM lParam) {
//this->hWnd = hWnd;
if (msg == WM_INITDIALOG) {
ProgressDialog* progD = reinterpret_cast<ProgressDialog*>(lParam);
SetWindowLong(hWndDlg, GWL_USERDATA, reinterpret_cast<long>(progD));
}
// get the WWindow structure and pass the data to that
ProgressDialog* progD = (ProgressDialog *) GetWindowLong(hWndDlg, GWL_USERDATA);
if (progD)
return progD->realProgDialogProc(hWndDlg, msg, wParam, lParam);
} // --- dialogProc -----------------------------------------------------------
示例9: switch
BOOL CALLBACK ProgressDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
{
::SetWindowLongPtr(hWnd, GWLP_USERDATA, lParam);
ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(lParam);
return dlg->runDlgProc(hWnd, message, wParam, lParam);
}
default:
{
ProgressDialog* dlg = reinterpret_cast<ProgressDialog*>(static_cast<LONG_PTR>(::GetWindowLongPtr(hWnd, GWLP_USERDATA)));
return dlg->runDlgProc(hWnd, message, wParam, lParam);
}
}
}
示例10: qDebug
void LocalView::slot_transfer_finished(int status, QString errorString)
{
qDebug() <<__FUNCTION__<<": "<<__LINE__<<":"<< __FILE__<<status;
// SFTPView *remote_view = this;
ProgressDialog *pdlg = (ProgressDialog*)sender();
this->main_mdi_area->removeSubWindow(pdlg->parentWidget());
delete pdlg;
this->own_progress_dialog = NULL;
if (status == 0 // || status == 3
) {
//TODO 通知UI更新目录结构,在某些情况下会导致左侧树目录变空。
//int transfer_type = pdlg->get_transfer_type();
//if ( transfer_type == TransferThread::TRANSFER_GET )
{
// this->local_view->update_layout();
// local 不需要吧,这个能自动更新的???
this->update_layout();
}
//else if ( transfer_type == TransferThread::TRANSFER_PUT )
{
// remote_view->update_layout();
}
//else
{
// xxxxx: 没有预期到的错误
//assert ( 1== 2 );
}
} else if (status == 52 // Transportor::ERROR_CANCEL
) {
// user cancel, show nothing
} else if (status != 0 // && status != 3
) {
QString errmsg = QString(errorString + " Code: %1").arg(status);
if (errmsg.length() < 50) errmsg = errmsg.leftJustified(50);
QMessageBox::critical(this, QString(tr("Error: ")), errmsg);
} else {
Q_ASSERT(1 == 2);
}
// remote_view->slot_leave_remote_dir_retrive_loop();
}
示例11: connect
void HttpWindow::startRequest(const QUrl &requestedUrl)
{
url = requestedUrl;
httpRequestAborted = false;
reply = qnam.get(QNetworkRequest(url));
connect(reply, &QNetworkReply::finished, this, &HttpWindow::httpFinished);
connect(reply, &QIODevice::readyRead, this, &HttpWindow::httpReadyRead);
ProgressDialog *progressDialog = new ProgressDialog(url, this);
progressDialog->setAttribute(Qt::WA_DeleteOnClose);
connect(progressDialog, &QProgressDialog::canceled, this, &HttpWindow::cancelDownload);
connect(reply, &QNetworkReply::downloadProgress, progressDialog, &ProgressDialog::networkReplyProgress);
connect(reply, &QNetworkReply::finished, progressDialog, &ProgressDialog::hide);
progressDialog->show();
statusLabel->setText(tr("Downloading %1...").arg(url.toString()));
songBeingDownloaded = true;//
}
示例12: ProgressDialog
void ImageTags::applyUserAction(QList<QTreeWidgetItem *> tagsList)
{
int processEventsCounter = 0;
ProgressDialog *dialog = new ProgressDialog(this);
dialog->show();
QStringList currentSelectedImages = thumbView->getSelectedThumbsList();
for (int i = 0; i < currentSelectedImages.size(); ++i) {
QString imageName = currentSelectedImages[i];
for (int i = tagsList.size() - 1; i > -1; --i) {
Qt::CheckState tagState = tagsList.at(i)->checkState(0);
setTagIcon(tagsList.at(i), (tagState == Qt::Checked? TagIconEnabled : TagIconDisabled));
QString tagName = tagsList.at(i)->text(0);
if (tagState == Qt::Checked) {
dialog->opLabel->setText(tr("Tagging ") + imageName);
mdCache->addTagToImage(imageName, tagName);
} else {
dialog->opLabel->setText(tr("Untagging ") + imageName);
mdCache->removeTagFromImage(imageName, tagName);
}
}
if (!writeTagsToImage(imageName, mdCache->getImageTags(imageName))) {
mdCache->removeImage(imageName);
}
++processEventsCounter;
if (processEventsCounter > 9) {
processEventsCounter = 0;
QApplication::processEvents();
}
if (dialog->abortOp) {
break;
}
}
dialog->close();
delete(dialog);
}
示例13: editResource
void ResourceManagementUtil::editResource( const std::string& path, const QIcon& resourceIcon )
{
ProgressDialog progressDlg;
progressDlg.initialize( "Loading a resource", 1 );
ResourcesManager& resMgr = ResourcesManager::getInstance();
Resource* resource = resMgr.create( path );
progressDlg.advance();
if ( resource )
{
TamyEditor& tamyEd = TamyEditor::getInstance();
if ( tamyEd.activateResourceEditor( resource ) == false )
{
ResourceEditor* resourceEd = tamyEd.createResourceEditor( resource, resourceIcon );
tamyEd.addResourceEditor( resourceEd );
}
}
}
示例14: ZpCallback
bool ZpCallback(const zp::Char* path, zp::u32 fileSize, void* param)
{
ProgressDialog* dlg = (ProgressDialog*)param;
if (dlg == NULL)
{
return true;
}
if (dlg->m_running)
{
if (dlg->m_totalFileSize != 0)
{
dlg->setProgress(path, (float)dlg->m_doneFileSize / dlg->m_totalFileSize);
}
else
{
dlg->setProgress(path, 1.0f);
}
}
dlg->m_doneFileSize += fileSize;
return dlg->m_running;
}
示例15: wxLogMessage
void FreqWindow::Recalc()
{
wxLogMessage(wxT("Starting FreqWindow::Recalc()"));
if (mProcessed)
delete[] mProcessed;
mProcessed = NULL;
if (!mData) {
mFreqPlot->Refresh(true);
return;
}
int alg = mAlgChoice->GetSelection();
int windowFunc = mFuncChoice->GetSelection();
long windowSize = 0;
(mSizeChoice->GetStringSelection()).ToLong(&windowSize);
int f = NumWindowFuncs();
if (!(windowSize >= 32 && windowSize <= 65536 &&
alg >= 0 && alg <= 4 && windowFunc >= 0 && windowFunc < f)) {
mFreqPlot->Refresh(true);
return;
}
mWindowSize = windowSize;
if (mDataLen < mWindowSize) {
mFreqPlot->Refresh(true);
return;
}
mProcessed = new float[mWindowSize];
int i;
for (i = 0; i < mWindowSize; i++)
mProcessed[i] = float(0.0);
int half = mWindowSize / 2;
float *in = new float[mWindowSize];
float *in2 = new float[mWindowSize];
float *out = new float[mWindowSize];
float *out2 = new float[mWindowSize];
float *win = new float[mWindowSize];
// initialize the window
for(int i=0; i<mWindowSize; i++)
win[i] = 1.0;
WindowFunc(windowFunc, mWindowSize, win);
// Scale window such that an amplitude of 1.0 in the time domain
// shows an amplitude of 0dB in the frequency domain
double wss = 0;
for(int i=0; i<mWindowSize; i++)
wss += win[i];
if(wss > 0)
wss = 4.0 / (wss*wss);
else
wss = 1.0;
//Progress dialog over FFT operation
wxLogMessage(wxT("Starting progress dialogue in FreqWindow::Recalc()"));
ProgressDialog *mProgress = new ProgressDialog(_("FreqWindow"),_("Drawing Spectrum"));
int start = 0;
int windows = 0;
while (start + mWindowSize <= mDataLen) {
for (i = 0; i < mWindowSize; i++)
in[i] = win[i] * mData[start + i];
switch (alg) {
case 0: // Spectrum
PowerSpectrum(mWindowSize, in, out);
for (i = 0; i < half; i++)
mProcessed[i] += out[i];
break;
case 1:
case 2:
case 3: // Autocorrelation, Cuberoot AC or Enhanced AC
// Take FFT
#ifdef EXPERIMENTAL_USE_REALFFTF
RealFFT(mWindowSize, in, out, out2);
#else
FFT(mWindowSize, false, in, NULL, out, out2);
#endif
// Compute power
for (i = 0; i < mWindowSize; i++)
in[i] = (out[i] * out[i]) + (out2[i] * out2[i]);
if (alg == 1) {
for (i = 0; i < mWindowSize; i++)
in[i] = sqrt(in[i]);
}
if (alg == 2 || alg == 3) {
// Tolonen and Karjalainen recommend taking the cube root
// of the power, instead of the square root
for (i = 0; i < mWindowSize; i++)
//.........这里部分代码省略.........