Bug #2002
closedWTabWidget.setTabEnabled is partialy working
0%
Description
Hi there,
just found that when you disable a tab with "setTabEnabled" the tab actually become grey but is always accessible (you can switch to).
Hope it will help !
Kim
Updated by Koen Deforche over 11 years ago
- Status changed from New to InProgress
- Assignee set to Korneel Dumon
- Target version set to 3.3.1
This should work according to WMenuItem.C:453. Can we reproduce this and figure out what's wrong?
Updated by Korneel Dumon over 11 years ago
I tried it and it's working for me. Can you post a small piece of code that reproduces the problem?
Updated by Kim Forest over 11 years ago
//declaration
tabZones = new WTabWidget(table->elementAt(14,0));
// i add 8 of these. tZone1 is a WTemplate object
tabZones->addTab(tZone1,"Zone 1", WTabWidget::PreLoading);
//Where used.
void on_cmbIdProduit_changed()
{
int product_channel[19] = {8,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,8,8};
int index = cmbIdProduit->currentIndex();
for(int i=0; i < tabZones->count() ;i)
{
//Vérifier si l'indice courant est plus petite que le nombre de zone permise par le produit sélectionné
if(i < product_channel[index])
{
//tabZones->setTabHidden(i, false); //Montre l'onglet
tabZones->setTabEnabled(i,true);
}
else
{
// tabZones->setTabHidden(i, true); //Cache l'onglet
tabZones->setTabEnabled(i,false);
}
}
tabZones->setCurrentIndex(0); //Sélectionne l'onglet zéro
}
please note that i've cloned the git directory 3 weeks ago.
Updated by Korneel Dumon over 11 years ago
- Status changed from InProgress to Resolved
Thanks, I found the problem!
Updated by Koen Deforche over 11 years ago
- Status changed from Resolved to Closed