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()
{
QObjectList objlistChildren = obj->children();
int iCount = objlistChildren.count();
for(int iIndex = 0; iIndex < iCount; iIndex++)
{
QObject *temp
= objlistChildren
[iIndex
];
( (QWidget*)objlistChildren
[iIndex
] )->setFont
(font
);
}
}
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);
}
}
To copy to clipboard, switch view to plain text mode
How can i access the parent widgets and set its font from the child control.
Thanks in advance for your suggestions.
Bookmarks