Unsolved stylesheet for widgets dynamically
-
Hi,
I have to provide stylesheet for widgets dynamically,
here is the codethe stylesheet is aplied to widgets but its flickering for all, i dont want in that manner.
QString objectName = QString("%1").arg(i); QString color = QString("#%1 { border: 5px solid black; border-color:green;}").arg(i); m_arr_CCamera[i].widget = new QWidget; m_arr_CCamera[i].widget->setObjectName(objectName); m_arr_CCamera[i].widget->setStyleSheet(color); m_arr_CCamera[i].widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
Thanks,
-
When does it flicker ? Are you applying style sheet through some option after your app starts ?
-
Hi,After running the application,
i am applying in constructor.
Thanks,
-
Hi,
I have provided border color for the widgets in paintevent, using setpen.
Thanks,
-
Hi,
Are you setting a style sheet while at the same time writing your own paint event ?
-
No , i am providing color in paintevent, i am not using stylesheet.
Thanks,
-
In that case, why use the style sheet at all ?