![]() |
Re: Need assistance from QT programmer
Application output window in QT Creator says this:
Object::connect: No such slot MainWindow::processFinished() in mainwindow.cpp:29 Object::connect: (receiver name: 'MainWindow') |
Re: Need assistance from QT programmer
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 Code:
void MainWindow::processFinished(int code) Code:
connect(progress, SIGNAL(finished(int, QString), this, SLOT(progressFinisshed(int)); |
Re: Need assistance from QT programmer
Quote:
But about the script not running issue; it looks like there's something wrong with this: Code:
QProcess *process = new QProcess(this); Code:
QProcess::execute("/sbin/launchblack", arguments); |
Re: Need assistance from QT programmer
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! |
Re: Need assistance from QT programmer
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 :) |
Re: Need assistance from QT programmer
Okay, one last question: what should I put the binary to depend on @ control -file?
Edit: nevermind, got it already :) |
Re: Need assistance from QT programmer
Quote:
|
Re: Need assistance from QT programmer
Quote:
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 :) |
Re: Need assistance from QT programmer
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 |
Re: Need assistance from QT programmer
You can use QSettings class for that. Just add following functions to your MainWindow class:
Code:
void MainWindow::saveSettings() const { EDIT: QSettings saves config files under ~/.config so in this case config file would be ~/.config/blackplastic-theme/config |
All times are GMT. The time now is 02:57. |
vBulletin® Version 3.8.8