|
2010-07-16
, 10:35
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#22
|
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.
|
2010-07-16
, 10:36
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#23
|
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.
The Following User Says Thank You to d-iivil For This Useful Post: | ||
|
2010-07-16
, 10:45
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#24
|
If you just want to get text from drop down menu when button is clicked (put this in hello() slot):
Or if you want to do something when user changes selection in drop down menu (put this in constructor and create new slot):Code:ui->myComboBox->currentText(); //This property holds the text of the current item.
Code:connect(ui->myComboBox, SIGNAL(currentIndexChanged(QString), this, SLOT(comboBoxCurrentIndexChanged(QString));E: Bit late.Code:void MainWindow::comboBoxCurrentIndexChanged(const QString &text) { //Do something }
QStringList arguments; arguments << "$variable1" << "$variable2" << "$variable3"; QProcess::execute("/sbin/myscript", arguments);
|
2010-07-16
, 10:49
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#25
|
QStringList arguments; arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText(); QProcess::execute("/sbin/myscript", arguments);
QString transition = ui->dropDownTransition->currentText(); //Not empty if (!transition.isEmpty()) { //Do something }
The Following User Says Thank You to Diph For This Useful Post: | ||
|
2010-07-16
, 11:05
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#26
|
Something like this:
E: It's a good practise to check if variables are empty:Code:QStringList arguments; arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText(); QProcess::execute("/sbin/myscript", arguments);
Code:QString transition = ui->dropDownTransition->currentText(); //Not empty if (!transition.isEmpty()) { //Do something }
|
2010-07-16
, 11:09
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#27
|
|
2010-07-16
, 11:25
|
|
Posts: 2,154 |
Thanked: 2,186 times |
Joined on Dec 2009
@ Hellsinki, Finland
|
#28
|
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.
|
2010-07-16
, 11:32
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#29
|
Okay, will read it. I have scratchbox already for making sources of my themes.
|
2010-07-16
, 11:40
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#30
|
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);
QString variable1("string1"); QString variable2("string2"); QString variable3("string3"); QStringList myStringList; myStringList.append(variable1); myStringList.append(variable2); myStringList.append(variable3);
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 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)
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.
You should follow me on Twitter!
Apps: Puzzle Master, IRC Chatter for Harmattan, IRC for Sailfish