![]() |
Need assistance from QT programmer
Hi there,
I have a scenario like this: - I've drawn a simple UI in Nokia QT Designer: http://i9.aijaa.com/b/00462/6426697.png - I have a shell script wich does various file manipulations based on variables given What I would like to do: - convert that UI to native app which would launch my shell script with variables based on what's been chosen from drop down list's at the UI when hitting the "Apply changes" -button. In this case the command to be launched from the button would be: /path/to/my/script/script.sh "Enable custom transitions" "Droid Sans" "Black" I have zero knowledge on coding with anything else than PHP. I would highly appreciate if someone is intrested in helping me with the project :) I think this could be done with Python(?) so I could later on easily edit the python "source" if I needed to add more options to the drop down lists? Edit: and as bonus: this app should be launchable from N900's settings "application", not from program launcher menu. |
Re: Need assistance from QT / Python programmer
Hello,
At the moment I can't write all the code for you, but I can give you some pointers about how to do it.
I know this was a very dense description, but I hope it will help! |
Re: Need assistance from QT / Python programmer
Quote:
Already got mad developer working with QT Creator. |
Re: Need assistance from QT / Python programmer
2 Attachment(s)
Heh, well, got it running on the device.
Now the hardest part: how to make the buttons actually to do something :-P |
Re: Need assistance from QT / Python programmer
Not sure whether I should post this, as right now I'm trying to blow the "embrace the future - develop with QT" - but coming from PHP, using Python and PyQt might indeed be the easier way to do it.
That would require to:
Again, if you want to be future prove, go with C++ and Qt, but if you want to keep it easy (and maemo-only), Python and PyQt would do the trick without much hassle, especially when you're coming from a PHP background. |
Re: Need assistance from QT / Python programmer
Quote:
Good thing seems to be that I can use the .ui -file with QT Creator and PyQT4. |
Re: Need assistance from QT / Python programmer
Quote:
In the constructor of your window widget, connect the "clicked" event of your button: Code:
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello())); "ui" is the... well, UI :p defined by "ui(new Ui::MyWindowName)" in the constructor "pushButton" is the name of your button "hello()" is the name of a slot created in the next step In the header file of the window widget, add the definition for a new slot (inside the class definition) : Code:
protected slots: Back in the implementation file of your window widget, define a function for that slot: Code:
void MainWindow::hello() Just don't call the spot hello - that was obviously taken from my inevitable first Hello World app. :D |
Re: Need assistance from QT / Python programmer
Quote:
|
Re: Need assistance from QT / Python programmer
If you want to run your shell script in the button handler, you need to use function int QProcess::execute ( const QString & program, const QStringList & arguments ).
In above example from Nathraiben you would call it in function hello like this: Code:
void MainWindow::hello() |
Re: Need assistance from QT / Python programmer
Quote:
And in which part of my project I should put these: Code:
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello())); Code:
void MainWindow::hello() Forms: - mainwindow-ui Headers. - mainwindow.h Sources: - main.cpp - mainwindow.cpp |
All times are GMT. The time now is 19:06. |
vBulletin® Version 3.8.8