PDA

View Full Version : Access the subTab Widget in Main TabWidget



hasnatzaidi
2nd September 2009, 02:19
hi all, I use the following code in QDialog


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


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

victor.fernandez
2nd September 2009, 08:21
To display one of your tabs, use QTabWidget::setCurrentIndex() or QTabWidget::setCurrentWidget().