maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Need assistance from QT programmer (https://talk.maemo.org/showthread.php?t=58569)

Venemo 2010-07-16 11:44

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by D-Iivil (Post 753755)
Thanks for you guys for the help. I know it's frustrading to teach someone who has no_idea_at_all what's happening :D

You're welcome!
Tbh, I like your style. :cool:

Basically, you went from zero to a working application in less than half day - and we just gave you some pointers about where to look, without any copy-pasteable code. :)

This is quite impressive! :) ;)

d-iivil 2010-07-16 13:00

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Venemo (Post 753801)
You're welcome!
Tbh, I like your style. :cool:

Basically, you went from zero to a working application in less than half day - and we just gave you some pointers about where to look, without any copy-pasteable code. :)

This is quite impressive! :) ;)

Haha, well.. it was pretty much copy-paste :P

The application is working fine on the device and the binary is easy to put inside my theme package. Now I need still to figure out how to display a progressbar which covers the UI while the shell script is being excecuted (running the script takes a minute, so it's good to tell the user that "this is gonna take a while, sit back and wait). I already downloaded source of fapman (great app!) because it has a nice overlay effect with bouncing status indicator, but couldn't implement it yet :)

To be continued later tonight...

Diph 2010-07-16 13:28

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by D-Iivil (Post 753863)
Now I need still to figure out how to display a progressbar which covers the UI while the shell script is being excecuted (running the script takes a minute, so it's good to tell the user that "this is gonna take a while, sit back and wait).

When script is executed, start progress indicator. There is finished signal in QProcess. You can connect it to slot which stops progress indicator.

http://doc.qt.nokia.com/4.6/qprocess.html#finished

d-iivil 2010-07-16 16:57

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 753892)
When script is executed, start progress indicator. There is finished signal in QProcess. You can connect it to slot which stops progress indicator.

http://doc.qt.nokia.com/4.6/qprocess.html#finished

Hmm... okay, I think I understood the idea. What I don't know is how to open a same kind of "dialog window" with seeking progressbar like for example built in application manager shows when updating catalogs or installing programs.

Allthough I don't necessarily need a progress bar, all I need is a window that covers the UI and has text that says "Please wait, setting up the theme. This may take few minutes." and the script would be executed in background. I just want to prevent user to hit the "apply settings" during the script is already running.

Should I create another "form" in qt desinger and somehow launch that when the apply -button has been hit?

Diph 2010-07-16 17:00

Re: Need assistance from QT / Python programmer
 
I haven't tried this but maybe this helps...

http://doc.qt.nokia.com/qt-maemo-4.6...essdialog.html

E: Or use QDialog with QProgressBar.

d-iivil 2010-07-16 17:37

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 754063)
I haven't tried this but maybe this helps...

http://doc.qt.nokia.com/qt-maemo-4.6...essdialog.html

E: Or use QDialog with QProgressBar.

Tried that already, but couldn't get it working. I propably misunderstood something because I cannot make the progressdialog to appear.

I'm trying to do it like this:
Code:

void MainWindow::on_pushButton_clicked()
{
    QProgressDialog progress("Setting up the theme, please wait...", "Abort", 0, 1, this);
    progress.setWindowModality(Qt::WindowModal);

    progress.setValue(0);
        QStringList arguments;
        arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText();
        QProcess::execute("/sbin/myscriptlauncher", arguments);
    progress.setValue(1);
}


Diph 2010-07-16 18:11

Re: Need assistance from QT / Python programmer
 
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec(); :D

d-iivil 2010-07-16 18:33

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 754146)
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec(); :D

Will try, thanks again :)

d-iivil 2010-07-16 19:06

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 754146)
The dialog gets destroyed before it shown (add progress.show() also). You can make the dialog member variable of MainWindow and create dialog with new and delete it when dialog is closed.

E: Or add dialog.exec(); :D

Adding progress.show() made the dialog appear and the script is ran in the background. But; there's nothing in the dialog, just blank dialog. How could I get my text shown there also and the progress bar itself?

Diph 2010-07-16 19:26

Re: Need assistance from QT / Python programmer
 
Did you try the dialog.exec()? It should block until user closes it. QProgressDialog wants minimum and maximum values and it might be difficult to set. Set both values to 0 and the dialog only shows busy indicator.


All times are GMT. The time now is 06:08.

vBulletin® Version 3.8.8