ramsailesh
7th January 2013, 13:23
Dear all,
I've a mainwindow M with some widgets L and a Custom-dropdown D which contains list of Fonts.
I need to set font for all the widgets in M if dropdown D is changed.
I tried to set the font which resulted in Segmentation fault.
void UpdateFont()
{
QObject *obj = this->parent();
QObjectList objlistChildren = obj->children();
int iCount = objlistChildren.count();
for(int iIndex = 0; iIndex < iCount; iIndex++)
{
QObject *temp = objlistChildren[iIndex];
( (QWidget*)objlistChildren[iIndex] )->setFont(font);
}
}
How can i access the parent widgets and set its font from the child control.
Thanks in advance for your suggestions.
I've a mainwindow M with some widgets L and a Custom-dropdown D which contains list of Fonts.
I need to set font for all the widgets in M if dropdown D is changed.
I tried to set the font which resulted in Segmentation fault.
void UpdateFont()
{
QObject *obj = this->parent();
QObjectList objlistChildren = obj->children();
int iCount = objlistChildren.count();
for(int iIndex = 0; iIndex < iCount; iIndex++)
{
QObject *temp = objlistChildren[iIndex];
( (QWidget*)objlistChildren[iIndex] )->setFont(font);
}
}
How can i access the parent widgets and set its font from the child control.
Thanks in advance for your suggestions.