![]() |
Re: Need assistance from QT / Python programmer
Quote:
|
Re: Need assistance from QT / Python programmer
Code:
progress.setCancelButton(0); Quote:
|
Re: Need assistance from QT / Python programmer
Quote:
dialog.exec() won't work because the script isn't ran in the background. It's launched only after user closes the dialog :-/ |
Re: Need assistance from QT / Python programmer
Now I got it :)
I didn't realize I had to separately create also QProgressBar, the QProgressDialog wasn't enough all by itself :-P Edit: no, I didn't get it. Still not seeing a progress bar in the dialog :-( |
Re: Need assistance from QT / Python programmer
Quote:
Finding out the hard way was good for getting the hang of how it works, but knowing that there's a hasslefree way to do it made my day... :D Thanks a lot, Venemo! Quote:
In maemo, that thing will completely take away the ability to close that application, so in case anything goes wrong with either your C++ code or your shell script, the user is stuck with an unclosable application until they either reboot or manage to issue a successful kill command (which, btw, didn't work for me - the application was completely locked). Instead, issue a warning in your progress bar that this might take a couple of minutes and should not be canceled. Warn the user, but don't take away control over their own system. |
Re: Need assistance from QT / Python programmer
Quote:
|
Re: Need assistance from QT / Python programmer
Quote:
|
Re: Need assistance from QT / Python programmer
1 Attachment(s)
Quote:
With code like this: Code:
void MainWindow::on_pushButton_clicked() |
Re: Need assistance from QT / Python programmer
Not sure whether they work the same in PyQt and Qt, but I had to set the value to something > 0 in order for the bar to show, since 0% more or less indicates that you didn't yet start.
With my rather short waiting times I simply set it to 50%, as I didn't really need a true progress bar but just an indication that the user will have to wait for for a short while. With a script running for that long, a working progress bar would be rather helpful, though. Normally, you would just increment the value each time a part of your script is finished, but with just one large script I guess that would be hard. Is there a way to split the script into smaller portions, so after each successful execute you can increment the value? Then, just set the value to 1% right before the first execute and the bar SHOULD show. |
Re: Need assistance from QT / Python programmer
Quote:
But while I coulnd't figure out the bar -issue I optimized the script instead (which I should have done already...) and now it's taking only like 30 secs to complete and user is informed what's happening by notifications sent via DBUS. |
All times are GMT. The time now is 06:08. |
vBulletin® Version 3.8.8