[SOLVED =)]ComboBox Qstring but need an int or GLenumb
-
Thank you, it seems i am doing something wrong
@ui->cmbx_primatives->addItem(const QString("Test"), const QVariant & userdata = QVariant(const int(0x0000)));@ -
Try this:
@ui->cmbx_primatives->addItem("Test", QVariant::fromValue<int>(0x0000));@ -
yep AcerExtensa that worked like a charm =]
but how do I access the integer value from arg1 so I could pass it to the render class? -
-
AcerExtensa your magic worker, is it possible to access the name of the index instead of the number.
I tried @QString arg1 = ui->cmbx_primatives->itemText(index).toStdWString();@ but that's wrong -
-
Yep that worked right away.
Well I removed all the values from the comboxbox in the Qt creator interface and the program crashed.
"The program has unexpectedly finished."So then I just randomly added an item to the combo box and it worked again. Why's that?
-
Maybe you're trying to access items or userData before there is any items in combobox? Sounds pretty like that....
-
Once again AcerExtensa thank very much =] all my problems are now solved!!!
-
You are welcome! Please add "[SOLVED]" to the topic subject.