View Single Post
Posts: 180 | Thanked: 76 times | Joined on May 2010
#20
Originally Posted by D-Iivil View Post
Okay, I got the apply -button to launch the script. Still haven't figured out how to get the text string from drop down menus to be put as variables.
After that it should be pretty much done.

I found this, but don't know what to do with it
http://doc.qt.nokia.com/4.6/qcombobox.html#activated-2
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.