Matze-o
5th November 2008, 10:43
Hello,
I'm looking for a way to acces ui items dynamically.
In detail:
My program receives a command from about 50 register states. Each register has it's own item on the ui. The item could either be a lineEdit or a checkBox.
After receiving the status I'm going to look up the registers ui-item in a "database" (up till now most likely a textfile).
receivedData = receive();
register = receivedData[0];
item = lookup(register);
if (lineEdit)
{
item->setText(receivedData[1]);
}
else if (checkbox)
{
item->setChecked(receivedData[1]);
}
I hope you get what I'm trying to say. I want to know a way to access each item without haveing to write a specific function for each register.
Thanks in advance.
I'm looking for a way to acces ui items dynamically.
In detail:
My program receives a command from about 50 register states. Each register has it's own item on the ui. The item could either be a lineEdit or a checkBox.
After receiving the status I'm going to look up the registers ui-item in a "database" (up till now most likely a textfile).
receivedData = receive();
register = receivedData[0];
item = lookup(register);
if (lineEdit)
{
item->setText(receivedData[1]);
}
else if (checkbox)
{
item->setChecked(receivedData[1]);
}
I hope you get what I'm trying to say. I want to know a way to access each item without haveing to write a specific function for each register.
Thanks in advance.