hi friends/Experts,
Im trying to set the tab order for the Custom widget im adding on the widget created by designer.
I used scrollArea and a line edit . so when the user enter 10, 10 custom widgets will be added to the scroll area.
I set the scrollArea tab no as ex:5 and 6,7 and 8 to the ok , cancel, clear push buttons.
when the text entered in the edit
entries = LineEdit entry.
while(entries)
{
SpeciesInfo *SpeciesParent = new SpeciesInfo(this);
m_speciesList<<SpeciesParent;
scrollLayout->addWidget(SpeciesParent); //Entries added to scrollarea layout
entries --;
}
ui.speciesScrollArea->setFocusProxy(m_speciesList.at(0));
ui.speciesScrollArea->setFocusPolicy(Qt::TabFocus);
while(entries)
{
SpeciesInfo *SpeciesParent = new SpeciesInfo(this);
m_speciesList<<SpeciesParent;
scrollLayout->addWidget(SpeciesParent); //Entries added to scrollarea layout
entries --;
}
ui.speciesScrollArea->setFocusProxy(m_speciesList.at(0));
ui.speciesScrollArea->setFocusPolicy(Qt::TabFocus);
To copy to clipboard, switch view to plain text mode
but the taborder is coming to speciesInFo only after ok,cancel and clear button. tab order is not coming inside the speciesInfo when it reach the tab on ScrollArea.
addition information:
scrollWidget->setLayout(scrollLayout);
ui.speciesScrollArea->setWidget(scrollWidget);
ui.speciesScrollArea->setContentsMargins(0,0,0,0);
ui.speciesScrollArea->viewport()->setAutoFillBackground(true);
scrollLayout = new QVBoxLayout;
scrollWidget->setLayout(scrollLayout);
ui.speciesScrollArea->setWidget(scrollWidget);
ui.speciesScrollArea->setContentsMargins(0,0,0,0);
ui.speciesScrollArea->viewport()->setAutoFillBackground(true);
To copy to clipboard, switch view to plain text mode
inside SpeciesInfo policy setFocusPolicy(Qt::TabFocus);
please help me. thanks in advanceSpProblem.png
Bookmarks