
Originally Posted by
Salazaar
That's what I've done

And about this slot, how can I compare text with "number one"? As you've seen in the code that Designer generated, there's no thing such as number1 or item1, so how would the comparision look like? (in code, as well

)
well, we have two functions here:
int QComboBox::currentItem () const
Returns the index of the current item in the combobox. See the "currentItem" property for details.
QString QComboBox::currentText () const
Returns the text of the combobox's current item. See the "currentText" property for details.
I assume you know the contents of the combobox, you can use an if statement like:
if(yourComboBox->currentText() == "YourTextAtItemNumber1")
{
// open your dialog.....
}
if(yourComboBox->currentText() == "YourTextAtItemNumber1")
{
// open your dialog.....
}
To copy to clipboard, switch view to plain text mode
or
if(yourComboBox->currentItem() == 1)
{
// open your dialog.....
}
if(yourComboBox->currentItem() == 1)
{
// open your dialog.....
}
To copy to clipboard, switch view to plain text mode
Bookmarks