Reply
Thread Tools
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#21
Originally Posted by D-Iivil View Post
For me it does not seem to create the connect() when right-clicking the button in UI and choosing -> Go to slot...
Yes.
It is auto-generated by the ui file and initalized with that.
(Eg. it doesn't pollute your own code, but it will be taken care of in the background.)

You can open the .ui file with an XML editor and see how it deals with the stuff.
Note that Qt will generate real C++ code from the .ui, and compile it along with the rest of the app.
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#22
Originally Posted by Diph View Post
If you just want to get text from drop down menu when button is clicked (put this in hello() slot):
Code:
ui->myComboBox->currentText(); //This property holds the text of the current item.
Indeed, this is the best way to read the current text from a combo box!

http://doc.qt.nokia.com/4.6/qcombobo...rrentText-prop
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#23
Originally Posted by Venemo View Post
Yes.
It is auto-generated by the ui file and initalized with that.
(Eg. it doesn't pollute your own code, but it will be taken care of in the background.)

You can open the .ui file with an XML editor and see how it deals with the stuff.
Note that Qt will generate real C++ code from the .ui, and compile it along with the rest of the app.
Well, the apply-button stopped working after trying to let the designer take care of it all.
Edit: re-did it and it's working again (I mean the let the designer take care of connecting)
__________________
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-16 at 10:39.
 

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
#24
Originally Posted by Diph View Post
If you just want to get text from drop down menu when button is clicked (put this in hello() slot):
Code:
ui->myComboBox->currentText(); //This property holds the text of the current item.
Or if you want to do something when user changes selection in drop down menu (put this in constructor and create new slot):
Code:
connect(ui->myComboBox, SIGNAL(currentIndexChanged(QString),
this,
SLOT(comboBoxCurrentIndexChanged(QString));
Code:
void MainWindow::comboBoxCurrentIndexChanged(const QString &text) {
   //Do something
}
E: Bit late.
Hmm... m'kay... still cannot figure out how to use this.

I mean with php I would do it like this:
$variable1 = $_GET[drop_down_transitions]
$variable2 = $_GET[drop_down_font]
$variable3 = $_GET[drop_down_color]

And then just include it like this:
Code:
    QStringList arguments;
    arguments << "$variable1" << "$variable2" << "$variable3";
    QProcess::execute("/sbin/myscript", arguments);
Thanks for you guys for the help. I know it's frustrading to teach someone who has no_idea_at_all what's happening
__________________
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
#25
Something like this:
Code:
QStringList arguments;
arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText();
QProcess::execute("/sbin/myscript", arguments);
E: It's a good practise to check if variables are empty:
Code:
QString transition = ui->dropDownTransition->currentText();
//Not empty
if (!transition.isEmpty()) {
   //Do something
}

Last edited by Diph; 2010-07-16 at 10:56.
 

The Following User Says Thank You to Diph For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#26
Originally Posted by Diph View Post
Something like this:
Code:
QStringList arguments;
arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText();
QProcess::execute("/sbin/myscript", arguments);
E: It's a good practise to check if variables are empty:
Code:
QString transition = ui->dropDownTransition->currentText();
//Not empty
if (!transition.isEmpty()) {
   //Do something
}
Just a minute before you replied I figured it out by reading your previous post few times over and over

So it's working now!

Next step: how to build / compile a binary out of this or how to include the source with my excisting package and make autobuilder to build / compile it?
__________________
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
#27
You can try the binary in the phone by following instructions from NokiaQtSDK_PATH/readme/index.html.

To create source package for autobuilder you need scratchbox.
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#28
Originally Posted by Diph View Post
You can try the binary in the phone by following instructions from NokiaQtSDK_PATH/readme/index.html.

To create source package for autobuilder you need scratchbox.
Okay, will read it. I have scratchbox already for making sources of my themes.
__________________
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
#29
Originally Posted by D-Iivil View Post
Okay, will read it. I have scratchbox already for making sources of my themes.
http://wiki.maemo.org/Packaging_a_Qt_application
 
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#30
Originally Posted by D-Iivil View Post
Hmm... m'kay... still cannot figure out how to use this.

I mean with php I would do it like this:
$variable1 = $_GET[drop_down_transitions]
$variable2 = $_GET[drop_down_font]
$variable3 = $_GET[drop_down_color]

And then just include it like this:
Code:
    QStringList arguments;
    arguments << "$variable1" << "$variable2" << "$variable3";
    QProcess::execute("/sbin/myscript", arguments);
Code:
QString variable1("string1");
QString variable2("string2");
QString variable3("string3");

QStringList myStringList;
myStringList.append(variable1);
myStringList.append(variable2);
myStringList.append(variable3);
Originally Posted by D-Iivil View Post
Next step: how to build / compile a binary out of this or how to include the source with my excisting package and make autobuilder to build / compile it?
If you already tested it using Qt Creator, here is how to make an installable package:

Originally Posted by Venemo View Post
If you want to make a .deb package, you can use Qt Creator's option to do so (but it is quite limited at the moment), or use MADDE and type "mad dpkg-buildpackage" into the command line (in your app's root folder)
If you would like to upload it to Extras-devel, here is a good description:
http://wiki.maemo.org/Uploading_to_Extras

I prefer to use the Assistant, it works like a charm.
https://garage.maemo.org/extras-assistant/index.php
 
Reply


 
Forum Jump


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