Reply
Thread Tools
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#71
Application output window in QT Creator says this:
Object::connect: No such slot MainWindow:rocessFinished() in mainwindow.cpp:29
Object::connect: (receiver name: 'MainWindow')
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#72
It should be connect(..., this, SLOT(processFinished(int) or you can define the method void processFinished() if you don't need the exit code.

In header file (*.h) you declare methods and in source file (*.cpp) you write the implementation. Method declarations and implementations have to be in same form, like

Header:
Code:
class MainWindow
{
...
private:
   void processFinished(int code);
Cpp:
Code:
void MainWindow::processFinished(int code)
{
}
Actually you can make the connect without less attributes:
Code:
connect(progress, SIGNAL(finished(int, QString), this, SLOT(progressFinisshed(int));
and it should work.

Last edited by Diph; 2010-07-18 at 18:54.
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#73
Originally Posted by Diph View Post
It should be connect(..., this, SLOT(processFinished(int) or you can define the method void processFinished() if you don't need the exit code.

In header file (*.h) you declare methods and in source file (*.cpp) you write the implementation. Method declarations and implementations have to be in same form, like

Header:
Code:
class MainWindow
{
...
private:
   void processFinished(int code);
Cpp:
Code:
void MainWindow::processFinished(int code)
{
}
Actually you can make the connect without less attributes:
Code:
connect(progress, SIGNAL(finished(int, QString), this, SLOT(progressFinisshed(int));
and it should work.
Yeah, got it connecting by adding the int.

But about the script not running issue; it looks like there's something wrong with this:
Code:
        QProcess *process = new QProcess(this);
        process->start("/sbin/launchblack", arguments);
since it starts fine with this:
Code:
QProcess::execute("/sbin/launchblack", arguments);
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#74
Okay, it's working now. And I am a complete idiot. I didn't realize I should not test the binary on the device with root login instead of developer :-/

The exitCode -thing isn't still working, the progress dialog is left running even the script finishes. Need to figure that out tomorrow Thanks for the help so far again!
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#75
Okay, after debugging I'm sure my scipt ends correctly and singnal finished(int) is sent to the slot and slot receives it. The damn progress-dialog won't just close with command progress.close()

Any other ways to make sure the progress-dialog will get killed?

Edit. Seems like progress.cancel(); did the trick
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE

Last edited by d-iivil; 2010-07-19 at 06:38.
 

The Following User Says Thank You to d-iivil For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#76
Okay, one last question: what should I put the binary to depend on @ control -file?

Edit: nevermind, got it already
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE

Last edited by d-iivil; 2010-07-19 at 08:09.
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#77
Originally Posted by D-Iivil View Post
Okay, after debugging I'm sure my scipt ends correctly and singnal finished(int) is sent to the slot and slot receives it. The damn progress-dialog won't just close with command progress.close()

Any other ways to make sure the progress-dialog will get killed?

Edit. Seems like progress.cancel(); did the trick
I was being lazy there and tried it on desktop only, not scratchbox. :P
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#78
Originally Posted by Diph View Post
I was being lazy there and tried it on desktop only, not scratchbox. :P
Heh
You have been extremely non-lazy while helping out qt-super-noob like me with all the issues I've had with this extremely simple program
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#79
Okay folks Now that I have the app up and running it's time to start adding some features to it and first is this:
- I wan't to save the state of selections user has made using the drop down menus when my shell script has been executed and progress dialog is closed. And then load this state when user launches the program next time.

What would be the best way to approach this? Some flat-file "database" where I store the selections and then read those when program is launched? Can you guys once again point me into right direction and I'll promise I'll try to figure it out myself as much as possible :-D
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 353 | Thanked: 263 times | Joined on Dec 2009 @ Finland
#80
You can use QSettings class for that. Just add following functions to your MainWindow class:
Code:
void MainWindow::saveSettings() const {
    QSettings sett("blackplastic-theme/config");
    sett.setValue("font", text_of_combobox /* you now how to get that already */);
    // Other values like that also
}
void MainWindow::loadSettings() {
    QSettings sett("blackplastic-theme/config");
    bool bOK;
    QString font = sett.value("font", QVariant("")).toString();
    // Other values likewise and set comboboxes to show values
}
Then call loadSettings at the end of MainWindow's constructor and saveSettings in MainWindows's destructor (~MainWindow).

EDIT: QSettings saves config files under ~/.config so in this case config file would be ~/.config/blackplastic-theme/config
__________________
My Maemo5 projects:
mSpede - Speed testing game | Them Bloody Ducks - 2D duck hunting game | Maetronome - A simple metronome app | CuteMPC - MPD client
 

The Following User Says Thank You to TNiga For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 16:55.