Yes. But I can't override the paintEvent of each child widget, because they were created in Designer (with UI). So maximum I can do - is try to install eventFilter on every widget like this:
@MyWidget::MyWIdget(QWidget parent) :
QWidget(parent)
{
QList<QWidget > widgets = findChildren<QWidget>();
foreach(QWidget widget, widgets)
{
widget->installEventFilter(this);
}
}
MyWidget::eventFilter(QObject* object, QEvent* event)
{
if(event->type() == QEvent::Paint)
{
QPaintEvent* paintEvent = static_cast<QPaintEvent*>(event);
if(_rowCount == 0)
paintEmptyWidget(widget, /// Function like I describe above
paintEvent->rect(),
"Emty text",
"Note text");
return true;
}
return QWidget::eventFilter(object,event);
}
@
But it doesn't work as I need.
[quote author="shoyeb" date="1329193466"]then u need to override the paint event of each child widget...
i am not sure that this will work but atleast u can try..[/quote]