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)

Diph 2010-07-17 12:33

Re: Need assistance from QT / Python programmer
 
Another solution:
Code:

arguments << ui->Transition->currentText() << ui->Font->currentText() << ui->Color->currentText() << QVariant(ui->checkBoxActivate->isChecked()).toString());

d-iivil 2010-07-17 17:29

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 754890)
API is your best friend: http://doc.trolltech.com/qt-maemo-4.....html#finished :)

Code:

connect(process, SIGNAL(finished(int), this, SLOT(processFinished(int));
Code:

MainWindow::processFinished(int exitCode)
{
  //Do something
}


Damn this is confusing :-D Even simplest action needs code in at least three different place. Well, tried and tried and tried, but all I get is these errors (build issues):
untermintaed argument list invoking macro "SIGNAL"
- in constructor 'MainWindow::MainWindow(QWidget*):
'process' was not declared in this scope
'SIGNAL' was not declared in this scope
expected ; at end of input
expected } at end of input

The code is looking like this (mainwindow.cpp):
http://www.pastie.org/1048648

Diph 2010-07-17 18:01

Re: Need assistance from QT / Python programmer
 
Modified the code (bit ugly :P): http://www.pastie.org/1048658

So you have to define progress as member variable to be able to access it in two methods.

You can't make connection in constructor because process is defined in method, it's not member variable of MainWindow (of course you can make it a member variable).

d-iivil 2010-07-17 19:29

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 755151)
Modified the code (bit ugly :P): http://www.pastie.org/1048658

So you have to define progress as member variable to be able to access it in two methods.

You can't make connection in constructor because process is defined in method, it's not member variable of MainWindow (of course you can make it a member variable).

Thanks in million!

But after putting this:
Code:

private:
      QProgressDialog progress;

into maindowndow.h I get another error:
'QProgressDialog' does not name a type

Diph 2010-07-17 19:43

Re: Need assistance from QT / Python programmer
 
mainwindow.h

Code:

#include <QProgressDialog>

d-iivil 2010-07-18 15:33

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 755231)
mainwindow.h

Code:

#include <QProgressDialog>

So sorry to bother you again, but I just can't figure out why I'm getting now new build issues (my googling skills seems to lack big time).

Now I'm getting this:
"ISO C++ forbids declaration of 'processFinished' with no type"
"no 'int MainWindow::processFinished(int)' member function declared in class 'MainWindow'

Edit: both errors are pointing at row 34 @ mainwindow.cpp

And the code is like this (mainwindow.cpp):
http://www.pastie.org/1049376

(mainwindow.h):
http://www.pastie.org/1049377

Diph 2010-07-18 15:34

Re: Need assistance from QT / Python programmer
 
Forget to put return value to method. :D

http://www.pastie.org/1049378

E: You have to add method declaration to mainwindow.h: http://www.pastie.org/1049383

d-iivil 2010-07-18 15:47

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 755853)
Forget to put return value to method. :D

http://www.pastie.org/1049378

E: You have to add method declaration to mainwindow.h: http://www.pastie.org/1049383

Thanks, this part is working now. But my destroying attemt of the progress isn't. It's saying that it's protected:
ävoid QWidget::destryi(book, bool)' is protected.

Diph 2010-07-18 16:08

Re: Need assistance from QT / Python programmer
 
Just use progress.close().

d-iivil 2010-07-18 17:36

Re: Need assistance from QT / Python programmer
 
Quote:

Originally Posted by Diph (Post 755887)
Just use progress.close().

That one I should have figured out myself :P Thanks!

Almost there with this:
- progress bar is showing up and everything looks fine

Only problem is that it won't run the script anymore. No errors no nothing, it just won't start :D


All times are GMT. The time now is 23:12.

vBulletin® Version 3.8.8