PDA

View Full Version : Accessing SubTabs in Main Tab



hasnatzaidi
2nd September 2009, 04:28
hi all, I use the following code in QDialog
Qt Code:


void Dialog::loadForm()

{
ui->volumeSlider->setValue(findItem("AUDIO_LEVEL").toInt());
ui->txtKeyBoad->setText(findItem("KEYBOARD_MAP"));
ui->txtTimeZone->setText(findItem("TIME_ZONE"));
}

To Access the Dialog consisting Volume Slider and Text Boxes, it Run Correctly.
Now I switch to MainWindow Form using this code
Qt Code:


ui->general_tab->horizontalSlider->setValue(findItem("AUDIO_LEVEL").toInt());

it can't access the subTab
where my maintab ObjectName is"general_tab_2" and SubTab ObjName is"general_tab"
Please anyone who tell me that "whats the changes required in this code".
thanks

wysota
2nd September 2009, 08:45
I'm sorry but do you expect us to guess how your objects are organized?

I would say you are missing the parenthesis after "horizontalSlider" but only provided that "general_tab" is a widget that has a horizontalSlider() method.