Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::dropEvent(QDropEvent * event)
- {
- event->acceptProposedAction();
- const QMimeData * mimeData = event->mimeData();
- // check for our needed mime type, here a file or a list of files
- if (mimeData->hasUrls())
- {
- QList<QUrl> urlList(mimeData->urls());
- QString fileName;
- bool encrypted;
- // extract the local paths of the files
- for (int i = 0; i < urlList.size() && i < 32; ++i)
- {
- fileName = urlList.at(i).toLocalFile();
- // Initialisation de la fenêtre de chargement
- this->tmpWin = new QWidget;
- QVBoxLayout * vLayout = new QVBoxLayout;
- QLabel * txtLabel = new QLabel(tr("Processing..."));
- QProgressBar * pBar = new QProgressBar;
- pBar->setRange(0, 0);
- vLayout->addWidget(txtLabel, 0, Qt::AlignHCenter);
- vLayout->addWidget(pBar, 0, Qt::AlignHCenter);
- //this->tmpWin->setAttribute(Qt::WA_DeleteOnClose);
- this->tmpWin->setLayout(vLayout);
- this->tmpWin->setWindowFlags(Qt::SplashScreen);
- // ---
- if ( fileName.contains(QRegExp(APPCRYPTEXT+"$")) )
- {
- this->tmpWin->show();
- qApp->processEvents(); // I tried this line
- this->tmpWin->update(); // and/or this line
- this->db->decryptFile(fileName);
- this->tmpWin->hide();
- }
- else
- {
- this->tmpWin->show();
- qApp->processEvents(); // I tried this line
- this->tmpWin->update(); // and/or this line
- this->db->encryptFile(fileName);
- this->tmpWin->hide();
- }
- }
- this->tray->showMessage(tr("Finished !"), tr("I've finished encrypting or decrypting (whatever it was)\nyour files..."), QSystemTrayIcon::Information, 2000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement